Chemical Data Processing Library C++ API - Version 1.1.0
ElasticPotential.hpp
Go to the documentation of this file.
1 /*
2  * ElasticPotential.hpp
3  *
4  * This file is part of the Chemical Data Processing Toolkit
5  *
6  * Copyright (C) 2003 Thomas Seidel <thomas.seidel@univie.ac.at>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the s of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this library; see the file COPYING. If not, write to
20  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23 
29 #ifndef CDPL_FORCEFIELD_ELASTICPOTENTIAL_HPP
30 #define CDPL_FORCEFIELD_ELASTICPOTENTIAL_HPP
31 
32 #include <cstddef>
33 
35 
36 
37 namespace CDPL
38 {
39 
40  namespace ForceField
41  {
42 
43  /*
44  * \since 1.1
45  */
47  {
48 
49  public:
50  ElasticPotential(std::size_t atom1_idx, std::size_t atom2_idx, double force_const, double ref_length):
51  atom1Idx(atom1_idx), atom2Idx(atom2_idx), forceConst(force_const), refLength(ref_length) {}
52 
53  std::size_t getAtom1Index() const
54  {
55  return atom1Idx;
56  }
57 
58  std::size_t getAtom2Index() const
59  {
60  return atom2Idx;
61  }
62 
63  double getForceConstant() const
64  {
65  return forceConst;
66  }
67 
68  double getReferenceLength() const
69  {
70  return refLength;
71  }
72 
74  {
75  refLength = length;
76  }
77 
78  private:
79  std::size_t atom1Idx;
80  std::size_t atom2Idx;
81  double forceConst;
82  double refLength;
83  };
84  } // namespace ForceField
85 } // namespace CDPL
86 
87 #endif // CDPL_FORCEFIELD_ELASTICPOTENTIAL_HPP
APIPrefix.hpp
Definition of the preprocessor macro CDPL_FORCEFIELD_API.
CDPL::ForceField::ElasticPotential::ElasticPotential
ElasticPotential(std::size_t atom1_idx, std::size_t atom2_idx, double force_const, double ref_length)
Definition: ElasticPotential.hpp:50
CDPL::ForceField::ElasticPotential
Definition: ElasticPotential.hpp:47
CDPL::ForceField::ElasticPotential::getAtom1Index
std::size_t getAtom1Index() const
Definition: ElasticPotential.hpp:53
CDPL::ForceField::ElasticPotential::setReferenceLength
void setReferenceLength(double length)
Definition: ElasticPotential.hpp:73
CDPL::ForceField::ElasticPotential::getForceConstant
double getForceConstant() const
Definition: ElasticPotential.hpp:63
CDPL
The namespace of the Chemical Data Processing Library.
CDPL::ForceField::ElasticPotential::getReferenceLength
double getReferenceLength() const
Definition: ElasticPotential.hpp:68
CDPL::ForceField::ElasticPotential::getAtom2Index
std::size_t getAtom2Index() const
Definition: ElasticPotential.hpp:58
CDPL_FORCEFIELD_API
#define CDPL_FORCEFIELD_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
CDPL::Math::length
VectorNorm2< E >::ResultType length(const VectorExpression< E > &e)
Definition: VectorExpression.hpp:553