AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM > Class Template Reference

#include <AbstractCardiacProblem.hpp>

Inherits AbstractUntemplatedCardiacProblem.

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

List of all members.

Public Member Functions

 AbstractCardiacProblem (AbstractCardiacCellFactory< ELEMENT_DIM, SPACE_DIM > *pCellFactory)
 AbstractCardiacProblem ()
virtual ~AbstractCardiacProblem ()
void Initialise ()
void SetNodesPerProcessorFilename (const std::string &rFilename)
void SetBoundaryConditionsContainer (BccType pBcc)
virtual void PreSolveChecks ()
virtual Vec CreateInitialCondition ()
void SetMesh (AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > *pMesh)
void PrintOutput (bool rPrintOutput)
void SetWriteInfo (bool writeInfo=true)
Vec GetSolution ()
DistributedVector GetSolutionDistributedVector ()
double GetCurrentTime ()
AbstractTetrahedralMesh
< ELEMENT_DIM, SPACE_DIM > & 
rGetMesh ()
AbstractCardiacTissue
< ELEMENT_DIM, SPACE_DIM > * 
GetTissue ()
void Solve ()
void CloseFilesAndPostProcess ()
virtual void WriteInfo (double time)=0
virtual void DefineWriterColumns (bool extending)
void DefineExtraVariablesWriterColumns (bool extending)
virtual void WriteOneStep (double time, Vec voltageVec)=0
void WriteExtraVariablesOneStep ()
bool InitialiseWriter ()
void SetOutputNodes (std::vector< unsigned > &rNodesToOutput)
Hdf5DataReader GetDataReader ()
virtual void AtBeginningOfTimestep (double time)
virtual void OnEndOfTimestep (double time)
virtual void SetUpAdditionalStoppingTimes (std::vector< double > &rAdditionalStoppingTimes)
void SetUseTimeAdaptivityController (bool useAdaptivity, AbstractTimeAdaptivityController *pController=NULL)
template<class Archive >
void LoadExtraArchive (Archive &archive, unsigned version)
virtual bool GetHasBath ()
virtual void SetElectrodes ()
void AddOutputModifier (boost::shared_ptr< AbstractOutputModifier > pOutputModifier)

Protected Member Functions

virtual AbstractCardiacTissue
< ELEMENT_DIM, SPACE_DIM > * 
CreateCardiacTissue ()=0
virtual
AbstractDynamicLinearPdeSolver
< ELEMENT_DIM, SPACE_DIM,
PROBLEM_DIM > * 
CreateSolver ()=0
virtual void CreateMeshFromHeartConfig ()

Protected Attributes

std::string mMeshFilename
bool mAllocatedMemoryForMesh
bool mWriteInfo
bool mPrintOutput
std::vector< unsignedmNodesToOutput
unsigned mVoltageColumnId
std::vector< unsignedmExtraVariablesId
unsigned mTimeColumnId
unsigned mNodeColumnId
AbstractCardiacTissue
< ELEMENT_DIM, SPACE_DIM > * 
mpCardiacTissue
BccType mpBoundaryConditionsContainer
BccType mpDefaultBoundaryConditionsContainer
AbstractDynamicLinearPdeSolver
< ELEMENT_DIM, SPACE_DIM,
PROBLEM_DIM > * 
mpSolver
AbstractCardiacCellFactory
< ELEMENT_DIM, SPACE_DIM > * 
mpCellFactory
AbstractTetrahedralMesh
< ELEMENT_DIM, SPACE_DIM > * 
mpMesh
Vec mSolution
double mCurrentTime
AbstractTimeAdaptivityControllermpTimeAdaptivityController
Hdf5DataWritermpWriter
std::vector< boost::shared_ptr
< AbstractOutputModifier > > 
mOutputModifiers

Private Types

typedef boost::shared_ptr
< BoundaryConditionsContainer
< ELEMENT_DIM, SPACE_DIM,
PROBLEM_DIM > > 
BccType

Private Member Functions

template<class Archive >
void save (Archive &archive, const unsigned int version) const
template<class Archive >
void load (Archive &archive, const unsigned int version)
template<class Archive >
void SaveBoundaryConditions (Archive &archive, AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > *pMesh, BccType pBcc) const
template<class Archive >
BccType LoadBoundaryConditions (Archive &archive, AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > *pMesh)

Friends

class TestBidomainWithBath
class TestMonodomainProblem
class TestCardiacSimulationArchiver
class boost::serialization::access
class CardiacElectroMechanicsProblem

