Scine::Swoose  2.1.0
This is the SCINE module Swoose.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
ElectrostaticEvaluator.h
Go to the documentation of this file.
1 
8 #ifndef MOLECULARMECHANICS_ELECTROSTATICEVALUATOR_H
9 #define MOLECULARMECHANICS_ELECTROSTATICEVALUATOR_H
10 
14 #include <Utils/Typenames.h>
15 #include <memory>
16 #include <vector>
17 
18 namespace Scine {
19 
20 namespace Qmmm {
21 class InteractionTermEliminator;
22 } // namespace Qmmm
23 
24 namespace MolecularMechanics {
25 
26 namespace Defaults {
27 static constexpr double defaultAtomicChargesScalingFactor = 1.0;
28 } // namespace Defaults
29 
35  public:
39  ElectrostaticEvaluator(const Utils::PositionCollection& positions, const std::vector<double>& atomicCharges);
43  double evaluate(Utils::DerivativeCollection& derivatives);
47  const std::vector<double>& getAtomicCharges();
51  void setScalingFactor(const double& scalingFactor);
56  void setCutOffRadius(std::shared_ptr<double> cutOffRadius);
57 
58  private:
59  // friend class declaration
61  const Utils::PositionCollection& positions_;
62  const std::vector<double>& atomicCharges_;
63  // Scaling factor applied to each atomic charge.
64  double scalingFactor_ = Defaults::defaultAtomicChargesScalingFactor;
73  double evaluateTermsForAtom(unsigned int atomIndex, Utils::DerivativeCollection& derivatives,
74  const Eigen::SparseVector<bool>& otherAtoms, double scaling);
76  std::shared_ptr<double> cutOffRadius_ = std::make_shared<double>(std::numeric_limits<double>::infinity());
77 };
78 
79 } // namespace MolecularMechanics
80 } // namespace Scine
81 
82 #endif // MOLECULARMECHANICS_ELECTROSTATICEVALUATOR_H
This class keeps track which pair-wise interaction between atoms is scaled. The scaling information i...
Definition: ScaledInteractions.h:22
void setScalingFactor(const double &scalingFactor)
Setter for the scaling factor for each atomic charge.
Definition: ElectrostaticEvaluator.cpp:92
double evaluate(Utils::DerivativeCollection &derivatives)
Function to evaluate and return the total electrostatic energy and update the derivatives.
Definition: ElectrostaticEvaluator.cpp:23
void setCutOffRadius(std::shared_ptr< double > cutOffRadius)
Set the cut off radius for the electrostatic interactions.
Definition: ElectrostaticEvaluator.cpp:95
This class handles the elimination of MM interaction terms, which are already covered by the QM calcu...
Definition: InteractionTermEliminator.h:39
ElectrostaticEvaluator(const Utils::PositionCollection &positions, const std::vector< double > &atomicCharges)
Constructor from positions and partial atomic charges.
Definition: ElectrostaticEvaluator.cpp:16
const std::vector< double > & getAtomicCharges()
Constant accessor for the partial atomic charges.
Definition: ElectrostaticEvaluator.cpp:88
This class provides a framework to store exclusions of interactions between atoms. Such exclusions are required for the non-covalent interactions between bonded atoms or to eliminate contributions to the energy for the interaction between QM atoms in QM/MM.
Definition: InteractionExclusion.h:26
Class evaluating the total energy and derivatives from the electrostatic interactions.
Definition: ElectrostaticEvaluator.h:34