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 
47  {
48 
49  public:
54  {
55 
60 
65 
69  ACCEPTOR
70  };
71 
92  MMFF94VanDerWaalsInteraction(std::size_t atom1_idx, std::size_t atom2_idx,
93  double atom_pol1, double eff_el_num1, double fact_a1, double fact_g1,
94  HDonorAcceptorType don_acc_type1, double atom_pol2, double eff_el_num2,
95  double fact_a2, double fact_g2, HDonorAcceptorType don_acc_type2,
96  double expo, double fact_b, double beta, double fact_darad, double fact_daeps):
97  atom1Idx(atom1_idx),
98  atom2Idx(atom2_idx)
99  {
100 
101  bool have_don = false;
102  bool have_don_acc = false;
103 
104  switch (don_acc_type1) {
105 
106  case DONOR:
107  have_don = true;
108  have_don_acc = (don_acc_type2 == ACCEPTOR);
109  break;
110 
111  case ACCEPTOR:
112  have_don_acc = (don_acc_type2 == DONOR);
113  have_don = have_don_acc;
114  break;
115 
116  default:
117  have_don = (don_acc_type2 == DONOR);
118  break;
119  }
120 
121  double rII = fact_a1 * std::pow(atom_pol1, expo);
122  double rJJ = fact_a2 * std::pow(atom_pol2, expo);
123  double gIJ = (rII - rJJ) / (rII + rJJ);
124 
125  rIJ = 0.5 * (rII + rJJ);
126 
127  if (!have_don)
128  rIJ += rIJ * fact_b * (1.0 - std::exp(-beta * gIJ * gIJ));
129 
130  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);
131 
132  if (have_don_acc) {
133  rIJ *= fact_darad;
134  eIJ *= fact_daeps;
135  }
136 
137  rIJPow7 = std::pow(rIJ, 7.0);
138  }
139 
144  std::size_t getAtom1Index() const
145  {
146  return atom1Idx;
147  }
148 
153  std::size_t getAtom2Index() const
154  {
155  return atom2Idx;
156  }
157 
162  double getEIJ() const
163  {
164  return eIJ;
165  }
166 
171  double getRIJ() const
172  {
173  return rIJ;
174  }
175 
180  double getRIJPow7() const
181  {
182  return rIJPow7;
183  }
184 
185  private:
186  std::size_t atom1Idx;
187  std::size_t atom2Idx;
188  double eIJ;
189  double rIJ;
190  double rIJPow7;
191  };
192  } // namespace ForceField
193 } // namespace CDPL
194 
195 #endif // CDPL_FORCEFIELD_MMFF94VANDERWAALSINTERACTION_HPP
Stores parameters for a single MMFF94 Van der Waals interaction between two non-bonded atoms.
Definition: MMFF94VanDerWaalsInteraction.hpp:47
std::size_t getAtom2Index() const
Returns the zero-based index of the second atom.
Definition: MMFF94VanDerWaalsInteraction.hpp:153
std::size_t getAtom1Index() const
Returns the zero-based index of the first atom.
Definition: MMFF94VanDerWaalsInteraction.hpp:144
double getEIJ() const
Returns the combined well-depth parameter .
Definition: MMFF94VanDerWaalsInteraction.hpp:162
double getRIJPow7() const
Returns the pre-computed seventh power of .
Definition: MMFF94VanDerWaalsInteraction.hpp:180
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:92
HDonorAcceptorType
MMFF94 hydrogen-bond donor/acceptor classification of an atom.
Definition: MMFF94VanDerWaalsInteraction.hpp:54
@ NONE
The atom is neither a hydrogen-bond donor nor an acceptor.
Definition: MMFF94VanDerWaalsInteraction.hpp:59
@ DONOR
The atom is a hydrogen-bond donor.
Definition: MMFF94VanDerWaalsInteraction.hpp:64
@ ACCEPTOR
The atom is a hydrogen-bond acceptor.
Definition: MMFF94VanDerWaalsInteraction.hpp:69
double getRIJ() const
Returns the combined minimum-energy distance .
Definition: MMFF94VanDerWaalsInteraction.hpp:171
The namespace of the Chemical Data Processing Library.