RDKit: PositionConstraint.h Source File

| RDKit Open-source cheminformatics and machine learning.

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

UFF/PositionConstraint.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_UFFPOSITIONCONSTRAINT_H__
13 #define __RD_UFFPOSITIONCONSTRAINT_H__
14 #include <iostream>
15 #include <ForceField/Contrib.h>
16 #include <Geometry/point.h>
17
18 namespace ForceFields {
19 namespace UFF {
20
21 //! A position constraint of the type 0.5k * deltaX^2
22 class PositionConstraintContrib : public ForceFieldContrib {
23 public:
24 PositionConstraintContrib() : d_atIdx(-1){};
25 //! Constructor
26 /*!
27 \param owner pointer to the owning ForceField
28 \param idx index of the atom in the ForceField's positions
29 \param minDispl minimum displacement
30 \param maxDispl maximum displacement
31 \param forceConst force constant
32
33 */
34 PositionConstraintContrib(ForceField *owner, unsigned int idx,
35 double maxDispl, double forceConst);
36
37 ~PositionConstraintContrib() {}
38 double getEnergy(double *pos) const;
39
40 void getGrad(double *pos, double *grad) const;
41 virtual PositionConstraintContrib *copy() const {
42 return new PositionConstraintContrib(*this);
43 };
44
45 private:
46 int d_atIdx; //!< index of the restrained atom
47 double d_maxDispl; //!< maximum allowed displacement
48 RDGeom::Point3D d_pos0; //!< reference position
49 double d_forceConstant; //!< force constant of the bond
50 };
51 }
52 }
53 #endif
point.h
ForceFields::UFF::PositionConstraintContrib::getGrad
void getGrad(double *pos, double *grad) const
calculates our contribution to the gradients of a position
ForceFields::ForceFieldContrib
abstract base class for contributions to ForceFields
Definition: Contrib.h:17
Contrib.h
ForceFields::UFF::PositionConstraintContrib::getEnergy
double getEnergy(double *pos) const
returns our contribution to the energy of a position
ForceFields
Definition: TorsionAngleM6.h:23
ForceFields::UFF::PositionConstraintContrib::PositionConstraintContrib
PositionConstraintContrib()
Definition: UFF/PositionConstraint.h:24
ForceFields::UFF::PositionConstraintContrib
A position constraint of the type 0.5k * deltaX^2.
Definition: UFF/PositionConstraint.h:22
ForceFields::UFF::PositionConstraintContrib::~PositionConstraintContrib
~PositionConstraintContrib()
Definition: UFF/PositionConstraint.h:37
RDGeom::Point3D
Definition: point.h:45
ForceFields::UFF::PositionConstraintContrib::copy
virtual PositionConstraintContrib * copy() const
return a copy
Definition: UFF/PositionConstraint.h:41
ForceFields::ForceField
A class to store forcefields and handle minimization.
Definition: ForceField.h:57