Scine::Swoose  2.1.0
This is the SCINE module Swoose.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
ImproperDihedralTerm.h
Go to the documentation of this file.
1 
8 #ifndef MMIMPROPERDIHEDRALTERM_H
9 #define MMIMPROPERDIHEDRALTERM_H
10 
11 #include "../Topology/ImproperDihedralType.h"
12 #include "ImproperDihedral.h"
13 #include "InteractionTermBase.h"
15 #include <Utils/Typenames.h>
16 
17 namespace Scine {
18 
19 namespace Utils {
20 class AtomicSecondDerivativeCollection;
21 class Tensor33;
22 } // namespace Utils
23 
24 namespace MolecularMechanics {
34  public:
35  using AtomIndex = int;
36 
40  ImproperDihedralTerm(AtomIndex firstAtom, AtomIndex secondAtom, AtomIndex centralAtom, AtomIndex fourthAtom,
41  const ImproperDihedral& improperDihedral, const ImproperDihedralType& typeOfImproperDihedral);
46 
51  Utils::AtomicSecondDerivativeCollection& derivatives) const;
52 
56  static double getTheta(const Eigen::Vector3d& A, const Eigen::Vector3d& B, const Eigen::Vector3d& G);
57 
62 
66  int getFirstAtom() const;
67 
71  int getSecondAtom() const;
72 
76  int getCentralAtom() const;
77 
81  int getFourthAtom() const;
82 
83  private:
86  void setSecondDerivative(Utils::AutomaticDifferentiation::Second3D& h, const Utils::Tensor33& tensor, double derFirst,
87  double derSecond) const;
88 
89  AtomIndex firstAtom_, secondAtom_, centralAtom_, fourthAtom_;
90  ImproperDihedral improperDihedral_;
91  ImproperDihedralType typeOfImproperDihedral_;
92 };
93 
94 } // namespace MolecularMechanics
95 } // namespace Scine
96 
97 #endif // MMIMPROPERDIHEDRALTERM_H
int getFirstAtom() const
Getter for first atom.
Definition: ImproperDihedralTerm.cpp:163
int getFourthAtom() const
Getter for fourth atom.
Definition: ImproperDihedralTerm.cpp:175
int getCentralAtom() const
Getter for central atom.
Definition: ImproperDihedralTerm.cpp:171
Class treating an improper dihedral interaction, based solely on the angle (in rad), i.e. in 1 dimension.
Definition: ImproperDihedral.h:19
int getSecondAtom() const
Getter for second atom.
Definition: ImproperDihedralTerm.cpp:167
double evaluateImproperDihedralTerm(const Utils::PositionCollection &positions, Utils::AtomicSecondDerivativeCollection &derivatives) const
Evaluates energy contribution and adds the derivatives.
Definition: ImproperDihedralTerm.cpp:30
Base class for all interaction terms.
Definition: InteractionTermBase.h:18
ImproperDihedralType getTypeOfImproperDihedral() const
Getter for the improper dihedral type.
Definition: ImproperDihedralTerm.cpp:159
Class evaluating improper dihedral interaction for four given atoms.
Definition: ImproperDihedralTerm.h:33
static double getTheta(const Eigen::Vector3d &A, const Eigen::Vector3d &B, const Eigen::Vector3d &G)
Calculates and returns the improper dihedral angle theta from the three essential vectors A...
Definition: ImproperDihedralTerm.cpp:140
Unique descriptor an improper dihedral for given atom types. (useful for maps/unordered_maps) ...
Definition: ImproperDihedralType.h:24
ImproperDihedralTerm(AtomIndex firstAtom, AtomIndex secondAtom, AtomIndex centralAtom, AtomIndex fourthAtom, const ImproperDihedral &improperDihedral, const ImproperDihedralType &typeOfImproperDihedral)
Constructor from four atoms and instances of an ImproperDihedral and an ImproperDihedralType.
Definition: ImproperDihedralTerm.cpp:17