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,
132 double energyTol = 1e-6);
159 double distance(
unsigned int i,
unsigned int j,
double *pos = 0);
174 double distance(
unsigned int i,
unsigned int j,
double *pos = 0)
const;
198 void scatter(
double *pos)
const;
unsigned int numPoints() const
returns the number of points the ForceField is handling
const ContribPtrVect & contribs() const
boost::shared_ptr< const ForceFieldContrib > ContribPtr
ContribPtrVect & contribs()
returns a reference to our contribs (a ContribPtrVect)
RDGeom::PointPtrVect d_positions
pointers to the points we're using
unsigned int dimension() const
returns the dimension of the forcefield
void scatter(double *pos) const
scatter our positions into an array
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
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
double calcEnergy() const
calculates and returns the energy (in kcal/mol) based on existing
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
const RDGeom::PointPtrVect & positions() const
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
void calcGrad(double *forces) const
calculates the gradient of the energy at the current position
std::vector< ContribPtr > ContribPtrVect