1#ifndef RPC_TRAJECTORY_WRITER_H
2#define RPC_TRAJECTORY_WRITER_H
17 template <
int D>
class System;
18 template <
int D>
class Simulator;
74 template <
class Archive>
75 void serialize(Archive& ar,
const unsigned int version);
88 virtual void sample(
long iStep);
103 std::ofstream outputFile_;
106 std::string filename_;
141 void writeFrame(std::ofstream& out,
long iStep);
160 template <
class Archive>
171 {
return *systemPtr_; }
176 {
return *simulatorPtr_; }
178 #ifndef RPC_TRAJECTORY_WRITER_TPP
Abstract base for periodic output and/or analysis actions.
bool isAtInterval(long counter) const
Return true iff counter is a multiple of the interval.
const std::string & outputFileName() const
Return outputFileName string.
Field theoretic simulator (base class).
Main class for SCFT or PS-FTS simulation of one system.
Periodically write snapshots to a trajectory file.
System< D > * systemPtr_
Pointer to the parent system.
virtual void readParameters(std::istream &in)
Read interval and output file name.
Simulator< D > & simulator()
Return reference to parent Simulator.
void writeHeader(std::ofstream &out)
Write data that should appear once, at beginning of the file.
virtual void output()
Close trajectory file after run.
long nSample_
Number of configurations dumped thus far (first dump is zero).
long isInitialized_
Has readParam been called?
void writeFrame(std::ofstream &out, long iStep)
Write data that should appear in every frame.
TrajectoryWriter(Simulator< D > &simulator, System< D > &system)
Constructor.
virtual ~TrajectoryWriter()
Destructor.
virtual void setup()
Clear nSample counter.
System< D > & system()
Return reference to parent system.
Simulator< D > * simulatorPtr_
Pointer to parent Simulator.
virtual void sample(long iStep)
Write a frame/snapshot to trajectory file.
Loading (input) archive for binary istream.
Saving / output archive for binary ostream.
void serialize(Archive &ar, const unsigned int version)
Serialize this ParamComponent as a string.
ScalarParam< Type > & read(std::istream &in, const char *label, Type &value)
Add and read a new required ScalarParam < Type > object.
void setClassName(const char *className)
Set class name string.
virtual void save(Serializable::OArchive &ar)
Saves all parameters to an archive.
virtual void loadParameters(Serializable::IArchive &ar)
Load state from archive, without adding Begin and End lines.
File containing preprocessor macros for error handling.
PSCF package top-level namespace.
Utility classes for scientific computation.