10 #ifndef RD_UFFCONVENIENCE_H 11 #define RD_UFFCONVENIENCE_H 15 #ifdef RDK_THREADSAFE_SSS 16 #include <boost/thread.hpp> 40 double vdwThresh=10.0,
int confId=-1,
41 bool ignoreInterfragInteractions=
true ){
43 ignoreInterfragInteractions);
48 return std::make_pair(res,e);
50 #ifdef RDK_THREADSAFE_SSS 54 std::vector< std::pair<int, double> > *res,
55 unsigned int threadIdx,
56 unsigned int numThreads,
62 if(i%numThreads != threadIdx)
continue;
63 for(
unsigned int aidx=0;aidx<mol->
getNumAtoms();++aidx){
64 ff.
positions()[aidx]=&(*cit)->getAtomPos(aidx);
69 (*res)[i] = std::make_pair(needsMore,e);
90 std::vector< std::pair<int, double> > &res,
91 unsigned int numThreads=1,
93 double vdwThresh=10.0,
94 bool ignoreInterfragInteractions=
true ){
96 #ifndef RDK_THREADSAFE_SSS 104 ignoreInterfragInteractions);
107 #ifdef RDK_THREADSAFE_SSS 110 ignoreInterfragInteractions);
111 boost::thread_group tg;
112 for(
unsigned int ti=0;ti<numThreads;++ti){
113 tg.add_thread(
new boost::thread(detail::UFFOptimizeMoleculeConfsHelper_,
115 &mol,&res,ti,numThreads,maxIters));
std::pair< int, double > UFFOptimizeMolecule(ROMol &mol, int maxIters=1000, double vdwThresh=10.0, int confId=-1, bool ignoreInterfragInteractions=true)
Convenience function for optimizing a molecule using UFF.
double calcEnergy() const
calculates and returns the energy (in kcal/mol) based on existing positions in the forcefield ...
unsigned int getNumConformers() const
RDGeom::PointPtrVect & positions()
returns a reference to our points (a PointPtrVect)
void UFFOptimizeMoleculeConfs(ROMol &mol, std::vector< std::pair< int, double > > &res, unsigned int numThreads=1, int maxIters=1000, double vdwThresh=10.0, bool ignoreInterfragInteractions=true)
Convenience function for optimizing all of a molecule's conformations using UFF.
unsigned int getNumAtoms(bool onlyExplicit=1) const
returns our number of atoms
int minimize(unsigned int maxIts=200, double forceTol=1e-4, double energyTol=1e-6)
minimizes the energy of the system by following gradients
ROMol is a molecule class that is intended to have a fixed topology.
void initialize()
does initialization
Includes a bunch of functionality for handling Atom and Bond queries.
ForceFields::ForceField * constructForceField(ROMol &mol, double vdwThresh=100.0, int confId=-1, bool ignoreInterfragInteractions=true)
Builds and returns a UFF force field for a molecule.
ConformerIterator endConformers()
ConformerIterator beginConformers()
A class to store forcefields and handle minimization.