BidomainProblem< DIM > Class Template Reference

#include <BidomainProblem.hpp>

Inherits AbstractCardiacProblem< DIM, DIM, 2 >.

Inherited by BidomainWithBathProblem< DIM >.

Collaboration diagram for BidomainProblem< DIM >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 BidomainProblem (AbstractCardiacCellFactory< DIM > *pCellFactory, bool hasBath=false)
 BidomainProblem ()
void SetFixedExtracellularPotentialNodes (std::vector< unsigned > nodes)
void SetNodeForAverageOfPhiZeroed (unsigned node)
BidomainTissue< DIM > * GetBidomainTissue ()
void WriteInfo (double time)
virtual void DefineWriterColumns (bool extending)
virtual void WriteOneStep (double time, Vec voltageVec)
void PreSolveChecks ()
void AtBeginningOfTimestep (double time)
void OnEndOfTimestep (double time)
void SetUpAdditionalStoppingTimes (std::vector< double > &rAdditionalStoppingTimes)
template<class Archive >
void LoadExtraArchiveForBidomain (Archive &archive, unsigned version)
bool GetHasBath ()
void SetElectrodes ()

Protected Member Functions

Vec CreateInitialCondition ()
void AnalyseMeshForBath ()
virtual AbstractCardiacTissue
< DIM > * 
CreateCardiacTissue ()
virtual
AbstractDynamicLinearPdeSolver
< DIM, DIM, 2 > * 
CreateSolver ()

Protected Attributes

BidomainTissue< DIM > * mpBidomainTissue
std::vector< unsignedmFixedExtracellularPotentialNodes
unsigned mExtracelluarColumnId
unsigned mRowForAverageOfPhiZeroed
bool mHasBath
boost::shared_ptr< Electrodes
< DIM > > 
mpElectrodes
AbstractBidomainSolver< DIM,
DIM > * 
mpSolver

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

Detailed Description

template<unsigned DIM>
class BidomainProblem< DIM >

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 58 of file BidomainProblem.hpp.


Constructor & Destructor Documentation

template<unsigned DIM>
BidomainProblem< DIM >::BidomainProblem ( AbstractCardiacCellFactory< DIM > *  pCellFactory,
bool  hasBath = false 
) [inline]

Constructor

Parameters:
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 149 of file BidomainProblem.cpp.

References BidomainProblem< DIM >::mFixedExtracellularPotentialNodes.

template<unsigned DIM>
BidomainProblem< DIM >::BidomainProblem (  )  [inline]

Constructor just used for archiving

Definition at line 160 of file BidomainProblem.cpp.

References BidomainProblem< DIM >::mFixedExtracellularPotentialNodes.


Member Function Documentation

template<unsigned DIM>
void BidomainProblem< DIM >::AnalyseMeshForBath (  )  [inline, protected]
template<unsigned DIM>
void BidomainProblem< DIM >::AtBeginningOfTimestep ( double  time  )  [inline, virtual]
template<unsigned DIM>
AbstractCardiacTissue< DIM > * BidomainProblem< DIM >::CreateCardiacTissue (  )  [inline, protected, virtual]
template<unsigned DIM>
Vec BidomainProblem< DIM >::CreateInitialCondition (  )  [inline, protected, virtual]

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 84 of file BidomainProblem.cpp.

References DistributedVector::Begin(), DistributedVector::End(), HeartRegionCode::IsRegionBath(), BidomainProblem< DIM >::mHasBath, AbstractCardiacProblem< DIM, DIM, 2 >::mpMesh, and DistributedVector::Restore().

template<unsigned DIM>
AbstractDynamicLinearPdeSolver< DIM, DIM, 2 > * BidomainProblem< DIM >::CreateSolver (  )  [inline, protected, virtual]
template<unsigned DIM>
void BidomainProblem< DIM >::DefineWriterColumns ( bool  extending  )  [inline, virtual]

Define what variables are written to the primary results file. Adds the extracellular potential.

Parameters:
extending whether we are extending an existing results file

Reimplemented from AbstractCardiacProblem< DIM, DIM, 2 >.

Definition at line 222 of file BidomainProblem.cpp.

