36#include "CardiacSimulationArchiver.hpp"
37#include "CardiacSimulation.hpp"
64 out_stream p_file = handler.
OpenOutputFile(
"ResumeParameters.xml");
65 (*p_file) <<
"<?xml version='1.0' encoding='UTF-8'?>" << std::endl;
66 (*p_file) <<
"<ChasteParameters xmlns='https://chaste.comlab.ox.ac.uk/nss/parameters/3_0' "
67 <<
"xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' "
68 <<
"xsi:schemaLocation='https://chaste.comlab.ox.ac.uk/nss/parameters/3_0 ChasteParameters_3_0.xsd'>" << std::endl;
69 (*p_file) << std::endl;
70 (*p_file) <<
" <ResumeSimulation>" << std::endl;
71 (*p_file) <<
" <ArchiveDirectory relative_to='this_file'>" << rArchiveDirectory <<
"</ArchiveDirectory>" << std::endl;
73 (*p_file) <<
" <SimulationDuration unit='ms'>0.0</SimulationDuration> <!-- Edit with new simulation duration. Please "
74 <<
"note that the simulation does not restart at t=0 but at the time where the checkpoint was created.-->" << std::endl;
78 <<
"'/> <!-- This is optional; if not given, the loaded simulation will NOT itself be checkpointed -->" << std::endl;
83 (*p_file) <<
" </ResumeSimulation>" << std::endl;
84 (*p_file) << std::endl;
85 (*p_file) <<
" <!-- These elements must exist, but their contents are ignored -->" << std::endl;
86 (*p_file) <<
" <Physiological/>" << std::endl;
87 (*p_file) <<
" <Numerical/>" << std::endl;
88 (*p_file) <<
"</ChasteParameters>" << std::endl;
96 bool writeProvenanceInfo,
97 bool saveProblemInstance)
98 : mSaveProblemInstance(saveProblemInstance)
101 if (parameterFileName ==
"")
109 if (writeProvenanceInfo)
129 if (e.CheckShortMessageContains(
"Missing file parsing configuration") ==
"")
144#define DOMAIN_CASE(VALUE, CLASS, DIM) \
147 CreateAndRun<CLASS<DIM>, DIM>(); \
151#define DOMAIN_SWITCH(DIM) \
152 switch (HeartConfig::Instance()->GetDomain()) \
154 DOMAIN_CASE(cp::domain_type::Mono, MonodomainProblem, DIM) \
155 DOMAIN_CASE(cp::domain_type::Bi, BidomainProblem, DIM) \
156 DOMAIN_CASE(cp::domain_type::BiWithBath, BidomainWithBathProblem, DIM) \
182 EXCEPTION(
"Space dimension not supported: should be 1, 2 or 3");
#define EXCEPTION(message)
void CreateResumeXmlFile(const std::string &rOutputDirectory, const std::string &rArchiveDirectory)
boost::shared_ptr< AbstractUntemplatedCardiacProblem > mSavedProblem
void ReadParametersFromFile(std::string parameterFileName)
boost::shared_ptr< AbstractUntemplatedCardiacProblem > GetSavedProblem()
CardiacSimulation(std::string parameterFileName, bool writeProvenanceInfo=false, bool saveProblemInstance=false)
std::string BoolToString(bool yesNo)
static void SetOutputDirectory(const std::string &rOutputDirectory)
static void WriteMachineInfoFile(std::string fileBaseName)
static void WriteProvenanceInfoFile()
unsigned GetMaxCheckpointsOnDisk() const
void SetUseFixedSchemaLocation(bool useFixedSchemaLocation)
unsigned GetSpaceDimension() const
double GetCheckpointTimestep() const
cp::domain_type GetDomain() const
void SetParametersFile(const std::string &rFileName)
static HeartConfig * Instance()
std::string GetOutputDirectoryFullPath() const
out_stream OpenOutputFile(const std::string &rFileName, std::ios_base::openmode mode=std::ios::out|std::ios::trunc) const