AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM > Class Template Reference

#include <AbstractCardiacPde.hpp>

Inherited by MonodomainPde< ELEMENT_DIM, SPACE_DIM > [virtual], and MonodomainPde< ELEMENT_DIM, ELEMENT_DIM > [virtual].

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

List of all members.

Public Member Functions

 AbstractCardiacPde (AbstractCardiacCellFactory< ELEMENT_DIM, SPACE_DIM > *pCellFactory, const unsigned stride=1)
 AbstractCardiacPde (std::vector< AbstractCardiacCell * > &rCellsDistributed, AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > *pMesh, const unsigned stride)
virtual ~AbstractCardiacPde ()
void MergeCells (const std::vector< AbstractCardiacCell * > &rOtherCells)
void SetCacheReplication (bool doCacheReplication)
bool GetDoCacheReplication ()
const c_matrix< double,
SPACE_DIM, SPACE_DIM > & 
rGetIntracellularConductivityTensor (unsigned elementIndex)
AbstractCardiacCellGetCardiacCell (unsigned globalIndex)
virtual void SolveCellSystems (Vec existingSolution, double time, double nextTime)
ReplicatableVectorrGetIionicCacheReplicated ()
ReplicatableVectorrGetIntracellularStimulusCacheReplicated ()
void UpdateCaches (unsigned globalIndex, unsigned localIndex, double nextTime)
void ReplicateCaches ()
const std::vector
< AbstractCardiacCell * > & 
rGetCellsDistributed () const
const AbstractTetrahedralMesh
< ELEMENT_DIM, SPACE_DIM > * 
pGetMesh () const
template<class Archive >
void SaveCardiacCells (Archive &archive, const unsigned int version) const

Static Public Member Functions

template<class Archive >
static void LoadCardiacCells (Archive &archive, const unsigned int version, std::vector< AbstractCardiacCell * > &rCells, AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > *pMesh)

Protected Member Functions

void DeleteCells (bool deleteFakeCells)

Protected Attributes

AbstractTetrahedralMesh
< ELEMENT_DIM, SPACE_DIM > * 
mpMesh
AbstractConductivityTensors
< SPACE_DIM > * 
mpIntracellularConductivityTensors
std::vector
< AbstractCardiacCell * > 
mCellsDistributed
ReplicatableVector mIionicCacheReplicated
ReplicatableVector mIntracellularStimulusCacheReplicated
const unsigned mStride
HeartConfigmpConfig
bool mDoCacheReplication
bool mDoOneCacheReplication
DistributedVectorFactorympDistributedVectorFactory
bool mMeshUnarchived

Private Member Functions

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

Friends

class boost::serialization::access

Detailed Description

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM = ELEMENT_DIM>
class AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >

Class containing common functionality to monodomain and bidomain PDEs.

Contains the cardiac cells (ODE systems for each node of the mesh), conductivity tensors (dependent on fibre directions).

Also contains knowledge of parallelisation in the form of the distributed vector factory.

Definition at line 76 of file AbstractCardiacPde.hpp.


Constructor & Destructor Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::AbstractCardiacPde ( AbstractCardiacCellFactory< ELEMENT_DIM, SPACE_DIM > *  pCellFactory,
const unsigned  stride = 1 
) [inline]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::AbstractCardiacPde ( std::vector< AbstractCardiacCell * > &  rCellsDistributed,
AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > *  pMesh,
const unsigned  stride 
) [inline]

This constructor is called by the archiver

Parameters:
rCellsDistributed pointers to the cardiac cells.
pMesh a pointer to the AbstractTetrahedral mesh.
stride determines how to access $V_m$ in the solution vector (1 for monodomain, 2 for bidomain).

Definition at line 80 of file AbstractCardiacPde.cpp.

References AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::CreateIntracellularConductivityTensor(), DistributedVectorFactory::GetProblemSize(), AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mIionicCacheReplicated, AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mIntracellularStimulusCacheReplicated, AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mpDistributedVectorFactory, and ReplicatableVector::Resize().

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

Member Function Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::CreateIntracellularConductivityTensor (  )  [inline, private]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::DeleteCells ( bool  deleteFakeCells  )  [inline, protected]

Helper method for destructor.

Parameters:
deleteFakeCells whether to delete fake bath cells

Definition at line 98 of file AbstractCardiacPde.cpp.

References AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mCellsDistributed.

