5 #include <boost/filesystem.hpp>
13 namespace Instrumentation
16 template<
typename PositionCoordinate,
typename VelocityCoordinate>
21 : starPolymers(starPolymers_), settings(settings_)
26 template<
typename PositionCoordinate,
typename VelocityCoordinate>
29 if(!snapshotFilePath.empty())
30 boost::filesystem::remove(snapshotFilePath);
33 template<
typename PositionCoordinate,
typename VelocityCoordinate>
36 starPolymers->writeStateToSnapshot(snapshotFile.get());
39 template<
typename PositionCoordinate,
typename VelocityCoordinate>
41 const std::string& rundir)
const
43 const std::string basedir = rundir +
"/StarPolymers";
46 if(settings.has(
"initialState"))
49 settings.read<std::string>(
"initialState"),
50 basedir +
"/initialState.vtf");
58 template<
typename PositionCoordinate,
typename VelocityCoordinate>
63 if(!snapshotFilePath.empty())
64 boost::filesystem::remove(snapshotFilePath);
67 const boost::filesystem::path tmp =
68 boost::filesystem::temp_directory_path() /
69 boost::filesystem::unique_path();
70 snapshotFilePath = tmp.string();
73 starPolymers->writeStructureToSnapshot(snapshotFile.get());