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
MultipoleMultipoleInteractionContainer.h
Go to the documentation of this file.
1 
8 #ifndef SPARROW_MULTIPOLEMULTIPOLEINTERACTIONCONTAINER_H
9 #define SPARROW_MULTIPOLEMULTIPOLEINTERACTIONCONTAINER_H
10 
12 #include "multipoleTypes.h"
13 #include <array>
14 
15 namespace Scine {
16 namespace Sparrow {
17 namespace nddo {
18 namespace multipole {
19 
29  public:
31  using InteractionLists = std::array<std::array<MultipoleMultipoleInteraction, 13>, 13>;
32 
45  template<Utils::DerivativeOrder O>
46  static Utils::AutomaticDifferentiation::Value1DType<O> calculate(Multipole m1, Multipole m2, double R, double D1,
47  double d2, double squaredRhos);
51  static const MultipoleMultipoleInteraction& get(Multipole m1, Multipole m2);
52 
53  private:
54  // Generates the list of monopoles. Is called to generate a static storage object.
55  static InteractionLists generateTermLists();
56  // Generates the charge configurations of the multipoles and constructs a MultipoleMultipoleInteraction based on it.
57  static MultipoleMultipoleInteraction termList(Multipole m1, Multipole m2);
58 };
59 
61  static InteractionLists termLists = generateTermLists();
62  return termLists[static_cast<int>(m1)][static_cast<int>(m2)];
63 }
64 
65 } // namespace multipole
66 } // namespace nddo
67 } // namespace Sparrow
68 } // namespace Scine
69 
70 #endif // SPARROW_MULTIPOLEMULTIPOLEINTERACTIONCONTAINER_H
This header-only class performs the actual calculation of the multipole-multipole interaction...
Definition: MultipoleMultipoleInteraction.h:29
static const MultipoleMultipoleInteraction & get(Multipole m1, Multipole m2)
The function generated the list of multipole interactions statically, and then returns a MultipoleMul...
Definition: MultipoleMultipoleInteractionContainer.h:60
static Utils::AutomaticDifferentiation::Value1DType< O > calculate(Multipole m1, Multipole m2, double R, double D1, double d2, double squaredRhos)
this function calculates all the possible interactions between the two multipoles m1 and m2 ...
This class keeps a list of terms of charge-charge-interactions for a pair of multipoles.
Definition: MultipoleMultipoleInteractionContainer.h:28
std::array< std::array< MultipoleMultipoleInteraction, 13 >, 13 > InteractionLists
InteractionLists is the matrix storing the 13x13 possible interactions.
Definition: MultipoleMultipoleInteractionContainer.h:31