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
MultipoleMultipoleInteraction.h
Go to the documentation of this file.
1 
8 #ifndef SPARROW_MULTIPOLEMULTIPOLEINTERACTION_H
9 #define SPARROW_MULTIPOLEMULTIPOLEINTERACTION_H
10 
11 #include "MultipoleMultipoleTerm.h"
13 #include <list>
14 
15 namespace Scine {
16 namespace Sparrow {
17 
18 namespace nddo {
19 
20 namespace multipole {
21 
30  public:
42  template<Utils::DerivativeOrder O>
43  Utils::AutomaticDifferentiation::Value1DType<O> calculate(double R, double D1, double d2, double squaredRhos) const {
44  auto sum = Utils::AutomaticDifferentiation::constant1D<O>(0);
45  for (const auto& t : terms_) {
46  sum += t.calculate<O>(R, D1, d2, squaredRhos);
47  }
48  return sum;
49  }
50 
55  void add(const MultipoleMultipoleTerm& m) {
56  terms_.push_back(m);
57  }
59  unsigned int size() const {
60  return static_cast<unsigned int>(terms_.size());
61  }
62 
63  private:
64  std::list<MultipoleMultipoleTerm> terms_;
65 };
66 
67 } // namespace multipole
68 
69 } // namespace nddo
70 
71 } // namespace Sparrow
72 } // namespace Scine
73 #endif // SPARROW_MULTIPOLEMULTIPOLEINTERACTION_H
This header-only class performs the actual calculation of the multipole-multipole interaction...
Definition: MultipoleMultipoleInteraction.h:29
unsigned int size() const
gets the current size of the std::list&lt;MultipoleMultipoleTerm&gt; containing the charge configurations ...
Definition: MultipoleMultipoleInteraction.h:59
void add(const MultipoleMultipoleTerm &m)
add an interaction between two charges in the multipoles to the total interaction ...
Definition: MultipoleMultipoleInteraction.h:55
Utils::AutomaticDifferentiation::Value1DType< O > calculate(double R, double D1, double d2, double squaredRhos) const
calculates the complete interaction between two multipoles whose single interactions have been stored...
Definition: MultipoleMultipoleInteraction.h:43
This header-only class defines an object for the calculation of an interaction between two charges in...
Definition: MultipoleMultipoleTerm.h:32