Scine::Swoose  2.1.0
This is the SCINE module Swoose.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
GaffMolecularMechanicsCalculator.h
Go to the documentation of this file.
1 
8 #ifndef GAFFMOLECULARMECHANICSCALCULATOR_H
9 #define GAFFMOLECULARMECHANICSCALCULATOR_H
10 
11 #include "../Interactions/AnglesEvaluator.h"
12 #include "../Interactions/BondsEvaluator.h"
13 #include "../Interactions/DihedralsEvaluator.h"
14 #include "../Interactions/ElectrostaticEvaluator.h"
15 #include "../Interactions/LennardJonesEvaluator.h"
16 #include "../MolecularMechanicsCalculator.h"
17 #include "../Topology/IndexedStructuralTopology.h"
18 #include "GaffAtomTypeIdentifier.h"
19 #include "GaffParameters.h"
20 
21 namespace Scine {
22 
23 namespace Qmmm {
24 class InteractionTermEliminator;
25 } // namespace Qmmm
26 
27 namespace MolecularMechanics {
28 class GaffParameters;
29 class AtomTypesHolder;
30 struct BondType;
31 struct AngleType;
32 struct DihedralType;
33 struct ImproperDihedralType;
43  : public Utils::CloneInterface<GaffMolecularMechanicsCalculator, MolecularMechanicsCalculator, Core::Calculator> {
44  public:
45  static constexpr const char* model = "GAFF";
49  ~GaffMolecularMechanicsCalculator() override = default;
56  void setStructure(const Utils::AtomCollection& structure) override;
65  const Utils::Results& calculate(std::string description) override;
70  std::string name() const override;
71 
72  private:
73  // friend class declarations
75  // Setter for the internal copy of the parameters.
76  void setParameters(GaffParameters parameters);
77  /*
78  * @brief Implementation of a calculation.
79  */
80  const Utils::Results& calculateImpl(std::string description);
81  /*
82  * @brief Apply settings.
83  */
84  void applySettings();
85 
86  // Other private members:
87  std::unique_ptr<BondsEvaluator> bondsEvaluator_;
88  std::unique_ptr<AnglesEvaluator> anglesEvaluator_;
89  std::unique_ptr<DihedralsEvaluator> dihedralsEvaluator_;
90  std::unique_ptr<DihedralsEvaluator> improperDihedralsEvaluator_;
91  std::unique_ptr<ElectrostaticEvaluator> electrostaticEvaluator_;
92  std::unique_ptr<LennardJonesEvaluator> lennardJonesEvaluator_;
93  bool printContributionsMolecularMechanics_;
94  std::string atomicChargesFile_;
95  std::string atomTypesFile_;
96  bool onlyCalculateBondedContribution_;
97  bool detectBondsWithCovalentRadii_;
98  /*
99  * Decides whether the potential terms that correspond to non-bonded interaction beyond the cutoff radius,
100  * are ignored during the initialization stage of the calculator. This can result in a great speed-up, however,
101  * the calculator may has to be re-initialized when the structure changes significantly.
102  */
103  bool applyCutoffDuringInitialization_;
104  double nonCovalentCutoffRadius_;
105  std::string connectivityFilePath_;
106  std::string parameterFilePath_;
107  /*
108  * Tracks whether the parameter file path has been recently changed.
109  * This boolean is set to true when the member 'parameterFilePath_' is updated
110  * and it is set back to false when these parameters are parsed and stored in the
111  * 'parameters_' member.
112  */
113  bool parameterFilePathHasBeenChanged_ = false;
114  // Whether this calculator is currently calculating a Hessian -> no detailed output printing
115  bool hessianMode_ = false;
116  // Copy of the parameters as a member that is also cloned when the MM calculator is cloned.
117  GaffParameters parameters_;
118  bool parametersHaveBeenSetInternally_ = false;
119  // Private methods:
120  void initialize();
121  void generatePotentialTerms(const GaffParameters& parameters, const IndexedStructuralTopology& topology,
122  const AtomTypesHolder& atomTypes);
123  void generatePotentialTerms(const std::string& parameterPath);
124 };
125 
126 } // namespace MolecularMechanics
127 } // namespace Scine
128 
129 #endif // GAFFMOLECULARMECHANICSCALCULATOR_H
Class containing the structural information about the connectivity of a system.
Definition: IndexedStructuralTopology.h:25
const Utils::Results & calculate(std::string description) override
The main function running calculations.
Definition: GaffMolecularMechanicsCalculator.cpp:97
Class containing the parameters for the GAFF model obtained after parsing a GAFF parameter file...
Definition: GaffParameters.h:38
~GaffMolecularMechanicsCalculator() override=default
Default Destructor.
std::string name() const override
Getter for the name of the Calculator.
Definition: GaffMolecularMechanicsCalculator.cpp:26
Calculator for the GAFF Molecular Mechanics method.
Definition: GaffMolecularMechanicsCalculator.h:42
Class containing the MM atom types of the atoms in a molecular system.
Definition: AtomTypesHolder.h:21
This class handles the elimination of MM interaction terms, which are already covered by the QM calcu...
Definition: InteractionTermEliminator.h:39
GaffMolecularMechanicsCalculator()
Constructor.
Definition: GaffMolecularMechanicsCalculator.cpp:30
void setStructure(const Utils::AtomCollection &structure) override
Changes the molecular structure to calculate.
Definition: GaffMolecularMechanicsCalculator.cpp:91