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