Chaste Commit::1fd4e48e3990e67db148bc1bc4cf6991a0049d0c
|
#include <ActivationOutputModifier.hpp>
Public Member Functions | |
ActivationOutputModifier (const std::string &rFilename, double threshold) | |
virtual void | InitialiseAtStart (DistributedVectorFactory *pVectorFactory, const std::vector< unsigned > &rNodePermutation) |
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) |
ActivationOutputModifier () | |
Private Attributes | |
double | mThreshold |
unsigned | mLocalSize |
std::vector< double > | mFirstActivitationTimes |
std::vector< double > | mFirstRecoveryTimes |
std::vector< double > | mSecondActivitationTimes |
std::vector< double > | mSecondRecoveryTimes |
Friends | |
class | TestOutputModifiers |
class | boost::serialization::access |
Additional Inherited Members | |
Protected Member Functions inherited from AbstractOutputModifier | |
AbstractOutputModifier () | |
Protected Attributes inherited from AbstractOutputModifier | |
std::string | mFilename |
double | mFlushTime |
Specialised class for on-the-fly calculation of activation and recovery times. This is hard-coded for the first 2 rounds of activation/recovery.
Times are relative to simulation start and are listed in node order and in 4 columns comma separated (.CSV)
node_0_activation, node_0_recovery, node_0_later_activation, node_0_later_recovery node_1_activation, node_1_recovery, node_1_later_activation, node_1_later_recovery ...
Any missing data (node was not activated a second time or did not recover) is marked with -1.
WARNING: If you checkpoint this class then the partial results will not be stored. This is because the sizes of the activation time vectors will be dependent on the number of processes involved in the parallel code. To fix this: archive as PETSc vectors? Then check ProcessSolutionAtTimeStep logic...
Definition at line 61 of file ActivationOutputModifier.hpp.
|
inlineprivate |
Private constructor that does nothing, for archiving
Definition at line 92 of file ActivationOutputModifier.hpp.
|
inline |
Constructor
rFilename | The file which is eventually produced by this modifier |
threshold | The transmembrane voltage threshold (in mV) at which activation is deemed to have been trigged. This is also used for calculating relaxation time (this is not so sophisticated as an APD90 calculation). |
Definition at line 104 of file ActivationOutputModifier.hpp.
|
virtual |
Finalise the modifier (write all results to the file)
Implements AbstractOutputModifier.
Definition at line 49 of file ActivationOutputModifier.cpp.
References PetscTools::AmMaster(), PetscTools::BeginRoundRobin(), PetscTools::EndRoundRobin(), PetscTools::GetMyRank(), HeartConfig::Instance(), AbstractOutputModifier::mFilename, mFirstActivitationTimes, mFirstRecoveryTimes, mLocalSize, mSecondActivitationTimes, mSecondRecoveryTimes, and OutputFileHandler::OpenOutputFile().
|
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 40 of file ActivationOutputModifier.cpp.
References DistributedVectorFactory::GetLocalOwnership(), mFirstActivitationTimes, mFirstRecoveryTimes, mLocalSize, mSecondActivitationTimes, and mSecondRecoveryTimes.
|
virtual |
Process a solution time-step (memorise all new activations)
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 91 of file ActivationOutputModifier.cpp.
References mFirstActivitationTimes, mFirstRecoveryTimes, mLocalSize, mSecondActivitationTimes, mSecondRecoveryTimes, and mThreshold.
|
inlineprivate |
Archive the output modifier, never used directly - boost uses this.
archive | the archive |
version | the current version of this class |
Definition at line 83 of file ActivationOutputModifier.hpp.
References mThreshold.
|
friend |
Needed for serialization.
Definition at line 74 of file ActivationOutputModifier.hpp.
|
friend |
Definition at line 71 of file ActivationOutputModifier.hpp.
|
private |
The first activation (first time above threshold) for all local nodes on this process
Definition at line 66 of file ActivationOutputModifier.hpp.
Referenced by FinaliseAtEnd(), InitialiseAtStart(), and ProcessSolutionAtTimeStep().
|
private |
The first recovery (first time subsequent time below threshold) for all local nodes on this process
Definition at line 67 of file ActivationOutputModifier.hpp.
Referenced by FinaliseAtEnd(), InitialiseAtStart(), and ProcessSolutionAtTimeStep().
|
private |
The number of nodes on this process (calculated in InitialiseAtStart)
Definition at line 65 of file ActivationOutputModifier.hpp.
Referenced by FinaliseAtEnd(), InitialiseAtStart(), and ProcessSolutionAtTimeStep().
|
private |
The second activation time for local nodes
Definition at line 68 of file ActivationOutputModifier.hpp.
Referenced by FinaliseAtEnd(), InitialiseAtStart(), and ProcessSolutionAtTimeStep().
|
private |
The second recovery time for local nodes
Definition at line 69 of file ActivationOutputModifier.hpp.
Referenced by FinaliseAtEnd(), InitialiseAtStart(), and ProcessSolutionAtTimeStep().
|
private |
The user-defined threshold at which activation and recovery is to be measured
Definition at line 64 of file ActivationOutputModifier.hpp.
Referenced by ProcessSolutionAtTimeStep(), and serialize().