Chaste
Release::2017.1
|
#include <AbstractCardiacProblem.hpp>
Protected Member Functions | |
virtual AbstractCardiacTissue< ELEMENT_DIM, SPACE_DIM > * | CreateCardiacTissue ()=0 |
virtual AbstractDynamicLinearPdeSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM > * | CreateSolver ()=0 |
virtual void | CreateMeshFromHeartConfig () |
Protected Attributes | |
std::string | mMeshFilename |
bool | mAllocatedMemoryForMesh |
bool | mWriteInfo |
bool | mPrintOutput |
std::vector< unsigned > | mNodesToOutput |
unsigned | mVoltageColumnId |
std::vector< unsigned > | mExtraVariablesId |
unsigned | mTimeColumnId |
unsigned | mNodeColumnId |
AbstractCardiacTissue< ELEMENT_DIM, SPACE_DIM > * | mpCardiacTissue |
BccType | mpBoundaryConditionsContainer |
BccType | mpDefaultBoundaryConditionsContainer |
AbstractDynamicLinearPdeSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM > * | mpSolver |
AbstractCardiacCellFactory< ELEMENT_DIM, SPACE_DIM > * | mpCellFactory |
AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > * | mpMesh |
Vec | mSolution |
double | mCurrentTime |
AbstractTimeAdaptivityController * | mpTimeAdaptivityController |
Hdf5DataWriter * | mpWriter |
bool | mUseHdf5DataWriterCache |
hsize_t | mHdf5DataWriterChunkSizeAndAlignment |
std::vector< boost::shared_ptr< AbstractOutputModifier > > | mOutputModifiers |
Private Types | |
typedef boost::shared_ptr< BoundaryConditionsContainer< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM > > | BccType |
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) |
template<class Archive > | |
void | SaveBoundaryConditions (Archive &archive, AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > *pMesh, BccType pBcc) const |
template<class Archive > | |
BccType | LoadBoundaryConditions (Archive &archive, AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > *pMesh) |
Friends | |
class | TestBidomainWithBath |
class | TestMonodomainProblem |
class | TestCardiacSimulationArchiver |
class | boost::serialization::access |
template<unsigned DIM, unsigned ELEC_PROB_DIM> | |
class | CardiacElectroMechanicsProblem |
Base class for cardiac problems; contains code generic to mono-/bi-domain and bidomain-with-bath.
This class contains the tissue (PDEs and 'cells' ODEs), boundary conditions, and postprocessing/results writers.
It is called by CardiacSimulation, which is the outer wrapper class for running a cardiac simulation, used by the executable.
Many non-standard simulations will use this class directly, and this is the preferred method for non-executable users. See tutorials for usage.
Definition at line 113 of file AbstractCardiacProblem.hpp.
|
private |
To save typing
Definition at line 121 of file AbstractCardiacProblem.hpp.
AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::AbstractCardiacProblem | ( | AbstractCardiacCellFactory< ELEMENT_DIM, SPACE_DIM > * | pCellFactory | ) |
Constructor
pCellFactory | User defined cell factory which shows how the pde should create cells. |
Definition at line 54 of file AbstractCardiacProblem.cpp.
References GenericEventHandler< 16, HeartEventHandler >::BeginEvent(), EXCEPTION, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mNodesToOutput, and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpCellFactory.
AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::AbstractCardiacProblem | ( | ) |
Constructor used by archiving.
Definition at line 80 of file AbstractCardiacProblem.cpp.
|
virtual |
Destructor
Definition at line 104 of file AbstractCardiacProblem.cpp.
References PetscTools::Destroy(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mAllocatedMemoryForMesh, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpCardiacTissue, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpMesh, and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mSolution.
|
inline |
Add an output modifier onto a list of such objects. These will be processed in the order in which they have been given. The modifier should not be destroyed before the solve loop has completed
pOutputModifier | Pointer to the modifier to be added |
Definition at line 799 of file AbstractCardiacProblem.hpp.
|
inlinevirtual |
Called at beginning of each time step in the main time-loop in Solve(). Empty implementation but can be overloaded by child classes.
time | the current time |
Reimplemented in BidomainProblem< DIM >.
Definition at line 726 of file AbstractCardiacProblem.hpp.
Referenced by AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Solve().
void AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::CloseFilesAndPostProcess | ( | ) |
Closes the files where the solution is stored and, if specified so (as it is by default), converts the output to Meshalyzer format by calling the WriteFilesUsingMesh method in the MeshalyzerWriter class.
Definition at line 590 of file AbstractCardiacProblem.cpp.
References GenericEventHandler< 16, HeartEventHandler >::BeginEvent(), RelativeTo::ChasteTestOutput, GenericEventHandler< 16, HeartEventHandler >::EndEvent(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::GetHasBath(), AbstractHdf5Converter< ELEMENT_DIM, SPACE_DIM >::GetSubdirectory(), HeartConfig::GetVisualizeWithMeshalyzer(), HeartConfig::Instance(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mHdf5DataWriterChunkSizeAndAlignment, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mNodesToOutput, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpMesh, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mPrintOutput, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpWriter, HeartConfig::Write(), and PostProcessingWriter< ELEMENT_DIM, SPACE_DIM >::WritePostProcessingFiles().
Referenced by AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Solve().
|
protectedpure virtual |
Subclasses must override this method to create a PDE object of the appropriate type.
This class will take responsibility for freeing the object when it is finished with.
Implemented in ExtendedBidomainProblem< DIM >, BidomainProblem< DIM >, MonodomainProblem< ELEMENT_DIM, SPACE_DIM >, and MonodomainPurkinjeProblem< ELEMENT_DIM, SPACE_DIM >.
Referenced by AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Initialise().
|
virtual |
This method sets the initial condition for the PDE by getting the voltages (V) from the cell models at the nodes.
If the problem dimension is two (Bidomain) the second variable (phi_e) is set to zero.
This is virtual so BidomainProblem can overwrite V to zero for bath nodes, if there are any.
Reimplemented in ExtendedBidomainProblem< DIM >, BidomainProblem< DIM >, and MonodomainPurkinjeProblem< ELEMENT_DIM, SPACE_DIM >.
Definition at line 267 of file AbstractCardiacProblem.cpp.
References DistributedVector::Begin(), DistributedVectorFactory::CreateDistributedVector(), DistributedVectorFactory::CreateVec(), DistributedVector::End(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpCardiacTissue, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpMesh, and DistributedVector::Restore().
Referenced by MonodomainPurkinjeProblem< ELEMENT_DIM, SPACE_DIM >::CreateInitialCondition(), BidomainProblem< DIM >::CreateInitialCondition(), CardiacElectroMechanicsProblem< DIM, ELEC_PROB_DIM >::Solve(), and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Solve().
|
protectedvirtual |
Subclasses must override this method to create a suitable mesh object.
Only needed if the subclass needs something other than a DistributedTetrahedralMesh.
This class will take responsibility for freeing the object when it is finished with.
Reimplemented in MonodomainPurkinjeProblem< ELEMENT_DIM, SPACE_DIM >.
Definition at line 219 of file AbstractCardiacProblem.cpp.
References HeartConfig::GetMeshPartitioning(), HeartConfig::Instance(), and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpMesh.
Referenced by AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Initialise().
|
protectedpure virtual |
Subclasses must override this method to create a suitable solver object.
This class will take responsibility for freeing the object when it is finished with.
Implemented in ExtendedBidomainProblem< DIM >, BidomainProblem< DIM >, MonodomainProblem< ELEMENT_DIM, SPACE_DIM >, and MonodomainPurkinjeProblem< ELEMENT_DIM, SPACE_DIM >.
Referenced by CardiacElectroMechanicsProblem< DIM, ELEC_PROB_DIM >::Solve(), and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Solve().
void AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::DefineExtraVariablesWriterColumns | ( | bool | extending | ) |
Define the user specified variables to be written to the primary results file
extending | whether we are extending an existing results file |
Definition at line 718 of file AbstractCardiacProblem.cpp.
References Hdf5DataWriter::DefineVariable(), HeartConfig::GetOutputVariables(), Hdf5DataWriter::GetVariableByName(), HeartConfig::Instance(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mExtraVariablesId, and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpWriter.
Referenced by MonodomainProblem< ELEMENT_DIM, SPACE_DIM >::DefineWriterColumns(), MonodomainPurkinjeProblem< ELEMENT_DIM, SPACE_DIM >::DefineWriterColumns(), BidomainProblem< DIM >::DefineWriterColumns(), and ExtendedBidomainProblem< DIM >::DefineWriterColumns().
|
virtual |
Define what variables are written to the primary results file.
extending | whether we are extending an existing results file |
Reimplemented in ExtendedBidomainProblem< DIM >, BidomainProblem< DIM >, MonodomainPurkinjeProblem< ELEMENT_DIM, SPACE_DIM >, and MonodomainProblem< ELEMENT_DIM, SPACE_DIM >.
Definition at line 687 of file AbstractCardiacProblem.cpp.
References Hdf5DataWriter::DefineFixedDimension(), Hdf5DataWriter::DefineUnlimitedDimension(), Hdf5DataWriter::DefineVariable(), TimeStepper::EstimateTimeSteps(), Hdf5DataWriter::GetVariableByName(), HeartConfig::Instance(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mCurrentTime, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mNodesToOutput, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpMesh, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpWriter, and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mVoltageColumnId.
Referenced by MonodomainProblem< ELEMENT_DIM, SPACE_DIM >::DefineWriterColumns(), MonodomainPurkinjeProblem< ELEMENT_DIM, SPACE_DIM >::DefineWriterColumns(), BidomainProblem< DIM >::DefineWriterColumns(), and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::InitialiseWriter().
double AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::GetCurrentTime | ( | ) |
Definition at line 334 of file AbstractCardiacProblem.cpp.
References AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mCurrentTime.
Hdf5DataReader AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::GetDataReader | ( | ) |
Definition at line 902 of file AbstractCardiacProblem.cpp.
References EXCEPTION, and HeartConfig::Instance().
|
virtual |
Reimplemented in ExtendedBidomainProblem< DIM >, and BidomainProblem< DIM >.
Definition at line 912 of file AbstractCardiacProblem.cpp.
Referenced by AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::CloseFilesAndPostProcess().
Vec AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::GetSolution | ( | ) |
In case of Bidomain, this is of length 2*numNodes, and 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.
Use with caution since we don't want to alter the state of the PETSc vector.
Definition at line 322 of file AbstractCardiacProblem.cpp.
References AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mSolution.
DistributedVector AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::GetSolutionDistributedVector | ( | ) |
See also GetSolution.
Definition at line 328 of file AbstractCardiacProblem.cpp.
References AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpMesh, and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mSolution.
AbstractCardiacTissue< ELEMENT_DIM, SPACE_DIM > * AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::GetTissue | ( | ) |
Definition at line 347 of file AbstractCardiacProblem.cpp.
References EXCEPTION, and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpCardiacTissue.
Referenced by CardiacElectroMechanicsProblem< DIM, ELEC_PROB_DIM >::Initialise(), and CardiacElectroMechanicsProblem< DIM, ELEC_PROB_DIM >::Solve().
void AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Initialise | ( | ) |
Initialise the system, once parameters have been set up.
Must be called before first calling Solve(). If loading from a checkpoint, do NOT call this method, as it can also be used to reset the problem to perform another simulation from time 0.
Definition at line 119 of file AbstractCardiacProblem.cpp.
References GenericEventHandler< 16, HeartEventHandler >::BeginEvent(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::CreateCardiacTissue(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::CreateMeshFromHeartConfig(), PetscTools::Destroy(), GenericEventHandler< 16, HeartEventHandler >::EndEvent(), EXCEPTION, HeartConfig::GetFibreLength(), HeartConfig::GetInterNodeSpace(), HeartConfig::GetMeshName(), HeartConfig::GetSheetDimensions(), Exception::GetShortMessage(), HeartConfig::GetSlabDimensions(), HeartConfig::Instance(), PetscTools::IsParallel(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mAllocatedMemoryForMesh, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mCurrentTime, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpCardiacTissue, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpCellFactory, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpMesh, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mSolution, NEVER_REACHED, and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetElectrodes().
Referenced by CardiacElectroMechanicsProblem< DIM, ELEC_PROB_DIM >::Initialise().
bool AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::InitialiseWriter | ( | ) |
It creates and initialises the hdf writer from the Hdf5DataWriter class. It passes the output directory and file name to it. It is called by Solve(), if the output needs to be generated.
This method will try to open an existing .h5 file for extension if we are loading from an archive and one is present.
Definition at line 803 of file AbstractCardiacProblem.cpp.
References RelativeTo::Absolute, Hdf5DataWriter::ApplyPermutation(), PetscTools::Barrier(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::DefineWriterColumns(), Hdf5DataWriter::EndDefineMode(), EXCEPTION, FileFinder::Exists(), FileFinder::GetAbsolutePath(), OutputFileHandler::GetChasteTestOutputDirectory(), HeartConfig::GetOutputDirectory(), HeartConfig::GetOutputFilenamePrefix(), Hdf5DataReader::GetUnlimitedDimensionValues(), HeartConfig::Instance(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mCurrentTime, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mHdf5DataWriterChunkSizeAndAlignment, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpMesh, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpWriter, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mSolution, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mUseHdf5DataWriterCache, Hdf5DataWriter::SetAlignment(), HeartConfig::SetOutputUsingOriginalNodeOrdering(), and Hdf5DataWriter::SetTargetChunkSize().
Referenced by CardiacElectroMechanicsProblem< DIM, ELEC_PROB_DIM >::Solve(), and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Solve().
|
inlineprivate |
Load the member variables.
archive | |
version |
Definition at line 224 of file AbstractCardiacProblem.hpp.
|
inlineprivate |
Serialization helper method to load a boundary conditions container.
archive | the archive to load from |
pMesh | the mesh boundary conditions are to be defined on |
Definition at line 367 of file AbstractCardiacProblem.hpp.
void AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::LoadExtraArchive | ( | 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 |
Definition at line 813 of file AbstractCardiacProblem.hpp.
References DistributedVectorFactory::GetNumProcs(), DistributedVectorFactory::GetOriginalFactory(), BidomainProblem< DIM >::LoadExtraArchiveForBidomain(), AbstractCardiacProblem< DIM, DIM, 2 >::mpBoundaryConditionsContainer, AbstractCardiacProblem< DIM, DIM, 2 >::mpCardiacTissue, and AbstractCardiacProblem< DIM, DIM, 2 >::mpMesh.
|
inlinevirtual |
Called at end of each time step in the main time-loop in Solve(). Empty implementation but can be overloaded by child classes.
time | the current time |
Reimplemented in BidomainProblem< DIM >.
Definition at line 736 of file AbstractCardiacProblem.hpp.
Referenced by AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Solve().
|
virtual |
Performs a series of checks before solving. It checks whether the cardiac pde has been defined, whether the simulation time is greater than zero and whether the output directory is specified (or the output is set not to be produced). It throws exceptions if any of the above checks fails.
Reimplemented in ExtendedBidomainProblem< DIM >, and BidomainProblem< DIM >.
Definition at line 231 of file AbstractCardiacProblem.cpp.
References EXCEPTION, HeartConfig::GetPdeTimeStep(), HeartConfig::GetSimulationDuration(), HeartConfig::Instance(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mCurrentTime, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpCardiacTissue, and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mPrintOutput.
Referenced by BidomainProblem< DIM >::PreSolveChecks(), ExtendedBidomainProblem< DIM >::PreSolveChecks(), and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Solve().
void AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::PrintOutput | ( | bool | rPrintOutput | ) |
Set whether the simulation will generate results files.
rPrintOutput |
Definition at line 310 of file AbstractCardiacProblem.cpp.
References AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mPrintOutput.
AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > & AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::rGetMesh | ( | ) |
Definition at line 340 of file AbstractCardiacProblem.cpp.
References AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpMesh.
|
inlineprivate |
Save the member variables.
archive | |
version |
Definition at line 134 of file AbstractCardiacProblem.hpp.
|
inlineprivate |
Serialization helper method to save a boundary conditions container.
archive | the archive to save to |
pMesh | the mesh boundary conditions are defined on |
pBcc | the container to save |
Definition at line 352 of file AbstractCardiacProblem.hpp.
void AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetBoundaryConditionsContainer | ( | BccType | pBcc | ) |
Set the boundary conditions container.
pBcc | is a pointer to a boundary conditions container |
Definition at line 225 of file AbstractCardiacProblem.cpp.
References AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpBoundaryConditionsContainer.
Referenced by CardiacElectroMechanicsProblem< DIM, ELEC_PROB_DIM >::Solve().
|
virtual |
Set an electrode object (which provides boundary conditions). Only valid if there is a bath.
Reimplemented in BidomainProblem< DIM >.
Definition at line 918 of file AbstractCardiacProblem.cpp.
Referenced by AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Initialise().
void AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetHdf5DataWriterTargetChunkSizeAndAlignment | ( | hsize_t | size | ) |
Set Hdf5DataWriter target chunk size and alignment parameters.
The most likely use case for this is setting it to the stripe size on a striped filesystem. This results in the writer choosing chunk dimensions that should efficiently fit within a stripe, AND padding the chunks so each chunk fits in one stripe.
For example, if your filesystem uses 1 M stripes, call this method with argument 1048576 (or 0x100000 if you like round numbers).
NOTE: The alignment parameter is only used for NEW HDF5 files. The chunk size is only used for NEW datasets (e.g. results or postprocessing) and NOT when EXTENDING a dataset. In other words, when adding a dataset to a file the alignment parameter will be ignored. When adding to a dataset, both will be ignored. etc.
size | size in bytes to use for target chunk size and alignment |
Definition at line 890 of file AbstractCardiacProblem.cpp.
References AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mHdf5DataWriterChunkSizeAndAlignment.
void AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetMesh | ( | AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > * | pMesh | ) |
This only needs to be called if a mesh filename has not been set.
pMesh | the mesh object to use |
Definition at line 297 of file AbstractCardiacProblem.cpp.
References AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mAllocatedMemoryForMesh, and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpMesh.
Referenced by CardiacElectroMechanicsProblem< DIM, ELEC_PROB_DIM >::Initialise().
void AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetNodesPerProcessorFilename | ( | const std::string & | rFilename | ) |
Set a file from which the nodes for each processor are read
rFilename |
void AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetOutputNodes | ( | std::vector< unsigned > & | rNodesToOutput | ) |
Specifies which nodes in the mesh to output. This method must be called before InitialiseWriter, otherwise all nodes will still be output. If this method is called when extending an existing HDF5 file, it will be ignored.
rNodesToOutput | is a reference to a vector with the indexes of the nodes where the output is desired. If empty, the output will be for all the nodes in the mesh. |
Definition at line 896 of file AbstractCardiacProblem.cpp.
References AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mNodesToOutput.
|
inlinevirtual |
Allow subclasses to define additional 'stopping times' for the printing time step loop. This allows bidomain simulations to specify exactly when the Electrodes should be turned on or off.
rAdditionalStoppingTimes | to be filled in with the additional stopping times |
Reimplemented in BidomainProblem< DIM >.
Definition at line 746 of file AbstractCardiacProblem.hpp.
Referenced by AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Solve().
void AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetUseHdf5DataWriterCache | ( | bool | useCache = true | ) |
Set whether to use caching in the Hdf5DataWriter. This tells the Hdf5DataWriter to write only whole chunks to disk, rather than every print timestep, which is much faster when running with many processes.
useCache | Whether to use the cache |
Definition at line 884 of file AbstractCardiacProblem.cpp.
References AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mUseHdf5DataWriterCache.
void AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetUseTimeAdaptivityController | ( | bool | useAdaptivity, |
AbstractTimeAdaptivityController * | pController = NULL |
||
) |
Set whether (or not) to use a time adaptivity controller
useAdaptivity | whether to use adaptivity |
pController | The controller (only relevant if useAdaptivity==true) |
Definition at line 357 of file AbstractCardiacProblem.cpp.
References AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpTimeAdaptivityController.
void AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetWriteInfo | ( | bool | writeInfo = true | ) |
Set whether extra info will be written to stdout during computation.
writeInfo |
Definition at line 316 of file AbstractCardiacProblem.cpp.
References AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mWriteInfo.
void AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Solve | ( | ) |
First performs some checks by calling the PreSolveChecks method. It creates an solver to which it passes the boundary conditions specified by the user (otherwise it passes the defauls bcc). It then calls the Solve method on the solver class. It also handles the output, if necessary.
Definition at line 373 of file AbstractCardiacProblem.cpp.
References Hdf5DataWriter::AdvanceAlongUnlimitedDimension(), TimeStepper::AdvanceOneTimeStep(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::AtBeginningOfTimestep(), GenericEventHandler< 16, HeartEventHandler >::BeginEvent(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::CloseFilesAndPostProcess(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::CreateInitialCondition(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::CreateSolver(), PetscTools::Destroy(), GenericEventHandler< 16, HeartEventHandler >::EndEvent(), TimeStepper::GetNextTime(), HeartConfig::GetOutputDirectory(), TimeStepper::GetTime(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::InitialiseWriter(), HeartConfig::Instance(), TimeStepper::IsTimeAtEnd(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mCurrentTime, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mOutputModifiers, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpBoundaryConditionsContainer, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpDefaultBoundaryConditionsContainer, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpMesh, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mPrintOutput, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpSolver, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpTimeAdaptivityController, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpWriter, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mSolution, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mWriteInfo, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::OnEndOfTimestep(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::PreSolveChecks(), ProgressReporter::PrintFinalising(), PetscTools::ReplicateException(), GenericEventHandler< 16, HeartEventHandler >::Reset(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetUpAdditionalStoppingTimes(), ProgressReporter::Update(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::WriteInfo(), and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::WriteOneStep().
void AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::WriteExtraVariablesOneStep | ( | ) |
Write one timestep of output data for the extra variables to the primary results file.
Definition at line 756 of file AbstractCardiacProblem.cpp.
References DistributedVector::Begin(), PetscTools::Destroy(), DistributedVector::End(), HeartConfig::GetOutputVariables(), HeartConfig::Instance(), HeartRegionCode::IsRegionBath(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mCurrentTime, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mExtraVariablesId, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpCardiacTissue, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpMesh, AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpWriter, Hdf5DataWriter::PutVector(), and DistributedVector::Restore().
Referenced by MonodomainProblem< ELEMENT_DIM, SPACE_DIM >::WriteOneStep(), MonodomainPurkinjeProblem< ELEMENT_DIM, SPACE_DIM >::WriteOneStep(), BidomainProblem< DIM >::WriteOneStep(), and ExtendedBidomainProblem< DIM >::WriteOneStep().
|
pure virtual |
Write informative details about the progress of the simulation to standard output.
Implemented only in subclasses.
time | the current time |
Implemented in ExtendedBidomainProblem< DIM >, BidomainProblem< DIM >, MonodomainPurkinjeProblem< ELEMENT_DIM, SPACE_DIM >, and MonodomainProblem< ELEMENT_DIM, SPACE_DIM >.
Referenced by AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Solve().
|
pure virtual |
Write one timestep of output data to the primary results file.
time | the current time |
voltageVec | the solution vector to write |
Implemented in ExtendedBidomainProblem< DIM >, BidomainProblem< DIM >, MonodomainPurkinjeProblem< ELEMENT_DIM, SPACE_DIM >, and MonodomainProblem< ELEMENT_DIM, SPACE_DIM >.
Referenced by CardiacElectroMechanicsProblem< DIM, ELEC_PROB_DIM >::Solve(), and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Solve().
|
friend |
Needed for serialization.
Definition at line 125 of file AbstractCardiacProblem.hpp.
|
friend |
CardiacElectroMechanicsProblem needs access to mpWriter.
Definition at line 467 of file AbstractCardiacProblem.hpp.
|
protected |
Whether this problem class has created the mesh itself, as opposed to being given it
Definition at line 390 of file AbstractCardiacProblem.hpp.
Referenced by AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Initialise(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetMesh(), and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::~AbstractCardiacProblem().
|
protected |
The current simulation time.
This is used to be able to restart simulations at a point other than time zero, either because of repeated calls to Solve (with increased simulation duration) or because of restarting from a checkpoint.
Definition at line 433 of file AbstractCardiacProblem.hpp.
Referenced by AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::DefineWriterColumns(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::GetCurrentTime(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Initialise(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::InitialiseWriter(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::PreSolveChecks(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Solve(), and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::WriteExtraVariablesOneStep().
|
protected |
List of extra variables to be written to HDF5 file
Definition at line 402 of file AbstractCardiacProblem.hpp.
Referenced by AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::DefineExtraVariablesWriterColumns(), and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::WriteExtraVariablesOneStep().
|
protected |
Size to pass to Hdf5DataWriter for chunk size and alignment.
Definition at line 482 of file AbstractCardiacProblem.hpp.
Referenced by AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::CloseFilesAndPostProcess(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::InitialiseWriter(), and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetHdf5DataWriterTargetChunkSizeAndAlignment().
|
protected |
Meshes can be read from file or instantiated and passed directly to this class, this is for the former
Definition at line 387 of file AbstractCardiacProblem.hpp.
|
protected |
Used by the writer
Definition at line 406 of file AbstractCardiacProblem.hpp.
|
protected |
If only outputing voltage for selected nodes, which nodes to output at
Definition at line 397 of file AbstractCardiacProblem.hpp.
Referenced by AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::AbstractCardiacProblem(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::CloseFilesAndPostProcess(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::DefineWriterColumns(), and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetOutputNodes().
|
protected |
A vector of user-defined output modifiers which may be used to produce lightweight on the fly output
Definition at line 487 of file AbstractCardiacProblem.hpp.
Referenced by AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Solve().
|
protected |
Boundary conditions container used in the simulation
Definition at line 412 of file AbstractCardiacProblem.hpp.
Referenced by AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetBoundaryConditionsContainer(), and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Solve().
|
protected |
The monodomain or bidomain pde
Definition at line 409 of file AbstractCardiacProblem.hpp.
Referenced by AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::CreateInitialCondition(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::GetTissue(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Initialise(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::PreSolveChecks(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::WriteExtraVariablesOneStep(), and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::~AbstractCardiacProblem().
|
protected |
The cell factory creates the cells for each node
Definition at line 418 of file AbstractCardiacProblem.hpp.
Referenced by AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::AbstractCardiacProblem(), and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Initialise().
|
protected |
It is convenient to also have a separate variable for default (zero-Neumann) boundary conditions
Definition at line 414 of file AbstractCardiacProblem.hpp.
Referenced by AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Solve().
|
protected |
The mesh. Can either by passed in, or the mesh filename can be set
Definition at line 420 of file AbstractCardiacProblem.hpp.
Referenced by AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::CloseFilesAndPostProcess(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::CreateInitialCondition(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::CreateMeshFromHeartConfig(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::DefineWriterColumns(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::GetSolutionDistributedVector(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Initialise(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::InitialiseWriter(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::rGetMesh(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetMesh(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Solve(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::WriteExtraVariablesOneStep(), and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::~AbstractCardiacProblem().
|
protected |
Whether to write any output at all
Definition at line 394 of file AbstractCardiacProblem.hpp.
Referenced by AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::CloseFilesAndPostProcess(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::PreSolveChecks(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::PrintOutput(), and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Solve().
|
protected |
The PDE solver
Definition at line 416 of file AbstractCardiacProblem.hpp.
Referenced by AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Solve().
|
protected |
Adaptivity controller (defaults to NULL).
Definition at line 436 of file AbstractCardiacProblem.hpp.
Referenced by AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetUseTimeAdaptivityController(), and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Solve().
|
protected |
The object to use to write results to disk.
Definition at line 472 of file AbstractCardiacProblem.hpp.
Referenced by AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::CloseFilesAndPostProcess(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::DefineExtraVariablesWriterColumns(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::DefineWriterColumns(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::InitialiseWriter(), CardiacElectroMechanicsProblem< DIM, ELEC_PROB_DIM >::Solve(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Solve(), and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::WriteExtraVariablesOneStep().
|
protected |
The current solution vector, of the form [V_0 .. V_N ] for monodomain and [V_0 phi_0 .. V_N phi_N] for bidomain
Definition at line 424 of file AbstractCardiacProblem.hpp.
Referenced by AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::GetSolution(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::GetSolutionDistributedVector(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Initialise(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::InitialiseWriter(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Solve(), and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::~AbstractCardiacProblem().
|
protected |
Used by the writer
Definition at line 404 of file AbstractCardiacProblem.hpp.
|
protected |
Whether to instruct the writer to cache writes.
Definition at line 477 of file AbstractCardiacProblem.hpp.
Referenced by AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::InitialiseWriter(), and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetUseHdf5DataWriterCache().
|
protected |
Used by the writer
Definition at line 400 of file AbstractCardiacProblem.hpp.
Referenced by AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::DefineWriterColumns().
|
protected |
Whether to print some statistics (max/min voltage) to screen during the simulation
Definition at line 392 of file AbstractCardiacProblem.hpp.
Referenced by AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetWriteInfo(), and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Solve().