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_RDFCONFIGURATION_H_
6 : #define _MOLECULARDYNAMICS_CONFIGURATIONS_RDFCONFIGURATION_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 RDFConfiguration;
16 : }
17 : } // namespace simplemd
18 :
19 : /** configuration input for RDF sampling.
20 : * @author Philipp Neumann
21 : */
22 : class simplemd::configurations::RDFConfiguration : public tarch::configuration::Configuration {
23 : public:
24 : RDFConfiguration();
25 1224 : virtual ~RDFConfiguration() {}
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 bool& isDefined() const { return _isDefined; }
49 : const unsigned int& getStartAtTimestep() const { return _startAtTimestep; }
50 : const unsigned int& getEvaluateEveryTimestep() const { return _evaluateEveryTimestep; }
51 : const unsigned int& getWriteEveryTimestep() const { return _writeEveryTimestep; }
52 : const unsigned int& getNumberOfPoints() const { return _numberPoints; }
53 :
54 : private:
55 : static const std::string START_AT_TIMESTEP;
56 : static const std::string EVALUATE_EVERY_TIMESTEP;
57 : static const std::string WRITE_EVERY_TIMESTEP;
58 : static const std::string NUMBER_OF_POINTS;
59 :
60 : /** first timestep when the rdf-evaluation shall be started */
61 : unsigned int _startAtTimestep;
62 :
63 : /** timesteps per subsequent rdf evaluations */
64 : unsigned int _evaluateEveryTimestep;
65 :
66 : /** number of timesteps per vtk output. If this value is zero, no output is written at all */
67 : unsigned int _writeEveryTimestep;
68 :
69 : /** number of points used to discretise the distance between two molecules (between r=0 and r=r_cutoff) */
70 : unsigned int _numberPoints;
71 :
72 : /** true, if the configuration was parsed */
73 : bool _isDefined;
74 :
75 : bool _isValid;
76 : };
77 :
78 : #endif // _MOLECULARDYNAMICS_CONFIGURATIONS_RDFCONFIGURATION_H_
|