29 #ifndef CDPL_FORCEFIELD_MMFF94ENERGYCALCULATOR_HPP
30 #define CDPL_FORCEFIELD_MMFF94ENERGYCALCULATOR_HPP
44 template <
typename ValueType>
59 template <
typename CoordsArray>
80 ValueType totalEnergy;
81 ValueType bondStretchingEnergy;
82 ValueType angleBendingEnergy;
83 ValueType stretchBendEnergy;
84 ValueType outOfPlaneEnergy;
85 ValueType torsionEnergy;
86 ValueType electrostaticEnergy;
87 ValueType vanDerWaalsEnergy;
88 unsigned int interactionTypes;
97 template <
typename ValueType>
99 interactionData(0), totalEnergy(), bondStretchingEnergy(), angleBendingEnergy(),
100 stretchBendEnergy(), outOfPlaneEnergy(), torsionEnergy(), electrostaticEnergy(),
101 vanDerWaalsEnergy(), interactionTypes(InteractionType::
ALL)
104 template <
typename ValueType>
106 interactionData(&ia_data), totalEnergy(), bondStretchingEnergy(),
107 angleBendingEnergy(), stretchBendEnergy(), outOfPlaneEnergy(), torsionEnergy(), electrostaticEnergy(),
108 vanDerWaalsEnergy(), interactionTypes(InteractionType::
ALL)
111 template <
typename ValueType>
114 interactionTypes = types;
117 template <
typename ValueType>
120 return interactionTypes;
123 template <
typename ValueType>
126 interactionData = &ia_data;
129 template <
typename ValueType>
130 template <
typename CoordsArray>
133 if (!interactionData) {
134 totalEnergy = ValueType();
135 bondStretchingEnergy = ValueType();
136 angleBendingEnergy = ValueType();
137 stretchBendEnergy = ValueType();
138 outOfPlaneEnergy = ValueType();
139 torsionEnergy = ValueType();
140 electrostaticEnergy = ValueType();
141 vanDerWaalsEnergy = ValueType();
146 totalEnergy = ValueType();
149 bondStretchingEnergy = calcMMFF94BondStretchingEnergy<ValueType>(interactionData->getBondStretchingInteractions().getElementsBegin(),
150 interactionData->getBondStretchingInteractions().getElementsEnd(),
152 totalEnergy += bondStretchingEnergy;
155 bondStretchingEnergy = ValueType();
159 angleBendingEnergy = calcMMFF94AngleBendingEnergy<ValueType>(interactionData->getAngleBendingInteractions().getElementsBegin(),
160 interactionData->getAngleBendingInteractions().getElementsEnd(),
162 totalEnergy += angleBendingEnergy;
165 angleBendingEnergy = ValueType();
168 stretchBendEnergy = calcMMFF94StretchBendEnergy<ValueType>(interactionData->getStretchBendInteractions().getElementsBegin(),
169 interactionData->getStretchBendInteractions().getElementsEnd(),
171 totalEnergy += stretchBendEnergy;
174 stretchBendEnergy = ValueType();
177 outOfPlaneEnergy = calcMMFF94OutOfPlaneBendingEnergy<ValueType>(interactionData->getOutOfPlaneBendingInteractions().getElementsBegin(),
178 interactionData->getOutOfPlaneBendingInteractions().getElementsEnd(),
180 totalEnergy += outOfPlaneEnergy;
183 outOfPlaneEnergy = ValueType();
186 torsionEnergy = calcMMFF94TorsionEnergy<ValueType>(interactionData->getTorsionInteractions().getElementsBegin(),
187 interactionData->getTorsionInteractions().getElementsEnd(),
189 totalEnergy += torsionEnergy;
192 torsionEnergy = ValueType();
195 electrostaticEnergy = calcMMFF94ElectrostaticEnergy<ValueType>(interactionData->getElectrostaticInteractions().getElementsBegin(),
196 interactionData->getElectrostaticInteractions().getElementsEnd(),
198 totalEnergy += electrostaticEnergy;
201 electrostaticEnergy = ValueType();
204 vanDerWaalsEnergy = calcMMFF94VanDerWaalsEnergy<ValueType>(interactionData->getVanDerWaalsInteractions().getElementsBegin(),
205 interactionData->getVanDerWaalsInteractions().getElementsEnd(),
207 totalEnergy += vanDerWaalsEnergy;
210 vanDerWaalsEnergy = ValueType();
215 template <
typename ValueType>
221 template <
typename ValueType>
224 return bondStretchingEnergy;
227 template <
typename ValueType>
230 return angleBendingEnergy;
233 template <
typename ValueType>
236 return stretchBendEnergy;
239 template <
typename ValueType>
242 return outOfPlaneEnergy;
245 template <
typename ValueType>
248 return torsionEnergy;
251 template <
typename ValueType>
254 return electrostaticEnergy;
257 template <
typename ValueType>
260 return vanDerWaalsEnergy;
Utility functions used in the calculation of force field energies and gradients.
Definition of constants in namespace CDPL::ForceField::InteractionType.
Functions for the calculation of MMFF94 interaction energies.
Definition of the class CDPL::ForceField::MMFF94InteractionData.
Definition: MMFF94EnergyCalculator.hpp:46
MMFF94EnergyCalculator(const MMFF94InteractionData &ia_data)
const ValueType & getTorsionEnergy() const
const ValueType & getAngleBendingEnergy() const
unsigned int getEnabledInteractionTypes() const
const ValueType & getOutOfPlaneBendingEnergy() const
void setEnabledInteractionTypes(unsigned int types)
const ValueType & getBondStretchingEnergy() const
const ValueType & getStretchBendEnergy() const
const ValueType & getElectrostaticEnergy() const
const ValueType & getVanDerWaalsEnergy() const
void setup(const MMFF94InteractionData &ia_data)
const ValueType & getTotalEnergy() const
const ValueType & operator()(const CoordsArray &coords)
Definition: MMFF94InteractionData.hpp:51
constexpr unsigned int ALL
Specifies reactants, agents and products of a reaction.
Definition: ReactionRole.hpp:74
constexpr unsigned int STRETCH_BEND
Definition: InteractionType.hpp:48
constexpr unsigned int TORSION
Definition: InteractionType.hpp:50
constexpr unsigned int VAN_DER_WAALS
Definition: InteractionType.hpp:51
constexpr unsigned int BOND_STRETCHING
Definition: InteractionType.hpp:46
constexpr unsigned int ELECTROSTATIC
Definition: InteractionType.hpp:52
constexpr unsigned int OUT_OF_PLANE_BENDING
Definition: InteractionType.hpp:49
constexpr unsigned int ANGLE_BENDING
Definition: InteractionType.hpp:47
The namespace of the Chemical Data Processing Library.