5 #ifndef __RD_FOURTHDIMCONTRIB_H__ 6 #define __RD_FOURTHDIMCONTRIB_H__ 28 : d_idx(idx), d_weight(weight) {
31 dp_forceField = owner;
38 "force field has wrong dimension");
40 unsigned int pid = d_idx * dp_forceField->dimension() + 3;
41 return d_weight * pos[pid] * pos[pid];
46 void getGrad(
double *pos,
double *grad)
const {
49 "force field has wrong dimension");
51 unsigned int pid = d_idx * dp_forceField->dimension() + 3;
52 grad[pid] += d_weight * pos[pid];
unsigned int dimension() const
returns the dimension of the forcefield
virtual FourthDimContrib * copy() const
return a copy
#define RDKIT_DISTGEOMETRY_EXPORT
double getEnergy(double *pos) const
return the contribution of this contrib to the energy of a given state
abstract base class for contributions to ForceFields
void getGrad(double *pos, double *grad) const
calculate the contribution of this contrib to the gradient at a given
FourthDimContrib(ForceFields::ForceField *owner, unsigned int idx, double weight)
Constructor.
#define PRECONDITION(expr, mess)
A class to store forcefields and handle minimization.