AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM > Class Template Reference

#include <AbstractCardiacProblem.hpp>

Inheritance diagram for AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >:

Inheritance graph
[legend]
Collaboration diagram for AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 AbstractCardiacProblem (AbstractCardiacCellFactory< SPACE_DIM > *pCellFactory)
void Initialise ()
void SetNodesPerProcessorFilename (const std::string &filename)
void SetBoundaryConditionsContainer (BoundaryConditionsContainer< SPACE_DIM, SPACE_DIM, PROBLEM_DIM > *bcc)
virtual void PreSolveChecks ()
virtual Vec CreateInitialCondition ()
void ConvertOutputToMeshalyzerFormat (bool call=true)
void SetMesh (AbstractMesh< SPACE_DIM, SPACE_DIM > *pMesh)
void PrintOutput (bool rPrintOutput)
void SetWriteInfo (bool writeInfo=true)
Vec GetSolution ()
AbstractMesh< SPACE_DIM,
SPACE_DIM > & 
rGetMesh ()
AbstractCardiacPde< SPACE_DIM > * GetPde ()
void Solve ()
void CloseFilesAndPostProcess ()
virtual void WriteInfo (double time)=0
virtual void DefineWriterColumns ()
virtual void WriteOneStep (double time, Vec voltageVec)
void InitialiseWriter ()
void SetOutputNodes (std::vector< unsigned > &nodesToOutput)
Hdf5DataReader GetDataReader ()
void UseMatrixBasedRhsAssembly (bool usematrix=true)
virtual void OnEndOfTimestep (double time)

Public Attributes

Hdf5DataWriter * mpWriter

Protected Member Functions

virtual AbstractCardiacPde
< SPACE_DIM > * 
CreateCardiacPde ()=0
virtual
AbstractDynamicAssemblerMixin
< SPACE_DIM, SPACE_DIM,
PROBLEM_DIM > * 
CreateAssembler ()=0

Protected Attributes

std::string mMeshFilename
std::string mNodesPerProcessorFilename
std::string mOutputDirectory
std::string mOutputFilenamePrefix
bool mUseMatrixBasedRhsAssembly
bool mAllocatedMemoryForMesh
bool mWriteInfo
bool mPrintOutput
bool mCallChaste2Meshalyzer
std::vector< unsigned > mNodesToOutput
unsigned mVoltageColumnId
unsigned mTimeColumnId
unsigned mNodeColumnId
AbstractCardiacPde< SPACE_DIM > * mpCardiacPde
BoundaryConditionsContainer
< SPACE_DIM, SPACE_DIM,
PROBLEM_DIM > * 
mpBoundaryConditionsContainer
BoundaryConditionsContainer
< SPACE_DIM, SPACE_DIM,
PROBLEM_DIM > * 
mpDefaultBoundaryConditionsContainer
AbstractDynamicAssemblerMixin
< SPACE_DIM, SPACE_DIM,
PROBLEM_DIM > * 
mpAssembler
AbstractCardiacCellFactory
< SPACE_DIM > * 
mpCellFactory
AbstractMesh< SPACE_DIM,
SPACE_DIM > * 
mpMesh
Vec mSolution

Friends

class TestBidomainWithBathAssembler


Detailed Description

template<unsigned SPACE_DIM, unsigned PROBLEM_DIM>
class AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >

Base class for cardiac problems; contains code generic to both mono- and bidomain.

See tutorials for usage.

Definition at line 51 of file AbstractCardiacProblem.hpp.


Constructor & Destructor Documentation

template<unsigned SPACE_DIM, unsigned PROBLEM_DIM>
AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::AbstractCardiacProblem ( AbstractCardiacCellFactory< SPACE_DIM > *  pCellFactory  )  [inline]


Member Function Documentation

template<unsigned SPACE_DIM, unsigned PROBLEM_DIM>
virtual AbstractCardiacPde<SPACE_DIM>* AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::CreateCardiacPde (  )  [protected, pure virtual]

Subclasses must override this method to create a PDE object of the appropriate type.

This class will take responsibility for freeing the object when it is finished with.

Implemented in BidomainProblem< DIM >, and MonodomainProblem< DIM >.

Referenced by AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::Initialise().

template<unsigned SPACE_DIM, unsigned PROBLEM_DIM>
virtual AbstractDynamicAssemblerMixin<SPACE_DIM, SPACE_DIM, PROBLEM_DIM>* AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::CreateAssembler (  )  [protected, pure virtual]

Subclasses must override this method to create a suitable assembler object.

This class will take responsibility for freeing the object when it is finished with.

Implemented in BidomainProblem< DIM >, and MonodomainProblem< DIM >.

Referenced by AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::Solve().

template<unsigned SPACE_DIM, unsigned PROBLEM_DIM>
void AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::Initialise (  )  [inline]

template<unsigned SPACE_DIM, unsigned PROBLEM_DIM>
void AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::SetNodesPerProcessorFilename ( const std::string &  filename  )  [inline]

Set a file from which the nodes for each processor are read

Definition at line 224 of file AbstractCardiacProblem.cpp.

References AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::mNodesPerProcessorFilename.

template<unsigned SPACE_DIM, unsigned PROBLEM_DIM>
void AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::SetBoundaryConditionsContainer ( BoundaryConditionsContainer< SPACE_DIM, SPACE_DIM, PROBLEM_DIM > *  bcc  )  [inline]

Set the boundary conditions container.

Parameters:
*pbcc is a pointer to a boundary conditions container

Definition at line 230 of file AbstractCardiacProblem.cpp.

References AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::mpBoundaryConditionsContainer.

template<unsigned SPACE_DIM, unsigned PROBLEM_DIM>
void AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::PreSolveChecks (  )  [inline, virtual]

Performs a series of checks before solving. It checks whether the cardiac pde has been defined, whether the simulation time is greater than zero and whether the output directory is specified (or the output is set not to be produced). It throws exceptions if any of the above checks fails.

Reimplemented in BidomainProblem< DIM >.

Definition at line 236 of file AbstractCardiacProblem.cpp.

References AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::mOutputDirectory, AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::mpCardiacPde, and AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::mPrintOutput.

Referenced by BidomainProblem< DIM >::PreSolveChecks(), and AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::Solve().

template<unsigned SPACE_DIM, unsigned PROBLEM_DIM>
Vec AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::CreateInitialCondition (  )  [inline, virtual]

template<unsigned SPACE_DIM, unsigned PROBLEM_DIM>
void AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::ConvertOutputToMeshalyzerFormat ( bool  call = true  )  [inline]

Set whether to call the Chaste2Meshalyzer script. This script gets everything ready to visualize the results with meshalyser and is useful in testing. By default the script is called. In performance testing for example it desirable to disable the script.

Definition at line 289 of file AbstractCardiacProblem.cpp.

References AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::mCallChaste2Meshalyzer.

template<unsigned SPACE_DIM, unsigned PROBLEM_DIM>
void AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::SetMesh ( AbstractMesh< SPACE_DIM, SPACE_DIM > *  pMesh  )  [inline]

This only needs to be called if a mesh filename has not been set

Definition at line 295 of file AbstractCardiacProblem.cpp.

References AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::mAllocatedMemoryForMesh, and AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::mpMesh.

template<unsigned SPACE_DIM, unsigned PROBLEM_DIM>
void AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::PrintOutput ( bool  rPrintOutput  )  [inline]

Set whether the simulation will generate results files.

Definition at line 306 of file AbstractCardiacProblem.cpp.

References AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::mPrintOutput.

template<unsigned SPACE_DIM, unsigned PROBLEM_DIM>
void AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::SetWriteInfo ( bool  writeInfo = true  )  [inline]

Set whether extra info will be written to stdout during computation.

Definition at line 312 of file AbstractCardiacProblem.cpp.

References AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::mWriteInfo.

template<unsigned SPACE_DIM, unsigned PROBLEM_DIM>
Vec AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::GetSolution (  )  [inline]