Referenced by AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::~AbstractCardiacPde().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
AbstractCardiacCell * AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::GetCardiacCell ( unsigned  globalIndex  )  [inline]

Get a pointer to a cell, indexed by the global node index.

Note:
Should only called by the process owning the cell - triggers an assertion otherwise.
Parameters:
globalIndex global node index for which to retrieve a cell

Definition at line 273 of file AbstractCardiacPde.cpp.

References DistributedVectorFactory::GetHigh(), DistributedVectorFactory::GetLow(), AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mCellsDistributed, and AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mpDistributedVectorFactory.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
bool AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::GetDoCacheReplication (  )  [inline]

Get whether or not to replicate the caches across all processors.

Returns:
mDoCacheReplication - true if the cache needs to be replicated

Definition at line 260 of file AbstractCardiacPde.cpp.

References AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mDoCacheReplication.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM = ELEMENT_DIM>
template<class Archive >
static void AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::LoadCardiacCells ( Archive &  archive,
const unsigned int  version,
std::vector< AbstractCardiacCell * > &  rCells,
AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > *  pMesh 
) [inline, static]

Load our collection of cells from an archive.

Handles the checkpoint migration case, deleting loaded cells immediately if they are not local to this process.

Parameters:
archive the process-specific archive to load from
version archive version
rCells vector to fill in with pointers to local cells
pMesh the mesh, so we can get at the node permutation, if any

Todo:
#1199 test this

Definition at line 350 of file AbstractCardiacPde.hpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::MergeCells ( const std::vector< AbstractCardiacCell * > &  rOtherCells  )  [inline]

Add more cells to this cardiac PDE.

This method is used by the checkpoint migration code to load a simulation checkpointed in parallel onto a single process. It adds the cells previously contained on one of the non-master processes to this process' collection.

Parameters:
rOtherCells the cells to add. This vector will have the same length as our collection, but contain non-NULL pointers in (some of) the places we have NULLs.

Definition at line 144 of file AbstractCardiacPde.cpp.

References AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mCellsDistributed.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
const AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > * AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::pGetMesh (  )  const [inline]

Returns a pointer to the mesh object

Returns:
pointer to mesh object

Definition at line 355 of file AbstractCardiacPde.cpp.

References AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mpMesh.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::ReplicateCaches (  )  [inline]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
const std::vector< AbstractCardiacCell * > & AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::rGetCellsDistributed (  )  const [inline]

Returns a reference to the vector of distributed cells. Needed for archiving.

Definition at line 349 of file AbstractCardiacPde.cpp.

References AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mCellsDistributed.

Referenced by AbstractCardiacPde< SPACE_DIM >::SaveCardiacCells().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
ReplicatableVector & AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::rGetIionicCacheReplicated (  )  [inline]

Get the entire ionic current cache

Definition at line 323 of file AbstractCardiacPde.cpp.

References AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mIionicCacheReplicated.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
const c_matrix< double, SPACE_DIM, SPACE_DIM > & AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::rGetIntracellularConductivityTensor ( unsigned  elementIndex  )  [inline]

Get the intracellular conductivity tensor for the given element

Parameters:
elementIndex index of the element of interest

Definition at line 266 of file AbstractCardiacPde.cpp.

References AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mpIntracellularConductivityTensors.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
ReplicatableVector & AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::rGetIntracellularStimulusCacheReplicated (  )  [inline]

Get the entire stimulus current cache

Definition at line 329 of file AbstractCardiacPde.cpp.

References AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mIntracellularStimulusCacheReplicated.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM = ELEMENT_DIM>
template<class Archive >
void AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::SaveCardiacCells ( Archive &  archive,
const unsigned int  version 
) const [inline]

Save our collection of cells to an archive.

Writes:

  1. mpDistributedVectorFactory
  2. number of cells on this process
  3. each cell pointer in turn
Parameters:
archive the master archive; cells will actually be written to the process-specific archive.
version 

Definition at line 313 of file AbstractCardiacPde.hpp.

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

Archive the member variables.

Parameters:
archive 
version 

Reimplemented in BidomainPde< SPACE_DIM >, MonodomainPde< ELEMENT_DIM, SPACE_DIM >, BidomainPde< DIM >, and MonodomainPde< ELEMENT_DIM, ELEMENT_DIM >.