Detailed Description

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

Base class for cardiac problems; contains code generic to mono-/bi-domain and bidomain-with-bath.

This class contains the tissue (PDEs and 'cells' ODEs), boundary conditions, and postprocessing/results writers.

It is called by CardiacSimulation, which is the outer wrapper class for running a cardiac simulation, used by the executable.

Many non-standard simulations will use this class directly, and this is the preferred method for non-executable users. See tutorials for usage.

Definition at line 115 of file AbstractCardiacProblem.hpp.


Member Typedef Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
typedef boost::shared_ptr<BoundaryConditionsContainer<ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM> > AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::BccType [private]

To save typing

Definition at line 123 of file AbstractCardiacProblem.hpp.


Constructor & Destructor Documentation

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

Constructor used by archiving.

Definition at line 78 of file AbstractCardiacProblem.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::~AbstractCardiacProblem (  )  [inline, virtual]

Member Function Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
void AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::AddOutputModifier ( boost::shared_ptr< AbstractOutputModifier pOutputModifier  )  [inline]

Add an output modifier onto a list of such objects. These will be processed in the order in which they have been given. The modifier should not be destroyed before the solve loop has completed

Parameters:
pOutputModifier Pointer to the modifier to be added

Definition at line 754 of file AbstractCardiacProblem.hpp.

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

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

Parameters:
time the current time

Reimplemented in BidomainProblem< DIM >.

