Chaste  Release::2018.1
ActivationOutputModifier Class Reference

#include <ActivationOutputModifier.hpp>

+ Inheritance diagram for ActivationOutputModifier:
+ Collaboration diagram for ActivationOutputModifier:

Public Member Functions

 ActivationOutputModifier (const std::string &rFilename, double threshold)
 
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)
 
 ActivationOutputModifier ()
 

Private Attributes

double mThreshold
 
unsigned mLocalSize
 
std::vector< doublemFirstActivitationTimes
 
std::vector< doublemFirstRecoveryTimes
 
std::vector< doublemSecondActivitationTimes
 
std::vector< doublemSecondRecoveryTimes
 

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
 

Detailed Description

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.

Constructor & Destructor Documentation

ActivationOutputModifier::ActivationOutputModifier ( )
inlineprivate

Private constructor that does nothing, for archiving

Definition at line 92 of file ActivationOutputModifier.hpp.

ActivationOutputModifier::ActivationOutputModifier ( const std::string &  rFilename,
double  threshold 
)
inline

Constructor

Parameters
rFilenameThe file which is eventually produced by this modifier
thresholdThe 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.

Member Function Documentation

void ActivationOutputModifier::InitialiseAtStart ( DistributedVectorFactory pVectorFactory)
virtual

Initialise the modifier (make space for local activation times) 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.

Parameters
pVectorFactoryThe vector factory which is associated with the calling problem's mesh

Implements AbstractOutputModifier.

Definition at line 40 of file ActivationOutputModifier.cpp.

References DistributedVectorFactory::GetLocalOwnership(), mFirstActivitationTimes, mFirstRecoveryTimes, mLocalSize, mSecondActivitationTimes, and mSecondRecoveryTimes.

void ActivationOutputModifier::ProcessSolutionAtTimeStep ( double  time,
Vec  solution,
unsigned  problemDim 
)
virtual

Process a solution time-step (memorise all new activations)

Parameters
timeThe current simulation time
solutionA working copy of the solution at the current time-step. This is the PETSc vector which is distributed across the processes.
problemDimThe calling problem dimension. Used here to avoid probing the size of the solution vector
Todo:
#2570 Add to a longer running test

Implements AbstractOutputModifier.

Definition at line 91 of file ActivationOutputModifier.cpp.

References mFirstActivitationTimes, mFirstRecoveryTimes, mLocalSize, mSecondActivitationTimes, mSecondRecoveryTimes, and mThreshold.

template<class Archive >
void ActivationOutputModifier::serialize ( Archive &  archive,
const unsigned int  version 
)
inlineprivate

Archive the output modifier, never used directly - boost uses this.

Parameters
archivethe archive
versionthe current version of this class

Definition at line 83 of file ActivationOutputModifier.hpp.

References mThreshold.

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Needed for serialization.

Definition at line 74 of file ActivationOutputModifier.hpp.

Member Data Documentation

std::vector<double> ActivationOutputModifier::mFirstActivitationTimes
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().

std::vector<double> ActivationOutputModifier::mFirstRecoveryTimes
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().

unsigned ActivationOutputModifier::mLocalSize
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().

std::vector<double> ActivationOutputModifier::mSecondActivitationTimes
private

The second activation time for local nodes

Definition at line 68 of file ActivationOutputModifier.hpp.

Referenced by FinaliseAtEnd(), InitialiseAtStart(), and ProcessSolutionAtTimeStep().

std::vector<double> ActivationOutputModifier::mSecondRecoveryTimes
private

The second recovery time for local nodes

Definition at line 69 of file ActivationOutputModifier.hpp.

Referenced by FinaliseAtEnd(), InitialiseAtStart(), and ProcessSolutionAtTimeStep().

double ActivationOutputModifier::mThreshold
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().


The documentation for this class was generated from the following files: