29 #ifndef CDPL_FORCEFIELD_MMFF94ENERGYCALCULATOR_HPP
30 #define CDPL_FORCEFIELD_MMFF94ENERGYCALCULATOR_HPP
55 template <
typename ValueType>
101 template <
typename CoordsArray>
154 ValueType totalEnergy;
155 ValueType bondStretchingEnergy;
156 ValueType angleBendingEnergy;
157 ValueType stretchBendEnergy;
158 ValueType outOfPlaneEnergy;
159 ValueType torsionEnergy;
160 ValueType electrostaticEnergy;
161 ValueType vanDerWaalsEnergy;
162 unsigned int interactionTypes;
171 template <
typename ValueType>
173 interactionData(0), totalEnergy(), bondStretchingEnergy(), angleBendingEnergy(),
174 stretchBendEnergy(), outOfPlaneEnergy(), torsionEnergy(), electrostaticEnergy(),
175 vanDerWaalsEnergy(), interactionTypes(InteractionType::
ALL)
178 template <
typename ValueType>
180 interactionData(&ia_data), totalEnergy(), bondStretchingEnergy(),
181 angleBendingEnergy(), stretchBendEnergy(), outOfPlaneEnergy(), torsionEnergy(), electrostaticEnergy(),
182 vanDerWaalsEnergy(), interactionTypes(InteractionType::
ALL)
185 template <
typename ValueType>
188 interactionTypes = types;
191 template <
typename ValueType>
194 return interactionTypes;
197 template <
typename ValueType>
200 interactionData = &ia_data;
203 template <
typename ValueType>
204 template <
typename CoordsArray>
207 if (!interactionData) {
208 totalEnergy = ValueType();
209 bondStretchingEnergy = ValueType();
210 angleBendingEnergy = ValueType();
211 stretchBendEnergy = ValueType();
212 outOfPlaneEnergy = ValueType();
213 torsionEnergy = ValueType();
214 electrostaticEnergy = ValueType();
215 vanDerWaalsEnergy = ValueType();
220 totalEnergy = ValueType();
223 bondStretchingEnergy = calcMMFF94BondStretchingEnergy<ValueType>(interactionData->getBondStretchingInteractions().getElementsBegin(),
224 interactionData->getBondStretchingInteractions().getElementsEnd(),
226 totalEnergy += bondStretchingEnergy;
229 bondStretchingEnergy = ValueType();
233 angleBendingEnergy = calcMMFF94AngleBendingEnergy<ValueType>(interactionData->getAngleBendingInteractions().getElementsBegin(),
234 interactionData->getAngleBendingInteractions().getElementsEnd(),
236 totalEnergy += angleBendingEnergy;
239 angleBendingEnergy = ValueType();
242 stretchBendEnergy = calcMMFF94StretchBendEnergy<ValueType>(interactionData->getStretchBendInteractions().getElementsBegin(),
243 interactionData->getStretchBendInteractions().getElementsEnd(),
245 totalEnergy += stretchBendEnergy;
248 stretchBendEnergy = ValueType();
251 outOfPlaneEnergy = calcMMFF94OutOfPlaneBendingEnergy<ValueType>(interactionData->getOutOfPlaneBendingInteractions().getElementsBegin(),
252 interactionData->getOutOfPlaneBendingInteractions().getElementsEnd(),
254 totalEnergy += outOfPlaneEnergy;
257 outOfPlaneEnergy = ValueType();
260 torsionEnergy = calcMMFF94TorsionEnergy<ValueType>(interactionData->getTorsionInteractions().getElementsBegin(),
261 interactionData->getTorsionInteractions().getElementsEnd(),
263 totalEnergy += torsionEnergy;
266 torsionEnergy = ValueType();
269 electrostaticEnergy = calcMMFF94ElectrostaticEnergy<ValueType>(interactionData->getElectrostaticInteractions().getElementsBegin(),
270 interactionData->getElectrostaticInteractions().getElementsEnd(),
272 totalEnergy += electrostaticEnergy;
275 electrostaticEnergy = ValueType();
278 vanDerWaalsEnergy = calcMMFF94VanDerWaalsEnergy<ValueType>(interactionData->getVanDerWaalsInteractions().getElementsBegin(),
279 interactionData->getVanDerWaalsInteractions().getElementsEnd(),
281 totalEnergy += vanDerWaalsEnergy;
284 vanDerWaalsEnergy = ValueType();
289 template <
typename ValueType>
295 template <
typename ValueType>
298 return bondStretchingEnergy;
301 template <
typename ValueType>
304 return angleBendingEnergy;
307 template <
typename ValueType>
310 return stretchBendEnergy;
313 template <
typename ValueType>
316 return outOfPlaneEnergy;
319 template <
typename ValueType>
322 return torsionEnergy;
325 template <
typename ValueType>
328 return electrostaticEnergy;
331 template <
typename ValueType>
334 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:57
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 parameters for a molecular graph.
Definition: MMFF94InteractionData.hpp:60
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.