Line data Source code
1 : // Copyright (C) 2015 Technische Universitaet Muenchen
2 : // This file is part of the Mamico project. For conditions of distribution
3 : // and use, please see the copyright notice in Mamico's main folder, or at
4 : // www5.in.tum.de/mamico
5 : #ifndef _MOLECULARDYNAMICS_CONFIGURATIONS_Adios2Configuration_H_
6 : #define _MOLECULARDYNAMICS_CONFIGURATIONS_Adios2Configuration_H_
7 :
8 : #include "simplemd/MolecularDynamicsDefinitions.h"
9 : #include "tarch/configuration/Configuration.h"
10 : #include "tarch/la/Vector.h"
11 : #include <iostream>
12 :
13 : namespace simplemd {
14 : namespace configurations {
15 : class Adios2Configuration;
16 : }
17 : } // namespace simplemd
18 :
19 : /** configuration input for Adios2 output.
20 : * @author Philipp Neumann
21 : */
22 : class simplemd::configurations::Adios2Configuration : public tarch::configuration::Configuration {
23 : public:
24 : Adios2Configuration();
25 408 : virtual ~Adios2Configuration() {}
26 :
27 : void parseSubtag(tinyxml2::XMLElement* node);
28 :
29 : /**
30 : * Return name of xml tag that is associated to the configuration.
31 : */
32 : virtual std::string getTag() const;
33 :
34 : /**
35 : * Is config valid?
36 : *
37 : * This operation usually fails, if
38 : *
39 : * - parseSubtag() hasn't been called, i.e. configuration has not been
40 : * used, or
41 : * - parseSubtag() failed due to a wrong file.
42 : *
43 : * If a tag ain't optional and parseSubtag() was not called (first case)
44 : */
45 : bool isValid() const;
46 :
47 : /** getters for all parsed and computed quantities */
48 : const std::string& getFilename() const { return _filename; }
49 : const unsigned int& getWriteEveryTimestep() const { return _writeEveryTimestep; }
50 :
51 : private:
52 : static const std::string FILENAME;
53 : static const std::string WRITE_EVERY_TIMESTEP;
54 :
55 : /** name stem of the corresponding Adios2 directory */
56 : std::string _filename;
57 :
58 : /** number of timesteps per Adios2 output. If this value is zero, no output is written at all */
59 : unsigned int _writeEveryTimestep;
60 :
61 : bool _isValid;
62 : };
63 : #endif // _MOLECULARDYNAMICS_CONFIGURATIONS_Adios2Configuration_H_
|