source: src/Fragmentation/Interfragmenter.hpp@ 78202b

Action_Thermostats Add_AtomRandomPerturbation Add_FitFragmentPartialChargesAction Add_RotateAroundBondAction Add_SelectAtomByNameAction Added_ParseSaveFragmentResults Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_ParticleName_to_Atom Adding_StructOpt_integration_tests AtomFragments Automaking_mpqc_open AutomationFragmentation_failures Candidate_v1.5.4 Candidate_v1.6.0 Candidate_v1.6.1 ChangeBugEmailaddress ChangingTestPorts ChemicalSpaceEvaluator CombiningParticlePotentialParsing Combining_Subpackages Debian_Package_split Debian_package_split_molecuildergui_only Disabling_MemDebug Docu_Python_wait EmpiricalPotential_contain_HomologyGraph EmpiricalPotential_contain_HomologyGraph_documentation Enable_parallel_make_install Enhance_userguide Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Example_ManyWaysToTranslateAtom Exclude_Hydrogens_annealWithBondGraph FitPartialCharges_GlobalError Fix_ChargeSampling_PBC Fix_ChronosMutex Fix_FitPartialCharges Fix_FitPotential_needs_atomicnumbers Fix_ForceAnnealing Fix_IndependentFragmentGrids Fix_ParseParticles Fix_ParseParticles_split_forward_backward_Actions Fix_PopActions Fix_QtFragmentList_sorted_selection Fix_Restrictedkeyset_FragmentMolecule Fix_StatusMsg Fix_StepWorldTime_single_argument Fix_Verbose_Codepatterns Fix_fitting_potentials Fixes ForceAnnealing_goodresults ForceAnnealing_oldresults ForceAnnealing_tocheck ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion FragmentAction_writes_AtomFragments FragmentMolecule_checks_bonddegrees GeometryObjects Gui_Fixes Gui_displays_atomic_force_velocity IndependentFragmentGrids IndependentFragmentGrids_IndividualZeroInstances IndependentFragmentGrids_IntegrationTest IndependentFragmentGrids_Sole_NN_Calculation JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool JobMarket_unresolvable_hostname_fix ODR_violation_mpqc_open PartialCharges_OrthogonalSummation PdbParser_setsAtomName PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks Rewrite_FitPartialCharges RotateToPrincipalAxisSystem_UndoRedo SaturateAtoms_findBestMatching SaturateAtoms_singleDegree StoppableMakroAction Subpackage_CodePatterns Subpackage_JobMarket Subpackage_LinearAlgebra Subpackage_levmar Subpackage_mpqc_open Subpackage_vmg Switchable_LogView ThirdParty_MPQC_rebuilt_buildsystem TrajectoryDependenant_MaxOrder TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps TremoloParser_setsAtomName Ubuntu_1604_changes stable
Last change on this file since 78202b was d713ce, checked in by Frederik Heber <heber@…>, 9 years ago

AtomFragmentsMap is now a Singleton and part of Homology code.

  • Property mode set to 100644
File size: 4.0 KB
Line 
1/*
2 * Interfragmenter.hpp
3 *
4 * Created on: Jul 5, 2013
5 * Author: heber
6 */
7
8#ifndef INTERFRAGMENTER_HPP_
9#define INTERFRAGMENTER_HPP_
10
11// include config.h
12#ifdef HAVE_CONFIG_H
13#include <config.h>
14#endif
15
16#include <list>
17#include <map>
18#include <vector>
19
20#include "AtomIdSet.hpp"
21#include "Fragmentation/Homology/AtomFragmentsMap.hpp"
22#include "Fragmentation/HydrogenSaturation_enum.hpp"
23
24class atom;
25class KeySet;
26class Graph;
27
28/** This functor adds the union of certain fragments to a given set of fragments
29 * (a Graph) by combining them depending on whether they are (not) bonded and
30 * how far their centers are apart and which bond order they have.
31 *
32 * This is to allow calculation of interfragment energies. As fragments are
33 * always of the same molecule, energies in between molecules so far are only
34 * attained electrostratically, whereas dynamic correlation is totally missed.
35 * Interfragments that are calculate with e.g. a sensible Post-HF method contain
36 * dynamic correlation which can then be used for later potential fitting.
37 */
38class Interfragmenter
39{
40public:
41 /** Constructor for class Interfragmenter.
42 *
43 * \param _TotalGraph Graph with all fragments to interrelate
44 */
45 Interfragmenter(Graph &_TotalGraph) :
46 TotalGraph(_TotalGraph)
47 {}
48
49 /** Adds interrelated fragments to TotalGraph up to \a MaxOrder and \a Rcut.
50 *
51 * \param MaxOrder maximum order for fragments to interrelate
52 * \param Rcut maximum distance to check for interrelatable fragments
53 * \param treatment whether hydrogens are treated specially or not
54 */
55 void operator()(
56 const size_t MaxOrder,
57 const double Rcut,
58 const enum HydrogenTreatment treatment);
59
60 /** This finds the largest cut off distance (\a Rcut) such that when running
61 * operator() no additional inter-fragments would be produced.
62 *
63 * \param MaxOrder maximum order for fragments to interrelate
64 * \param _upperbound upper bound on \a Rcut above which we do not look
65 * \param treatment whether hydrogens are treated specially or not
66 * \return largest cutoff distance to cause no additional inter-fragments
67 */
68 double findLargestCutoff(
69 const size_t _MaxOrder,
70 const double _upperbound,
71 const enum HydrogenTreatment _treatment) const;
72
73private:
74
75 typedef AtomFragmentsMap::keysets_t keysets_t;
76 typedef AtomFragmentsMap::AtomFragmentsMap_t atomkeyset_t;
77
78 typedef std::vector<const atom *> candidates_t;
79
80 /** Helper function to get all atoms around a specific keyset not contained in
81 * the same molecule.
82 *
83 * \param _atoms all atoms of a fragment
84 * \param _Rcut desired distance cutoff
85 * \param _treatment whether hydrogens are treated special or not
86 */
87 candidates_t getNeighborsOutsideMolecule(
88 const AtomIdSet &_atoms,
89 const double _Rcut,
90 const enum HydrogenTreatment _treatment) const;
91
92 /** Helper function to return a fragment/KeySet map specific to all candidates.
93 *
94 * \param _candidates all neighboring atoms around keyset
95 * \param _atomkeyset map with all atoms and the KeySets they are contained in
96 * \return specific fragment map
97 */
98 atomkeyset_t getCandidatesSpecificKeySetMap(
99 const candidates_t &_candidates,
100 const atomkeyset_t &_atomkeyset) const;
101
102 /** For a given set of candidates atoms in \a _candidates and a \a _keyset
103 * we combine each fragment from either atom and place it into internal
104 * Graph.
105 *
106 * \param _MaxOrder maximum order
107 * \param _candidates all atoms neighboring the current out outside of its molecule
108 * \param _fragmentmap all keysets related to this atom
109 * \param _keyset current keyset (used as base for creating inter-fragments)
110 * \param _InterFragments container for all created inter-fragments
111 * \param _counter counts added fragments
112 */
113 void combineFragments(
114 const size_t _MaxOrder,
115 const candidates_t &_candidates,
116 const atomkeyset_t &_fragmentmap,
117 const KeySet &_keyset,
118 Graph &_InterFragments,
119 int &_counter);
120
121private:
122 Graph &TotalGraph;
123};
124
125#endif /* INTERFRAGMENTER_HPP_ */
Note: See TracBrowser for help on using the repository browser.