Scine::Sparrow  5.1.0
Library for fast and agile quantum chemical calculations with semiempirical methods.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
PM6RepulsionEnergy.h
Go to the documentation of this file.
1 
8 #ifndef SPARROW_PM6REPULSIONENERGY_H
9 #define SPARROW_PM6REPULSIONENERGY_H
10 
13 #include <Utils/Typenames.h>
14 #include <memory>
15 #include <vector>
16 
17 namespace Scine {
18 
19 namespace Utils {
20 enum class DerivativeOrder;
21 }
22 
23 namespace Sparrow {
24 namespace nddo {
25 class ElementParameters;
26 class ElementPairParameters;
27 
34  public:
35  using pairRepulsion_t = std::unique_ptr<PM6PairwiseRepulsion>;
36  using Container = std::vector<std::vector<pairRepulsion_t>>;
37 
40  const ElementParameters& elementParameters, const ElementPairParameters& pairParameters);
42  ~PM6RepulsionEnergy() override;
43 
45  void initialize() override;
46 
48  void calculateRepulsion(Utils::DerivativeOrder order) override;
50  double getRepulsionEnergy() const override;
52  void addRepulsionDerivatives(Utils::AutomaticDifferentiation::DerivativeContainerType<Utils::Derivative::First>& derivatives) const override;
54  Utils::AutomaticDifferentiation::DerivativeContainerType<Utils::Derivative::SecondAtomic>& derivatives) const override;
56  Utils::AutomaticDifferentiation::DerivativeContainerType<Utils::Derivative::SecondFull>& derivatives) const override;
57 
58  private:
59  template<Utils::Derivative O>
60  void addRepulsionDerivativesImpl(Utils::AutomaticDifferentiation::DerivativeContainerType<O>& derivatives) const;
61 
62  void calculatePairRepulsion(int i, int j, Utils::DerivativeOrder order);
63  void initializePair(int i, int j);
64 
65  const ElementParameters& elementParameters_;
66  const ElementPairParameters& pairParameters_;
67  Container rep_;
68  int nAtoms_;
69 };
70 
71 } // namespace nddo
72 
73 } // namespace Sparrow
74 } // namespace Scine
75 #endif // SPARROW_REPULSIONENERGY_H
void calculateRepulsion(Utils::DerivativeOrder order) override
Starts the calculation of the core-core repulsion up to the.
Definition: PM6RepulsionEnergy.cpp:52
Definition: ElementParameters.h:26
Definition: ElementPairParameters.h:29
void initialize() override
Initializes the core-core repulsion pairs.
Definition: PM6RepulsionEnergy.cpp:27
This class sums up the core-core repulsion energies and the corresponding derivatives with respect to...
Definition: PM6RepulsionEnergy.h:33
double getRepulsionEnergy() const override
Sums up all the single core-core contributions to return the overall core-core repulsion energy...
Definition: PM6RepulsionEnergy.cpp:69
~PM6RepulsionEnergy() override
Overrides virtual base class desctructor with default implementation.
void addRepulsionDerivatives(Utils::AutomaticDifferentiation::DerivativeContainerType< Utils::Derivative::First > &derivatives) const override
Functions calculating the core-core derivative contributions up to the corresponding derivative order...
PM6RepulsionEnergy(const Utils::ElementTypeCollection &elements, const Utils::PositionCollection &positions, const ElementParameters &elementParameters, const ElementPairParameters &pairParameters)
Constructor.
Definition: PM6RepulsionEnergy.cpp:20