RDKit
Open-source cheminformatics and machine learning.
UFF/TorsionConstraint.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2013 Paolo Tosco
3 //
4 // Copyright (C) 2004-2006 Rational Discovery LLC
5 //
6 // @@ All Rights Reserved @@
7 // This file is part of the RDKit.
8 // The contents are covered by the terms of the BSD license
9 // which is included in the file license.txt, found at the root
10 // of the RDKit source tree.
11 //
12 #include <RDGeneral/export.h>
13 #ifndef __RD_UFFTORSIONCONSTRAINT_H__
14 #define __RD_UFFTORSIONCONSTRAINT_H__
15 #include <iostream>
16 #include <ForceField/Contrib.h>
17 
18 namespace ForceFields {
19 namespace UFF {
20 
21 //! A dihedral angle range constraint modelled after a TorsionContrib
23  : public ForceFieldContrib {
24  public:
26  : d_at1Idx(-1), d_at2Idx(-1), d_at3Idx(-1), d_at4Idx(-1){};
27  //! Constructor
28  /*!
29  \param owner pointer to the owning ForceField
30  \param idx1 index of atom1 in the ForceField's positions
31  \param idx2 index of atom2 in the ForceField's positions
32  \param idx3 index of atom3 in the ForceField's positions
33  \param idx4 index of atom4 in the ForceField's positions
34  \param minDihedralDeg minimum dihedral angle
35  \param maxDihedralDeg maximum dihedral angle
36  \param forceConst force Constant
37 
38  */
39  TorsionConstraintContrib(ForceField *owner, unsigned int idx1,
40  unsigned int idx2, unsigned int idx3,
41  unsigned int idx4, double minDihedralDeg,
42  double maxDihedralDeg, double forceConst);
43  TorsionConstraintContrib(ForceField *owner, unsigned int idx1,
44  unsigned int idx2, unsigned int idx3,
45  unsigned int idx4, bool relative,
46  double minDihedralDeg, double maxDihedralDeg,
47  double forceConst);
48 
50  double getEnergy(double *pos) const;
51 
52  void getGrad(double *pos, double *grad) const;
53  virtual TorsionConstraintContrib *copy() const {
54  return new TorsionConstraintContrib(*this);
55  };
56 
57  private:
58  void setParameters(ForceField *owner, unsigned int idx1,
59  unsigned int idx2, unsigned int idx3, unsigned int idx4,
60  double minDihedralDeg, double maxDihedralDeg, double forceConst);
61  double computeDihedralTerm(double dihedral) const;
62  int d_at1Idx, d_at2Idx, d_at3Idx,
63  d_at4Idx; //!< indices of atoms forming the dihedral angle
64  double d_minDihedralDeg,
65  d_maxDihedralDeg; //!< rest amplitudes of the dihedral angle
66  double d_forceConstant; //!< force constant of the angle constraint
67 };
68 } // namespace UFF
69 } // namespace ForceFields
70 #endif
ForceFields::UFF::TorsionConstraintContrib
A dihedral angle range constraint modelled after a TorsionContrib.
Definition: UFF/TorsionConstraint.h:22
ForceFields::ForceField
A class to store forcefields and handle minimization.
Definition: ForceField.h:79
ForceFields::UFF::TorsionConstraintContrib::~TorsionConstraintContrib
~TorsionConstraintContrib()
Definition: UFF/TorsionConstraint.h:49
ForceFields::ForceFieldContrib
abstract base class for contributions to ForceFields
Definition: Contrib.h:18
RDKIT_FORCEFIELD_EXPORT
#define RDKIT_FORCEFIELD_EXPORT
Definition: export.h:255
ForceFields
Definition: TorsionAngleM6.h:24
Contrib.h
ForceFields::UFF::TorsionConstraintContrib::TorsionConstraintContrib
TorsionConstraintContrib()
Definition: UFF/TorsionConstraint.h:25
ForceFields::UFF::TorsionConstraintContrib::copy
virtual TorsionConstraintContrib * copy() const
return a copy
Definition: UFF/TorsionConstraint.h:53
export.h