Scine::Swoose  2.1.0
This is the SCINE module Swoose.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
QmmmReferenceDataManager.h
Go to the documentation of this file.
1 
8 #ifndef SWOOSE_QMMM_QMMMREFERENCEDATAMANAGER_H
9 #define SWOOSE_QMMM_QMMMREFERENCEDATAMANAGER_H
10 
11 #include <Eigen/Dense>
12 #include <memory>
13 #include <vector>
14 
15 namespace Scine {
16 
17 namespace Core {
18 struct Log;
19 } // namespace Core
20 
21 namespace Utils {
22 class Settings;
23 class AtomCollection;
24 class BondOrderCollection;
25 } // namespace Utils
26 
27 namespace Qmmm {
28 struct QmmmModel;
29 class QmmmCalculator;
30 using ForcesCollection = Eigen::Matrix<double, Eigen::Dynamic, 3, Eigen::RowMajor>;
31 
36 struct QmmmData {
38  std::vector<ForcesCollection> forces;
40  std::vector<double> symmetryScores;
42  std::vector<int> linkAtomNumbers;
44  int nRef = 0;
45 };
46 
52  public:
56  QmmmReferenceDataManager(std::shared_ptr<QmmmCalculator> qmmmCalculator, const Utils::Settings& settings,
57  Core::Log& log, const Utils::AtomCollection& structure,
58  const Utils::BondOrderCollection& bondOrders, const std::vector<QmmmModel>& qmmmModelCandidates,
59  const std::vector<QmmmModel>& qmmmReferenceModels);
60 
66 
67  private:
68  // Calculates the symmetry scores and stores them in the QM/MM data
69  void calculateSymmetryScores(QmmmData& data) const;
70  // Calculates the number of link atoms for each QM/MM model and stores these values in the QM/MM data
71  void calculateLinkAtomNumbers(QmmmData& data) const;
72  // Perform reference calculations and store results in QmmmData object
73  void handleReferenceCalculations(QmmmData& data);
74  // The settings.
75  const Utils::Settings& settings_;
76  // Logger.
77  Core::Log& log_;
78  // Molecular structure of the whole system
79  const Utils::AtomCollection& structure_;
80  // QM/MM model candidates
81  const std::vector<QmmmModel>& qmmmModelCandidates_;
82  // QM/MM reference models
83  const std::vector<QmmmModel>& qmmmReferenceModels_;
84  // The bond orders of the system
85  const Utils::BondOrderCollection& bondOrders_;
86  // The QMMM Calculator that performs the reference calculations
87  std::shared_ptr<QmmmCalculator> qmmmCalculator_;
88 };
89 
90 } // namespace Qmmm
91 } // namespace Scine
92 
93 #endif // SWOOSE_QMMM_QMMMREFERENCEDATAMANAGER_H
Definition: QmmmReferenceDataManager.h:36
Manages the calculation of all data contained in the QmmmData struct.
Definition: QmmmReferenceDataManager.h:51
std::vector< ForcesCollection > forces
Container for the atomic forces calculated with each QM/MM model.
Definition: QmmmReferenceDataManager.h:38
int nRef
Number of reference calculations. The last nRef data points in the objects above correspond to these...
Definition: QmmmReferenceDataManager.h:44
QmmmData calculateData()
Calculates the properties in the QmmmData struct for the QM/MM candidate models and reference models...
Definition: QmmmReferenceDataManager.cpp:39
std::vector< double > symmetryScores
Container for the symmetry scores for each QM/MM model.
Definition: QmmmReferenceDataManager.h:40
std::vector< int > linkAtomNumbers
Container for the number of link atoms for each QM/MM model.
Definition: QmmmReferenceDataManager.h:42
QmmmReferenceDataManager(std::shared_ptr< QmmmCalculator > qmmmCalculator, const Utils::Settings &settings, Core::Log &log, const Utils::AtomCollection &structure, const Utils::BondOrderCollection &bondOrders, const std::vector< QmmmModel > &qmmmModelCandidates, const std::vector< QmmmModel > &qmmmReferenceModels)
Constructor.
Definition: QmmmReferenceDataManager.cpp:24