Chaste
Release::3.4
|
#include <ExtendedBidomainTissue.hpp>
Static Public Member Functions | |
template<class Archive > | |
static void | LoadExtendedBidomainCells (Archive &archive, const unsigned int version, std::vector< AbstractCardiacCellInterface * > &rCells, std::vector< AbstractCardiacCellInterface * > &rSecondCells, std::vector< double > &rGgaps, AbstractTetrahedralMesh< SPACE_DIM, SPACE_DIM > *pMesh) |
Private Member Functions | |
template<class Archive > | |
void | serialize (Archive &archive, const unsigned int version) |
void | CreateExtracellularConductivityTensors () |
void | UpdateAdditionalCaches (unsigned globalIndex, unsigned localIndex, double nextTime) |
void | ReplicateAdditionalCaches () |
Private Attributes | |
AbstractConductivityTensors < SPACE_DIM, SPACE_DIM > * | mpIntracellularConductivityTensorsSecondCell |
c_vector< double, SPACE_DIM > | mIntracellularConductivitiesSecondCell |
AbstractConductivityTensors < SPACE_DIM, SPACE_DIM > * | mpExtracellularConductivityTensors |
ReplicatableVector | mExtracellularStimulusCacheReplicated |
ReplicatableVector | mGgapCacheReplicated |
ReplicatableVector | mIionicCacheReplicatedSecondCell |
ReplicatableVector | mIntracellularStimulusCacheReplicatedSecondCell |
std::vector < AbstractCardiacCellInterface * > | mCellsDistributedSecondCell |
std::vector< boost::shared_ptr < AbstractStimulusFunction > > | mExtracellularStimuliDistributed |
std::vector< double > | mGgapDistributed |
double | mAmFirstCell |
double | mAmSecondCell |
double | mAmGap |
double | mCmFirstCell |
double | mCmSecondCell |
double | mGGap |
bool | mUserSuppliedExtracellularStimulus |
std::vector< boost::shared_ptr < AbstractChasteRegion < SPACE_DIM > > > | mGgapHeterogeneityRegions |
std::vector< double > | mGgapValues |
Friends | |
class | TestExtendedBidomainTissue |
class | boost::serialization::access |
Class that provides functionalities to specify a tissue within the context of the extended bidomain framework.
The extended bidomain equations are of the form:
div ( sigma_i2 grad Phi_2 ) + Am2*Cm2*d(phi_2)/dt - Am2*Cm2*d(phi_e)/dt + Am2*I_ion2 - Am2*I_stim2 - Amgap*G_gap*(phi_1 - phi_2) div ( sigma_e grad Phi_e ) + div ( sigma_i1 grad Phi_1 ) + div ( sigma_i2 grad Phi_2 ) = I_stim
The unknowns are:
Am1, Am2 and Amgap are surface-to-volume ratios for first cell, second cell and gap junction. User can set their values. Cm1 and cm2 are capaciatnce values of first and second cell respectively sigma_i1 and sigma_i2 are intracellular conductivity tensors of first and second cell respectively sigma_e is the conductivity tensor for the extracellular space G_gap is the conductance (in ms/cm2) of the gap junction channel.
Definition at line 77 of file ExtendedBidomainTissue.hpp.
ExtendedBidomainTissue< SPACE_DIM >::ExtendedBidomainTissue | ( | AbstractCardiacCellFactory< SPACE_DIM > * | pCellFactory, |
AbstractCardiacCellFactory< SPACE_DIM > * | pCellFactorySecondCell, | ||
AbstractStimulusFactory< SPACE_DIM > * | pExtracellularStimulusFactory | ||
) |
Constructor sets up extracellular conductivity tensors.
pCellFactory | factory to pass on to the base class constructor |
pCellFactorySecondCell | factory to pass on to the base class constructor for the second cell |
pExtracellularStimulusFactory | factory for creating extracellular stimuli |
Definition at line 47 of file ExtendedBidomainTissue.cpp.
References GenericEventHandler< 16, HeartEventHandler >::BeginEvent(), AbstractCardiacCellFactory< ELEMENT_DIM, SPACE_DIM >::CreateCardiacCellForNode(), ExtendedBidomainTissue< SPACE_DIM >::CreateExtracellularConductivityTensors(), AbstractStimulusFactory< ELEMENT_DIM, SPACE_DIM >::CreateStimulusForNode(), GenericEventHandler< 16, HeartEventHandler >::EndEvent(), AbstractCardiacCellFactory< ELEMENT_DIM, SPACE_DIM >::FinaliseCellCreation(), DistributedVectorFactory::GetHigh(), DistributedVectorFactory::GetLocalOwnership(), DistributedVectorFactory::GetLow(), AbstractStimulusFactory< ELEMENT_DIM, SPACE_DIM >::GetMesh(), AbstractCardiacCellFactory< ELEMENT_DIM, SPACE_DIM >::GetMesh(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNode(), AbstractStimulusFactory< ELEMENT_DIM, SPACE_DIM >::GetNumberOfCells(), AbstractCardiacCellFactory< ELEMENT_DIM, SPACE_DIM >::GetNumberOfCells(), ExtendedBidomainTissue< SPACE_DIM >::mCellsDistributedSecondCell, ExtendedBidomainTissue< SPACE_DIM >::mExtracellularStimuliDistributed, ExtendedBidomainTissue< SPACE_DIM >::mExtracellularStimulusCacheReplicated, ExtendedBidomainTissue< SPACE_DIM >::mGgapCacheReplicated, ExtendedBidomainTissue< SPACE_DIM >::mGgapDistributed, ExtendedBidomainTissue< SPACE_DIM >::mIionicCacheReplicatedSecondCell, ExtendedBidomainTissue< SPACE_DIM >::mIntracellularStimulusCacheReplicatedSecondCell, AbstractCardiacTissue< SPACE_DIM >::mpDistributedVectorFactory, AbstractCardiacTissue< SPACE_DIM >::mpMesh, PetscTools::ReplicateException(), and ReplicatableVector::Resize().
ExtendedBidomainTissue< SPACE_DIM >::ExtendedBidomainTissue | ( | std::vector< AbstractCardiacCellInterface * > & | rCellsDistributed, |
std::vector< AbstractCardiacCellInterface * > & | rSecondCellsDistributed, | ||
std::vector< boost::shared_ptr< AbstractStimulusFunction > > & | rExtraStimuliDistributed, | ||
std::vector< double > & | rGgapsDistributed, | ||
AbstractTetrahedralMesh< SPACE_DIM, SPACE_DIM > * | pMesh, | ||
c_vector< double, SPACE_DIM > | intracellularConductivitiesSecondCell | ||
) |
Archiving constructor
rCellsDistributed | local cell models (recovered from archive) |
rSecondCellsDistributed | local cell models for second cells (recovered from archive) |
rExtraStimuliDistributed | local extracellular stimuli (recovered from archive) |
rGgapsDistributed | distributed Ggaps (recovered from archive) |
pMesh | a pointer to the AbstractTetrahedral mesh (recovered from archive). |
intracellularConductivitiesSecondCell | a vector with the orthotropic conductivities for the second cell (this is needed because the second cell values may not be taken from HeartConfig as the the ones for the first cell are). |
Definition at line 117 of file ExtendedBidomainTissue.cpp.
References ExtendedBidomainTissue< SPACE_DIM >::CreateExtracellularConductivityTensors(), ExtendedBidomainTissue< SPACE_DIM >::CreateIntracellularConductivityTensorSecondCell(), DistributedVectorFactory::GetProblemSize(), ExtendedBidomainTissue< SPACE_DIM >::mCellsDistributedSecondCell, ExtendedBidomainTissue< SPACE_DIM >::mExtracellularStimuliDistributed, ExtendedBidomainTissue< SPACE_DIM >::mExtracellularStimulusCacheReplicated, ExtendedBidomainTissue< SPACE_DIM >::mGgapCacheReplicated, ExtendedBidomainTissue< SPACE_DIM >::mGgapDistributed, ExtendedBidomainTissue< SPACE_DIM >::mIionicCacheReplicatedSecondCell, ExtendedBidomainTissue< SPACE_DIM >::mIntracellularStimulusCacheReplicatedSecondCell, AbstractCardiacTissue< SPACE_DIM >::mpDistributedVectorFactory, and ReplicatableVector::Resize().
|
virtual |
Destructor
Definition at line 434 of file ExtendedBidomainTissue.cpp.
|
private |
Convenience method for extracellular conductivity tensors creation
Definition at line 331 of file ExtendedBidomainTissue.cpp.
References RelativeTo::AbsoluteOrCwd, FileFinder::Exists(), HeartConfig::GetConductivityHeterogeneities(), HeartConfig::Instance(), NEVER_REACHED, and PetscTools::ReplicateException().
Referenced by ExtendedBidomainTissue< SPACE_DIM >::ExtendedBidomainTissue().
void ExtendedBidomainTissue< SPACE_DIM >::CreateGGapConductivities | ( | ) |
Create the pattern of Ggap across the mesh based upon mCellHeterogeneityRegions, mGgapValues and mGgap. This will fill in mGgapDistributed. It will set mGgap everywhere except in the areas mCellHeterogeneityRegions[i] where it will put mGgapValues[i] instead. If mCellHeterogeneityRegions (and mGgapValues) are empty, mGgap will be set everywhere.
Definition at line 156 of file ExtendedBidomainTissue.cpp.
References Node< SPACE_DIM >::GetPoint(), and PetscTools::ReplicateException().
void ExtendedBidomainTissue< SPACE_DIM >::CreateIntracellularConductivityTensorSecondCell | ( | ) |
Convenience method for intracellular conductivity tensors creation for the second cell
Definition at line 193 of file ExtendedBidomainTissue.cpp.
References RelativeTo::AbsoluteOrCwd, GenericEventHandler< 16, HeartEventHandler >::BeginEvent(), GenericEventHandler< 16, HeartEventHandler >::EndEvent(), FileFinder::Exists(), HeartConfig::GetConductivityHeterogeneities(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorBegin(), HeartConfig::Instance(), NEVER_REACHED, and PetscTools::ReplicateException().
Referenced by ExtendedBidomainTissue< SPACE_DIM >::ExtendedBidomainTissue().
double ExtendedBidomainTissue< SPACE_DIM >::GetAmFirstCell | ( | ) |
Definition at line 602 of file ExtendedBidomainTissue.cpp.
double ExtendedBidomainTissue< SPACE_DIM >::GetAmGap | ( | ) |
Definition at line 614 of file ExtendedBidomainTissue.cpp.
double ExtendedBidomainTissue< SPACE_DIM >::GetAmSecondCell | ( | ) |
Definition at line 608 of file ExtendedBidomainTissue.cpp.
AbstractCardiacCellInterface * ExtendedBidomainTissue< SPACE_DIM >::GetCardiacSecondCell | ( | unsigned | globalIndex | ) |
globalIndex | the global index in the mesh |
Definition at line 499 of file ExtendedBidomainTissue.cpp.
double ExtendedBidomainTissue< SPACE_DIM >::GetCmFirstCell | ( | ) |
Definition at line 620 of file ExtendedBidomainTissue.cpp.
double ExtendedBidomainTissue< SPACE_DIM >::GetCmSecondCell | ( | ) |
Definition at line 626 of file ExtendedBidomainTissue.cpp.
boost::shared_ptr< AbstractStimulusFunction > ExtendedBidomainTissue< SPACE_DIM >::GetExtracellularStimulus | ( | unsigned | globalIndex | ) |
globalIndex | the global index in the mesh |
Definition at line 505 of file ExtendedBidomainTissue.cpp.
double ExtendedBidomainTissue< SPACE_DIM >::GetGGap | ( | ) |
Definition at line 632 of file ExtendedBidomainTissue.cpp.
c_vector< double, SPACE_DIM > ExtendedBidomainTissue< SPACE_DIM >::GetIntracellularConductivitiesSecondCell | ( | ) | const |
Definition at line 465 of file ExtendedBidomainTissue.cpp.
bool ExtendedBidomainTissue< SPACE_DIM >::HasTheUserSuppliedExtracellularStimulus | ( | ) |
This method gives access to the member variable mUserSuppliedExtracellularStimulus, which is false by default but turned true if the user supplies an extracellular stimulus in any form.
Definition at line 300 of file ExtendedBidomainTissue.cpp.
|
inlinestatic |
Load our tissue from an archive. This is the equivalent of LoadCardiacCells in the abstract class. it loads the two cells instead of only one.
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 |
rSecondCells | vector to fill in with pointers to the second cells |
rGgaps | vector of values of gap junctions |
pMesh | the mesh, so we can get at the node permutation, if any |
Definition at line 472 of file ExtendedBidomainTissue.hpp.
|
inline |
This method is the equivalent of LoadCardiacCells but Load the extracellular stimulus instead
archive | the master archive; cells will actually be written to the process-specific archive. |
version | |
rStimuli | the extracellular stimuli (will be filled from the archive). |
pMesh | the mesh (needed to work out number of nodes). Here it is assumed we have already unarchived the mesh somewhere and the pointer passed in is not NULL. |
Definition at line 582 of file ExtendedBidomainTissue.hpp.
|
private |
The parent class AbstractCardiacTissue has a method ReplicateCaches that replicates some caches of general use. This method replicates more caches that are specific to extended bidomain problems, namely:
It is typically called right after the ReplicateCaches method in the parent class.
Definition at line 569 of file ExtendedBidomainTissue.cpp.
|
virtual |
elementIndex | index of the element of interest |
Reimplemented from AbstractCardiacTissue< SPACE_DIM >.
Definition at line 471 of file ExtendedBidomainTissue.cpp.
ReplicatableVector & ExtendedBidomainTissue< SPACE_DIM >::rGetExtracellularStimulusCacheReplicated | ( | ) |
Definition at line 590 of file ExtendedBidomainTissue.cpp.
const std::vector< boost::shared_ptr< AbstractStimulusFunction > > & ExtendedBidomainTissue< SPACE_DIM >::rGetExtracellularStimulusDistributed | ( | ) | const |
Definition at line 324 of file ExtendedBidomainTissue.cpp.
Referenced by ExtendedBidomainTissue< DIM >::SaveExtracellularStimulus().
const std::vector< double > & ExtendedBidomainTissue< SPACE_DIM >::rGetGapsDistributed | ( | ) | const |
Definition at line 318 of file ExtendedBidomainTissue.cpp.
Referenced by ExtendedBidomainTissue< DIM >::SaveExtendedBidomainCells().
ReplicatableVector & ExtendedBidomainTissue< SPACE_DIM >::rGetGgapCacheReplicated | ( | ) |
Definition at line 596 of file ExtendedBidomainTissue.cpp.
ReplicatableVector & ExtendedBidomainTissue< SPACE_DIM >::rGetIionicCacheReplicatedSecondCell | ( | ) |
Definition at line 578 of file ExtendedBidomainTissue.cpp.
const c_matrix< double, SPACE_DIM, SPACE_DIM > & ExtendedBidomainTissue< SPACE_DIM >::rGetIntracellularConductivityTensorSecondCell | ( | unsigned | elementIndex | ) |
elementIndex | index of the element of interest |
Definition at line 485 of file ExtendedBidomainTissue.cpp.
ReplicatableVector & ExtendedBidomainTissue< SPACE_DIM >::rGetIntracellularStimulusCacheReplicatedSecondCell | ( | ) |
Definition at line 584 of file ExtendedBidomainTissue.cpp.
const std::vector< AbstractCardiacCellInterface * > & ExtendedBidomainTissue< SPACE_DIM >::rGetSecondCellsDistributed | ( | ) | const |
Definition at line 312 of file ExtendedBidomainTissue.cpp.
Referenced by ExtendedBidomainTissue< DIM >::SaveExtendedBidomainCells().
|
inline |
This method is the equivalent of SaveCardiacCells in the abstract class but save both cells of the extended bidomain tissue
archive | the master archive; cells will actually be written to the process-specific archive. |
version |
Definition at line 425 of file ExtendedBidomainTissue.hpp.
|
inline |
This method is the equivalent of SaveCardiacCells but Saves the extracellular stimulus instead
archive | the master archive; cells will actually be written to the process-specific archive. |
version |
Definition at line 560 of file ExtendedBidomainTissue.hpp.
|
inlineprivate |
Archive the member variables.
archive | |
version |
Definition at line 91 of file ExtendedBidomainTissue.hpp.
void ExtendedBidomainTissue< SPACE_DIM >::SetAmFirstCell | ( | double | value | ) |
value | Am for the first cell |
Definition at line 638 of file ExtendedBidomainTissue.cpp.
void ExtendedBidomainTissue< SPACE_DIM >::SetAmGap | ( | double | value | ) |
value | Am for the gap junction |
Definition at line 650 of file ExtendedBidomainTissue.cpp.
void ExtendedBidomainTissue< SPACE_DIM >::SetAmSecondCell | ( | double | value | ) |
value | Am for the second cell |
Definition at line 644 of file ExtendedBidomainTissue.cpp.
void ExtendedBidomainTissue< SPACE_DIM >::SetCmFirstCell | ( | double | value | ) |
value | Cm for the first cell |
Definition at line 662 of file ExtendedBidomainTissue.cpp.
void ExtendedBidomainTissue< SPACE_DIM >::SetCmSecondCell | ( | double | value | ) |
value | Cm for the first cell |
Definition at line 668 of file ExtendedBidomainTissue.cpp.
void ExtendedBidomainTissue< SPACE_DIM >::SetGGap | ( | double | value | ) |
value | conductance, in mS of the gap junction |
Definition at line 656 of file ExtendedBidomainTissue.cpp.
void ExtendedBidomainTissue< SPACE_DIM >::SetGgapHeterogeneities | ( | std::vector< boost::shared_ptr< AbstractChasteRegion< SPACE_DIM > > > & | rGgapHeterogeneityRegions, |
std::vector< double > | rGgapValues | ||
) |
Set the values of mCellHeterogeneityRegions and mGgapValues for the heterogeneities of Ggap.
rGgapHeterogeneityRegions | a vector of (pointers to) heterogeneity regions for gap junctions |
rGgapValues | a vector (of the same size as rGgapHeterogeneityRegions) with the respective values of Ggap for every region. |
Definition at line 147 of file ExtendedBidomainTissue.cpp.
void ExtendedBidomainTissue< SPACE_DIM >::SetIntracellularConductivitiesSecondCell | ( | c_vector< double, SPACE_DIM > | conductivities | ) |
Sets the value of the conductivities for the second cell.
conductivities | the conductivities to be set. |
Definition at line 456 of file ExtendedBidomainTissue.cpp.
void ExtendedBidomainTissue< SPACE_DIM >::SetUserSuppliedExtracellularStimulus | ( | bool | flag | ) |
This method allows modifications of the mUserSuppliedExtracellularStimulus flag (false by default). Other classes (e.g., Problem classes) can use this method to tell the Tissue that the user specified an extracellular stimulus.
flag | ; true if you want to tell the Tissue object that the user supplied an extracellular stimulus explicitly |
Definition at line 306 of file ExtendedBidomainTissue.cpp.
Referenced by ExtendedBidomainProblem< DIM >::CreateCardiacTissue().
|
virtual |
Integrate the cell ODEs and update ionic current etc for each of the cells, between the two times provided. This is a re-implementation from the version in the base class.
existingSolution | the current voltage solution vector |
time | the current simulation time |
nextTime | when to simulate the cells until |
updateVoltage | (unused here) |
Reimplemented from AbstractCardiacTissue< SPACE_DIM >.
Definition at line 511 of file ExtendedBidomainTissue.cpp.
References DistributedVector::Begin(), GenericEventHandler< 16, HeartEventHandler >::BeginEvent(), DistributedVector::End(), GenericEventHandler< 16, HeartEventHandler >::EndEvent(), and PetscTools::ReplicateException().
|
private |
The parent class AbstractCardiacTissue has a method UpdateCaches that updates some caches of general use. This method updates more caches that are specific to extended bidomain problems, namely:
It is typically called right after the UpdateCaches method in the parent class.
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 560 of file ExtendedBidomainTissue.cpp.
|
friend |
Needed for serialization.
Definition at line 83 of file ExtendedBidomainTissue.hpp.
|
private |
the Am for the first cell, set by the problem class and picked up by the assembler
Definition at line 152 of file ExtendedBidomainTissue.hpp.
Referenced by ExtendedBidomainTissue< DIM >::serialize().
|
private |
the Am for the gap junction, set by the problem class and picked up by the assembler
Definition at line 156 of file ExtendedBidomainTissue.hpp.
Referenced by ExtendedBidomainTissue< DIM >::serialize().
|
private |
the Am for the second cell, set by the problem class and picked up by the assembler
Definition at line 154 of file ExtendedBidomainTissue.hpp.
Referenced by ExtendedBidomainTissue< DIM >::serialize().
|
private |
The vector of cells (the second one). Distributed.
Definition at line 143 of file ExtendedBidomainTissue.hpp.
Referenced by ExtendedBidomainTissue< SPACE_DIM >::ExtendedBidomainTissue().
|
private |
the Cm for the first cell, set by the problem class and picked up by the assembler
Definition at line 158 of file ExtendedBidomainTissue.hpp.
Referenced by ExtendedBidomainTissue< DIM >::serialize().
|
private |
the Cm for the second cell, set by the problem class and picked up by the assembler
Definition at line 160 of file ExtendedBidomainTissue.hpp.
Referenced by ExtendedBidomainTissue< DIM >::serialize().
|
private |
The vector of stimuli for the extracellular stimulus. Distributed.
Definition at line 146 of file ExtendedBidomainTissue.hpp.
Referenced by ExtendedBidomainTissue< SPACE_DIM >::ExtendedBidomainTissue().
|
private |
Cache containing all the stimulus currents for each node, replicated over all processes.
Definition at line 122 of file ExtendedBidomainTissue.hpp.
Referenced by ExtendedBidomainTissue< SPACE_DIM >::ExtendedBidomainTissue().
|
private |
the conductance of the gap junction, in mS/cm2. Set by the problem class and picked up by the assembler
Definition at line 162 of file ExtendedBidomainTissue.hpp.
Referenced by ExtendedBidomainTissue< DIM >::serialize().
|
private |
Cache containing all the stimulus currents for each node, replicated over all processes.
Definition at line 128 of file ExtendedBidomainTissue.hpp.
Referenced by ExtendedBidomainTissue< SPACE_DIM >::ExtendedBidomainTissue().
|
private |
The vector of gap junction conductances. Distributed
Definition at line 149 of file ExtendedBidomainTissue.hpp.
Referenced by ExtendedBidomainTissue< SPACE_DIM >::ExtendedBidomainTissue().
|
private |
vector of regions for Ggap heterogeneities
Definition at line 204 of file ExtendedBidomainTissue.hpp.
|
private |
values of heterogeneous Ggaps corresponding to mGgapHeterogeneityRegions. This has the same size as mGgapHeterogeneityRegions
Definition at line 206 of file ExtendedBidomainTissue.hpp.
|
private |
Cache containing all the ionic currents for each node for the seconed cell, replicated over all processes.
Definition at line 134 of file ExtendedBidomainTissue.hpp.
Referenced by ExtendedBidomainTissue< SPACE_DIM >::ExtendedBidomainTissue().
|
private |
Stores the values of the conductivities for the second cell. Accessible via get and set methods. The problem class will set it This variable is a convenient interface for other classes. It is used to fill in mpIntracellularConductivityTensorsSecondCell.
Definition at line 112 of file ExtendedBidomainTissue.hpp.
|
private |
Cache containing all the stimulus currents for each node for the second cell, replicated over all processes.
Definition at line 140 of file ExtendedBidomainTissue.hpp.
Referenced by ExtendedBidomainTissue< SPACE_DIM >::ExtendedBidomainTissue().
|
private |
Extracellular conductivity tensors.
Definition at line 116 of file ExtendedBidomainTissue.hpp.
|
private |
Intracellular conductivity tensors for the second cell.
Definition at line 106 of file ExtendedBidomainTissue.hpp.
|
private |
Whether the extracellular stimulus that is passed in was supplied by the user or not (it could be the default zero implementation). Initialise to false (user did not pass in anything).
Definition at line 168 of file ExtendedBidomainTissue.hpp.
Referenced by ExtendedBidomainTissue< DIM >::serialize().