29 #ifndef CDPL_FORCEFIELD_MMFF94ENERGYCALCULATOR_HPP
30 #define CDPL_FORCEFIELD_MMFF94ENERGYCALCULATOR_HPP
56 template <
typename ValueType>
102 template <
typename CoordsArray>
155 ValueType totalEnergy;
156 ValueType bondStretchingEnergy;
157 ValueType angleBendingEnergy;
158 ValueType stretchBendEnergy;
159 ValueType outOfPlaneEnergy;
160 ValueType torsionEnergy;
161 ValueType electrostaticEnergy;
162 ValueType vanDerWaalsEnergy;
163 unsigned int interactionTypes;
172 template <
typename ValueType>
174 interactionData(0), totalEnergy(), bondStretchingEnergy(), angleBendingEnergy(),
175 stretchBendEnergy(), outOfPlaneEnergy(), torsionEnergy(), electrostaticEnergy(),
176 vanDerWaalsEnergy(), interactionTypes(InteractionType::
ALL)
179 template <
typename ValueType>
181 interactionData(&ia_data), totalEnergy(), bondStretchingEnergy(),
182 angleBendingEnergy(), stretchBendEnergy(), outOfPlaneEnergy(), torsionEnergy(), electrostaticEnergy(),
183 vanDerWaalsEnergy(), interactionTypes(InteractionType::
ALL)
186 template <
typename ValueType>
189 interactionTypes = types;
192 template <
typename ValueType>
195 return interactionTypes;
198 template <
typename ValueType>
201 interactionData = &ia_data;
204 template <
typename ValueType>
205 template <
typename CoordsArray>
208 if (!interactionData) {
209 totalEnergy = ValueType();
210 bondStretchingEnergy = ValueType();
211 angleBendingEnergy = ValueType();
212 stretchBendEnergy = ValueType();
213 outOfPlaneEnergy = ValueType();
214 torsionEnergy = ValueType();
215 electrostaticEnergy = ValueType();
216 vanDerWaalsEnergy = ValueType();
221 totalEnergy = ValueType();
224 bondStretchingEnergy = calcMMFF94BondStretchingEnergy<ValueType>(interactionData->getBondStretchingInteractions().getElementsBegin(),
225 interactionData->getBondStretchingInteractions().getElementsEnd(),
227 totalEnergy += bondStretchingEnergy;
230 bondStretchingEnergy = ValueType();
234 angleBendingEnergy = calcMMFF94AngleBendingEnergy<ValueType>(interactionData->getAngleBendingInteractions().getElementsBegin(),
235 interactionData->getAngleBendingInteractions().getElementsEnd(),
237 totalEnergy += angleBendingEnergy;
240 angleBendingEnergy = ValueType();
243 stretchBendEnergy = calcMMFF94StretchBendEnergy<ValueType>(interactionData->getStretchBendInteractions().getElementsBegin(),
244 interactionData->getStretchBendInteractions().getElementsEnd(),
246 totalEnergy += stretchBendEnergy;
249 stretchBendEnergy = ValueType();
252 outOfPlaneEnergy = calcMMFF94OutOfPlaneBendingEnergy<ValueType>(interactionData->getOutOfPlaneBendingInteractions().getElementsBegin(),
253 interactionData->getOutOfPlaneBendingInteractions().getElementsEnd(),
255 totalEnergy += outOfPlaneEnergy;
258 outOfPlaneEnergy = ValueType();
261 torsionEnergy = calcMMFF94TorsionEnergy<ValueType>(interactionData->getTorsionInteractions().getElementsBegin(),
262 interactionData->getTorsionInteractions().getElementsEnd(),
264 totalEnergy += torsionEnergy;
267 torsionEnergy = ValueType();
270 electrostaticEnergy = calcMMFF94ElectrostaticEnergy<ValueType>(interactionData->getElectrostaticInteractions().getElementsBegin(),
271 interactionData->getElectrostaticInteractions().getElementsEnd(),
273 totalEnergy += electrostaticEnergy;
276 electrostaticEnergy = ValueType();
279 vanDerWaalsEnergy = calcMMFF94VanDerWaalsEnergy<ValueType>(interactionData->getVanDerWaalsInteractions().getElementsBegin(),
280 interactionData->getVanDerWaalsInteractions().getElementsEnd(),
282 totalEnergy += vanDerWaalsEnergy;
285 vanDerWaalsEnergy = ValueType();
290 template <
typename ValueType>
296 template <
typename ValueType>
299 return bondStretchingEnergy;
302 template <
typename ValueType>
305 return angleBendingEnergy;
308 template <
typename ValueType>
311 return stretchBendEnergy;
314 template <
typename ValueType>
317 return outOfPlaneEnergy;
320 template <
typename ValueType>
323 return torsionEnergy;
326 template <
typename ValueType>
329 return electrostaticEnergy;
332 template <
typename ValueType>
335 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 class CDPL::ForceField::MMFF94InteractionData.
Calculates the total MMFF94 force field energy for a set of atom 3D coordinates.
Definition: MMFF94EnergyCalculator.hpp:58
MMFF94EnergyCalculator(const MMFF94InteractionData &ia_data)
Constructs the calculator and associates it with the supplied ForceField::MMFF94InteractionData insta...
const ValueType & getTorsionEnergy() const
Returns the torsion energy contribution computed by the most recent operator()() call.
const ValueType & getAngleBendingEnergy() const
Returns the angle-bending energy contribution computed by the most recent operator()() call.
unsigned int getEnabledInteractionTypes() const
Returns the currently enabled interaction-type contributions.
const ValueType & getOutOfPlaneBendingEnergy() const
Returns the out-of-plane bending energy contribution computed by the most recent operator()() call.
void setEnabledInteractionTypes(unsigned int types)
Enables/disables specific MMFF94 interaction-type contributions.
MMFF94EnergyCalculator()
Constructs the calculator without an associated ForceField::MMFF94InteractionData instance.
const ValueType & getBondStretchingEnergy() const
Returns the bond-stretching energy contribution computed by the most recent operator()() call.
const ValueType & getStretchBendEnergy() const
Returns the stretch-bend coupling energy contribution computed by the most recent operator()() call.
const ValueType & getElectrostaticEnergy() const
Returns the electrostatic energy contribution computed by the most recent operator()() call.
const ValueType & getVanDerWaalsEnergy() const
Returns the Van der Waals energy contribution computed by the most recent operator()() call.
void setup(const MMFF94InteractionData &ia_data)
Associates the calculator with the supplied ForceField::MMFF94InteractionData instance.
const ValueType & getTotalEnergy() const
Returns the total MMFF94 energy computed by the most recent operator()() call.
const ValueType & operator()(const CoordsArray &coords)
Computes the total MMFF94 energy of the conformation specified by coords.
Container holding the full set of MMFF94 interaction parameter records for a molecular graph.
Definition: MMFF94InteractionData.hpp:62
constexpr unsigned int ALL
Specifies reactants, agents and products of a reaction.
Definition: ReactionRole.hpp:74
constexpr unsigned int STRETCH_BEND
Specifies a stretch-bend coupling interaction.
Definition: InteractionType.hpp:63
constexpr unsigned int TORSION
Specifies a torsion interaction.
Definition: InteractionType.hpp:73
constexpr unsigned int VAN_DER_WAALS
Specifies a Van der Waals interaction.
Definition: InteractionType.hpp:78
constexpr unsigned int BOND_STRETCHING
Specifies a bond stretching interaction.
Definition: InteractionType.hpp:53
constexpr unsigned int ELECTROSTATIC
Specifies an electrostatic interaction.
Definition: InteractionType.hpp:83
constexpr unsigned int OUT_OF_PLANE_BENDING
Specifies an out-of-plane bending interaction.
Definition: InteractionType.hpp:68
constexpr unsigned int ANGLE_BENDING
Specifies an angle bending interaction.
Definition: InteractionType.hpp:58
The namespace of the Chemical Data Processing Library.