Scine::Swoose  2.1.0
This is the SCINE module Swoose.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
FragmentationHelper.h
Go to the documentation of this file.
1 
8 #ifndef SWOOSEUTILITIES_FRAGMENTATIONHELPER_H
9 #define SWOOSEUTILITIES_FRAGMENTATIONHELPER_H
10 
12 #include <deque>
13 #include <list>
14 #include <memory>
15 #include <random>
16 #include <vector>
17 
18 namespace Scine {
19 
20 namespace Core {
21 struct Log;
22 } // namespace Core
23 
24 namespace Utils {
25 class Settings;
26 class Atom;
27 class AtomCollection;
28 class BondOrderCollection;
29 } // namespace Utils
30 
31 namespace SwooseUtilities {
32 
33 // The index given to saturating atoms in the atomIndexMapping object
34 static constexpr int indexForSaturatingAtoms = -1;
35 // Minimum size of a subsystem
36 static constexpr int minimumSubsystemSize_ = 20;
37 
38 namespace FragmentationHelper {
53 void addAtomsUpToReasonableCut(Utils::AtomCollection& atomsToAdd, std::vector<int>& alreadyAddedAtoms,
54  std::deque<bool>& isSaturatingAtom, int atomInside, int atomOutside,
55  const Utils::AtomCollection& fullStructure, const std::vector<std::list<int>>& listsOfNeighbors,
56  double probabilityToDivide, std::shared_ptr<std::mt19937> randomEngine);
64 void addMoreAtomsToSubsystem(const Utils::AtomCollection& atomsToAdd, Utils::AtomCollection& subsystem,
65  const std::deque<bool>& isSaturatingAtom, bool addSaturatingAtoms);
71 void checkSizeOfSubsystem(int size, double& additionToRadius, bool& unsuccessfulFragmentation, int fragmentIndex,
72  int fullStructureSize, int maximumSubsystemSize, Core::Log& log);
76 void updateInformationForIndexMapping(const Utils::AtomCollection& subsystem,
77  const Utils::AtomCollection& fullStructure, std::vector<int>& atomIndexMapping);
82 std::vector<int> calculateSubgraphSizes(const Utils::AtomCollection& fullStructure, const Utils::BondOrderCollection& bondOrders);
83 
89 bool atomIsCloseToExistingAtom(const Utils::Atom& atom, const Utils::AtomCollection& existingAtoms);
90 
100 bool isDivisibleAtBond(int atomInside, int atomOutside, const Utils::AtomCollection& fullStructure,
101  const std::vector<std::list<int>>& listsOfNeighbors, double probabilityToDivide,
102  std::shared_ptr<std::mt19937> randomEngine);
109 Utils::AtomCollection mergeSubsystems(std::vector<int>& atomIndexMapping, std::vector<Utils::AtomCollection> subsystems,
110  std::vector<std::vector<int>> atomIndexMappings);
111 
112 } // namespace FragmentationHelper
113 } // namespace SwooseUtilities
114 } // namespace Scine
115 
116 #endif // SWOOSEUTILITIES_FRAGMENTATIONHELPER_H