36 #ifndef CARDIACSIMULATION_HPP_
37 #define CARDIACSIMULATION_HPP_
44 #include "AbstractCardiacProblem.hpp"
45 #include "MonodomainProblem.hpp"
46 #include "BidomainProblem.hpp"
47 #include "BidomainWithBathProblem.hpp"
48 #include "CardiacSimulationArchiver.hpp"
50 #include "TimeStepper.hpp"
53 #include "HeartConfig.hpp"
54 #include "HeartConfigRelatedCellFactory.hpp"
55 #include "HeartFileFinder.hpp"
57 #include "TetrahedralMesh.hpp"
58 #include "NonCachedTetrahedralMesh.hpp"
59 #include "ChastePoint.hpp"
60 #include "ChasteCuboid.hpp"
61 #include "MeshalyzerMeshWriter.hpp"
62 #include "TrianglesMeshWriter.hpp"
64 #include "OrthotropicConductivityTensors.hpp"
65 #include "PostProcessingWriter.hpp"
67 #include "OutputDirectoryFifoQueue.hpp"
68 #include "ExecutableSupport.hpp"
94 template<
class Problem,
unsigned SPACE_DIM>
97 boost::shared_ptr<Problem> p_problem;
102 p_problem.reset(
new Problem(&cell_factory));
104 p_problem->Initialise();
111 cell_factory.
SetMesh(&(p_problem->rGetMesh()));
114 for (
unsigned node_global_index = p_vector_factory->
GetLow();
115 node_global_index < p_vector_factory->
GetHigh();
132 while ( !checkpoint_stepper.IsTimeAtEnd() )
139 std::stringstream checkpoint_id;
141 std::string checkpoint_dir_basename = directory_queue.
CreateNextDir(checkpoint_id.str());
149 std::stringstream archive_foldername;
155 OutputFileHandler checkpoint_dir_basename_handler(checkpoint_dir_basename,
false);
159 partial_output_dir_handler.
FindFile(
"").
CopyTo(checkpoint_dir_basename_handler.FindFile(
""));
166 checkpoint_stepper.AdvanceOneTimeStep();
195 void CreateResumeXmlFile(
const std::string& rOutputDirectory,
const std::string& rArchiveDirectory);
214 bool writeProvenanceInfo=
false,
215 bool saveProblemInstance=
false);
221 boost::shared_ptr<AbstractUntemplatedCardiacProblem>
GetSavedProblem();
double GetSimulationDuration() const
CardiacSimulation(std::string parameterFileName, bool writeProvenanceInfo=false, bool saveProblemInstance=false)
double GetCheckpointTimestep() const
std::string CreateNextDir(const std::string &rSubdirectoryName)
FileFinder CopyTo(const FileFinder &rDest) const
static void Save(PROBLEM_CLASS &rSimulationToArchive, const std::string &rDirectory, bool clearDirectory=true)
boost::shared_ptr< AbstractUntemplatedCardiacProblem > mSavedProblem
void SetSimulationDuration(double simulationDuration)
FileFinder FindFile(std::string leafName) const
std::string BoolToString(bool yesNo)
void CreateResumeXmlFile(const std::string &rOutputDirectory, const std::string &rArchiveDirectory)
virtual void SetMesh(AbstractTetrahedralMesh< ELEMENT_DIM, ELEMENT_DIM > *pMesh)
boost::shared_ptr< AbstractUntemplatedCardiacProblem > GetSavedProblem()
bool GetCheckpointSimulation() const
std::string GetOutputDirectory() const
AbstractCardiacCellInterface * GetCardiacCell(unsigned globalIndex)
static HeartConfig * Instance()
void ReadParametersFromFile(std::string parameterFileName)
bool mSaveProblemInstance