1#ifndef RPG_TRAJECTORY_WRITER_H
2#define RPG_TRAJECTORY_WRITER_H
13#include <rpg/System.h>
19 template <
int D>
class System;
20 template <
int D>
class Simulator;
76 template <
class Archive>
77 void serialize(Archive& ar,
const unsigned int version);
90 virtual void sample(
long iStep);
105 std::ofstream outputFile_;
108 std::string filename_;
143 void writeFrame(std::ofstream& out,
long iStep);
162 template <
class Archive>
174 {
return *systemPtr_; }
179 {
return *simulatorPtr_; }
Abstract base for periodic output and/or analysis actions.
const std::string & outputFileName() const
Return outputFileName string.
bool isAtInterval(long counter) const
Return true iff counter is a multiple of the interval.
Field theoretic simulator (base class).
Main class for calculations that represent one system.
Periodically write snapshots to a trajectory file.
void writeHeader(std::ofstream &out)
Write data that should appear once, at beginning of the file.
virtual void save(Serializable::OArchive &ar)
Save state to archive.
virtual void readParameters(std::istream &in)
Read interval and output file name.
virtual void setup()
Clear nSample counter.
long nSample_
Number of configurations dumped thus far (first dump is zero).
Simulator< D > & simulator()
Return reference to parent Simulator.
TrajectoryWriter(Simulator< D > &simulator, System< D > &system)
Constructor.
void writeFrame(std::ofstream &out, long iStep)
Write data that should appear in every frame.
virtual ~TrajectoryWriter()
Destructor.
Simulator< D > * simulatorPtr_
Pointer to parent Simulator.
System< D > & system()
Return reference to parent system.
virtual void output()
Close trajectory file after run.
long isInitialized_
Has readParam been called?
System< D > * systemPtr_
Pointer to the parent system.
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 loadParameters(Serializable::IArchive &ar)
Load state from archive, without adding Begin and End lines.
File containing preprocessor macros for error handling.
Fields, FFTs, and utilities for periodic boundary conditions (CUDA)
Periodic fields and crystallography.
PSCF package top-level namespace.
Utility classes for scientific computation.