Scine::Swoose  2.0.0
This is the SCINE module Swoose.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
LennardJonesTerm.h
Go to the documentation of this file.
1 
8 #ifndef MOLECULARMECHANICS_LENNARDJONESTERM_H
9 #define MOLECULARMECHANICS_LENNARDJONESTERM_H
10 
11 #include "InteractionTermBase.h"
12 #include "LennardJones.h"
13 #include <Utils/Typenames.h>
14 #include <memory>
15 #include <vector>
16 
17 namespace Scine {
18 
19 namespace Utils {
20 class FullSecondDerivativeCollection;
21 } // namespace Utils
22 
23 namespace MolecularMechanics {
29  public:
30  using AtomIndex = int;
31 
35  LennardJonesTerm(AtomIndex firstAtom, AtomIndex secondAtom, const LennardJones& lj, std::shared_ptr<double> cutoffRadius);
36 
41  Utils::FullSecondDerivativeCollection& derivatives) const;
42 
44  int getFirstAtom() const;
46  int getSecondAtom() const;
47 
48  private:
49  AtomIndex firstAtom_, secondAtom_;
50  LennardJones lj_;
51  // Pointer so that it is updated whenever the settings are updated.
52  // Reference does not work because then the class loses its assignment operator.
53  std::shared_ptr<double> cutoffRadius_;
54 };
55 
56 } // namespace MolecularMechanics
57 } // namespace Scine
58 
59 #endif // MOLECULARMECHANICS_LENNARDJONESTERM_H
int getSecondAtom() const
Getter for index of second atom.
Definition: LennardJonesTerm.cpp:41
LennardJonesTerm(AtomIndex firstAtom, AtomIndex secondAtom, const LennardJones &lj, std::shared_ptr< double > cutoffRadius)
Constructor from two atom indices and an instance of the LennardJones class.
Definition: LennardJonesTerm.cpp:15
Class evaluating electrostatic interaction between two atoms.
Definition: LennardJonesTerm.h:28
Base class for all interaction terms.
Definition: InteractionTermBase.h:18
int getFirstAtom() const
Getter for index of first atom.
Definition: LennardJonesTerm.cpp:37
Class treating a non-bonded van der Waals interaction with a LJ potential, based solely on the bond l...
Definition: LennardJones.h:20
double evaluateLennardJonesTerm(const Utils::PositionCollection &positions, Utils::FullSecondDerivativeCollection &derivatives) const
Evaluates energy contribution and adds the derivatives.
Definition: LennardJonesTerm.cpp:20