Definition at line 89 of file AbstractCardiacPde.hpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::SetCacheReplication ( bool  doCacheReplication  )  [inline]

Set whether or not to replicate the caches across all processors.

See also mDoCacheReplication.

Parameters:
doCacheReplication - true if the cache needs to be replicated

Definition at line 253 of file AbstractCardiacPde.cpp.

References AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mDoCacheReplication, and AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mDoOneCacheReplication.

Referenced by MonodomainMatrixBasedAssembler< ELEMENT_DIM, SPACE_DIM >::MonodomainMatrixBasedAssembler().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::SolveCellSystems ( Vec  existingSolution,
double  time,
double  nextTime 
) [inline, virtual]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::UpdateCaches ( unsigned  globalIndex,
unsigned  localIndex,
double  nextTime 
) [inline]

Update the Iionic and intracellular stimulus caches.

Parameters:
globalIndex global index of the entry to update
localIndex local index of the entry to update
nextTime the next PDE time point, at which to evaluate the stimulus current

Definition at line 335 of file AbstractCardiacPde.cpp.

References AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mCellsDistributed, AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mIionicCacheReplicated, and AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mIntracellularStimulusCacheReplicated.

Referenced by AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::SolveCellSystems().


Friends And Related Function Documentation

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

Member Data Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM = ELEMENT_DIM>
std::vector< AbstractCardiacCell* > AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mCellsDistributed [protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM = ELEMENT_DIM>
bool AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mDoCacheReplication [protected]

Whether we need to replicate the caches.

When doing matrix-based RHS assembly, we only actually need information from cells/nodes local to the processor, so replicating the caches is an unnecessary communication overhead.

Defaults to true.

Definition at line 155 of file AbstractCardiacPde.hpp.

Referenced by AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::GetDoCacheReplication(), AbstractCardiacPde< SPACE_DIM >::serialize(), AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::SetCacheReplication(), and AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::SolveCellSystems().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM = ELEMENT_DIM>
bool AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mDoOneCacheReplication [protected]

This is to mark the conventional assembly on the first time step.

Todo:
#1063 maybe we don't want the conventional assembly even in the first time step.

Definition at line 162 of file AbstractCardiacPde.hpp.

Referenced by AbstractCardiacPde< SPACE_DIM >::serialize(), AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::SetCacheReplication(), and AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::SolveCellSystems().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM = ELEMENT_DIM>
ReplicatableVector AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mIionicCacheReplicated [protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM = ELEMENT_DIM>
ReplicatableVector AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mIntracellularStimulusCacheReplicated [protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM = ELEMENT_DIM>
bool AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mMeshUnarchived [protected]

Whether the mesh was unarchived or got from elsewhere.

Definition at line 177 of file AbstractCardiacPde.hpp.

Referenced by AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::~AbstractCardiacPde().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM = ELEMENT_DIM>
HeartConfig* AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mpConfig [protected]

Local pointer to the HeartConfig singleton instance, for convenience.

Definition at line 144 of file AbstractCardiacPde.hpp.

Referenced by AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::CreateIntracellularConductivityTensor().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM = ELEMENT_DIM>
DistributedVectorFactory* AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mpDistributedVectorFactory [protected]

Local pointer to the distributed vector factory associated with the mesh object used.

Used to retrieve node ownership range when needed.

NB: This is set from mpMesh->GetDistributedVectorFactory() and thus always equal to that. We never assume ownership of the object.

Definition at line 172 of file AbstractCardiacPde.hpp.

Referenced by AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::AbstractCardiacPde(), AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::GetCardiacCell(), AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::ReplicateCaches(), AbstractCardiacPde< SPACE_DIM >::SaveCardiacCells(), AbstractCardiacPde< SPACE_DIM >::serialize(), and AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::SolveCellSystems().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM = ELEMENT_DIM>
AbstractConductivityTensors<SPACE_DIM>* AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mpIntracellularConductivityTensors [protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM = ELEMENT_DIM>
AbstractTetrahedralMesh<ELEMENT_DIM,SPACE_DIM>* AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mpMesh [protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM = ELEMENT_DIM>
const unsigned AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mStride [protected]

Constant set to 1 in monodomain and 2 in bidomain. Used when accessing the voltage components in the solution vector (because the solution vector is 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.

Definition at line 141 of file AbstractCardiacPde.hpp.


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

Generated by  doxygen 1.6.2