References AbstractCardiacProblem< DIM, DIM, 2 >::DefineExtraVariablesWriterColumns(), Hdf5DataWriter::DefineVariable(), Hdf5DataWriter::GetVariableByName(), BidomainProblem< DIM >::mExtracelluarColumnId, and AbstractCardiacProblem< DIM, DIM, 2 >::mpWriter.

template<unsigned DIM>
BidomainTissue< DIM > * BidomainProblem< DIM >::GetBidomainTissue (  )  [inline]

Get the pde. Can only be called after Initialise()

Definition at line 189 of file BidomainProblem.cpp.

References BidomainProblem< DIM >::mpBidomainTissue.

template<unsigned DIM>
bool BidomainProblem< DIM >::GetHasBath (  )  [inline, virtual]

Return whether this is a bidomain problem with bath or not

Reimplemented from AbstractCardiacProblem< DIM, DIM, 2 >.

Definition at line 374 of file BidomainProblem.cpp.

References BidomainProblem< DIM >::mHasBath.

template<unsigned DIM>
template<class Archive >
void BidomainProblem< DIM >::load ( Archive &  archive,
const unsigned int  version 
) [inline, private]

Load the member variables from an archive.

Parameters:
archive 
version 

Reimplemented from AbstractCardiacProblem< DIM, DIM, 2 >.

Definition at line 90 of file BidomainProblem.hpp.

template<unsigned DIM>
template<class Archive >
void BidomainProblem< DIM >::LoadExtraArchiveForBidomain ( Archive &  archive,
unsigned  version 
) [inline]

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.

Parameters:
archive the archive to load
version the archive file version
Note:
The process-specific archives currently contain the following data. If the layout changes, then this method will need to be altered, since it hard-codes knowledge of the order in which things are archived.
  1. Stuff known by AbstractCardiacProblem
  2. mpElectrodes->mpBoundaryConditionsContainer

This gets called by AbstractCardiacProblem::LoadExtraArchive when it's done the generic stuff.

Todo:
#1159 sanity check that the contents of p_bcc and mpElectrodes->GetBoundaryConditionsContainer() match.

Definition at line 293 of file BidomainProblem.hpp.

References AbstractCardiacProblem< DIM, DIM, 2 >::mpBoundaryConditionsContainer, and AbstractCardiacProblem< DIM, DIM, 2 >::mpMesh.

Referenced by AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::LoadExtraArchive().

