Loading...
Searching...
No Matches
UFF.h
Go to the documentation of this file.
//
// Copyright (C) 2015-2018 Greg Landrum
//
// @@ All Rights Reserved @@
// This file is part of the RDKit.
// The contents are covered by the terms of the BSD license
// which is included in the file license.txt, found at the root
// of the RDKit source tree.
//
#include <RDGeneral/export.h>
#ifndef RD_UFFCONVENIENCE_H
#define RD_UFFCONVENIENCE_H
#include <ForceField/ForceField.h>
#include <GraphMol/ForceFieldHelpers/FFConvenience.h>
#include <RDGeneral/RDThreads.h>
#include "Builder.h"
namespace RDKit {
class ROMol;
namespace UFF {
//! Convenience function for optimizing a molecule using UFF
/*
\param mol the molecule to use
\param maxIters the maximum number of force-field iterations
\param vdwThresh the threshold to be used in adding van der Waals terms
to the force field. Any non-bonded contact whose current
distance is greater than \c vdwThresh * the minimum value
for that contact will not be included.
\param confId the optional conformer id, if this isn't provided, the
molecule's
default confId will be used.
\param ignoreInterfragInteractions if true, nonbonded terms will not be added
between
fragments
\return a pair with:
first: 0 if the optimization converged, 1 if more iterations are required.
second: the energy
*/
inline std::pair<int, double> UFFOptimizeMolecule(
ROMol &mol, int maxIters = 1000, double vdwThresh = 10.0, int confId = -1,
bool ignoreInterfragInteractions = true) {
ForceFields::ForceField *ff = UFF::constructForceField(
mol, vdwThresh, confId, ignoreInterfragInteractions);
std::pair<int, double> res =
ForceFieldsHelper::OptimizeMolecule(*ff, maxIters);
delete ff;
return res;
}
//! Convenience function for optimizing all of a molecule's conformations using
/// UFF
/*
\param mol the molecule to use
\param res vector of (needsMore,energy)
\param numThreads the number of simultaneous threads to use (only has an
effect if the RDKit is compiled with thread support).
If set to zero, the max supported by the system will be
used.
\param maxIters the maximum number of force-field iterations
\param vdwThresh the threshold to be used in adding van der Waals terms
to the force field. Any non-bonded contact whose current
distance is greater than \c vdwThresh * the minimum value
for that contact will not be included.
\param ignoreInterfragInteractions if true, nonbonded terms will not be added
between
fragments
*/
inline void UFFOptimizeMoleculeConfs(ROMol &mol,
std::vector<std::pair<int, double>> &res,
int numThreads = 1, int maxIters = 1000,
double vdwThresh = 10.0,
bool ignoreInterfragInteractions = true) {
ForceFields::ForceField *ff =
UFF::constructForceField(mol, vdwThresh, -1, ignoreInterfragInteractions);
ForceFieldsHelper::OptimizeMoleculeConfs(mol, *ff, res, numThreads, maxIters);
delete ff;
}
} // end of namespace UFF
} // end of namespace RDKit
#endif
FFConvenience.h
ForceField.h
RDThreads.h
Builder.h
ForceFields::ForceField
A class to store forcefields and handle minimization.
Definition ForceField.h:79
RDKit::ROMol
Definition ROMol.h:199
export.h
RDKit::ForceFieldsHelper::OptimizeMoleculeConfs
void OptimizeMoleculeConfs(ROMol &mol, ForceFields::ForceField &ff, std::vector< std::pair< int, double > > &res, int numThreads=1, int maxIters=1000)
Definition FFConvenience.h:114
RDKit::ForceFieldsHelper::OptimizeMolecule
std::pair< int, double > OptimizeMolecule(ForceFields::ForceField &ff, int maxIters=1000)
Definition FFConvenience.h:93
RDKit::UFF::constructForceField
RDKIT_FORCEFIELDHELPERS_EXPORT 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.
RDKit::UFF::UFFOptimizeMoleculeConfs
void UFFOptimizeMoleculeConfs(ROMol &mol, std::vector< std::pair< int, double > > &res, int numThreads=1, int maxIters=1000, double vdwThresh=10.0, bool ignoreInterfragInteractions=true)
Definition UFF.h:70
RDKit::UFF::UFFOptimizeMolecule
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.
Definition UFF.h:40
RDKit
Std stuff.
Definition Abbreviations.h:19
RDKit::rdvalue_is
bool rdvalue_is(const RDValue_cast_t)
Definition RDValue-doublemagic.h:372