Get the final solution vector. This vector is distributed over all processes.

In case of Bidomain, this is of length 2*numNodes, and of the form (V_1, phi_1, V_2, phi_2, ......, V_N, phi_N). where V_j is the voltage at node j and phi_j is the extracellular potential at node j.

Use with caution since we don't want to alter the state of the PETSc vector.

Definition at line 318 of file AbstractCardiacProblem.cpp.

References AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::mSolution.

template<unsigned SPACE_DIM, unsigned PROBLEM_DIM>
void AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::Solve (  )  [inline]

First performs some checks by calling the PreSolveChecks method. It creates an assembler to which it passes the boundary conditions specified by the user (otherwise it passes the defauls bcc). It then calls the Solve method in the assembler class. It also handles the output, if necessary.

Definition at line 337 of file AbstractCardiacProblem.cpp.

References GenericEventHandler< 11, HeartEventHandler >::BeginEvent(), AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::CloseFilesAndPostProcess(), AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::CreateAssembler(), AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::CreateInitialCondition(), BoundaryConditionsContainer< ELEM_DIM, SPACE_DIM, PROBLEM_DIM >::DefineZeroNeumannOnMeshBoundary(), GenericEventHandler< 11, HeartEventHandler >::EndEvent(), AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::InitialiseWriter(), AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::mOutputDirectory, AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::mpAssembler, AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::mpBoundaryConditionsContainer, AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::mpDefaultBoundaryConditionsContainer, AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::mpMesh, AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::mPrintOutput, AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::mSolution, AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::mWriteInfo, AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::OnEndOfTimestep(), AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::PreSolveChecks(), ProgressReporter::PrintFinalising(), PetscTools::ReplicateException(), GenericEventHandler< 11, HeartEventHandler >::Reset(), and ProgressReporter::Update().

template<unsigned SPACE_DIM, unsigned PROBLEM_DIM>
void AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::CloseFilesAndPostProcess (  )  [inline]

template<unsigned SPACE_DIM, unsigned PROBLEM_DIM>
void AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::InitialiseWriter (  )  [inline]

It creates and initialises the hdf writer from the Hdf5DataWriter class. It passes the output directory (mOutputDirectory) and file name (mOutputFilenamePrefix) to it. It is called by Solve(), if the output needs to be generated.

Definition at line 525 of file AbstractCardiacProblem.cpp.

References AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::mOutputDirectory.

Referenced by AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::Solve().

template<unsigned SPACE_DIM, unsigned PROBLEM_DIM>
void AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::SetOutputNodes ( std::vector< unsigned > &  nodesToOutput  )  [inline]

Specifies which nodes in the mesh to output.

Parameters:
&nodesToOutput is a reference to a vector with the indexes of the nodes where the output is desired. If empty, the output will be for all the nodes in the mesh.

Definition at line 533 of file AbstractCardiacProblem.cpp.

References AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::mNodesToOutput.

template<unsigned SPACE_DIM, unsigned PROBLEM_DIM>
void AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::UseMatrixBasedRhsAssembly ( bool  usematrix = true  )  [inline]

Whether to use matrix-based RHS assembly or not

Definition at line 549 of file AbstractCardiacProblem.cpp.

References AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::mUseMatrixBasedRhsAssembly.

template<unsigned SPACE_DIM, unsigned PROBLEM_DIM>
virtual void AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::OnEndOfTimestep ( double  time  )  [inline, virtual]

Called at end of each time step in the main time-loop in Solve(). Empty implementation but can be overloaded by child classes

Reimplemented in BidomainProblem< DIM >.

Definition at line 258 of file AbstractCardiacProblem.hpp.

Referenced by AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::Solve().


Member Data Documentation

template<unsigned SPACE_DIM, unsigned PROBLEM_DIM>
std::string AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::mMeshFilename [protected]

Meshes can be read from file or instantiated and passed directly to this class, this is for the former

Definition at line 58 of file AbstractCardiacProblem.hpp.

template<unsigned SPACE_DIM, unsigned PROBLEM_DIM>
std::string AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::mNodesPerProcessorFilename [protected]

