Chemical Data Processing Library C++ API - Version 1.1.0
MMFF94VanDerWaalsInteraction.hpp
Go to the documentation of this file.
1 /*
2  * MMFF94VanDerWaalsInteraction.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 terms 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_MMFF94VANDERWAALSINTERACTION_HPP
30 #define CDPL_FORCEFIELD_MMFF94VANDERWAALSINTERACTION_HPP
31 
32 #include <cstddef>
33 #include <cmath>
34 
36 
37 
38 namespace CDPL
39 {
40 
41  namespace ForceField
42  {
43 
45  {
46 
47  public:
49  {
50 
53  ACCEPTOR
54  };
55 
56  MMFF94VanDerWaalsInteraction(std::size_t atom1_idx, std::size_t atom2_idx,
57  double atom_pol1, double eff_el_num1, double fact_a1, double fact_g1,
58  HDonorAcceptorType don_acc_type1, double atom_pol2, double eff_el_num2,
59  double fact_a2, double fact_g2, HDonorAcceptorType don_acc_type2,
60  double expo, double fact_b, double beta, double fact_darad, double fact_daeps):
61  atom1Idx(atom1_idx),
62  atom2Idx(atom2_idx)
63  {
64 
65  bool have_don = false;
66  bool have_don_acc = false;
67 
68  switch (don_acc_type1) {
69 
70  case DONOR:
71  have_don = true;
72  have_don_acc = (don_acc_type2 == ACCEPTOR);
73  break;
74 
75  case ACCEPTOR:
76  have_don_acc = (don_acc_type2 == DONOR);
77  have_don = have_don_acc;
78  break;
79 
80  default:
81  have_don = (don_acc_type2 == DONOR);
82  break;
83  }
84 
85  double rII = fact_a1 * std::pow(atom_pol1, expo);
86  double rJJ = fact_a2 * std::pow(atom_pol2, expo);
87  double gIJ = (rII - rJJ) / (rII + rJJ);
88 
89  rIJ = 0.5 * (rII + rJJ);
90 
91  if (!have_don)
92  rIJ += rIJ * fact_b * (1.0 - std::exp(-beta * gIJ * gIJ));
93 
94  eIJ = 181.16 * fact_g1 * fact_g2 * atom_pol1 * atom_pol2 / (std::pow(atom_pol1 / eff_el_num1, 0.5) + std::pow(atom_pol2 / eff_el_num2, 0.5)) * std::pow(rIJ, -6.0);
95 
96  if (have_don_acc) {
97  rIJ *= fact_darad;
98  eIJ *= fact_daeps;
99  }
100 
101  rIJPow7 = std::pow(rIJ, 7.0);
102  }
103 
104  std::size_t getAtom1Index() const
105  {
106  return atom1Idx;
107  }
108 
109  std::size_t getAtom2Index() const
110  {
111  return atom2Idx;
112  }
113 
114  double getEIJ() const
115  {
116  return eIJ;
117  }
118 
119  double getRIJ() const
120  {
121  return rIJ;
122  }
123 
124  double getRIJPow7() const
125  {
126  return rIJPow7;
127  }
128 
129  private:
130  std::size_t atom1Idx;
131  std::size_t atom2Idx;
132  double eIJ;
133  double rIJ;
134  double rIJPow7;
135  };
136  } // namespace ForceField
137 } // namespace CDPL
138 
139 #endif // CDPL_FORCEFIELD_MMFF94VANDERWAALSINTERACTION_HPP
APIPrefix.hpp
Definition of the preprocessor macro CDPL_FORCEFIELD_API.
CDPL::ForceField::MMFF94VanDerWaalsInteraction::DONOR
@ DONOR
Definition: MMFF94VanDerWaalsInteraction.hpp:52
CDPL::ForceField::MMFF94VanDerWaalsInteraction::getAtom2Index
std::size_t getAtom2Index() const
Definition: MMFF94VanDerWaalsInteraction.hpp:109
CDPL::ForceField::MMFF94VanDerWaalsInteraction::MMFF94VanDerWaalsInteraction
MMFF94VanDerWaalsInteraction(std::size_t atom1_idx, std::size_t atom2_idx, double atom_pol1, double eff_el_num1, double fact_a1, double fact_g1, HDonorAcceptorType don_acc_type1, double atom_pol2, double eff_el_num2, double fact_a2, double fact_g2, HDonorAcceptorType don_acc_type2, double expo, double fact_b, double beta, double fact_darad, double fact_daeps)
Definition: MMFF94VanDerWaalsInteraction.hpp:56
CDPL::ForceField::MMFF94VanDerWaalsInteraction::getEIJ
double getEIJ() const
Definition: MMFF94VanDerWaalsInteraction.hpp:114
CDPL::ForceField::MMFF94VanDerWaalsInteraction::getRIJ
double getRIJ() const
Definition: MMFF94VanDerWaalsInteraction.hpp:119
CDPL::ForceField::MMFF94VanDerWaalsInteraction::getAtom1Index
std::size_t getAtom1Index() const
Definition: MMFF94VanDerWaalsInteraction.hpp:104
CDPL::ForceField::MMFF94VanDerWaalsInteraction
Definition: MMFF94VanDerWaalsInteraction.hpp:45
CDPL::ForceField::MMFF94VanDerWaalsInteraction::HDonorAcceptorType
HDonorAcceptorType
Definition: MMFF94VanDerWaalsInteraction.hpp:49
CDPL
The namespace of the Chemical Data Processing Library.
CDPL::ForceField::MMFF94VanDerWaalsInteraction::NONE
@ NONE
Definition: MMFF94VanDerWaalsInteraction.hpp:51
CDPL_FORCEFIELD_API
#define CDPL_FORCEFIELD_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
CDPL::ForceField::MMFF94VanDerWaalsInteraction::getRIJPow7
double getRIJPow7() const
Definition: MMFF94VanDerWaalsInteraction.hpp:124