RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
TorsionAngleM6.h
Go to the documentation of this file.
1//
2// Copyright (C) 2015 Sereina Riniker and other RDKit contributors
3//
4// @@ All Rights Reserved @@
5// This file is part of the RDKit.
6// The contents are covered by the terms of the BSD license
7// which is included in the file license.txt, found at the root
8// of the RDKit source tree.
9//
10#include <RDGeneral/export.h>
11#ifndef RD_TORSIONANGLEM6_H
12#define RD_TORSIONANGLEM6_H
13
14#include <ForceField/Contrib.h>
15#include <tuple>
16#include <vector>
17
18namespace RDGeom {
19class Point3D;
20}
21
22namespace ForceFields {
23class ForceField;
24class ForceFieldContrib;
25} // namespace ForceFields
26
27namespace ForceFields {
28namespace CrystalFF {
29
30//! the torsion term for multiplicity m = 1 - 6
33 public:
35 //! Constructor
36 /*!
37 The torsion is between atom1 - atom2 - atom3 - atom4
38 (i.e the angle between bond atom1-atom2 and bond atom3-atom4
39 while looking down bond atom2-atom3)
40
41 \param owner pointer to the owning ForceField
42 \param idx1 index of atom1 in the ForceField's positions
43 \param idx2 index of atom2 in the ForceField's positions
44 \param idx3 index of atom3 in the ForceField's positions
45 \param idx4 index of atom4 in the ForceField's positions
46 \param V list of 6 force constants
47 \param signs list of 6 signs (+1 or -1)
48 */
50 unsigned int idx2, unsigned int idx3, unsigned int idx4,
51 std::vector<double> V, std::vector<int> signs);
52 double getEnergy(double *pos) const override;
53 void getGrad(double *pos, double *grad) const override;
54 TorsionAngleContribM6 *copy() const override {
55 return new TorsionAngleContribM6(*this);
56 }
57
58 private:
59 int d_at1Idx{-1}, d_at2Idx{-1}, d_at3Idx{-1}, d_at4Idx{-1};
60 std::vector<double> d_V;
61 std::vector<int> d_sign;
62};
63
64//! calculates and returns the torsional energy
66 const std::vector<double> &V, const std::vector<int> &signs,
67 const double cosPhi);
68} // namespace CrystalFF
69} // namespace ForceFields
70#endif
the torsion term for multiplicity m = 1 - 6
double getEnergy(double *pos) const override
returns our contribution to the energy of a position
void getGrad(double *pos, double *grad) const override
calculates our contribution to the gradients of a position
TorsionAngleContribM6 * copy() const override
return a copy
TorsionAngleContribM6(ForceFields::ForceField *owner, unsigned int idx1, unsigned int idx2, unsigned int idx3, unsigned int idx4, std::vector< double > V, std::vector< int > signs)
Constructor.
abstract base class for contributions to ForceFields
Definition Contrib.h:18
A class to store forcefields and handle minimization.
Definition ForceField.h:79
#define RDKIT_FORCEFIELDHELPERS_EXPORT
Definition export.h:193
RDKIT_FORCEFIELDHELPERS_EXPORT double calcTorsionEnergyM6(const std::vector< double > &V, const std::vector< int > &signs, const double cosPhi)
calculates and returns the torsional energy