RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
UFF.h
Go to the documentation of this file.
1//
2// Copyright (C) 2015-2018 Greg Landrum
3//
4// @@ All Rights Reserved @@
5// This file is part of the RDKit.
6// The contents are covered by the terms of the BSD license
7// which is included in the file license.txt, found at the root
8// of the RDKit source tree.
9//
10#include <RDGeneral/export.h>
11#ifndef RD_UFFCONVENIENCE_H
12#define RD_UFFCONVENIENCE_H
15#include <RDGeneral/RDThreads.h>
16#include "Builder.h"
17
18namespace RDKit {
19class ROMol;
20namespace UFF {
21//! Convenience function for optimizing a molecule using UFF
22/*
23 \param mol the molecule to use
24 \param maxIters the maximum number of force-field iterations
25 \param vdwThresh the threshold to be used in adding van der Waals terms
26 to the force field. Any non-bonded contact whose current
27 distance is greater than \c vdwThresh * the minimum value
28 for that contact will not be included.
29 \param confId the optional conformer id, if this isn't provided, the
30 molecule's
31 default confId will be used.
32 \param ignoreInterfragInteractions if true, nonbonded terms will not be added
33 between
34 fragments
35
36 \return a pair with:
37 first: 0 if the optimization converged, 1 if more iterations are required.
38 second: the energy
39*/
40inline std::pair<int, double> UFFOptimizeMolecule(
41 ROMol &mol, int maxIters = 1000, double vdwThresh = 10.0, int confId = -1,
42 bool ignoreInterfragInteractions = true) {
43 std::unique_ptr<ForceFields::ForceField> ff(UFF::constructForceField(
45 std::pair<int, double> res =
47 return res;
48}
49
50//! Convenience function for optimizing all of a molecule's conformations using
51/// UFF
52/*
53 \param mol the molecule to use
54 \param res vector of (needsMore,energy)
55 \param numThreads the number of simultaneous threads to use (only has an
56 effect if the RDKit is compiled with thread support).
57 If set to zero, the max supported by the system will be
58 used.
59 \param maxIters the maximum number of force-field iterations
60 \param vdwThresh the threshold to be used in adding van der Waals terms
61 to the force field. Any non-bonded contact whose current
62 distance is greater than \c vdwThresh * the minimum value
63 for that contact will not be included.
64 \param ignoreInterfragInteractions if true, nonbonded terms will not be added
65 between
66 fragments
67
68*/
70 std::vector<std::pair<int, double>> &res,
71 int numThreads = 1, int maxIters = 1000,
72 double vdwThresh = 10.0,
73 bool ignoreInterfragInteractions = true) {
74 std::unique_ptr<ForceFields::ForceField> ff(UFF::constructForceField(
77}
78} // end of namespace UFF
79} // end of namespace RDKit
80#endif
void OptimizeMoleculeConfs(ROMol &mol, ForceFields::ForceField &ff, std::vector< std::pair< int, double > > &res, int numThreads=1, int maxIters=1000)
std::pair< int, double > OptimizeMolecule(ForceFields::ForceField &ff, int maxIters=1000)
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.
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:69
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
Std stuff.
bool rdvalue_is(const RDValue_cast_t)