Chaste Commit::ca8ccdedf819b6e02855bc0e8e6f50bdecbc5208
AbstractOutputModifier Class Referenceabstract

#include <AbstractOutputModifier.hpp>

+ Inheritance diagram for AbstractOutputModifier:
+ Collaboration diagram for AbstractOutputModifier:

Public Member Functions

 AbstractOutputModifier (const std::string &rFilename, double flushTime=0.0)
 
virtual ~AbstractOutputModifier ()
 
virtual void InitialiseAtStart (DistributedVectorFactory *pVectorFactory, const std::vector< unsigned > &rNodePermutation)=0
 
virtual void FinaliseAtEnd ()=0
 
virtual void ProcessSolutionAtTimeStep (double time, Vec solution, unsigned problemDim)=0
 

Protected Member Functions

 AbstractOutputModifier ()
 

Protected Attributes

std::string mFilename
 
double mFlushTime
 

Private Member Functions

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

Friends

class TestMonodomainProblem
 
class boost::serialization::access
 

Detailed Description

A plug-in class for on-the-fly output. This is designed so that a user can insert something in order to monitor the progress of a simulation or to produce "post processed" output during the simulation.

Definition at line 51 of file AbstractOutputModifier.hpp.

Constructor & Destructor Documentation

◆ AbstractOutputModifier() [1/2]

AbstractOutputModifier::AbstractOutputModifier ( )
inlineprotected

Constructor that does nothing, for archiving

Definition at line 74 of file AbstractOutputModifier.hpp.

◆ AbstractOutputModifier() [2/2]

AbstractOutputModifier::AbstractOutputModifier ( const std::string &  rFilename,
double  flushTime = 0.0 
)
inline

Standard construction method contains only the name of the file which this simulation modifier should produce.

Note that construction occurs before the Solve() loop and probably before initialisation. This means that it will not be possible to view certain data (e.g the mesh) at the time of construction

Note the problem passes parameters in a non-templated fashion in order to keep the interface as lightweight as possible.

Parameters
rFilenameThe file which is eventually produced by this modifier
flushTimeThe (simulation) time between flushing the file to disk. Default (0) means don't flush.

Definition at line 96 of file AbstractOutputModifier.hpp.

◆ ~AbstractOutputModifier()

virtual AbstractOutputModifier::~AbstractOutputModifier ( )
inlinevirtual

Destructor should be overridden when necessary

Definition at line 103 of file AbstractOutputModifier.hpp.

Member Function Documentation

◆ FinaliseAtEnd()

virtual void AbstractOutputModifier::FinaliseAtEnd ( )
pure virtual

Finalise the modifier (close a file or dump the calculation to disk)

Implemented in ActivationOutputModifier, and SingleTraceOutputModifier.

◆ InitialiseAtStart()

virtual void AbstractOutputModifier::InitialiseAtStart ( DistributedVectorFactory pVectorFactory,
const std::vector< unsigned > &  rNodePermutation 
)
pure 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.

Parameters
pVectorFactoryThe vector factory which is associated with the calling problem's mesh
rNodePermutationThe permutation associated with the calling problem's mesh (when running with parallel partitioning)

Implemented in ActivationOutputModifier, and SingleTraceOutputModifier.

◆ ProcessSolutionAtTimeStep()

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

Process a solution time-step (dump a small line to file or compute the latest activation times)

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

Implemented in ActivationOutputModifier, and SingleTraceOutputModifier.

◆ serialize()

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

Archive this modifier. Just calls the base class version.

Parameters
archivethe archive
versionthe current version of this class

Definition at line 66 of file AbstractOutputModifier.hpp.

References mFilename, and mFlushTime.

Friends And Related Symbol Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Needed for serialization.

Definition at line 58 of file AbstractOutputModifier.hpp.

◆ TestMonodomainProblem

friend class TestMonodomainProblem
friend

For testing

Definition at line 55 of file AbstractOutputModifier.hpp.

Member Data Documentation

◆ mFilename

std::string AbstractOutputModifier::mFilename
protected

The file which is eventually produced by this modifier

Definition at line 78 of file AbstractOutputModifier.hpp.

Referenced by ActivationOutputModifier::FinaliseAtEnd(), SingleTraceOutputModifier::InitialiseAtStart(), and serialize().

◆ mFlushTime

double AbstractOutputModifier::mFlushTime
protected

Simulation time period between flushes to disk

Definition at line 81 of file AbstractOutputModifier.hpp.

Referenced by SingleTraceOutputModifier::ProcessSolutionAtTimeStep(), and serialize().


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