![]() |
Chaste Commit::333233612e3dcc941d260418acd7b5ccdc30390e
|
#include <SingleTraceOutputModifier.hpp>
Public Member Functions | |
SingleTraceOutputModifier (const std::string &rFilename, unsigned globalIndex, double flushTime=0.0) | |
virtual void | InitialiseAtStart (DistributedVectorFactory *pVectorFactory, const std::vector< unsigned > &rNodePermutation) |
virtual void | FinaliseAtEnd () |
virtual void | ProcessSolutionAtTimeStep (double time, Vec solution, unsigned problemDim) |
![]() | |
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 | |
![]() | |
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. This is the index *in the original mesh*. If you are running in parallel your index in the original mesh will be automatically converted to the runtime index using the node permutation in the mesh. That is, is you ask for node 5 in the original mesh then you will automatically get unsigned new_index_for_5 = mesh.rGetNodePermutation()[5];
Definition triangle.cpp:740 |
rFilename | The file which is eventually produced by this modifier |
flushTime | The simulation time between manual file flushes (if required) |
Definition at line 109 of file SingleTraceOutputModifier.hpp.
|
virtual |
Finalise the modifier (close the file)
Implements AbstractOutputModifier.
Definition at line 63 of file SingleTraceOutputModifier.cpp.
References mFileStream, and mLocalIndex.
|
virtual |
Initialise the modifier (open a file or make some memory) 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. That is, it might have been slicker to pass in the mesh but that would require multiple templates.
pVectorFactory | The vector factory which is associated with the calling problem's mesh |
rNodePermutation | The permutation associated with the calling problem's mesh (when running with parallel partitioning) |
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 73 of file SingleTraceOutputModifier.cpp.
References 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.
|
friend |
Definition at line 69 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().