Chaste Commit::baa90ac2819b962188b7562f2326be23c47859a7
|
#include <BidomainProblem.hpp>
Protected Member Functions | |
Vec | CreateInitialCondition () |
void | AnalyseMeshForBath () |
virtual AbstractCardiacTissue< DIM > * | CreateCardiacTissue () |
virtual AbstractDynamicLinearPdeSolver< DIM, DIM, 2 > * | CreateSolver () |
Protected Member Functions inherited from AbstractCardiacProblem< DIM, DIM, 2 > | |
virtual void | CreateMeshFromHeartConfig () |
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) |
Friends | |
class | boost::serialization::access |
class | TestPCTwoLevelsBlockDiagonal |
class | TestBidomainWithBathProblem |
class | TestCardiacSimulationArchiver |
Class which specifies and solves a bidomain problem.
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 65 of file BidomainProblem.hpp.
BidomainProblem< DIM >::BidomainProblem | ( | AbstractCardiacCellFactory< DIM > * | pCellFactory, |
bool | hasBath = false |
||
) |
Constructor
pCellFactory | User defined cell factory which shows how the pde should create cells. |
hasBath | Whether the simulation has a bath (if this is true, all elements with attribute = 1 will be set to be bath elements (the rest should have attribute = 0)). |
Definition at line 164 of file BidomainProblem.cpp.
References BidomainProblem< DIM >::mFixedExtracellularPotentialNodes.
BidomainProblem< DIM >::BidomainProblem | ( | ) |
Constructor just used for archiving
Definition at line 175 of file BidomainProblem.cpp.
References BidomainProblem< DIM >::mFixedExtracellularPotentialNodes.
|
protected |
Annotate bath nodes with the correct region code, if a bath is present. Will throw if mHasBath is set but no bath is present in the mesh.
Definition at line 45 of file BidomainProblem.cpp.
References EXCEPTION, AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNode(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetUnsignedAttribute(), HeartRegionCode::GetValidBathId(), HeartRegionCode::GetValidTissueId(), HeartConfig::Instance(), HeartRegionCode::IsRegionBath(), HeartRegionCode::IsRegionTissue(), PetscTools::ReplicateBool(), and HeartConfig::rGetBathIdentifiers().
Referenced by BidomainProblem< DIM >::load().
|
virtual |
Called at beginning of each time step in the main time-loop in AbstractCardiacProblem::Solve(). Overloaded here to switch on the electrodes (if there are any).
time | the current time |
Reimplemented from AbstractCardiacProblem< DIM, DIM, 2 >.
Definition at line 296 of file BidomainProblem.cpp.
|
protectedvirtual |
Implements AbstractCardiacProblem< DIM, DIM, 2 >.
Definition at line 125 of file BidomainProblem.cpp.
References HeartConfig::Instance().
|
protectedvirtual |
Create normal initial condition but overwrite V to zero for bath nodes, if there are any.
Reimplemented from AbstractCardiacProblem< DIM, DIM, 2 >.
Definition at line 100 of file BidomainProblem.cpp.
References DistributedVector::Begin(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::CreateInitialCondition(), DistributedVector::End(), HeartRegionCode::IsRegionBath(), and DistributedVector::Restore().
|
protectedvirtual |
Implements AbstractCardiacProblem< DIM, DIM, 2 >.
Definition at line 133 of file BidomainProblem.cpp.
|
virtual |
Define what variables are written to the primary results file. Adds the extracellular potential.
extending | whether we are extending an existing results file |
Reimplemented from AbstractCardiacProblem< DIM, DIM, 2 >.
Definition at line 233 of file BidomainProblem.cpp.
References AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::DefineExtraVariablesWriterColumns(), and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::DefineWriterColumns().
BidomainTissue< DIM > * BidomainProblem< DIM >::GetBidomainTissue | ( | ) |
Definition at line 202 of file BidomainProblem.cpp.
|
virtual |
Reimplemented from AbstractCardiacProblem< DIM, DIM, 2 >.
Definition at line 383 of file BidomainProblem.cpp.
|
inlineprivate |
Load the member variables from an archive.
archive | |
version |
Definition at line 97 of file BidomainProblem.hpp.
References BidomainProblem< DIM >::AnalyseMeshForBath(), BidomainProblem< DIM >::mHasBath, BidomainProblem< DIM >::mpBidomainTissue, BidomainProblem< DIM >::mpElectrodes, and BidomainProblem< DIM >::mRowForAverageOfPhiZeroed.
void BidomainProblem< DIM >::LoadExtraArchiveForBidomain | ( | Archive & | archive, |
unsigned | version | ||
) |
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.
archive | the archive to load |
version | the archive file version |
This gets called by AbstractCardiacProblem::LoadExtraArchive when it's done the generic stuff.
Definition at line 299 of file BidomainProblem.hpp.
References BidomainProblem< DIM >::mpElectrodes, and AbstractCardiacProblem< DIM, DIM, 2 >::mpMesh.
Referenced by AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::LoadExtraArchive().
|
virtual |
Called at end of each time step in the main time-loop in AbstractCardiacProblem::Solve(). Overloaded here to switch off the electrodes (if there are any).
time | the current time |
Reimplemented from AbstractCardiacProblem< DIM, DIM, 2 >.
Definition at line 337 of file BidomainProblem.cpp.
References HeartConfig::Instance().
|
virtual |
Performs a series of checks before solving. Checks that a suitable method of resolving the singularity is being used.
Reimplemented from AbstractCardiacProblem< DIM, DIM, 2 >.
Definition at line 259 of file BidomainProblem.cpp.
References EXCEPTION, HeartConfig::Instance(), and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::PreSolveChecks().
|
inlineprivate |
Save the member variables to an archive.
archive | |
version |
Definition at line 80 of file BidomainProblem.hpp.
References BidomainProblem< DIM >::mHasBath, BidomainProblem< DIM >::mpBidomainTissue, BidomainProblem< DIM >::mpElectrodes, and BidomainProblem< DIM >::mRowForAverageOfPhiZeroed.
|
virtual |
Set an electrode object (which provides boundary conditions). Only valid if there is a bath.
Reimplemented from AbstractCardiacProblem< DIM, DIM, 2 >.
Definition at line 279 of file BidomainProblem.cpp.
References HeartConfig::Instance().
void BidomainProblem< DIM >::SetFixedExtracellularPotentialNodes | ( | std::vector< unsigned > | nodes | ) |
Set the nodes at which phi_e (the extracellular potential) is fixed to zero. This does not necessarily have to be called. If it is not, phi_e is only defined up to a constant.
nodes | the nodes to be fixed. |
Definition at line 184 of file BidomainProblem.cpp.
void BidomainProblem< DIM >::SetNodeForAverageOfPhiZeroed | ( | unsigned | node | ) |
Set which row of the linear system should be used to enforce the condition that the average of phi_e is zero. If not called, this condition will not be used.
node | the mesh node index giving the row at which to impose the constraint |
Definition at line 196 of file BidomainProblem.cpp.
|
virtual |
Method to fill in a vector of additional stopping times consisting of the times when the electrodes are to be turned on and off
rAdditionalStoppingTimes | reference to vector that will contain the on and off times for the electrodes |
Reimplemented from AbstractCardiacProblem< DIM, DIM, 2 >.
Definition at line 373 of file BidomainProblem.cpp.
|
virtual |
Print out time and max/min voltage/phi_e values at current time.
time | current time. |
Implements AbstractCardiacProblem< DIM, DIM, 2 >.
Definition at line 209 of file BidomainProblem.cpp.
References PetscTools::AmMaster(), and CHASTE_PETSC_NULLPTR.
|
virtual |
Write one timestep of output data to the primary results file. Adds the extracellular potential to the results.
time | the current time |
voltageVec | the solution vector to write |
Implements AbstractCardiacProblem< DIM, DIM, 2 >.
Definition at line 248 of file BidomainProblem.cpp.
References AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::WriteExtraVariablesOneStep().
|
friend |
Needed for serialization.
Definition at line 68 of file BidomainProblem.hpp.
|
friend |
Definition at line 114 of file BidomainProblem.hpp.
|
friend |
Definition at line 115 of file BidomainProblem.hpp.
|
friend |
Definition at line 71 of file BidomainProblem.hpp.
|
protected |
Used by the writer
Definition at line 124 of file BidomainProblem.hpp.
|
protected |
Nodes at which the extracellular voltage is fixed to zero (replicated)
Definition at line 122 of file BidomainProblem.hpp.
Referenced by BidomainProblem< DIM >::BidomainProblem(), and BidomainProblem< DIM >::BidomainProblem().
|
protected |
Whether the mesh has a bath, ie whether this is a bath simulation
Definition at line 132 of file BidomainProblem.hpp.
Referenced by BidomainProblem< DIM >::load(), and BidomainProblem< DIM >::save().
|
protected |
The bidomain PDE
Definition at line 119 of file BidomainProblem.hpp.
Referenced by BidomainProblem< DIM >::load(), and BidomainProblem< DIM >::save().
|
protected |
Electrodes used to provide a shock
Definition at line 135 of file BidomainProblem.hpp.
Referenced by BidomainProblem< DIM >::load(), BidomainProblem< DIM >::LoadExtraArchiveForBidomain(), and BidomainProblem< DIM >::save().
|
protected |
We need to save the solver that is being used to be able to switch off the electrodes (by adding default boundary conditions to the solver)
Definition at line 155 of file BidomainProblem.hpp.
|
protected |
Another method of resolving the singularity in the bidomain equations. Specifies a row of the matrix at which to impose an extra condition.
Definition at line 129 of file BidomainProblem.hpp.
Referenced by BidomainProblem< DIM >::load(), and BidomainProblem< DIM >::save().