Definition at line 679 of file AbstractCardiacProblem.hpp.

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

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
void AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::CloseFilesAndPostProcess (  )  [inline]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
virtual AbstractCardiacTissue<ELEMENT_DIM,SPACE_DIM>* AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::CreateCardiacTissue (  )  [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.

Returns:
a pointer to the newly created tissue

Implemented in BidomainProblem< DIM >, ExtendedBidomainProblem< DIM >, and MonodomainProblem< ELEMENT_DIM, SPACE_DIM >.

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

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

This method sets the initial condition for the PDE by getting the voltages (V) from the cell models at the nodes.

If the problem dimension is two (Bidomain) the second variable (phi_e) is set to zero.

This is virtual so BidomainProblem can overwrite V to zero for bath nodes, if there are any.

Todo:
Perhaps this should be a method of AbstractCardiacTissue??
Returns:
the newly created intial conditions vector

Reimplemented in BidomainProblem< DIM >, and ExtendedBidomainProblem< DIM >.

Definition at line 263 of file AbstractCardiacProblem.cpp.

References DistributedVector::Begin(), DistributedVectorFactory::CreateDistributedVector(), DistributedVectorFactory::CreateVec(), DistributedVector::End(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpCardiacTissue, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpMesh, and DistributedVector::Restore().

Referenced by CardiacElectroMechanicsProblem< DIM, ELEC_PROB_DIM >::Solve(), and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Solve().

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

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

Only needed if the subclass needs something other than a DistributedTetrahedralMesh.

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

Definition at line 215 of file AbstractCardiacProblem.cpp.

References HeartConfig::GetMeshPartitioning(), HeartConfig::Instance(), and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpMesh.

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

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
virtual AbstractDynamicLinearPdeSolver<ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM>* AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::CreateSolver (  )  [protected, pure virtual]

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

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

Returns:
pointer to newly created PDE solver

Implemented in BidomainProblem< DIM >, ExtendedBidomainProblem< DIM >, and MonodomainProblem< ELEMENT_DIM, SPACE_DIM >.

Referenced by CardiacElectroMechanicsProblem< DIM, ELEC_PROB_DIM >::Solve(), and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Solve().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
void AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::DefineExtraVariablesWriterColumns ( bool  extending  )  [inline]

Define the user specified variables to be written to the primary results file

Parameters:
extending whether we are extending an existing results file

Definition at line 710 of file AbstractCardiacProblem.cpp.

References Hdf5DataWriter::DefineVariable(), HeartConfig::GetOutputVariables(), Hdf5DataWriter::GetVariableByName(), HeartConfig::Instance(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mExtraVariablesId, and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpWriter.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
void AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::DefineWriterColumns ( bool  extending  )  [inline, virtual]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
double AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::GetCurrentTime (  )  [inline]
Returns:
the current time of the simulation

Definition at line 330 of file AbstractCardiacProblem.cpp.

References AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mCurrentTime.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
Hdf5DataReader AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::GetDataReader (  )  [inline]
Returns:
a newly created data reader configured to read the results we've been outputting.

Definition at line 868 of file AbstractCardiacProblem.cpp.

References EXCEPTION, and HeartConfig::Instance().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
bool AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::GetHasBath (  )  [inline, virtual]
Returns:
whether there's bath defined in this problem

Reimplemented in BidomainProblem< DIM >, and ExtendedBidomainProblem< DIM >.

Definition at line 878 of file AbstractCardiacProblem.cpp.

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

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
Vec AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::GetSolution (  )  [inline]
Returns:
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< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mSolution.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
DistributedVector AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::GetSolutionDistributedVector (  )  [inline]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
AbstractCardiacTissue< ELEMENT_DIM, SPACE_DIM > * AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::GetTissue (  )  [inline]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
void AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Initialise (  )  [inline]

Initialise the system, once parameters have been set up.

Must be called before first calling Solve(). If loading from a checkpoint, do NOT call this method, as it can also be used to reset the problem to perform another simulation from time 0.

Definition at line 115 of file AbstractCardiacProblem.cpp.

References GenericEventHandler< 16, HeartEventHandler >::BeginEvent(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::CreateCardiacTissue(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::CreateMeshFromHeartConfig(), PetscTools::Destroy(), GenericEventHandler< 16, HeartEventHandler >::EndEvent(), EXCEPTION, HeartConfig::GetFibreLength(), HeartConfig::GetInterNodeSpace(), HeartConfig::GetMeshName(), HeartConfig::GetSheetDimensions(), Exception::GetShortMessage(), HeartConfig::GetSlabDimensions(), HeartConfig::Instance(), PetscTools::IsParallel(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mAllocatedMemoryForMesh, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mCurrentTime, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpCardiacTissue, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpCellFactory, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpMesh, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mSolution, NEVER_REACHED, and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetElectrodes().

Referenced by CardiacElectroMechanicsProblem< DIM, ELEC_PROB_DIM >::Initialise().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
bool AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::InitialiseWriter (  )  [inline]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
template<class Archive >
void AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::load ( Archive &  archive,
const unsigned int  version 
) [inline, private]

Load the member variables.

Parameters:
archive 
version 

Todo:
#1317 code for saving/loading mSolution is PROBLEM_DIM specific, move it into the save/load methods for Mono and BidomainProblem. (ExtendedBidomain has its own already.)
Todo:
#1317 is there a reason we can't use PETSc's load/save vector functionality?

Reimplemented in BidomainProblem< DIM >, and ExtendedBidomainProblem< DIM >.

Definition at line 220 of file AbstractCardiacProblem.hpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
template<class Archive >
BccType AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::LoadBoundaryConditions ( Archive &  archive,
AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > *  pMesh 
) [inline, private]

Serialization helper method to load a boundary conditions container.

Parameters:
archive the archive to load from
pMesh the mesh boundary conditions are to be defined on
Returns:
the loaded container

Definition at line 357 of file AbstractCardiacProblem.hpp.

Referenced by AbstractCardiacProblem< DIM, DIM, 1 >::load().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
template<class Archive >
void AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::LoadExtraArchive ( Archive &  archive,
unsigned  version 
) [inline]

Used when loading a set of archives written by a parallel simulation onto a single process. Loads data from the given process-specific archive (written by a non-master process) and merges it into our data.

Parameters:
archive the archive to load
version the archive file version
Note:
The process-specific archives currently contain the following data. If the layout changes, then this method will need to be altered, since it hard-codes knowledge of the order in which things are archived.
  1. (via mpMesh) DistributedVectorFactory*
  2. (via mpCardiacTissue LoadCardiacCells) DistributedVectorFactory*
  3. (via mpCardiacTissue LoadCardiacCells) number_of_cells and sequence of AbstractCardiacCell*, possibly with Purkinje interleaved
  4. (via mpCardiacTissue) DistributedVectorFactory*
  5. mpBoundaryConditionsContainer
  6. mpDefaultBoundaryConditionsContainer
  7. (if we're a BidomainProblem) stuff in BidomainProblem::LoadExtraArchiveForBidomain

Definition at line 768 of file AbstractCardiacProblem.hpp.

References DistributedVectorFactory::GetNumProcs(), DistributedVectorFactory::GetOriginalFactory(), and BidomainProblem< DIM >::LoadExtraArchiveForBidomain().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
virtual void AbstractCardiacProblem< ELEMENT_DIM, 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.

Parameters:
time the current time

Reimplemented in BidomainProblem< DIM >.

Definition at line 689 of file AbstractCardiacProblem.hpp.

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

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
void AbstractCardiacProblem< ELEMENT_DIM, 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.

Todo:
remove magic number? (#1884)

Reimplemented in BidomainProblem< DIM >, and ExtendedBidomainProblem< DIM >.

Definition at line 227 of file AbstractCardiacProblem.cpp.

References EXCEPTION, HeartConfig::GetPdeTimeStep(), HeartConfig::GetSimulationDuration(), HeartConfig::Instance(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mCurrentTime, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpCardiacTissue, and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mPrintOutput.

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

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

Set whether the simulation will generate results files.

Parameters:
rPrintOutput 

Definition at line 306 of file AbstractCardiacProblem.cpp.

References AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mPrintOutput.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > & AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::rGetMesh (  )  [inline]
Returns:
the mesh used

Definition at line 336 of file AbstractCardiacProblem.cpp.

References AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpMesh.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
template<class Archive >
void AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::save ( Archive &  archive,
const unsigned int  version 
) const [inline, private]

Save the member variables.

Parameters:
archive 
version 

Todo:
#1317 code for saving/loading mSolution is PROBLEM_DIM specific, move it into the save/load methods for Mono and BidomainProblem. Note that extended_bidomain has its own version of this code.

Reimplemented in BidomainProblem< DIM >, and ExtendedBidomainProblem< DIM >.

Definition at line 136 of file AbstractCardiacProblem.hpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
template<class Archive >
void AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SaveBoundaryConditions ( Archive &  archive,
AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > *  pMesh,
BccType  pBcc 
) const [inline, private]

Serialization helper method to save a boundary conditions container.

Parameters:
archive the archive to save to
pMesh the mesh boundary conditions are defined on
pBcc the container to save

Definition at line 342 of file AbstractCardiacProblem.hpp.

Referenced by AbstractCardiacProblem< DIM, DIM, 1 >::save().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
void AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetBoundaryConditionsContainer ( BccType  pBcc  )  [inline]

Set the boundary conditions container.

Parameters:
pBcc is a pointer to a boundary conditions container

Definition at line 221 of file AbstractCardiacProblem.cpp.

References AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpBoundaryConditionsContainer.

Referenced by CardiacElectroMechanicsProblem< DIM, ELEC_PROB_DIM >::Solve().

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

Set an electrode object (which provides boundary conditions). Only valid if there is a bath.

Reimplemented in BidomainProblem< DIM >.

Definition at line 884 of file AbstractCardiacProblem.cpp.

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

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

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

Parameters:
pMesh the mesh object to use

Definition at line 293 of file AbstractCardiacProblem.cpp.

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

Referenced by CardiacElectroMechanicsProblem< DIM, ELEC_PROB_DIM >::Initialise().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
void AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetNodesPerProcessorFilename ( const std::string &  rFilename  ) 

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

Parameters:
rFilename 
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
void AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetOutputNodes ( std::vector< unsigned > &  rNodesToOutput  )  [inline]

Specifies which nodes in the mesh to output. This method must be called before InitialiseWriter, otherwise all nodes will still be output. If this method is called when extending an existing HDF5 file, it will be ignored.

Parameters:
rNodesToOutput 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 862 of file AbstractCardiacProblem.cpp.

References AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mNodesToOutput.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
virtual void AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetUpAdditionalStoppingTimes ( std::vector< double > &  rAdditionalStoppingTimes  )  [inline, virtual]

Allow subclasses to define additional 'stopping times' for the printing time step loop. This allows bidomain simulations to specify exactly when the Electrodes should be turned on or off.

Parameters:
rAdditionalStoppingTimes to be filled in with the additional stopping times

Reimplemented in BidomainProblem< DIM >.

Definition at line 699 of file AbstractCardiacProblem.hpp.

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

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
void AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetUseTimeAdaptivityController ( bool  useAdaptivity,
AbstractTimeAdaptivityController pController = NULL 
) [inline]
Todo:
#1704 add default adaptivity controller and allow the user just to call with true

Set whether (or not) to use a time adaptivity controller

Parameters:
useAdaptivity whether to use adaptivity
pController The controller (only relevant if useAdaptivity==true)

Definition at line 353 of file AbstractCardiacProblem.cpp.

References AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpTimeAdaptivityController.

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

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

Parameters:
writeInfo 

Definition at line 312 of file AbstractCardiacProblem.cpp.

References AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mWriteInfo.

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

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

Note:
This method is collective, and hence must be called by all processes.

Definition at line 370 of file AbstractCardiacProblem.cpp.

References Hdf5DataWriter::AdvanceAlongUnlimitedDimension(), TimeStepper::AdvanceOneTimeStep(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::AtBeginningOfTimestep(), GenericEventHandler< 16, HeartEventHandler >::BeginEvent(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::CloseFilesAndPostProcess(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::CreateInitialCondition(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::CreateSolver(), PetscTools::Destroy(), GenericEventHandler< 16, HeartEventHandler >::EndEvent(), TimeStepper::GetNextTime(), HeartConfig::GetOutputDirectory(), TimeStepper::GetTime(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::InitialiseWriter(), HeartConfig::Instance(), TimeStepper::IsTimeAtEnd(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mCurrentTime, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mOutputModifiers, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpBoundaryConditionsContainer, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpDefaultBoundaryConditionsContainer, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpMesh, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mPrintOutput, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpSolver, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpTimeAdaptivityController, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpWriter, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mSolution, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mWriteInfo, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::OnEndOfTimestep(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::PreSolveChecks(), ProgressReporter::PrintFinalising(), PetscTools::ReplicateException(), GenericEventHandler< 16, HeartEventHandler >::Reset(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetUpAdditionalStoppingTimes(), ProgressReporter::Update(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::WriteInfo(), and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::WriteOneStep().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
void AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::WriteExtraVariablesOneStep (  )  [inline]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
virtual void AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::WriteInfo ( double  time  )  [pure virtual]

Write informative details about the progress of the simulation to standard output.

Implemented only in subclasses.

Parameters:
time the current time

Implemented in BidomainProblem< DIM >, ExtendedBidomainProblem< DIM >, and MonodomainProblem< ELEMENT_DIM, SPACE_DIM >.

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

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
virtual void AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::WriteOneStep ( double  time,
Vec  voltageVec 
) [pure virtual]

Write one timestep of output data to the primary results file.

Parameters:
time the current time
voltageVec the solution vector to write

Implemented in BidomainProblem< DIM >, ExtendedBidomainProblem< DIM >, and MonodomainProblem< ELEMENT_DIM, SPACE_DIM >.

Referenced by CardiacElectroMechanicsProblem< DIM, ELEC_PROB_DIM >::Solve(), and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Solve().


Friends And Related Function Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
friend class boost::serialization::access [friend]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
friend class CardiacElectroMechanicsProblem [friend]

CardiacElectroMechanicsProblem needs access to mpWriter.

Definition at line 459 of file AbstractCardiacProblem.hpp.


Member Data Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
bool AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mAllocatedMemoryForMesh [protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
double AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mCurrentTime [protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
std::vector<unsigned> AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mExtraVariablesId [protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
std::string AbstractCardiacProblem< ELEMENT_DIM, 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 377 of file AbstractCardiacProblem.hpp.

Referenced by AbstractCardiacProblem< DIM, DIM, 1 >::load(), and AbstractCardiacProblem< DIM, DIM, 1 >::save().

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

Used by the writer

Definition at line 396 of file AbstractCardiacProblem.hpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
std::vector<unsigned> AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mNodesToOutput [protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
std::vector<boost::shared_ptr<AbstractOutputModifier> > AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mOutputModifiers [protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
BccType AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpBoundaryConditionsContainer [protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
AbstractCardiacTissue<ELEMENT_DIM,SPACE_DIM>* AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpCardiacTissue [protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
AbstractCardiacCellFactory<ELEMENT_DIM,SPACE_DIM>* AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpCellFactory [protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
BccType AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpDefaultBoundaryConditionsContainer [protected]

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

Definition at line 404 of file AbstractCardiacProblem.hpp.

Referenced by AbstractCardiacProblem< DIM, DIM, 1 >::load(), AbstractCardiacProblem< DIM, DIM, 1 >::save(), and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Solve().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
AbstractTetrahedralMesh<ELEMENT_DIM,SPACE_DIM>* AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpMesh [protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
bool AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mPrintOutput [protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
AbstractDynamicLinearPdeSolver<ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM>* AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpSolver [protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
AbstractTimeAdaptivityController* AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpTimeAdaptivityController [protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
Hdf5DataWriter* AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpWriter [protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
Vec AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mSolution [protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
unsigned AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mTimeColumnId [protected]

Used by the writer

Definition at line 394 of file AbstractCardiacProblem.hpp.

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

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

Generated by  doxygen 1.6.2