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