Scine::Swoose  1.0.0
This is the SCINE module Swoose.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
QmRegionSelector.h
Go to the documentation of this file.
1 
8 #ifndef SWOOSE_QMMM_QMREGIONSELECTOR_H
9 #define SWOOSE_QMMM_QMREGIONSELECTOR_H
10 
13 #include <memory>
14 #include <vector>
15 
16 namespace Scine {
17 
18 namespace Utils {
19 class BondOrderCollection;
20 class Settings;
21 } // namespace Utils
22 
23 namespace Qmmm {
24 
30 struct QmmmModel {
31  Utils::AtomCollection structure;
32  std::vector<int> qmAtomIndices;
33  int molecularCharge;
34  int spinMultiplicity;
35 };
36 
43  public:
46 
51  void generateQmRegion(const Utils::AtomCollection& fullSystem);
52 
57 
61  std::vector<int> getQmRegionIndices() const;
62 
66  std::pair<int, int> getQmRegionChargeAndMultiplicity() const;
67 
73 
78  const Utils::Settings& settings() const;
79 
80  private:
81  // Helper function that reads in the system connectivity from the connectivity file specified in the settings.
82  Utils::BondOrderCollection getBondOrders(const Utils::AtomCollection& structure) const;
83  // The settings.
84  std::unique_ptr<Utils::Settings> settings_;
85  // The QM/MM model candidates.
86  std::vector<QmmmModel> qmmmModelCandidates_;
87  // The QM/MM reference models.
88  std::vector<QmmmModel> qmmmReferenceModels_;
89  // The selected QM region. Initialized as -1, which is the state that no selection has been made yet.
90  int selectedQmRegionIndex_ = -1;
91 };
92 
93 class QmRegionHasNotBeenSelectedException : public std::runtime_error {
94  public:
95  explicit QmRegionHasNotBeenSelectedException() : std::runtime_error("The QM Region has not been generated yet.") {
96  }
97 };
98 
99 } // namespace Qmmm
100 } // namespace Scine
101 
102 #endif // SWOOSE_QMMM_QMREGIONSELECTOR_H
Definition: QmRegionSelector.h:93
Holds the information about one QM/MM model: its structure, its QM atom indices, and its charge and s...
Definition: QmRegionSelector.h:30
std::vector< int > getQmRegionIndices() const
Getter for the indices of the atoms in the generated QM region.
Definition: QmRegionSelector.cpp:63
QmRegionSelector()
Constructor.
Definition: QmRegionSelector.cpp:22
Utils::Settings & settings()
Accessor for the settings.
Definition: QmRegionSelector.cpp:82
Automated selection of the QM region given a central atom around which it should be constructed and o...
Definition: QmRegionSelector.h:42
std::pair< int, int > getQmRegionChargeAndMultiplicity() const
Getter for the molecular charge and multiplicity of the generated QM region.
Definition: QmRegionSelector.cpp:75
Utils::AtomCollection getQmRegionStructure() const
Getter for the generated QM region as a Utils::AtomCollection.
Definition: QmRegionSelector.cpp:69
void generateQmRegion(const Utils::AtomCollection &fullSystem)
Generates the optimal QM region automatically.
Definition: QmRegionSelector.cpp:26