source: src/Fragmentation/Interfragmenter.hpp@ 4cac6c

Action_Thermostats Add_AtomRandomPerturbation Add_FitFragmentPartialChargesAction Add_RotateAroundBondAction Add_SelectAtomByNameAction Added_ParseSaveFragmentResults AddingActions_SaveParseParticleParameters 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_BoundInBox_CenterInBox_MoleculeActions 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 ImplicitCharges IndependentFragmentGrids IndependentFragmentGrids_IndividualZeroInstances IndependentFragmentGrids_IntegrationTest IndependentFragmentGrids_Sole_NN_Calculation JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool JobMarket_unresolvable_hostname_fix MoreRobust_FragmentAutomation 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 4cac6c was cee9e8, checked in by Frederik Heber <heber@…>, 9 years ago

Added Interfragmenter::findLargestCutoff() to find largest Rcut not causing additional inter-fragments.

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