template<unsigned DIM>
void BidomainProblem< DIM >::OnEndOfTimestep ( double  time  )  [inline, virtual]
template<unsigned DIM>
void BidomainProblem< DIM >::PreSolveChecks (  )  [inline, 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 248 of file BidomainProblem.cpp.

References EXCEPTION, HeartConfig::GetUseRelativeTolerance(), HeartConfig::Instance(), BidomainProblem< DIM >::mFixedExtracellularPotentialNodes, and BidomainProblem< DIM >::mRowForAverageOfPhiZeroed.

template<unsigned DIM>
template<class Archive >
void BidomainProblem< DIM >::save ( Archive &  archive,
const unsigned int  version 
) const [inline, private]

Save the member variables to an archive.

Parameters:
archive 
version 

Reimplemented from AbstractCardiacProblem< DIM, DIM, 2 >.

Definition at line 73 of file BidomainProblem.hpp.

template<unsigned DIM>
void BidomainProblem< DIM >::SetElectrodes (  )  [inline, 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 268 of file BidomainProblem.cpp.

References HeartConfig::Instance(), BidomainProblem< DIM >::mHasBath, BidomainProblem< DIM >::mpElectrodes, and AbstractCardiacProblem< DIM, DIM, 2 >::mpMesh.

template<unsigned DIM>
void BidomainProblem< DIM >::SetFixedExtracellularPotentialNodes ( std::vector< unsigned nodes  )  [inline]

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.

Parameters:
nodes the nodes to be fixed.
Note:
currently, the value of phi_e at the fixed nodes cannot be set to be anything other than zero.

Definition at line 171 of file BidomainProblem.cpp.

References BidomainProblem< DIM >::mFixedExtracellularPotentialNodes.

template<unsigned DIM>
void BidomainProblem< DIM >::SetNodeForAverageOfPhiZeroed ( unsigned  node  )  [inline]

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.

Parameters:
node the mesh node index giving the row at which to impose the constraint

Definition at line 183 of file BidomainProblem.cpp.

References BidomainProblem< DIM >::mRowForAverageOfPhiZeroed.

template<unsigned DIM>
void BidomainProblem< DIM >::SetUpAdditionalStoppingTimes ( std::vector< double > &  rAdditionalStoppingTimes  )  [inline, 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

Parameters:
rAdditionalStoppingTimes reference to vector that will contain the on and off times for the electrodes

Reimplemented from AbstractCardiacProblem< DIM, DIM, 2 >.

Definition at line 364 of file BidomainProblem.cpp.

References BidomainProblem< DIM >::mpElectrodes.

template<unsigned DIM>
void BidomainProblem< DIM >::WriteInfo ( double  time  )  [inline, virtual]

Print out time and max/min voltage/phi_e values at current time.

Parameters:
time current time.

Implements AbstractCardiacProblem< DIM, DIM, 2 >.

Definition at line 196 of file BidomainProblem.cpp.

References PetscTools::AmMaster(), and AbstractCardiacProblem< DIM, DIM, 2 >::mSolution.

template<unsigned DIM>
void BidomainProblem< DIM >::WriteOneStep ( double  time,
Vec  voltageVec 
) [inline, virtual]

Write one timestep of output data to the primary results file. Adds the extracellular potential to the results.

Parameters:
time the current time
voltageVec the solution vector to write

Implements AbstractCardiacProblem< DIM, DIM, 2 >.

Definition at line 237 of file BidomainProblem.cpp.

References BidomainProblem< DIM >::mExtracelluarColumnId, AbstractCardiacProblem< DIM, DIM, 2 >::mpWriter, AbstractCardiacProblem< DIM, DIM, 2 >::mVoltageColumnId, Hdf5DataWriter::PutStripedVector(), Hdf5DataWriter::PutUnlimitedVariable(), and AbstractCardiacProblem< DIM, DIM, 2 >::WriteExtraVariablesOneStep().


Friends And Related Function Documentation

template<unsigned DIM>
friend class boost::serialization::access [friend]

Needed for serialization.

Reimplemented from AbstractCardiacProblem< DIM, DIM, 2 >.

Reimplemented in BidomainWithBathProblem< DIM >.

Definition at line 61 of file BidomainProblem.hpp.


Member Data Documentation

template<unsigned DIM>
unsigned BidomainProblem< DIM >::mExtracelluarColumnId [protected]

Used by the writer

Definition at line 117 of file BidomainProblem.hpp.

Referenced by BidomainProblem< DIM >::DefineWriterColumns(), and BidomainProblem< DIM >::WriteOneStep().

template<unsigned DIM>
std::vector<unsigned> BidomainProblem< DIM >::mFixedExtracellularPotentialNodes [protected]
template<unsigned DIM>
bool BidomainProblem< DIM >::mHasBath [protected]
template<unsigned DIM>
BidomainTissue<DIM>* BidomainProblem< DIM >::mpBidomainTissue [protected]
template<unsigned DIM>
boost::shared_ptr<Electrodes<DIM> > BidomainProblem< DIM >::mpElectrodes [protected]
template<unsigned DIM>
AbstractBidomainSolver<DIM,DIM>* BidomainProblem< DIM >::mpSolver [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)

Reimplemented from AbstractCardiacProblem< DIM, DIM, 2 >.

Reimplemented in AdaptiveBidomainProblem.

Definition at line 147 of file BidomainProblem.hpp.

Referenced by BidomainProblem< DIM >::AtBeginningOfTimestep(), BidomainProblem< DIM >::CreateSolver(), and BidomainProblem< DIM >::OnEndOfTimestep().

template<unsigned DIM>
unsigned BidomainProblem< DIM >::mRowForAverageOfPhiZeroed [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 122 of file BidomainProblem.hpp.

Referenced by BidomainProblem< DIM >::CreateSolver(), BidomainProblem< 3 >::load(), BidomainProblem< DIM >::PreSolveChecks(), BidomainProblem< 3 >::save(), and BidomainProblem< DIM >::SetNodeForAverageOfPhiZeroed().


The documentation for this class was generated from the following files:
Generated on Thu Dec 22 13:02:17 2011 for Chaste by  doxygen 1.6.3