ls1-MarDyn
ls1-MarDyn molecular dynamics code
TimerWriter.h
1//
2// Created by seckler on 10.10.19.
3//
4#pragma once
5
6#include <fstream>
7#include <vector>
8
9#include "plugins/PluginBase.h"
10#include "utils/Timer.h"
11
19class TimerWriter : public PluginBase {
20public:
40 void readXML(XMLfileUnits &xmlconfig) override;
41
42 void init(ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, Domain *domain) override;
43
44 void endStep(ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, Domain *domain,
45 unsigned long simstep) override;
46
47 void finish(ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, Domain *domain) override {
48 /* nothing to do */
49 }
50
51 std::string getPluginName() override { return std::string("TimerWriter"); }
52 static PluginBase *createInstance() { return new TimerWriter(); }
53
54private:
55 unsigned long _writeFrequency{0ul};
56 std::ofstream _fileStream{};
57 std::string _outputPrefix{""};
58 std::vector<std::string> _timerNames{};
59 std::vector<bool> _incremental{};
60 std::vector<double> _times{};
61 unsigned long _stepsSinceLastWrite{0ul};
62};
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
Definition: TimerWriter.h:19
void init(ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, Domain *domain) override
Method init will be called at the begin of the simulation.
Definition: TimerWriter.cpp:42
void finish(ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, Domain *domain) override
Method finish will be called at the end of the simulation.
Definition: TimerWriter.h:47
void endStep(ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, Domain *domain, unsigned long simstep) override
Method endStep will be called at the end of each time step.
Definition: TimerWriter.cpp:66
void readXML(XMLfileUnits &xmlconfig) override
Read in XML configuration for TimerWriter.
Definition: TimerWriter.cpp:14
std::string getPluginName() override
return the name of the plugin
Definition: TimerWriter.h:51
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