Scine::Swoose  2.1.0
This is the SCINE module Swoose.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
FragmentDataDistributor.h
Go to the documentation of this file.
1 
8 #include <string>
9 #include <vector>
10 
11 #ifndef MMPARAMETRIZATION_FRAGMENTDATADISTRIBUTOR_H
12 # define MMPARAMETRIZATION_FRAGMENTDATADISTRIBUTOR_H
13 
14 namespace Scine {
15 namespace Core {
16 struct Log;
17 }
18 
19 namespace MMParametrization {
20 struct ParametrizationData;
21 
29  public:
49  bool referenceDataIsSufficient(bool refineConnectivity, std::vector<int> failedCalculations = {},
50  std::vector<std::vector<std::string>> failedCalculationIds = {}) const;
55  std::vector<int> getCandidateFragments(int fragmentIndex) const;
60  void updateCandidateFragments(int fragmentIndex, std::vector<int>& listOfCandidates) const;
68  void updateCandidateFragmentsWithThirdShellNeighbors(int fragmentIndex, std::vector<int>& listOfCandidates) const;
69 
70  private:
71  /*
72  * @brief Returns whether enough data has been calculated already based on the given candidate fragments.
73  * @throws std::runtime_error Throws if the parametrization cannot be completed anymore
74  * because too many calculations already failed.
75  */
76  bool fragmentIsCoveredByData(int fragmentIndex, const std::vector<int>& candidates, bool refineConnectivity,
77  const std::vector<int>& failedCalculations,
78  std::vector<std::vector<std::string>> failedCalculationIds) const;
79  /*
80  * Returns whether the fragment with the given candidates can not be covered anymore because too many calculations
81  * have failed already.
82  */
83  bool fragmentIsHopeless(const std::vector<int>& candidates, const std::vector<int>& failedCalculations) const;
84  // The parametrization data
85  ParametrizationData& data_;
86  // The logger
87  Core::Log& log_;
88 };
89 
90 } // namespace MMParametrization
91 } // namespace Scine
92 
93 #endif // MMPARAMETRIZATION_FRAGMENTDATADISTRIBUTOR_H
FragmentDataDistributor(ParametrizationData &data, Core::Log &log)
Constructor.
Definition: FragmentDataDistributor.cpp:15
This class handles the distribution of the available data for the parameter optimization. This mainly includes the task of providing a list of candidate fragments from which to take reference data for the parameters associated with a given atom.
Definition: FragmentDataDistributor.h:28
std::vector< int > getCandidateFragments(int fragmentIndex) const
Returns the indices of candidate fragments to get the data from for the given fragment index &#39;fragmen...
Definition: FragmentDataDistributor.cpp:93
void updateCandidateFragmentsWithThirdShellNeighbors(int fragmentIndex, std::vector< int > &listOfCandidates) const
Updates a given list of candidate fragments with third shell neighboring atoms (neighbors of neighbor...
Definition: FragmentDataDistributor.cpp:114
This struct holds all objects used inside the MM parametrization algorithm.
Definition: ParametrizationData.h:29
bool referenceDataIsSufficient(bool refineConnectivity, std::vector< int > failedCalculations={}, std::vector< std::vector< std::string >> failedCalculationIds={}) const
Checks whether the reference data that has already been collected is sufficient to perform the parame...
Definition: FragmentDataDistributor.cpp:18
void updateCandidateFragments(int fragmentIndex, std::vector< int > &listOfCandidates) const
Updates a given list of candidate fragments to get the data from for the given fragment index &#39;fragme...
Definition: FragmentDataDistributor.cpp:99