Scine::Swoose  1.0.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 <vector>
9 
10 #ifndef MMPARAMETRIZATION_FRAGMENTDATADISTRIBUTOR_H
11 # define MMPARAMETRIZATION_FRAGMENTDATADISTRIBUTOR_H
12 
13 namespace Scine {
14 namespace MMParametrization {
15 struct ParametrizationData;
16 
24  public:
41  bool referenceDataIsSufficient(bool refineConnectivity, std::vector<int> failedCalculations = {}) const;
46  std::vector<int> getCandidateFragments(int fragmentIndex) const;
51  void updateCandidateFragments(int fragmentIndex, std::vector<int>& listOfCandidates) const;
59  void updateCandidateFragmentsWithThirdShellNeighbors(int fragmentIndex, std::vector<int>& listOfCandidates) const;
60 
61  private:
62  /*
63  * @brief Returns whether enough data has been calculated already based on the given candidate fragments.
64  * @throws std::runtime_error Throws if the parametrization cannot be completed anymore
65  * because too many calculations already failed.
66  */
67  bool fragmentIsCoveredByData(const std::vector<int>& candidates, bool refineConnectivity,
68  const std::vector<int>& failedCalculations) const;
69  /*
70  * Returns whether the fragment with the given candidates can not be covered anymore because too many calculations
71  * have failed already.
72  */
73  bool fragmentIsHopeless(const std::vector<int>& candidates, const std::vector<int>& failedCalculations) const;
74  // The parametrization data
75  ParametrizationData& data_;
76 };
77 
78 } // namespace MMParametrization
79 } // namespace Scine
80 
81 #endif // MMPARAMETRIZATION_FRAGMENTDATADISTRIBUTOR_H
bool referenceDataIsSufficient(bool refineConnectivity, std::vector< int > failedCalculations={}) const
Checks whether the reference data that has already been collected is sufficient to perform the parame...
Definition: FragmentDataDistributor.cpp:17
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:23
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:84
FragmentDataDistributor(ParametrizationData &data)
Constructor.
Definition: FragmentDataDistributor.cpp:14
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:105
This struct holds all objects used inside the MM parametrization algorithm.
Definition: ParametrizationData.h:28
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:90