Scine::Swoose  1.0.0
This is the SCINE module Swoose.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
ElectrostaticTerm.h
Go to the documentation of this file.
1 
8 #ifndef MOLECULARMECHANICS_ELECTROSTATICTERM_H
9 #define MOLECULARMECHANICS_ELECTROSTATICTERM_H
10 
11 #include "Electrostatic.h"
12 #include "InteractionTermBase.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  ElectrostaticTerm(AtomIndex firstAtom, AtomIndex secondAtom, const Electrostatic& electrostatic,
36  std::shared_ptr<double> cutoffRadius);
37 
42  const std::vector<double>& atomicCharges, const double& scalingFactorForEachCharge) const;
43 
45  int getFirstAtom() const;
47  int getSecondAtom() const;
48 
49  private:
50  AtomIndex firstAtom_, secondAtom_;
51  Electrostatic electrostatic_;
52  // Pointer so that it is updated whenever the settings are updated.
53  // Reference does not work because then the class loses its assignment operator.
54  std::shared_ptr<double> cutoffRadius_;
55 };
56 
57 } // namespace MolecularMechanics
58 } // namespace Scine
59 
60 #endif // MOLECULARMECHANICS_ELECTROSTATICTERM_H
Class evaluating electrostatic interaction between two atoms.
Definition: ElectrostaticTerm.h:28
double evaluateElectrostaticTerm(const Utils::PositionCollection &positions, Utils::FullSecondDerivativeCollection &derivatives, const std::vector< double > &atomicCharges, const double &scalingFactorForEachCharge) const
Evaluates energy contribution and adds the derivatives.
Definition: ElectrostaticTerm.cpp:19
Base class for all interaction terms.
Definition: InteractionTermBase.h:18
Class treating non-bonded electrostatic interaction, based solely on the bond length. (i.e. in 1 dimension)
Definition: Electrostatic.h:19
ElectrostaticTerm(AtomIndex firstAtom, AtomIndex secondAtom, const Electrostatic &electrostatic, std::shared_ptr< double > cutoffRadius)
Constructor from two atom indices and an instance of the Electrostatic class.
Definition: ElectrostaticTerm.cpp:14
int getSecondAtom() const
Getter for index of second atom.
Definition: ElectrostaticTerm.cpp:45
int getFirstAtom() const
Getter for index of first atom.
Definition: ElectrostaticTerm.cpp:41