ls1-MarDyn
ls1-MarDyn molecular dynamics code
ResultWriter.h
1#ifndef SRC_IO_RESULTWRITER_H_
2#define SRC_IO_RESULTWRITER_H_
3
4#include <fstream>
5#include <string>
6
7#include "plugins/PluginBase.h"
8#include "utils/Accumulator.h"
9
10
23class ResultWriter : public PluginBase {
24public:
25 ResultWriter() : _U_pot_acc(nullptr), _p_acc(nullptr) {}
26 ~~ResultWriter() {
27 delete _U_pot_acc;
28 delete _p_acc;
29 }
30
43 virtual void readXML(XMLfileUnits& xmlconfig);
44
45 void init(ParticleContainer *particleContainer,
46 DomainDecompBase *domainDecomp, Domain *domain);
47
48 void endStep(
49 ParticleContainer *particleContainer,
50 DomainDecompBase *domainDecomp, Domain *domain,
51 unsigned long simstep
52 );
53
54 void finish(ParticleContainer *particleContainer,
55 DomainDecompBase *domainDecomp, Domain *domain);
56
58 return std::string("ResultWriter");
59 }
60 static PluginBase* createInstance() { return new ResultWriter(); }
61
62private:
63 std::ofstream _resultStream;
64 unsigned long _writeFrequency;
65 unsigned int _writePrecision;
66 std::string _outputPrefix;
67 Accumulator<double> *_U_pot_acc;
68 Accumulator<double> *_p_acc;
69};
70
71#endif // SRC_IO_RESULTWRITER_H_
Definition: TemperatureControl.h:211
handle boundary region and multiple processes
Definition: DomainDecompBase.h:51
This class is used to read in the phasespace and to handle macroscopic values.
Definition: Domain.h:47
This Interface is used to get access to particles and pairs of particles.
Definition: ParticleContainer.h:69
The PluginBase class provides the interface for any kind of output/plugin classes - called "(output) ...
Definition: PluginBase.h:47
Writes thermodynamic properties to a file.
Definition: ResultWriter.h:23
void init(ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, Domain *domain)
Method init will be called at the begin of the simulation.
Definition: ResultWriter.cpp:32
std::string getPluginName()
return the name of the plugin
Definition: ResultWriter.h:57
virtual void readXML(XMLfileUnits &xmlconfig)
Read in XML configuration for ResultWriter and all its included objects.
Definition: ResultWriter.cpp:12
void finish(ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, Domain *domain)
Method finish will be called at the end of the simulation.
Definition: ResultWriter.cpp:76
void endStep(ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, Domain *domain, unsigned long simstep)
Method endStep will be called at the end of each time step.
Definition: ResultWriter.cpp:55
XML file with unit attributes abstraction.
Definition: xmlfileUnits.h:25
::xsd::cxx::tree::string< char, simple_type > string
C++ type corresponding to the string XML Schema built-in type.
Definition: vtk-punstructured.h:270