5#ifndef __RD_FOURTHDIMCONTRIB_H__
6#define __RD_FOURTHDIMCONTRIB_H__
30 : d_idx(idx), d_weight(weight) {
33 dp_forceField = owner;
40 "force field has wrong dimension");
42 unsigned int pid = d_idx * dp_forceField->dimension() + 3;
43 return d_weight * pos[pid] * pos[pid];
48 void getGrad(
double *pos,
double *grad)
const override {
51 "force field has wrong dimension");
53 unsigned int pid = d_idx * dp_forceField->dimension() + 3;
54 grad[pid] += d_weight * pos[pid];
61 unsigned int d_idx{0};
#define PRECONDITION(expr, mess)
FourthDimContrib(ForceFields::ForceField *owner, unsigned int idx, double weight)
Constructor.
FourthDimContrib * copy() const override
return a copy
void getGrad(double *pos, double *grad) const override
double getEnergy(double *pos) const override
return the contribution of this contrib to the energy of a given state
abstract base class for contributions to ForceFields
A class to store forcefields and handle minimization.
unsigned int dimension() const
returns the dimension of the forcefield
#define RDKIT_DISTGEOMETRY_EXPORT