forked from plumed/plumed2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Units.h
93 lines (76 loc) · 2.54 KB
/
Units.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Copyright (c) 2013 The plumed team
(see the PEOPLE file at the root of the distribution for a list of names)
See http://www.plumed-code.org for more information.
This file is part of plumed, version 2.0.
plumed is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
plumed is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with plumed. If not, see <http://www.gnu.org/licenses/>.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
#ifndef __PLUMED_tools_Units_h
#define __PLUMED_tools_Units_h
#include <string>
namespace PLMD{
/// Small utility class.
/// It has no implemented methods, and all its data are public.
/// It just simplify the syntax of functions which should pass the
/// value of all the units.
class Units{
/// Units for energy, expressed in kj/mol (e.g. 4.184 means kcal/mol)
double energy;
std::string energyString;
/// Units for length, expressed in nm (e.g. 0.1 means A)
double length;
std::string lengthString;
/// Units for time, expressed in ps (e.g. 0.001 means fs)
double time;
std::string timeString;
public:
// Constructor, setting default values (1.0)
Units();
void setEnergy(const std::string &);
void setTime(const std::string &);
void setLength(const std::string &);
void setEnergy(const double);
void setTime(const double);
void setLength(const double);
const double & getEnergy()const;
const double & getLength()const;
const double & getTime()const;
const std::string & getEnergyString()const;
const std::string & getLengthString()const;
const std::string & getTimeString()const;
};
inline
const double & Units::getEnergy()const{
return energy;
}
inline
const double & Units::getLength()const{
return length;
}
inline
const double & Units::getTime()const{
return time;
}
inline
const std::string & Units::getEnergyString()const{
return energyString;
}
inline
const std::string & Units::getLengthString()const{
return lengthString;
}
inline
const std::string & Units::getTimeString()const{
return timeString;
}
}
#endif