Chemical Data Processing Library C++ API - Version 1.4.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 
46  {
47 
48  public:
51  {
52 
58  ACCEPTOR
59  };
60 
81  MMFF94VanDerWaalsInteraction(std::size_t atom1_idx, std::size_t atom2_idx,
82  double atom_pol1, double eff_el_num1, double fact_a1, double fact_g1,
83  HDonorAcceptorType don_acc_type1, double atom_pol2, double eff_el_num2,
84  double fact_a2, double fact_g2, HDonorAcceptorType don_acc_type2,
85  double expo, double fact_b, double beta, double fact_darad, double fact_daeps):
86  atom1Idx(atom1_idx),
87  atom2Idx(atom2_idx)
88  {
89 
90  bool have_don = false;
91  bool have_don_acc = false;
92 
93  switch (don_acc_type1) {
94 
95  case DONOR:
96  have_don = true;
97  have_don_acc = (don_acc_type2 == ACCEPTOR);
98  break;
99 
100  case ACCEPTOR:
101  have_don_acc = (don_acc_type2 == DONOR);
102  have_don = have_don_acc;
103  break;
104 
105  default:
106  have_don = (don_acc_type2 == DONOR);
107  break;
108  }
109 
110  double rII = fact_a1 * std::pow(atom_pol1, expo);
111  double rJJ = fact_a2 * std::pow(atom_pol2, expo);
112  double gIJ = (rII - rJJ) / (rII + rJJ);
113 
114  rIJ = 0.5 * (rII + rJJ);
115 
116  if (!have_don)
117  rIJ += rIJ * fact_b * (1.0 - std::exp(-beta * gIJ * gIJ));
118 
119  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);
120 
121  if (have_don_acc) {
122  rIJ *= fact_darad;
123  eIJ *= fact_daeps;
124  }
125 
126  rIJPow7 = std::pow(rIJ, 7.0);
127  }
128 
133  std::size_t getAtom1Index() const
134  {
135  return atom1Idx;
136  }
137 
142  std::size_t getAtom2Index() const
143  {
144  return atom2Idx;
145  }
146 
151  double getEIJ() const
152  {
153  return eIJ;
154  }
155 
160  double getRIJ() const
161  {
162  return rIJ;
163  }
164 
169  double getRIJPow7() const
170  {
171  return rIJPow7;
172  }
173 
174  private:
175  std::size_t atom1Idx;
176  std::size_t atom2Idx;
177  double eIJ;
178  double rIJ;
179  double rIJPow7;
180  };
181  } // namespace ForceField
182 } // namespace CDPL
183 
184 #endif // CDPL_FORCEFIELD_MMFF94VANDERWAALSINTERACTION_HPP
Stores parameters for a single MMFF94 Van der Waals interaction between two non-bonded atoms.
Definition: MMFF94VanDerWaalsInteraction.hpp:46
std::size_t getAtom2Index() const
Returns the zero-based index of the second atom.
Definition: MMFF94VanDerWaalsInteraction.hpp:142
std::size_t getAtom1Index() const
Returns the zero-based index of the first atom.
Definition: MMFF94VanDerWaalsInteraction.hpp:133
double getEIJ() const
Returns the combined well-depth parameter .
Definition: MMFF94VanDerWaalsInteraction.hpp:151
double getRIJPow7() const
Returns the pre-computed seventh power of .
Definition: MMFF94VanDerWaalsInteraction.hpp:169
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)
Constructs the Van der Waals interaction parameter set and pre-computes some coordinates invariant MM...
Definition: MMFF94VanDerWaalsInteraction.hpp:81
HDonorAcceptorType
MMFF94 hydrogen-bond donor/acceptor classification of an atom.
Definition: MMFF94VanDerWaalsInteraction.hpp:51
@ NONE
The atom is neither a hydrogen-bond donor nor an acceptor.
Definition: MMFF94VanDerWaalsInteraction.hpp:54
@ DONOR
The atom is a hydrogen-bond donor.
Definition: MMFF94VanDerWaalsInteraction.hpp:56
@ ACCEPTOR
The atom is a hydrogen-bond acceptor.
Definition: MMFF94VanDerWaalsInteraction.hpp:58
double getRIJ() const
Returns the combined minimum-energy distance .
Definition: MMFF94VanDerWaalsInteraction.hpp:160
The namespace of the Chemical Data Processing Library.