Scine::Swoose  2.1.0
This is the SCINE module Swoose.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
DispersionTerm.h
Go to the documentation of this file.
1 
8 #ifndef MOLECULARMECHANICS_DISPERSIONTERM_H
9 #define MOLECULARMECHANICS_DISPERSIONTERM_H
10 
11 #include "Dispersion.h"
12 #include "InteractionTermBase.h"
13 #include <Utils/Dftd3/Dftd3.h>
14 #include <memory>
15 
16 namespace Scine {
17 
18 namespace Utils {
19 class AtomCollection;
20 class FullSecondDerivativeCollection;
21 } // namespace Utils
22 
23 namespace MolecularMechanics {
29  public:
30  using AtomIndex = int;
31 
38  DispersionTerm(AtomIndex firstAtom, AtomIndex secondAtom, const Dispersion& dispersion, std::shared_ptr<double> cutoffRadius);
41 
45  double evaluateDispersionTerm(const std::vector<Utils::Dftd3::Dftd3Atom>& structureOfDftd3Atoms,
47  std::shared_ptr<Utils::Dftd3::Dftd3> d3, Eigen::MatrixXd& R0) const;
49  int getFirstAtom() const;
51  int getSecondAtom() const;
53  Dispersion getDispersion() const;
54 
55  private:
56  AtomIndex firstAtom_, secondAtom_;
57  Dispersion dispersion_;
58  // Pointer so that it is updated whenever the settings are updated.
59  // Reference does not work because then the class loses its assignment operator.
60  std::shared_ptr<double> cutoffRadius_;
61 };
62 
63 } // namespace MolecularMechanics
64 } // namespace Scine
65 #endif // MOLECULARMECHANICS_DISPERSIONTERM_H
DispersionTerm(AtomIndex firstAtom, AtomIndex secondAtom, const Dispersion &dispersion, std::shared_ptr< double > cutoffRadius)
Constructor.
Definition: DispersionTerm.cpp:14
Class treating a dispersion (D3-BJ) interaction, based solely on the bond length. (i...
Definition: Dispersion.h:20
int getFirstAtom() const
Getter for index of first atom.
Definition: DispersionTerm.cpp:58
Base class for all interaction terms.
Definition: InteractionTermBase.h:18
int getSecondAtom() const
Getter for index of second atom.
Definition: DispersionTerm.cpp:62
Class evaluating dispersion (D3-BJ) interaction between two atoms.
Definition: DispersionTerm.h:28
Dispersion getDispersion() const
Getter for the underlying instance of the Dispersion class.
Definition: DispersionTerm.cpp:66
double evaluateDispersionTerm(const std::vector< Utils::Dftd3::Dftd3Atom > &structureOfDftd3Atoms, Utils::FullSecondDerivativeCollection &derivatives, std::shared_ptr< Utils::Dftd3::Dftd3 > d3, Eigen::MatrixXd &R0) const
Evaluates energy contribution and adds the derivatives.
Definition: DispersionTerm.cpp:21