27 #include <boost/property_tree/exceptions.hpp>
28 #include <boost/optional.hpp>
35 using boost::optional;
44 shared_ptr<SimShell::Session::ISession>
47 shared_ptr<Session::ISession> session;
50 auto prefs = MergedPreferences::Create(ws, proj);
53 }
catch (exception& e) {
54 throw Exception(
"Could not open \"" + m_path +
"\": " + e.what());
57 optional<ptree&> coupled_pt = pt.get_child_optional(
"vleaf2.coupled_project");
60 session = make_shared<Session::SimSession>(prefs, pt);
63 session = make_shared<Session::SimSessionCoupled>(prefs, pt, ws);
73 if (pt.get<
int>(
"vleaf2.sim_step") == timestep) {
80 }
catch (exception& e) {
81 throw Exception(
"GetSimStates(): Could not open \"" + m_path +
"\": " + e.what());
90 result.push_back(pt.get<
int>(
"vleaf2.sim_step"));
91 }
catch (exception& e) {
92 throw Exception(
"GetSimSteps() exception: \"" + m_path +
"\": " + e.what());
Interface for SimSessionCoupled.
virtual boost::property_tree::ptree ToPtree() const =0
Returns file content in a ptree format.
Namespace for miscellaneous utilities.
Simulator: mesh & parameters, model & algorithms.
Namespace for SimPT shell package.
Extremely simple Exception root class.
virtual SimPT_Sim::SimState GetSimState(int timestep) const
void Initialize(const boost::property_tree::ptree &pt)
Initialize with full configuration (global info, parameters, random engine, mesh) i...
Namespace for generic workspace classes.
Interface for MergedPreferences.
Interfaces for simulator session.
Contains the state of the whole Simulator at a given simulation step.
Base class representing the file types used to initiate a session.
StartupFilePtree(const std::string &path)
Constructor.
Header file for Exception class.
virtual std::shared_ptr< SimShell::Session::ISession > CreateSession(std::shared_ptr< SimShell::Ws::IProject > proj, std::shared_ptr< SimShell::Ws::IWorkspace > ws) const
SimState GetState() const
Provide sim state in format suitable for i/o.
Interface for StartupFilePtree.
virtual std::vector< int > GetTimeSteps() const