#include <AbstractCardiacPde.hpp>
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 77 of file AbstractCardiacPde.hpp.
AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::AbstractCardiacPde | ( | AbstractCardiacCellFactory< ELEM_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 AbstractCardiacCellFactory< ELEM_DIM, SPACE_DIM >::CreateCardiacCellForNode(), AbstractCardiacCellFactory< ELEM_DIM, SPACE_DIM >::FinaliseCellCreation(), HeartConfig::GetConductivityHeterogeneities(), HeartConfig::GetConductivityHeterogeneitiesProvided(), HeartConfig::GetConductivityMedia(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetDistributedVectorFactory(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElement(), DistributedVectorFactory::GetHigh(), HeartConfig::GetIntracellularConductivities(), HeartConfig::GetLoadMesh(), DistributedVectorFactory::GetLocalOwnership(), DistributedVectorFactory::GetLow(), AbstractCardiacCellFactory< ELEM_DIM, SPACE_DIM >::GetMesh(), HeartConfig::GetMeshName(), AbstractCardiacCellFactory< ELEM_DIM, SPACE_DIM >::GetNumberOfCells(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetNumElements(), HeartConfig::Instance(), HeartConfig::IsMeshProvided(), AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::mCellsDistributed, AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::mIionicCacheReplicated, AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::mIntracellularStimulusCacheReplicated, AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::mpConfig, AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::mpDistributedVectorFactory, AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::mpIntracellularConductivityTensors, and ReplicatableVector::resize().
AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::AbstractCardiacPde | ( | std::vector< AbstractCardiacCell * > & | rCellsDistributed, | |
const unsigned | stride = 1 | |||
) | [inline] |
This constructor is called by the archiver
rCellsDistributed | pointers to the cardiac cells. | |
stride | determines how to access in the solution vector (1 for monodomain, 2 for bidomain). |
Definition at line 150 of file AbstractCardiacPde.cpp.
References AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::mpIntracellularConductivityTensors.
AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::~AbstractCardiacPde | ( | ) | [inline, virtual] |
Virtual destructor
Definition at line 164 of file AbstractCardiacPde.cpp.
References AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::mCellsDistributed, AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::mpDistributedVectorFactory, AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::mpFactoryWasUnarchived, and AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::mpIntracellularConductivityTensors.
void AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::serialize | ( | Archive & | archive, | |
const unsigned int | version | |||
) | [inline, private] |
Archive the member variables.
archive | ||
version |
Reimplemented in BidomainPde< SPACE_DIM >, MonodomainPde< ELEM_DIM, SPACE_DIM >, BidomainPde< DIM >, MonodomainPde< ELEM_DIM, ELEM_DIM >, and MonodomainPde< ELEMENT_DIM, SPACE_DIM >.
Definition at line 90 of file AbstractCardiacPde.hpp.
void AbstractCardiacPde< ELEM_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 192 of file AbstractCardiacPde.cpp.
References AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::mDoCacheReplication.
Referenced by MonodomainMatrixBasedAssembler< ELEMENT_DIM, SPACE_DIM >::MonodomainMatrixBasedAssembler().
const c_matrix< double, SPACE_DIM, SPACE_DIM > & AbstractCardiacPde< ELEM_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 198 of file AbstractCardiacPde.cpp.
References AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::mpIntracellularConductivityTensors.
AbstractCardiacCell * AbstractCardiacPde< ELEM_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 205 of file AbstractCardiacPde.cpp.
References DistributedVectorFactory::GetHigh(), DistributedVectorFactory::GetLow(), AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::mCellsDistributed, and AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::mpDistributedVectorFactory.
Referenced by CardiacElectroMechanicsProblem< DIM >::WriteWatchedLocationData().
void AbstractCardiacPde< ELEM_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 214 of file AbstractCardiacPde.cpp.
References DistributedVector::Begin(), GenericEventHandler< 11, HeartEventHandler >::BeginEvent(), DistributedVectorFactory::CreateDistributedVector(), DistributedVector::End(), GenericEventHandler< 11, HeartEventHandler >::EndEvent(), AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::mCellsDistributed, AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::mDoCacheReplication, AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::mDoOneCacheReplication, AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::mpDistributedVectorFactory, AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::ReplicateCaches(), PetscTools::ReplicateException(), and AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::UpdateCaches().
Referenced by MonodomainDg0Assembler< ELEMENT_DIM, SPACE_DIM >::PrepareForAssembleSystem().
ReplicatableVector & AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::rGetIionicCacheReplicated | ( | ) | [inline] |
Get the entire ionic current cache
Definition at line 256 of file AbstractCardiacPde.cpp.
References AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::mIionicCacheReplicated.
ReplicatableVector & AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::rGetIntracellularStimulusCacheReplicated | ( | ) | [inline] |
Get the entire stimulus current cache
Definition at line 262 of file AbstractCardiacPde.cpp.
References AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::mIntracellularStimulusCacheReplicated.
void AbstractCardiacPde< ELEM_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 268 of file AbstractCardiacPde.cpp.
References AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::mCellsDistributed, AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::mIionicCacheReplicated, and AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::mIntracellularStimulusCacheReplicated.
Referenced by AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::SolveCellSystems().
void AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::ReplicateCaches | ( | ) | [inline] |
Replicate the Iionic and intracellular stimulus caches.
Definition at line 275 of file AbstractCardiacPde.cpp.
References DistributedVectorFactory::GetHigh(), DistributedVectorFactory::GetLow(), AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::mIionicCacheReplicated, AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::mIntracellularStimulusCacheReplicated, AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::mpDistributedVectorFactory, and ReplicatableVector::Replicate().
Referenced by AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::SolveCellSystems().
const std::vector< AbstractCardiacCell * > & AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::GetCellsDistributed | ( | ) | const [inline] |
Returns a reference to the vector of distributed cells. Needed for archiving.
Definition at line 282 of file AbstractCardiacPde.cpp.
References AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::mCellsDistributed.
friend class boost::serialization::access [friend] |
Needed for serialization.
Reimplemented in BidomainPde< SPACE_DIM >, MonodomainPde< ELEM_DIM, SPACE_DIM >, BidomainPde< DIM >, MonodomainPde< ELEM_DIM, ELEM_DIM >, and MonodomainPde< ELEMENT_DIM, SPACE_DIM >.
Definition at line 82 of file AbstractCardiacPde.hpp.
AbstractConductivityTensors<SPACE_DIM>* AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::mpIntracellularConductivityTensors [protected] |
Intracellular conductivity tensors. Not archived, since it's loaded from the HeartConfig singleton.
Definition at line 104 of file AbstractCardiacPde.hpp.
Referenced by AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::AbstractCardiacPde(), MonodomainPde< ELEM_DIM, SPACE_DIM >::ComputeDiffusionTerm(), AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::rGetIntracellularConductivityTensor(), and AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::~AbstractCardiacPde().
std::vector< AbstractCardiacCell* > AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::mCellsDistributed [protected] |
The vector of cells. Distributed.
Definition at line 107 of file AbstractCardiacPde.hpp.
Referenced by AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::AbstractCardiacPde(), AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::GetCardiacCell(), AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::GetCellsDistributed(), AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::SolveCellSystems(), AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::UpdateCaches(), and AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::~AbstractCardiacPde().
ReplicatableVector AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::mIionicCacheReplicated [protected] |
Cache containing all the ionic currents for each node, replicated over all processes.
Definition at line 113 of file AbstractCardiacPde.hpp.
Referenced by AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::AbstractCardiacPde(), MonodomainPde< ELEM_DIM, SPACE_DIM >::ComputeNonlinearSourceTermAtNode(), AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::ReplicateCaches(), AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::rGetIionicCacheReplicated(), and AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::UpdateCaches().
ReplicatableVector AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::mIntracellularStimulusCacheReplicated [protected] |
Cache containing all the stimulus currents for each node, replicated over all processes.
Definition at line 119 of file AbstractCardiacPde.hpp.
Referenced by AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::AbstractCardiacPde(), MonodomainPde< ELEM_DIM, SPACE_DIM >::ComputeNonlinearSourceTermAtNode(), AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::ReplicateCaches(), AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::rGetIntracellularStimulusCacheReplicated(), and AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::UpdateCaches().
const unsigned AbstractCardiacPde< ELEM_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 127 of file AbstractCardiacPde.hpp.
HeartConfig* AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::mpConfig [protected] |
Local pointer to the HeartConfig singleton instance, for convenience.
Definition at line 130 of file AbstractCardiacPde.hpp.
Referenced by AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::AbstractCardiacPde(), MonodomainPde< ELEM_DIM, SPACE_DIM >::ComputeDuDtCoefficientFunction(), and MonodomainPde< ELEM_DIM, SPACE_DIM >::ComputeNonlinearSourceTermAtNode().
bool AbstractCardiacPde< ELEM_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 141 of file AbstractCardiacPde.hpp.
Referenced by AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::SetCacheReplication(), and AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::SolveCellSystems().
bool AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::mDoOneCacheReplication [protected] |
This is to mark the conventional assembly on the first time step.
Definition at line 148 of file AbstractCardiacPde.hpp.
Referenced by AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::SolveCellSystems().
DistributedVectorFactory* AbstractCardiacPde< ELEM_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.
Definition at line 155 of file AbstractCardiacPde.hpp.
Referenced by AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::AbstractCardiacPde(), AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::GetCardiacCell(), AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::ReplicateCaches(), AbstractCardiacPde< SPACE_DIM >::serialize(), AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::SolveCellSystems(), and AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::~AbstractCardiacPde().
bool AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::mpFactoryWasUnarchived [protected] |
Wether the distributed vector factory was unarchived or got from the cell factory.
Definition at line 160 of file AbstractCardiacPde.hpp.
Referenced by AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::~AbstractCardiacPde().