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_MOLECULECONFIGURATION_H_
6 : #define _MOLECULARDYNAMICS_CONFIGURATIONS_MOLECULECONFIGURATION_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 MoleculeConfiguration;
16 : }
17 : } // namespace simplemd
18 :
19 : /** reads properties for a single molecule.
20 : * @author Philipp Neumann
21 : */
22 : class simplemd::configurations::MoleculeConfiguration : public tarch::configuration::Configuration {
23 : public:
24 : MoleculeConfiguration();
25 408 : virtual ~MoleculeConfiguration() {}
26 :
27 : void parseSubtag(tinyxml2::XMLElement* node);
28 :
29 : /**
30 : * Return name of xml tag that is associated to the configuration.
31 : */
32 : 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 tarch::la::Vector<MD_DIM, double>& getMeanVelocity() const { return _meanVelocity; }
49 : const double& getTemperature() const { return _temperature; }
50 : const double& getMass() const { return _mass; }
51 : const double& getEpsilon() const { return _epsilon; }
52 : const double& getSigma() const { return _sigma; }
53 :
54 : private:
55 : static const std::string MEAN_VELOCITY;
56 : static const std::string TEMPERATURE;
57 : static const std::string MASS;
58 : static const std::string EPSILON;
59 : static const std::string SIGMA;
60 :
61 : tarch::la::Vector<MD_DIM, double> _meanVelocity;
62 : double _temperature;
63 : double _mass;
64 : double _epsilon;
65 : double _sigma;
66 :
67 : bool _isValid;
68 : };
69 : #endif // _MOLECULARDYNAMICS_CONFIGURATIONS_MOLECULECONFIGURATION_H_
|