Loading...
Searching...
No Matches
StretchBend.h
Go to the documentation of this file.
// Copyright (C) 2013-2025 Paolo Tosco and other RDKit contributors
//
// @@ All Rights Reserved @@
// This file is part of the RDKit.
// The contents are covered by the terms of the BSD license
// which is included in the file license.txt, found at the root
// of the RDKit source tree.
//
#include <RDGeneral/export.h>
#ifndef __RD_MMFFSTRETCHBEND_H__
#define __RD_MMFFSTRETCHBEND_H__
#include <utility>
#include <vector>
#include <ForceField/Contrib.h>
namespace ForceFields {
namespace MMFF {
class MMFFBond;
class MMFFAngle;
class MMFFStbn;
class MMFFProp;
//! The angle-bend term for MMFF
class RDKIT_FORCEFIELD_EXPORT StretchBendContrib : public ForceFieldContrib {
public:
StretchBendContrib() {}
//! Constructor
StretchBendContrib(ForceField *owner);
/*!
Adds a stretch-bend term to the force field contrib.
The angle is between atom1 - atom2 - atom3
\param idx1 index of atom1 in the ForceField's positions
\param idx2 index of atom2 in the ForceField's positions
\param idx3 index of atom3 in the ForceField's positions
\param angleType MMFF type of the angle (as an unsigned int)
*/
void addTerm(const unsigned int idx1, const unsigned int idx2,
const unsigned int idx3, const MMFFStbn *mmffStbnParams,
const MMFFAngle *mmffAngleParams,
const MMFFBond *mmffBondParams1,
const MMFFBond *mmffBondParams2);
double getEnergy(double *pos) const override;
void getGrad(double *pos, double *grad) const override;
StretchBendContrib *copy() const override {
return new StretchBendContrib(*this);
}
private:
std::vector<int16_t> d_at1Idxs;
std::vector<int16_t> d_at2Idxs;
std::vector<int16_t> d_at3Idxs;
std::vector<double> d_restLen1s;
std::vector<double> d_restLen2s;
std::vector<double> d_theta0s;
std::vector<double> d_forceConstants1;
std::vector<double> d_forceConstants2;
};
namespace Utils {
//! returns the std::pair of stretch-bend force constants for an angle
RDKIT_FORCEFIELD_EXPORT std::pair<double, double> calcStbnForceConstants(
const MMFFStbn *mmffStbnParams);
//! calculates and returns the stretch-bending MMFF energy
RDKIT_FORCEFIELD_EXPORT std::pair<double, double> calcStretchBendEnergy(
const double deltaDist1, const double deltaDist2, const double deltaTheta,
const std::pair<double, double> forceConstants);
} // namespace Utils
} // namespace MMFF
} // namespace ForceFields
#endif
Contrib.h
ForceFields::ForceFieldContrib::ForceField
friend class ForceField
Definition Contrib.h:20
ForceFields::ForceFieldContrib::ForceFieldContrib
ForceFieldContrib()
Definition Contrib.h:22
ForceFields::MMFF::MMFFAngle
class to store MMFF parameters for angle bending
Definition MMFF/Params.h:105
ForceFields::MMFF::MMFFBond
class to store MMFF parameters for bond stretching
Definition MMFF/Params.h:81
ForceFields::MMFF::MMFFProp
class to store MMFF Properties
Definition MMFF/Params.h:54
ForceFields::MMFF::MMFFStbn
class to store MMFF parameters for stretch-bending
Definition MMFF/Params.h:112
ForceFields::MMFF::StretchBendContrib::addTerm
void addTerm(const unsigned int idx1, const unsigned int idx2, const unsigned int idx3, const MMFFStbn *mmffStbnParams, const MMFFAngle *mmffAngleParams, const MMFFBond *mmffBondParams1, const MMFFBond *mmffBondParams2)
ForceFields::MMFF::StretchBendContrib::getEnergy
double getEnergy(double *pos) const override
returns our contribution to the energy of a position
ForceFields::MMFF::StretchBendContrib::StretchBendContrib
StretchBendContrib()
Definition StretchBend.h:28
ForceFields::MMFF::StretchBendContrib::getGrad
void getGrad(double *pos, double *grad) const override
calculates our contribution to the gradients of a position
ForceFields::MMFF::StretchBendContrib::StretchBendContrib
StretchBendContrib(ForceField *owner)
Constructor.
ForceFields::MMFF::StretchBendContrib::copy
StretchBendContrib * copy() const override
return a copy
Definition StretchBend.h:48
export.h
RDKIT_FORCEFIELD_EXPORT
#define RDKIT_FORCEFIELD_EXPORT
Definition export.h:201
ForceFields::MMFF::Utils::calcStretchBendEnergy
RDKIT_FORCEFIELD_EXPORT std::pair< double, double > calcStretchBendEnergy(const double deltaDist1, const double deltaDist2, const double deltaTheta, const std::pair< double, double > forceConstants)
calculates and returns the stretch-bending MMFF energy
ForceFields::MMFF::Utils::calcStbnForceConstants
RDKIT_FORCEFIELD_EXPORT std::pair< double, double > calcStbnForceConstants(const MMFFStbn *mmffStbnParams)
returns the std::pair of stretch-bend force constants for an angle
ForceFields::MMFF
Definition MMFF/AngleBend.h:17
ForceFields
Definition TorsionAngleContribs.h:21