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
MNDORepulsionEnergy.h
Go to the documentation of this file.
1 
8 #ifndef SPARROW_MNDOREPULSIONENERGY_H
9 #define SPARROW_MNDOREPULSIONENERGY_H
10 
11 #include "MNDOPairwiseRepulsion.h"
13 #include <memory>
14 #include <vector>
15 
16 namespace Scine {
17 namespace Utils {
18 enum class DerivativeOrder;
19 }
20 namespace Sparrow {
21 
22 namespace nddo {
23 class ElementParameters;
24 
31  public:
32  using pairRepulsion_t = std::unique_ptr<MNDOPairwiseRepulsion>;
33  using Container = std::vector<std::vector<pairRepulsion_t>>;
34 
37  const ElementParameters& elementParameters);
39  ~MNDORepulsionEnergy() override;
40 
42  void initialize() override;
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 
71 #endif // SPARROW_REPULSIONENERGY_H
Definition: ElementParameters.h:26
void calculateRepulsion(Utils::DerivativeOrder order) override
Starts the calculation of the core-core repulsion up to the.
Definition: MNDORepulsionEnergy.cpp:50
This class sums up the core-core repulsion energies and the corresponding derivatives with respect to...
Definition: MNDORepulsionEnergy.h:30
void addRepulsionDerivatives(Utils::AutomaticDifferentiation::DerivativeContainerType< Utils::Derivative::First > &derivatives) const override
Functions calculating the core-core derivative contributions up to the corresponding derivative order...
MNDORepulsionEnergy(const Utils::ElementTypeCollection &elements, const Utils::PositionCollection &positions, const ElementParameters &elementParameters)
Constructor.
Definition: MNDORepulsionEnergy.cpp:19
~MNDORepulsionEnergy() override
Overrides virtual base class desctructor with default implementation.
void initialize() override
Initializes the core-core repulsion pairs.
Definition: MNDORepulsionEnergy.cpp:26
double getRepulsionEnergy() const override
Sums up all the single core-core contributions to return the overall core-core repulsion energy...
Definition: MNDORepulsionEnergy.cpp:67