 |
RDKit
Open-source cheminformatics and machine learning.
|
Go to the documentation of this file.
11 #ifndef __RD_FORCEFIELD_H__
12 #define __RD_FORCEFIELD_H__
15 #include <boost/smart_ptr.hpp>
16 #include <boost/foreach.hpp>
21 namespace ForceFieldsHelper {
24 unsigned int idx2,
unsigned int idx3,
unsigned int idx4,
25 double *dihedral = NULL,
double *cosPhi = NULL,
29 unsigned int idx2,
unsigned int idx3,
unsigned int idx4,
30 double *dihedral = NULL,
double *cosPhi = NULL,
35 double *dihedral = NULL,
double *cosPhi = NULL,
42 class ForceFieldContrib;
44 typedef boost::shared_ptr<const ForceFieldContrib>
ContribPtr;
83 : d_dimension(dimension), df_init(false), d_numPoints(0), dp_distMat(0){};
104 double calcEnergy(std::vector<double> *contribs = NULL)
const;
155 unsigned int maxIts = 200,
double forceTol = 1e-4,
156 double energyTol = 1e-6);
175 int minimize(
unsigned int maxIts = 200,
double forceTol = 1e-4,
176 double energyTol = 1e-6);
203 double distance(
unsigned int i,
unsigned int j,
double *pos = 0);
218 double distance(
unsigned int i,
unsigned int j,
double *pos = 0)
const;
237 unsigned int d_matSize = 0;
std::vector< ContribPtr > ContribPtrVect
const ContribPtrVect & contribs() const
boost::shared_ptr< const ForceFieldContrib > ContribPtr
unsigned int dimension() const
returns the dimension of the forcefield
void initDistanceMatrix()
initializes our internal distance matrix
double distance(unsigned int i, unsigned int j, double *pos=0)
returns the distance between two points
ContribPtrVect d_contribs
contributions to the energy
double calcEnergy(double *pos)
calculates and returns the energy of the position passed in
void initialize()
does initialization
A class to store forcefields and handle minimization.
unsigned int numPoints() const
returns the number of points the ForceField is handling
void RDKIT_FORCEFIELD_EXPORT computeDihedral(const RDGeom::PointPtrVect &pos, unsigned int idx1, unsigned int idx2, unsigned int idx3, unsigned int idx4, double *dihedral=NULL, double *cosPhi=NULL, RDGeom::Point3D r[4]=NULL, RDGeom::Point3D t[2]=NULL, double d[2]=NULL)
int minimize(unsigned int snapshotFreq, RDKit::SnapshotVect *snapshotVect, unsigned int maxIts=200, double forceTol=1e-4, double energyTol=1e-6)
minimizes the energy of the system by following gradients
int minimize(unsigned int maxIts=200, double forceTol=1e-4, double energyTol=1e-6)
minimizes the energy of the system by following gradients
RDGeom::PointPtrVect d_positions
pointers to the points we're using
ContribPtrVect & contribs()
returns a reference to our contribs (a ContribPtrVect)
RDGeom::PointPtrVect & positions()
returns a reference to our points (a PointPtrVect)
double distance(unsigned int i, unsigned int j, double *pos=0) const
returns the distance between two points
double * dp_distMat
our internal distance matrix
#define RDKIT_FORCEFIELD_EXPORT
void calcGrad(double *pos, double *forces)
calculates the gradient of the energy at the provided position
const INT_VECT & fixedPoints() const
std::vector< int > INT_VECT
std::vector< Snapshot > SnapshotVect
ForceField(unsigned int dimension=3)
construct with a dimension
bool df_init
whether or not we've been initialized
void calcGrad(double *forces) const
calculates the gradient of the energy at the current position
ForceField(const ForceField &other)
copy ctor, copies contribs.
void RDKIT_FORCEFIELD_EXPORT normalizeAngleDeg(double &angleDeg)
double calcEnergy(std::vector< double > *contribs=NULL) const
calculates and returns the energy (in kcal/mol) based on existing
void scatter(double *pos) const
scatter our positions into an array
unsigned int d_numPoints
the number of active points
const RDGeom::PointPtrVect & positions() const
void gather(double *pos)
update our positions from an array
std::vector< RDGeom::Point * > PointPtrVect