Scine::Sparrow  5.1.0
Library for fast and agile quantum chemical calculations with semiempirical methods.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
NDDOMethodWrapper.h
Go to the documentation of this file.
1 
7 #ifndef SPARROW_NDDOMETHODWRAPPER_H
8 #define SPARROW_NDDOMETHODWRAPPER_H
9 
13 
14 namespace Scine {
15 
16 namespace Utils {
17 class Settings;
18 class ScfMethod;
19 class SpinAdaptedMatrix;
20 } // namespace Utils
21 
22 namespace Sparrow {
23 class CISData;
24 class DipoleMatrixCalculator;
25 
31  : public Utils::CloneInterface<Utils::Abstract<NDDOMethodWrapper>, GenericMethodWrapper, Core::Calculator> {
32  public:
38  ~NDDOMethodWrapper() override;
44  Utils::PropertyList possibleProperties() const override;
45 
46  friend class NDDOStatesHandler;
47 
52  CISData getCISData() const;
53 
58  bool allowsPythonGILRelease() const override {
59  return true;
60  };
61 
62  protected:
63  // Extracted method from all copy constructors and copy assignment operators.
64  template<class NDDOMethod>
65  void copyInto(NDDOMethod& instance, const NDDOMethod& classToCopy) {
66  auto results = classToCopy.results();
67  instance.settings() = classToCopy.settings();
68  // Concurrent calling of the logger introduces race conditions
69  // that eventually trigger a segfault
70  instance.setStructure(*classToCopy.getStructure());
71  instance.results() = std::move(results);
72  instance.loadState(classToCopy.getState());
73  instance.setLog(classToCopy.getLog());
74  }
75  virtual Eigen::MatrixXd getOneElectronMatrix() const = 0;
76  virtual Utils::SpinAdaptedMatrix getTwoElectronMatrix() const = 0;
77  virtual CISData getCISDataImpl() const = 0;
78  void assembleResults(const std::string& description) final;
79 
80  void applySettings(std::unique_ptr<Utils::Settings>& settings, Utils::ScfMethod& method);
81  bool getZPVEInclusion() const final;
82 };
83 
84 } // namespace Sparrow
85 } // namespace Scine
86 
87 #endif // SPARROW_NDDOMETHODWRAPPER_H
bool allowsPythonGILRelease() const override
Whether the calculator has no underlying Python code and can therefore release the global interpreter...
Definition: NDDOMethodWrapper.h:58
Abstract class acting as a genericWrapper for NDDO methods.
Definition: NDDOMethodWrapper.h:30
CISData getCISData() const
This function is needed in the calcualtion of the CIS matrix in linear response method.
Definition: NDDOMethodWrapper.cpp:105
Utils::PropertyList possibleProperties() const override
Get the list of the possible properties to calculate analytically. Since it is the same for all NDDO...
Definition: NDDOMethodWrapper.cpp:28
NDDOMethodWrapper()
Constructor. It plays with the befriended states handler by giving it a *this reference.
This class contains the infos needed to perform a CIS calculation. This way excited states properties...
Definition: CISData.h:24