template<unsigned SPACE_DIM, unsigned PROBLEM_DIM>
std::string AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::mOutputDirectory [protected]

template<unsigned SPACE_DIM, unsigned PROBLEM_DIM>
bool AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::mUseMatrixBasedRhsAssembly [protected]

Whether to use matrix-based assembly of the RHS vector (much more efficient). True by default

Definition at line 70 of file AbstractCardiacProblem.hpp.

Referenced by AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::UseMatrixBasedRhsAssembly().

template<unsigned SPACE_DIM, unsigned PROBLEM_DIM>
bool AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::mAllocatedMemoryForMesh [protected]

template<unsigned SPACE_DIM, unsigned PROBLEM_DIM>
bool AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::mWriteInfo [protected]

template<unsigned SPACE_DIM, unsigned PROBLEM_DIM>
bool AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::mPrintOutput [protected]

template<unsigned SPACE_DIM, unsigned PROBLEM_DIM>
bool AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::mCallChaste2Meshalyzer [protected]

template<unsigned SPACE_DIM, unsigned PROBLEM_DIM>
std::vector<unsigned> AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::mNodesToOutput [protected]

template<unsigned SPACE_DIM, unsigned PROBLEM_DIM>
unsigned AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::mVoltageColumnId [protected]

Used by the writer

Definition at line 84 of file AbstractCardiacProblem.hpp.

template<unsigned SPACE_DIM, unsigned PROBLEM_DIM>
unsigned AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::mTimeColumnId [protected]

Used by the writer

Definition at line 86 of file AbstractCardiacProblem.hpp.

template<unsigned SPACE_DIM, unsigned PROBLEM_DIM>
unsigned AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::mNodeColumnId [protected]

Used by the writer

Definition at line 88 of file AbstractCardiacProblem.hpp.

template<unsigned SPACE_DIM, unsigned PROBLEM_DIM>
AbstractCardiacPde<SPACE_DIM>* AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::mpCardiacPde [protected]

template<unsigned SPACE_DIM, unsigned PROBLEM_DIM>
BoundaryConditionsContainer<SPACE_DIM, SPACE_DIM, PROBLEM_DIM>* AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::mpBoundaryConditionsContainer [protected]

template<unsigned SPACE_DIM, unsigned PROBLEM_DIM>
BoundaryConditionsContainer<SPACE_DIM, SPACE_DIM, PROBLEM_DIM>* AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::mpDefaultBoundaryConditionsContainer [protected]

It is convenient to also have a separate variable for default (zero-Neumann) boundary conditions

Definition at line 96 of file AbstractCardiacProblem.hpp.

Referenced by AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::Solve().

template<unsigned SPACE_DIM, unsigned PROBLEM_DIM>
AbstractDynamicAssemblerMixin<SPACE_DIM, SPACE_DIM, PROBLEM_DIM>* AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::mpAssembler [protected]

template<unsigned SPACE_DIM, unsigned PROBLEM_DIM>
AbstractCardiacCellFactory<SPACE_DIM>* AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::mpCellFactory [protected]

The cell factory creates the cells for each node

Definition at line 100 of file AbstractCardiacProblem.hpp.

Referenced by AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::Initialise().

template<unsigned SPACE_DIM, unsigned PROBLEM_DIM>
AbstractMesh<SPACE_DIM,SPACE_DIM>* AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::mpMesh [protected]

template<unsigned SPACE_DIM, unsigned PROBLEM_DIM>
Vec AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::mSolution [protected]

The current solution vector, of the form [V_0 .. V_N ] for monodomain and [V_0 phi_0 .. V_N phi_N] for bidomain

Definition at line 106 of file AbstractCardiacProblem.hpp.

Referenced by AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::AbstractCardiacProblem(), AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::GetSolution(), and AbstractCardiacProblem< SPACE_DIM, PROBLEM_DIM >::Solve().


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

Generated on Wed Mar 18 12:52:02 2009 for Chaste by  doxygen 1.5.5