#include <CardiacSimulation.hpp>
Public Member Functions | |
CardiacSimulation (std::string parameterFileName) | |
Private Member Functions | |
void | ReadParametersFromFile (std::string parameterFileName) |
template<class Problem , unsigned SPACE_DIM> | |
void | CreateAndRun () |
void | Run () |
void | CreateResumeXmlFile (const std::string &rOutputDirectory, const std::string &rArchiveDirectory) |
std::string | BoolToString (bool yesNo) |
A class which encapsulates the executable functionality.
Takes in a chaste parameters XML file and runs the relevant simulation.
The XML Schema, which describes what is allowed in the XML configuration file, can be found at heart/src/io/ChasteParameters_2_0.xsd (for Chaste release 2.0). It contains documentation describing what settings are available. The documentation of the HeartConfig class may also be of use.
Definition at line 79 of file CardiacSimulation.hpp.
CardiacSimulation::CardiacSimulation | ( | std::string | parameterFileName | ) |
Constructor
This also runs the simulation immediately.
parameterFileName | The name of the chaste parameters xml file to use to run a simulation (not mandatory since HeartConfig may be set by hand) |
Definition at line 233 of file CardiacSimulation.hpp.
References GenericEventHandler< 13, HeartEventHandler >::Headings(), ReadParametersFromFile(), GenericEventHandler< 13, HeartEventHandler >::Report(), and Run().
std::string CardiacSimulation::BoolToString | ( | bool | yesNo | ) | [private] |
Convert a boolean to a "yes" or "no" string.
yesNo |
Definition at line 192 of file CardiacSimulation.hpp.
Referenced by CreateResumeXmlFile().
void CardiacSimulation::CreateAndRun | ( | ) | [inline, private] |
Templated method which creates and runs a cardiac simulation, based on the XML file passed to our constructor.
Definition at line 77 of file CardiacSimulation.hpp.
void CardiacSimulation::CreateResumeXmlFile | ( | const std::string & | rOutputDirectory, | |
const std::string & | rArchiveDirectory | |||
) | [private] |
Write a ResumeParameters.xml file to the checkpoint directory, to help users in resuming a checkpointed simulation. If the contents of rOutputDirectory are copied to CHASTE_TEST_OUTPUT, and ResumeParameters.xml edited to specify a sensible simulation duration, then it can be used as the input parameters file to resume from the given checkpoint.
rOutputDirectory | the directory to put the XML file in | |
rArchiveDirectory | the relative path from this directory to the archive directory |
Definition at line 206 of file CardiacSimulation.hpp.
References BoolToString(), HeartConfig::GetCheckpointTimestep(), HeartConfig::GetDomain(), HeartConfig::GetMaxCheckpointsOnDisk(), HeartConfig::GetSpaceDimension(), HeartConfig::Instance(), and OutputFileHandler::OpenOutputFile().
void CardiacSimulation::ReadParametersFromFile | ( | std::string | parameterFileName | ) | [private] |
Read parameters from the HeartConfig XML file.
parameterFileName | a string containing the chaste simulation parameters XML file name. |
Definition at line 247 of file CardiacSimulation.hpp.
References Exception::CheckShortMessageContains(), HeartConfig::Instance(), HeartConfig::Reset(), HeartConfig::SetParametersFile(), and HeartConfig::SetUseFixedSchemaLocation().
Referenced by CardiacSimulation().
void CardiacSimulation::Run | ( | ) | [private] |
Run the simulation. This method basically contains switches on the problem type and space dimension, and calls CreateAndRun() to do the work.
Definition at line 274 of file CardiacSimulation.hpp.
References HeartConfig::Instance().
Referenced by CardiacSimulation().