Scine::Swoose  2.1.0
This is the SCINE module Swoose.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
QmmmModelAnalyzer.h
Go to the documentation of this file.
1 
8 #ifndef SWOOSE_QMMM_QMMMMODELANALYZER_H
9 #define SWOOSE_QMMM_QMMMMODELANALYZER_H
10 
11 #include <Utils/Constants.h>
12 #include <Eigen/Dense>
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 } // namespace Utils
25 
26 namespace Qmmm {
27 struct QmmmData;
28 struct QmmmModel;
29 
35  public:
44  QmmmModelAnalyzer(const Utils::Settings& settings, Core::Log& log, const QmmmData& data,
45  const Utils::AtomCollection& structure, const std::vector<QmmmModel>& qmmmModelCandidates);
46 
51  int getIndexOfOptimalModel() const;
52 
53  private:
54  // Function that performs the analysis of the reference data
55  void analyzeData();
56  // Function returning a vector of atom indices of the atoms that are close to the center atom
57  std::vector<int> getAtomIndicesCloseToCenterAtom();
58  std::vector<Eigen::RowVector3d> calculateReferenceForces(const std::vector<int>& relevantAtoms);
59  // Calculates the mean error of the forces for a given candidate model (with index 'modelIndex')
60  double calculateMeanErrorForCandidateModel(int modelIndex, const std::vector<int>& relevantAtoms,
61  const std::vector<Eigen::RowVector3d>& referenceForces);
62  // The settings.
63  const Utils::Settings& settings_;
64  // Logger.
65  Core::Log& log_;
66  // The QM/MM reference data
67  const QmmmData& data_;
68  // Molecular structure of the whole system
69  const Utils::AtomCollection& structure_;
70  // QM/MM model candidates
71  const std::vector<QmmmModel>& candidates_;
72  // Index of the optimal candidate model, default of -1 signals that no decision has been made yet
73  int indexOfOptimalModel_ = -1;
74  static constexpr double distanceThresholdForAnalysis_ = 4.0 * Utils::Constants::bohr_per_angstrom; // 4 Angstrom
75 };
76 
77 } // namespace Qmmm
78 } // namespace Scine
79 
80 #endif // SWOOSE_QMMM_QMMMMODELANALYZER_H
Definition: QmmmReferenceDataManager.h:36
int getIndexOfOptimalModel() const
Returns the index of the candidate model that is the optimal choice based on the reference data...
Definition: QmmmModelAnalyzer.cpp:27
QmmmModelAnalyzer(const Utils::Settings &settings, Core::Log &log, const QmmmData &data, const Utils::AtomCollection &structure, const std::vector< QmmmModel > &qmmmModelCandidates)
Constructor. It also already performs the analysis based on the given reference data.
Definition: QmmmModelAnalyzer.cpp:19
TODO.
Definition: QmmmModelAnalyzer.h:34