RDKit
Open-source cheminformatics and machine learning.
UFF/AngleConstraint.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 #ifndef __RD_UFFANGLECONSTRAINT_H__
13 #define __RD_UFFANGLECONSTRAINT_H__
14 #include <iostream>
15 #include <ForceField/Contrib.h>
16 
17 namespace ForceFields {
18 namespace UFF {
19 
20 //! An angle range constraint modelled after a AngleBendContrib
22  public:
23  AngleConstraintContrib() : d_at1Idx(-1), d_at2Idx(-1), d_at3Idx(-1){};
24  //! Constructor
25  /*!
26  \param owner pointer to the owning ForceField
27  \param idx1 index of atom1 in the ForceField's positions
28  \param idx2 index of atom2 in the ForceField's positions
29  \param idx3 index of atom3 in the ForceField's positions
30  \param minAngle minimum angle
31  \param maxAngle maximum angle
32  \param forceConst force Constant
33 
34  */
35  AngleConstraintContrib(ForceField *owner, unsigned int idx1,
36  unsigned int idx2, unsigned int idx3,
37  double minAngleDeg, double maxAngleDeg,
38  double forceConst);
39  AngleConstraintContrib(ForceField *owner, unsigned int idx1,
40  unsigned int idx2, unsigned int idx3, bool relative,
41  double minAngleDeg, double maxAngleDeg,
42  double forceConst);
43 
45  double getEnergy(double *pos) const;
46 
47  void getGrad(double *pos, double *grad) const;
48  virtual AngleConstraintContrib *copy() const {
49  return new AngleConstraintContrib(*this);
50  };
51 
52  private:
53  int d_at1Idx, d_at2Idx, d_at3Idx; //!< indices of atoms forming the angle
54  double d_minAngleDeg, d_maxAngleDeg; //!< rest amplitudes of the angle
55  double d_forceConstant; //!< force constant of the angle constraint
56 };
57 }
58 }
59 #endif
abstract base class for contributions to ForceFields
Definition: Contrib.h:17
An angle range constraint modelled after a AngleBendContrib.
virtual AngleConstraintContrib * copy() const
return a copy
A class to store forcefields and handle minimization.
Definition: ForceField.h:57
void getGrad(double *pos, double *grad) const
calculates our contribution to the gradients of a position
double getEnergy(double *pos) const
returns our contribution to the energy of a position