10 #ifndef __RD_FORCEFIELD_H__ 11 #define __RD_FORCEFIELD_H__ 14 #include <boost/smart_ptr.hpp> 15 #include <boost/foreach.hpp> 21 typedef boost::shared_ptr<const ForceFieldContrib>
ContribPtr;
107 void calcGrad(
double *forces)
const;
118 void calcGrad(
double *pos,
double *forces);
131 int minimize(
unsigned int maxIts=200,
double forceTol=1e-4,
double energyTol=1e-6);
158 double distance(
unsigned int i,
unsigned int j,
double *pos=0);
173 double distance(
unsigned int i,
unsigned int j,
double *pos=0)
const;
199 void scatter(
double *pos)
const;
boost::shared_ptr< const ForceFieldContrib > ContribPtr
ContribPtrVect & contribs()
returns a reference to our contribs (a ContribPtrVect)
const ContribPtrVect & contribs() const
RDGeom::PointPtrVect d_positions
pointers to the points we're using
double calcEnergy() const
calculates and returns the energy (in kcal/mol) based on existing positions in the forcefield ...
std::vector< RDGeom::Point * > PointPtrVect
ContribPtrVect d_contribs
contributions to the energy
RDGeom::PointPtrVect & positions()
returns a reference to our points (a PointPtrVect)
abstract base class for contributions to ForceFields
void scatter(double *pos) const
scatter our positions into an array
int minimize(unsigned int maxIts=200, double forceTol=1e-4, double energyTol=1e-6)
minimizes the energy of the system by following gradients
std::vector< int > INT_VECT
void initialize()
does initialization
void gather(double *pos)
update our positions from an array
void initDistanceMatrix()
initializes our internal distance matrix
ForceField(unsigned int dimension=3)
construct with a dimension
const RDGeom::PointPtrVect & positions() const
void calcGrad(double *forces) const
calculates the gradient of the energy at the current position
unsigned int numPoints() const
returns the number of points the ForceField is handling
double distance(unsigned int i, unsigned int j, double *pos=0)
returns the distance between two points
bool df_init
whether or not we've been initialized
unsigned int dimension() const
returns the dimension of the forcefield
double * dp_distMat
our internal distance matrix
A class to store forcefields and handle minimization.
const INT_VECT & fixedPoints() const
unsigned int d_numPoints
the number of active points
std::vector< ContribPtr > ContribPtrVect