Chaste
Release::3.4
|
#include <SingleTraceOutputModifier.hpp>
Public Member Functions | |
SingleTraceOutputModifier (const std::string &rFilename, unsigned globalIndex, double flushTime=0.0) | |
virtual void | InitialiseAtStart (DistributedVectorFactory *pVectorFactory) |
virtual void | FinaliseAtEnd () |
virtual void | ProcessSolutionAtTimeStep (double time, Vec solution, unsigned problemDim) |
Public Member Functions inherited from AbstractOutputModifier | |
AbstractOutputModifier (const std::string &rFilename, double flushTime=0.0) | |
virtual | ~AbstractOutputModifier () |
Private Member Functions | |
template<class Archive > | |
void | serialize (Archive &archive, const unsigned int version) |
SingleTraceOutputModifier () | |
Private Attributes | |
unsigned | mGlobalIndex |
unsigned | mLocalIndex |
out_stream | mFileStream |
Friends | |
class | TestMonodomainProblem |
class | boost::serialization::access |
class | TestOutputModifiers |
Additional Inherited Members | |
Protected Member Functions inherited from AbstractOutputModifier | |
AbstractOutputModifier () | |
Protected Attributes inherited from AbstractOutputModifier | |
std::string | mFilename |
double | mFlushTime |
Provide the trace for a transmembrane potential at a single mode of the mesh. File updated during the simulation.
WARNING: If you checkpoint this class then the file output will not be saved in the checkpoint. The state of the output file will be unchanged (up to the most recent file flush) but may be overwritten by a restarted simulation. You will need to manually move the output file before restarting the simulation and then merge the two files together at a later point.
Definition at line 54 of file SingleTraceOutputModifier.hpp.
|
inlineprivate |
Private constructor that resets process-specific data, for archiving
Definition at line 87 of file SingleTraceOutputModifier.hpp.
|
inline |
Constructor
globalIndex | The global index of the node which is to be output (assumes no permutation). This is the index *in memory at solve time*. If you are running in parallel and you want a specific location or index in your mesh then you will need to look in the mesh for node or permutation. ChastePoint<1> point(0.05);
unsigned new_index_for_5 = mesh.GetNearestNodeIndex(point);
SingleTraceOutputModifier("trace_5.txt", new_index_for_5));
unsigned new_index_for_5 = mesh.rGetNodePermutation()[5];
SingleTraceOutputModifier("trace_5.txt", new_index_for_5));
|
rFilename | The file which is eventually produced by this modifier |
flushTime | The simulation time between manual file flushes (if required) |
Definition at line 114 of file SingleTraceOutputModifier.hpp.
|
virtual |
Finalise the modifier (close the file)
Implements AbstractOutputModifier.
Definition at line 57 of file SingleTraceOutputModifier.cpp.
References mFileStream, and mLocalIndex.
|
virtual |
Initialise the modifier (open the file) when the solve loop is starting.
Note the problem passes parameters in a non-templated fashion in order to keep the interface as lightweight as possible.
pVectorFactory | The vector factory which is associated with the calling problem's mesh |
Implements AbstractOutputModifier.
Definition at line 41 of file SingleTraceOutputModifier.cpp.
References DistributedVectorFactory::GetLow(), HeartConfig::Instance(), DistributedVectorFactory::IsGlobalIndexLocal(), AbstractOutputModifier::mFilename, mFileStream, mGlobalIndex, mLocalIndex, and OutputFileHandler::OpenOutputFile().
|
virtual |
Process a solution time-step (dump a small line to file)
time | The current simulation time |
solution | A working copy of the solution at the current time-step. This is the PETSc vector which is distributed across the processes. |
problemDim | The calling problem dimension. Used here to avoid probing the size of the solution vector |
Implements AbstractOutputModifier.
Definition at line 67 of file SingleTraceOutputModifier.cpp.
References Divides(), mFileStream, AbstractOutputModifier::mFlushTime, and mLocalIndex.
|
inlineprivate |
Archive the output modifier, never used directly - boost uses this.
archive | the archive |
version | the current version of this class |
Definition at line 78 of file SingleTraceOutputModifier.hpp.
References mGlobalIndex.
|
friend |
Needed for serialization.
Definition at line 60 of file SingleTraceOutputModifier.hpp.
|
friend |
For testing
Definition at line 58 of file SingleTraceOutputModifier.hpp.
|
private |
Output file stream (remains open during solve).
Definition at line 67 of file SingleTraceOutputModifier.hpp.
Referenced by FinaliseAtEnd(), InitialiseAtStart(), and ProcessSolutionAtTimeStep().
|
private |
The global index of the node for which the trace is to be made. This is the index *in memory at solve time*. If you are running in parallel and you want a specific index/location in your mesh then you will need to look in the mesh permutation.
Definition at line 65 of file SingleTraceOutputModifier.hpp.
Referenced by InitialiseAtStart(), and serialize().
|
private |
The local index of the node for which the trace is to be made - set to UINT_MAX if the node is not local to the process
Definition at line 66 of file SingleTraceOutputModifier.hpp.
Referenced by FinaliseAtEnd(), InitialiseAtStart(), and ProcessSolutionAtTimeStep().