Chemical Data Processing Library C++ API - Version 1.1.1
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 
34 
35 namespace CDPL
36 {
37 
38  namespace ForceField
39  {
40 
41  /*
42  * \since 1.1
43  */
45  {
46 
47  public:
48  ElasticPotential(std::size_t atom1_idx, std::size_t atom2_idx, double force_const, double ref_length):
49  atom1Idx(atom1_idx), atom2Idx(atom2_idx), forceConst(force_const), refLength(ref_length) {}
50 
51  std::size_t getAtom1Index() const
52  {
53  return atom1Idx;
54  }
55 
56  std::size_t getAtom2Index() const
57  {
58  return atom2Idx;
59  }
60 
61  double getForceConstant() const
62  {
63  return forceConst;
64  }
65 
66  double getReferenceLength() const
67  {
68  return refLength;
69  }
70 
72  {
73  refLength = length;
74  }
75 
76  private:
77  std::size_t atom1Idx;
78  std::size_t atom2Idx;
79  double forceConst;
80  double refLength;
81  };
82  } // namespace ForceField
83 } // namespace CDPL
84 
85 #endif // CDPL_FORCEFIELD_ELASTICPOTENTIAL_HPP
CDPL::ForceField::ElasticPotential::ElasticPotential
ElasticPotential(std::size_t atom1_idx, std::size_t atom2_idx, double force_const, double ref_length)
Definition: ElasticPotential.hpp:48
CDPL::ForceField::ElasticPotential
Definition: ElasticPotential.hpp:45
CDPL::ForceField::ElasticPotential::getAtom1Index
std::size_t getAtom1Index() const
Definition: ElasticPotential.hpp:51
CDPL::ForceField::ElasticPotential::setReferenceLength
void setReferenceLength(double length)
Definition: ElasticPotential.hpp:71
CDPL::ForceField::ElasticPotential::getForceConstant
double getForceConstant() const
Definition: ElasticPotential.hpp:61
CDPL
The namespace of the Chemical Data Processing Library.
CDPL::ForceField::ElasticPotential::getReferenceLength
double getReferenceLength() const
Definition: ElasticPotential.hpp:66
CDPL::ForceField::ElasticPotential::getAtom2Index
std::size_t getAtom2Index() const
Definition: ElasticPotential.hpp:56
CDPL::Math::length
VectorNorm2< E >::ResultType length(const VectorExpression< E > &e)
Definition: VectorExpression.hpp:553