Scine::Swoose  2.1.0
This is the SCINE module Swoose.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
FullHessianAssembler.h
Go to the documentation of this file.
1 
8 #ifndef MMPARAMETRIZATION_FULLHESSIANASSEMBLER_H
9 #define MMPARAMETRIZATION_FULLHESSIANASSEMBLER_H
10 
12 #include <Utils/Typenames.h>
13 #include <memory>
14 #include <vector>
15 
16 namespace Scine {
17 
18 namespace Core {
19 struct Log;
20 } // namespace Core
21 
22 namespace MMParametrization {
23 struct ParametrizationData;
24 
30  public:
40  void assembleFullHessian();
41 
42  private:
43  // Implementation of the public function "assembleFullHessian" for the case of more than one subsystem
44  void assembleFullHessianFromSubsystems();
45  // Assembles the relevant subblocks of the Hessian for the bonds
46  void assembleBondContributions();
47  // Assembles the relevant subblocks of the Hessian for the angles
48  void assembleAngleContributions();
49  // Assembles the relevant subblocks of the Hessian for the dihedals
50  void assembleDihedralContributions();
51  // Assembles the relevant subblocks of the Hessian for the improper dihedrals
52  void assembleImproperDihedralContributions();
53  /*
54  * This function finds the correct submatrix for a given MM parameter (by relevant atoms)
55  * from a given set of candidate subsystems and transfers it to the sparse full Hessian matrix
56  */
57  void addContributionToSparseHessian(const std::pair<int, int>& relevantAtoms,
58  const std::vector<int>& orderedPotentialCandidatesForHessian);
59  // Transfers a 3x3 matrix to its correct position in the full sparse Hessian matrix
60  void transferSubblockToSparseHessian(const Utils::HessianMatrix& subblock, int index1, int index2);
61  /*
62  * Adds the neighbors of the atoms that are already part of a given MM parameter
63  * to the list of candidates for Hessians, too.
64  */
65  void addNeighboringAtomsToListOfHessianCandidates(std::vector<int>& orderedCandidatesForHessian);
66  // The data used within all MM parametrization classes
67  ParametrizationData& data_;
68  // The logger.
69  Core::Log& log_;
70  // Pointer to an instance of the fragment data distributor class needed to find fragment candidates to get data from.
71  std::unique_ptr<FragmentDataDistributor> fragmentDataDistributor_;
72 };
73 
74 } // namespace MMParametrization
75 } // namespace Scine
76 
77 #endif // MMPARAMETRIZATION_FULLHESSIANASSEMBLER_H
Assembles the full system&#39;s Hessian matrix from the subsystem&#39;s Hessians.
Definition: FullHessianAssembler.h:29
This struct holds all objects used inside the MM parametrization algorithm.
Definition: ParametrizationData.h:29
void assembleFullHessian()
This function takes all the Hessians from the subsystems and the mapping of the parameters to the sub...
Definition: FullHessianAssembler.cpp:20
FullHessianAssembler(ParametrizationData &data, Core::Log &log)
Constructor.
Definition: FullHessianAssembler.cpp:16