kim-api  2.1.4-git+v2.1.3-git-3-g4c859c7f.GNU
An Application Programming Interface (API) for the Knowledgebase of Interatomic Models (KIM).
KIM_EnergyUnit.hpp
Go to the documentation of this file.
1 //
2 // CDDL HEADER START
3 //
4 // The contents of this file are subject to the terms of the Common Development
5 // and Distribution License Version 1.0 (the "License").
6 //
7 // You can obtain a copy of the license at
8 // http://www.opensource.org/licenses/CDDL-1.0. See the License for the
9 // specific language governing permissions and limitations under the License.
10 //
11 // When distributing Covered Code, include this CDDL HEADER in each file and
12 // include the License file in a prominent location with the name LICENSE.CDDL.
13 // If applicable, add the following below this CDDL HEADER, with the fields
14 // enclosed by brackets "[]" replaced with your own identifying information:
15 //
16 // Portions Copyright (c) [yyyy] [name of copyright owner]. All rights reserved.
17 //
18 // CDDL HEADER END
19 //
20 
21 //
22 // Copyright (c) 2016--2019, Regents of the University of Minnesota.
23 // All rights reserved.
24 //
25 // Contributors:
26 // Ryan S. Elliott
27 //
28 
29 //
30 // Release: This file is part of the kim-api.git repository.
31 //
32 
33 
34 #ifndef KIM_ENERGY_UNIT_HPP_
35 #define KIM_ENERGY_UNIT_HPP_
36 
37 #include <string>
38 
39 namespace KIM
40 {
50 {
51  public:
62 
66  EnergyUnit();
67 
73  EnergyUnit(int const id);
74 
83  EnergyUnit(std::string const & str);
84 
94  bool Known() const;
95 
104  bool operator==(EnergyUnit const & rhs) const;
105 
114  bool operator!=(EnergyUnit const & rhs) const;
115 
127  std::string const & ToString() const;
128 }; // class EnergyUnit
129 
132 namespace ENERGY_UNIT
133 {
140 extern EnergyUnit const unused;
141 
148 extern EnergyUnit const amu_A2_per_ps2;
149 
156 extern EnergyUnit const erg;
157 
164 extern EnergyUnit const eV;
165 
172 extern EnergyUnit const Hartree;
173 
180 extern EnergyUnit const J;
181 
188 extern EnergyUnit const kcal_mol;
189 
199 void GetNumberOfEnergyUnits(int * const numberOfEnergyUnits);
200 
215 int GetEnergyUnit(int const index, EnergyUnit * const energyUnit);
216 
221 {
226  bool operator()(EnergyUnit const & a, EnergyUnit const & b) const
227  {
228  return a.energyUnitID < b.energyUnitID;
229  }
230 }; // struct Comparator
231 } // namespace ENERGY_UNIT
232 } // namespace KIM
233 
234 #endif // KIM_ENERGY_UNIT_HPP_
int energyUnitID
Integer identifying the specific EnergyUnit represented.
void GetNumberOfEnergyUnits(int *const numberOfEnergyUnits)
Get the number of standard EnergyUnit&#39;s defined by the KIM API.
EnergyUnit const J
The standard Joule unit of energy.
EnergyUnit const Hartree
The standard Hartree unit of energy.
Structure provided for use with std::map.
EnergyUnit const amu_A2_per_ps2
The standard amu*A /ps unit of energy.
std::string const & ToString() const
Converts the object to a string.
An Extensible Enumeration for the EnergyUnit&#39;s supported by the KIM API.
EnergyUnit const kcal_mol
The standard kilocalorie per mole unit of energy.
int GetEnergyUnit(int const index, EnergyUnit *const energyUnit)
Get the identity of each defined standard EnergyUnit.
EnergyUnit const unused
Indicates that a EnergyUnit is not used.
bool operator==(EnergyUnit const &rhs) const
Compares EnergyUnit objects for equality.
EnergyUnit const eV
The standard electronvolt unit of energy.
EnergyUnit const erg
The standard erg unit of energy.
bool operator()(EnergyUnit const &a, EnergyUnit const &b) const
Provides an (logically unmeaningful) ordering for EnergyUnit objects so that they can be stored in a ...
bool Known() const
Determines if the object is a quantity known to the KIM API.
EnergyUnit()
Create an uninitialized EnergyUnit object.
bool operator!=(EnergyUnit const &rhs) const
Compares EnergyUnit objects for inequality.