27 #include <boost/filesystem/fstream.hpp>
34 void run_sim(
const boost::filesystem::path& infile,
const boost::filesystem::path& outfile,
35 bool write_xml,
double time_limit)
37 maquis::cout.precision(10);
42 boost::filesystem::ifstream param_file(infile);
44 throw std::runtime_error(std::string(
"Could not open parameter file ") + infile.string() +
".");
45 alps::Parameters p; p.extract_from_xml(param_file);
50 if (parms.defined(
"MAXSTATES")) parms.
set(
"max_bond_dimension",
int(parms[
"MAXSTATES"]));
51 if (parms.defined(
"TRUNCATION_ERROR")) parms.
set(
"truncation_final",
double(parms[
"TRUNCATION_ERROR"]));
53 if (parms.defined(
"DT")) parms.
set(
"dt",
double(parms[
"DT"]));
54 if (parms.defined(
"SWEEPS")) parms.
set(
"nsweeps",
int(parms[
"SWEEPS"]));
55 if (parms.defined(
"timesteps")) parms.
set(
"nsweeps",
int(parms[
"timesteps"]));
56 if (parms.defined(
"TIMESTEPS")) parms.
set(
"nsweeps",
int(parms[
"TIMESTEPS"]));
57 if (parms.defined(
"img_timesteps")) parms.
set(
"nsweeps_img",
int(parms[
"img_timesteps"]));
58 if (parms.defined(
"IMG_TIMESTEPS")) parms.
set(
"nsweeps_img",
int(parms[
"IMG_TIMESTEPS"]));
60 parms.
set(
"chkpfile", (outfile.parent_path() / outfile.stem()).
string() +
".chkp");
61 parms.
set(
"resultfile", (outfile.parent_path() / outfile.stem()).
string() +
".h5");
62 parms.
set(
"run_seconds", time_limit);
67 sim->
run(parms, write_xml);
void set(std::string const &key, T const &value)
void run_sim(const boost::filesystem::path &infile, const boost::filesystem::path &outfile, bool write_xml, double time_limit)
wrapper of tevol_sim for symmetry factory
boost::shared_ptr< simulation_base > shared_ptr
symmetry factory: runtime dispatch for SymmGroup template argument