8 #ifndef SWOOSE_QMMM_QMMMCALCULATOR_H
9 #define SWOOSE_QMMM_QMMMCALCULATOR_H
12 #include <Core/Interfaces/EmbeddingCalculator.h>
19 namespace MolecularMechanics {
20 class MolecularMechanicsCalculator;
32 static constexpr
const char* model =
"QM-SFAM";
60 std::unique_ptr<Utils::AtomCollection>
getStructure()
const override;
97 std::string
name()
const override;
128 std::shared_ptr<Core::State>
getState()
const final;
133 void loadState(std::shared_ptr<Core::State> )
final;
140 return std::all_of(underlyingCalculators.begin(), underlyingCalculators.end(),
141 [](
const auto& c) {
return c->allowsPythonGILRelease(); });
156 void setUnderlyingCalculatorsImpl(std::vector<std::shared_ptr<Core::Calculator>> underlyingCalculators);
157 void addUnderlyingSettingsImpl();
158 void optimizeLinks();
159 void handleElectrostaticEmbedding();
160 void removeCalculatorSpecificSettings();
168 const Utils::Results& ignoreQmCalculateImpl(std::string description);
172 void applySettings();
176 void applySettingsToUnderlyingCalculators();
183 void prepareTermsForMmCalculator(
bool reducedEnergyCalculation =
false);
187 void setLogForUnderlyingCalculators();
191 std::unique_ptr<Utils::Settings> settings_;
199 std::vector<int> mmBoundaryAtoms_;
201 std::vector<int> listOfQmAtoms_;
203 std::shared_ptr<Core::Calculator> qmCalculator_;
205 bool mmAtomsLeft_ =
true;
210 bool calculateReducedQmMmEnergy_;
212 std::shared_ptr<MolecularMechanics::MolecularMechanicsCalculator> mmCalculator_;
214 bool electrostaticEmbedding_;
218 std::string qmRegionFile_;
220 std::string chargeRedistributionScheme_;
222 static constexpr
const char* pointChargesFilename_ =
"environment_pointcharges.pc";
227 bool turbomoleIsQmCalculator_ =
false;
237 bool scfConvCriterionIsSet_ =
false;
238 bool optimizeLinks_ =
false;
244 #endif // SWOOSE_QMMM_QMMMCALCULATOR_H
bool supportsMethodFamily(const std::string &methodFamily) const override
Whether the calculator supports a method family.
Definition: QmmmCalculator.cpp:31
void setUnderlyingCalculators(std::vector< std::shared_ptr< Core::Calculator >> underlyingCalculators) override
Sets the underlying QM and MM calculators.
Definition: QmmmCalculator.cpp:55
Calculator implementing the QM/MM method.
Definition: QmmmCalculator.h:30
std::vector< std::shared_ptr< Core::Calculator > > getUnderlyingCalculators() const override
Gets the underlying QM and MM calculators.
Definition: QmmmCalculator.cpp:99
const Utils::PositionCollection & getPositions() const override
Getter for the coordinates of the underlying Utils::AtomCollection.
Definition: QmmmCalculator.cpp:391
std::shared_ptr< MolecularMechanics::MolecularMechanicsCalculator > getMolecularMechanicsCalculator()
Getter for the MM calculator.
Definition: QmmmCalculator.cpp:546
bool allowsPythonGILRelease() const override
Whether the calculator has no underlying Python code and can therefore release the global interpreter...
Definition: QmmmCalculator.h:138
void setStructure(const Utils::AtomCollection &structure) override
Changes the molecular structure to calculate.
Definition: QmmmCalculator.cpp:144
void loadState(std::shared_ptr< Core::State >) final
Implements Core::StateHandableObject::loadState().
Definition: QmmmCalculator.cpp:459
QmmmCalculator()
Constructor.
Definition: QmmmCalculator.cpp:35
Utils::Settings & settings() override
Accessor for the settings.
Definition: QmmmCalculator.cpp:447
Utils::PropertyList possibleProperties() const override
Returns the list of the possible properties to calculate.
Definition: QmmmCalculator.cpp:431
Utils::PropertyList getRequiredProperties() const override
Getter for the properties to calculate.
Definition: QmmmCalculator.cpp:427
~QmmmCalculator() override
Destructor.
Definition: QmmmCalculator.cpp:524
std::unique_ptr< Utils::AtomCollection > getStructure() const override
Gets the molecular structure as a const Utils::AtomCollection&.
Definition: QmmmCalculator.cpp:375
std::shared_ptr< Core::Calculator > getQuantumMechanicsCalculator()
Getter for the QM calculator.
Definition: QmmmCalculator.cpp:550
std::string name() const override
Getter for the name of the Calculator.
Definition: QmmmCalculator.cpp:27
std::shared_ptr< Core::State > getState() const final
Implements Core::StateHandableObject::getState().
Definition: QmmmCalculator.cpp:463
const Utils::Results & calculate(std::string description) override
The main function running calculations.
Definition: QmmmCalculator.cpp:134
void setRequiredProperties(const Utils::PropertyList &requiredProperties) override
Sets the properties to calculate.
Definition: QmmmCalculator.cpp:395
Utils::Results & results() override
Accessor for the saved instance of Utils::Results.
Definition: QmmmCalculator.cpp:455
void modifyPositions(Utils::PositionCollection newPositions) override
Allows to modify the positions of the underlying Utils::AtomCollection.
Definition: QmmmCalculator.cpp:379
void addUnderlyingSettings() override
Sets the underlying QM and MM calculators.
Definition: QmmmCalculator.cpp:78