RDKit: AngleConstraint.h Source File

| RDKit Open-source cheminformatics and machine learning.

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

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
21 class AngleConstraintContrib : public ForceFieldContrib {
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
44 ~AngleConstraintContrib() {}
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
ForceFields::UFF::AngleConstraintContrib::AngleConstraintContrib
AngleConstraintContrib()
Definition: UFF/AngleConstraint.h:23
ForceFields::UFF::AngleConstraintContrib::~AngleConstraintContrib
~AngleConstraintContrib()
Definition: UFF/AngleConstraint.h:44
ForceFields::ForceFieldContrib
abstract base class for contributions to ForceFields
Definition: Contrib.h:17
ForceFields::UFF::AngleConstraintContrib
An angle range constraint modelled after a AngleBendContrib.
Definition: UFF/AngleConstraint.h:21
Contrib.h
ForceFields
Definition: TorsionAngleM6.h:23
ForceFields::UFF::AngleConstraintContrib::copy
virtual AngleConstraintContrib * copy() const
return a copy
Definition: UFF/AngleConstraint.h:48
ForceFields::ForceField
A class to store forcefields and handle minimization.
Definition: ForceField.h:56
ForceFields::UFF::AngleConstraintContrib::getGrad
void getGrad(double *pos, double *grad) const
calculates our contribution to the gradients of a position
ForceFields::UFF::AngleConstraintContrib::getEnergy
double getEnergy(double *pos) const
returns our contribution to the energy of a position