#include <AbstractCardiacPde.hpp>
Inherited by MonodomainPde< ELEMENT_DIM, SPACE_DIM > [virtual]
, and MonodomainPde< ELEMENT_DIM, ELEMENT_DIM > [virtual]
.
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.
AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::AbstractCardiacPde | ( | AbstractCardiacCellFactory< ELEMENT_DIM, SPACE_DIM > * | pCellFactory, | |
const unsigned | stride = 1 | |||
) | [inline] |
This constructor is called from the Initialise() method of the CardiacProblem class. It creates all the cell objects, and sets up the conductivities.
pCellFactory | factory to use to create cells. | |
stride | determines how to access in the solution vector (1 for monodomain, 2 for bidomain). |
Definition at line 42 of file AbstractCardiacPde.cpp.
References GenericEventHandler< 13, HeartEventHandler >::BeginEvent(), AbstractCardiacCellFactory< ELEMENT_DIM, SPACE_DIM >::CreateCardiacCellForNode(), AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::CreateIntracellularConductivityTensor(), GenericEventHandler< 13, HeartEventHandler >::EndEvent(), AbstractCardiacCellFactory< ELEMENT_DIM, SPACE_DIM >::FinaliseCellCreation(), DistributedVectorFactory::GetHigh(), DistributedVectorFactory::GetLocalOwnership(), DistributedVectorFactory::GetLow(), AbstractCardiacCellFactory< ELEMENT_DIM, SPACE_DIM >::GetMesh(), AbstractCardiacCellFactory< ELEMENT_DIM, SPACE_DIM >::GetNumberOfCells(), AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mCellsDistributed, AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mIionicCacheReplicated, AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mIntracellularStimulusCacheReplicated, AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mpDistributedVectorFactory, and ReplicatableVector::Resize().
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
rCellsDistributed | pointers to the cardiac cells. | |
pMesh | a pointer to the AbstractTetrahedral mesh. | |
stride | determines how to access 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().
AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::~AbstractCardiacPde | ( | ) | [inline, virtual] |
Virtual destructor
Definition at line 130 of file AbstractCardiacPde.cpp.
References AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::DeleteCells(), AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mMeshUnarchived, AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mpIntracellularConductivityTensors, and AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mpMesh.
void AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::CreateIntracellularConductivityTensor | ( | ) | [inline, private] |
Convenience method for intracellular conductivity tensor creation
Definition at line 158 of file AbstractCardiacPde.cpp.
References GenericEventHandler< 13, HeartEventHandler >::BeginEvent(), GenericEventHandler< 13, HeartEventHandler >::EndEvent(), HeartConfig::GetConductivityHeterogeneities(), HeartConfig::GetConductivityHeterogeneitiesProvided(), HeartConfig::GetConductivityMedia(), HeartConfig::GetIntracellularConductivities(), HeartConfig::GetLoadMesh(), HeartConfig::GetMeshName(), HeartConfig::Instance(), HeartConfig::IsMeshProvided(), AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mpConfig, AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mpIntracellularConductivityTensors, AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mpMesh, and PetscTools::ReplicateException().
Referenced by AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::AbstractCardiacPde().
void AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::DeleteCells | ( | bool | deleteFakeCells | ) | [inline, protected] |
Helper method for destructor.
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().
AbstractCardiacCell * AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::GetCardiacCell | ( | unsigned | globalIndex | ) | [inline] |
Get a pointer to a cell, indexed by the global node index.
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.
bool AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::GetDoCacheReplication | ( | ) | [inline] |
Get whether or not to replicate the caches across all processors.
Definition at line 260 of file AbstractCardiacPde.cpp.
References AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mDoCacheReplication.
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.
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 |
Definition at line 350 of file AbstractCardiacPde.hpp.
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.
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.
const AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > * AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::pGetMesh | ( | ) | const [inline] |
Returns a pointer to the mesh object
Definition at line 355 of file AbstractCardiacPde.cpp.
References AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mpMesh.
void AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::ReplicateCaches | ( | ) | [inline] |
Replicate the Iionic and intracellular stimulus caches.
Definition at line 342 of file AbstractCardiacPde.cpp.
References DistributedVectorFactory::GetHigh(), DistributedVectorFactory::GetLow(), AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mIionicCacheReplicated, AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mIntracellularStimulusCacheReplicated, AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mpDistributedVectorFactory, and ReplicatableVector::Replicate().
Referenced by AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::SolveCellSystems().
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().
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.
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
elementIndex | index of the element of interest |
Definition at line 266 of file AbstractCardiacPde.cpp.
References AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mpIntracellularConductivityTensors.
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.
void AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::SaveCardiacCells | ( | Archive & | archive, | |
const unsigned int | version | |||
) | const [inline] |
Save our collection of cells to an archive.
Writes:
archive | the master archive; cells will actually be written to the process-specific archive. | |
version |
Definition at line 313 of file AbstractCardiacPde.hpp.
void AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::serialize | ( | Archive & | archive, | |
const unsigned int | version | |||
) | [inline, private] |
Archive the member variables.
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.
void AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::SetCacheReplication | ( | bool | doCacheReplication | ) | [inline] |
Set whether or not to replicate the caches across all processors.
See also mDoCacheReplication.
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().
void AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::SolveCellSystems | ( | Vec | existingSolution, | |
double | time, | |||
double | nextTime | |||
) | [inline, virtual] |
Integrate the cell ODEs and update ionic current etc for each of the cells, between the two times provided.
existingSolution | the current voltage solution vector | |
time | the current simulation time | |
nextTime | when to simulate the cells until |
Definition at line 282 of file AbstractCardiacPde.cpp.
References DistributedVector::Begin(), GenericEventHandler< 13, HeartEventHandler >::BeginEvent(), DistributedVectorFactory::CreateDistributedVector(), DistributedVector::End(), GenericEventHandler< 13, HeartEventHandler >::EndEvent(), AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mCellsDistributed, AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mDoCacheReplication, AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mDoOneCacheReplication, AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mpDistributedVectorFactory, AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::ReplicateCaches(), PetscTools::ReplicateException(), and AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::UpdateCaches().
void AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::UpdateCaches | ( | unsigned | globalIndex, | |
unsigned | localIndex, | |||
double | nextTime | |||
) | [inline] |
Update the Iionic and intracellular stimulus caches.
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().
friend class boost::serialization::access [friend] |
Needed for serialization.
Reimplemented in BidomainPde< SPACE_DIM >, MonodomainPde< ELEMENT_DIM, SPACE_DIM >, BidomainPde< DIM >, and MonodomainPde< ELEMENT_DIM, ELEMENT_DIM >.
Definition at line 81 of file AbstractCardiacPde.hpp.
std::vector< AbstractCardiacCell* > AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mCellsDistributed [protected] |
The vector of cells. Distributed.
Definition at line 121 of file AbstractCardiacPde.hpp.
Referenced by AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::AbstractCardiacPde(), AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::DeleteCells(), AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::GetCardiacCell(), AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::MergeCells(), AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::rGetCellsDistributed(), AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::SolveCellSystems(), and AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::UpdateCaches().
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().
bool AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mDoOneCacheReplication [protected] |
This is to mark the conventional assembly on 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().
ReplicatableVector AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mIionicCacheReplicated [protected] |
Cache containing all the ionic currents for each node, replicated over all processes.
Definition at line 127 of file AbstractCardiacPde.hpp.
Referenced by AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::AbstractCardiacPde(), AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::ReplicateCaches(), AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::rGetIionicCacheReplicated(), and AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::UpdateCaches().
ReplicatableVector AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mIntracellularStimulusCacheReplicated [protected] |
Cache containing all the stimulus currents for each node, replicated over all processes.
Definition at line 133 of file AbstractCardiacPde.hpp.
Referenced by AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::AbstractCardiacPde(), AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::ReplicateCaches(), AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::rGetIntracellularStimulusCacheReplicated(), and AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::UpdateCaches().
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().
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().
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().
AbstractConductivityTensors<SPACE_DIM>* AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mpIntracellularConductivityTensors [protected] |
Intracellular conductivity tensors. Not archived, since it's loaded from the HeartConfig singleton.
Definition at line 118 of file AbstractCardiacPde.hpp.
Referenced by AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::CreateIntracellularConductivityTensor(), AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::rGetIntracellularConductivityTensor(), and AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::~AbstractCardiacPde().
AbstractTetrahedralMesh<ELEMENT_DIM,SPACE_DIM>* AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::mpMesh [protected] |
It's handy to keep a pointer to the mesh object
Definition at line 115 of file AbstractCardiacPde.hpp.
Referenced by AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::CreateIntracellularConductivityTensor(), AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::pGetMesh(), AbstractCardiacPde< SPACE_DIM >::serialize(), and AbstractCardiacPde< ELEMENT_DIM, SPACE_DIM >::~AbstractCardiacPde().
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.