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
Repulsion.h
Go to the documentation of this file.
1 
8 #ifndef SPARROW_DFTB_REPULSION_H
9 #define SPARROW_DFTB_REPULSION_H
10 
11 #include "DFTBCommon.h"
13 #include <memory>
14 #include <vector>
15 
16 namespace Scine {
17 namespace Sparrow {
18 
19 namespace dftb {
20 class PairwiseRepulsion;
21 
23  public:
24  Repulsion(const Utils::ElementTypeCollection& elements, const Utils::PositionCollection& positions,
25  const DFTBCommon::DiatomicParameterContainer& diatomicParameters);
26  ~Repulsion() override;
27 
28  using PairRepulsion = std::unique_ptr<dftb::PairwiseRepulsion>;
29  using Container = std::vector<std::vector<PairRepulsion>>;
30 
31  void initialize() override;
32  void calculateRepulsion(Utils::DerivativeOrder order) override;
33  double getRepulsionEnergy() const override;
34  void addRepulsionDerivatives(Utils::AutomaticDifferentiation::DerivativeContainerType<Utils::Derivative::First>& derivatives) const override;
35  void addRepulsionDerivatives(
36  Utils::AutomaticDifferentiation::DerivativeContainerType<Utils::Derivative::SecondAtomic>& derivatives) const override;
37  void addRepulsionDerivatives(
38  Utils::AutomaticDifferentiation::DerivativeContainerType<Utils::Derivative::SecondFull>& derivatives) const override;
39 
40  private:
41  template<Utils::Derivative O>
42  void addRepulsionDerivativesImpl(Utils::AutomaticDifferentiation::DerivativeContainerType<O>& derivatives) const;
43  void calculatePairRepulsion(int i, int j, Utils::DerivativeOrder order);
44  void initializePair(int i, int j);
45 
46  int nAtoms_;
47  Container pairRepulsions_;
48  const DFTBCommon::DiatomicParameterContainer& diatomicParameters_;
49 };
50 
51 } // namespace dftb
52 
53 } // namespace Sparrow
54 } // namespace Scine
55 #endif // SPARROW_DFTB_REPULSION_H
Definition: Repulsion.h:22