SingleTraceOutputModifier Class Reference

#include <SingleTraceOutputModifier.hpp>

Inherits AbstractOutputModifier.

Collaboration diagram for SingleTraceOutputModifier:
Collaboration graph
[legend]

List of all members.

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)

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

Detailed Description

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.


Constructor & Destructor Documentation

SingleTraceOutputModifier::SingleTraceOutputModifier (  )  [inline, private]

Private constructor that resets process-specific data, for archiving

Definition at line 87 of file SingleTraceOutputModifier.hpp.

SingleTraceOutputModifier::SingleTraceOutputModifier ( const std::string &  rFilename,
unsigned  globalIndex,
double  flushTime = 0.0 
) [inline]

Constructor

Parameters:
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));

or

     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.


Member Function Documentation

void SingleTraceOutputModifier::FinaliseAtEnd (  )  [virtual]

Finalise the modifier (close the file)

Implements AbstractOutputModifier.

Definition at line 57 of file SingleTraceOutputModifier.cpp.

References mFileStream, and mLocalIndex.

void SingleTraceOutputModifier::InitialiseAtStart ( DistributedVectorFactory pVectorFactory  )  [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.

Parameters:
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().

void SingleTraceOutputModifier::ProcessSolutionAtTimeStep ( double  time,
Vec  solution,
unsigned  problemDim 
) [virtual]

Process a solution time-step (dump a small line to file)

Parameters:
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 mFileStream, AbstractOutputModifier::mFlushTime, and mLocalIndex.

template<class Archive >
void SingleTraceOutputModifier::serialize ( Archive &  archive,
const unsigned int  version 
) [inline, private]

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

Parameters:
archive the archive
version the current version of this class

Reimplemented from AbstractOutputModifier.

Definition at line 78 of file SingleTraceOutputModifier.hpp.

References mGlobalIndex.


Friends And Related Function Documentation

friend class boost::serialization::access [friend]

Needed for serialization.

Reimplemented from AbstractOutputModifier.

Definition at line 60 of file SingleTraceOutputModifier.hpp.

friend class TestMonodomainProblem [friend]

For testing

Reimplemented from AbstractOutputModifier.

Definition at line 58 of file SingleTraceOutputModifier.hpp.


Member Data Documentation

Output file stream (remains open during solve).

Definition at line 67 of file SingleTraceOutputModifier.hpp.

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

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().

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().


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

Generated by  doxygen 1.6.2