4 #ifndef __RD_FOURTHDIMCONTRIB_H__ 5 #define __RD_FOURTHDIMCONTRIB_H__ 26 double weight) : d_idx(idx), d_weight(weight) {
38 return d_weight*pos[pid]*pos[pid];
42 void getGrad(
double *pos,
double *grad)
const {
47 grad[pid] += d_weight*pos[pid];
abstract base class for contributions to ForceFields
ForceField * dp_forceField
our owning ForceField
FourthDimContrib(ForceFields::ForceField *owner, unsigned int idx, double weight)
Constructor.
void getGrad(double *pos, double *grad) const
calculate the contribution of this contrib to the gradient at a given state
double getEnergy(double *pos) const
return the contribution of this contrib to the energy of a given state
virtual FourthDimContrib * copy() const
return a copy
#define PRECONDITION(expr, mess)
unsigned int dimension() const
returns the dimension of the forcefield
A class to store forcefields and handle minimization.