10 #ifndef RD_UFFCONVENIENCE_H 11 #define RD_UFFCONVENIENCE_H 39 ROMol &mol,
int maxIters = 1000,
double vdwThresh = 10.0,
int confId = -1,
40 bool ignoreInterfragInteractions =
true) {
42 mol, vdwThresh, confId, ignoreInterfragInteractions);
47 return std::make_pair(res, e);
49 #ifdef RDK_THREADSAFE_SSS 52 std::vector<std::pair<int, double> > *res,
53 unsigned int threadIdx,
54 unsigned int numThreads,
int maxIters) {
59 if (i % numThreads != threadIdx)
continue;
60 for (
unsigned int aidx = 0; aidx < mol->
getNumAtoms(); ++aidx) {
61 ff.
positions()[aidx] = &(*cit)->getAtomPos(aidx);
64 int needsMore = ff.
minimize(maxIters);
66 (*res)[i] = std::make_pair(needsMore, e);
91 std::vector<std::pair<int, double> > &res,
92 int numThreads = 1,
int maxIters = 1000,
93 double vdwThresh = 10.0,
94 bool ignoreInterfragInteractions =
true) {
97 if (numThreads == 1) {
102 ignoreInterfragInteractions);
105 #ifdef RDK_THREADSAFE_SSS 108 mol, vdwThresh, -1, ignoreInterfragInteractions);
109 boost::thread_group tg;
110 for (
int ti = 0; ti < numThreads; ++ti) {
111 tg.add_thread(
new boost::thread(detail::UFFOptimizeMoleculeConfsHelper_,
112 *ff, &mol, &res, ti, numThreads,
unsigned int getNumAtoms(bool onlyExplicit=1) const
returns our number of atoms
RDGeom::PointPtrVect & positions()
returns a reference to our points (a PointPtrVect)
unsigned int getNumConformers() const
int minimize(unsigned int maxIts=200, double forceTol=1e-4, double energyTol=1e-6)
minimizes the energy of the system by following gradients
void UFFOptimizeMoleculeConfs(ROMol &mol, std::vector< std::pair< int, double > > &res, int numThreads=1, int maxIters=1000, double vdwThresh=10.0, bool ignoreInterfragInteractions=true)
Convenience function for optimizing all of a molecule's conformations using.
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.
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
unsigned int getNumThreadsToUse(int target)
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.