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