source: src/Fragmentation/Interfragmenter.hpp@ 0d9053

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 Candidate_v1.7.0 Candidate_v1.7.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 0d9053 was 0d9053, checked in by Frederik Heber <heber@…>, 10 years ago

Exracted several functions out of Interfragmenter::operator().

  • extracted Interfragmenter::getAtomKeysetMap(), ::getNeighborsOutsideMolecule(), ::getAtomSpecificKeySetMap(), ::combineFragments().
  • this is preparatory for enhancing the Interfragmenter to automatically ascertaining a certain "distance" between fragments for long-range interactions. That is, we may afterwards smear out nuclear and electronic charge distributions up to said distance without them overlapping outside of a present fragments (i.e. without capturing their short-range interactions elsewhere).
  • Property mode set to 100644
File size: 3.8 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
59private:
60 /** Helper to translate a keyset into a set of atoms.
61 *
62 * \param keyset
63 * \return vector of atom refs
64 */
65 std::vector<atom *> getAtomsFromKeySet(const KeySet &keyset) const;
66
67 typedef std::list<const KeySet *> keysets_t;
68 typedef std::map<const atom *, keysets_t > atomkeyset_t;
69
70 /** Helper function to create a map of atoms and their fragments/keysets.
71 *
72 * \param _MaxOrder maximum order
73 * \return map with atoms as a keys and fragments as values
74 */
75 atomkeyset_t getAtomKeySetMap(size_t _MaxOrder) const;
76
77 typedef std::vector<const atom *> candidates_t;
78
79 /** Helper function to get all atoms around a specific keyset not contained in
80 * the same molecule.
81 *
82 * \param _atoms all atoms of a fragment
83 * \param _Rcut desired distance cutoff
84 * \param _treatment whether hydrogens are treated special or not
85 */
86 candidates_t getNeighborsOutsideMolecule(
87 const AtomIdSet &_atoms,
88 const double _Rcut,
89 const enum HydrogenTreatment _treatment) const;
90
91 /** Helper function to return a fragment/KeySet map specific to all candidates.
92 *
93 * \param _candidates all neighboring atoms around keyset
94 * \param _atomkeyset map with all atoms and the KeySets they are contained in
95 * \return specific fragment map
96 */
97 atomkeyset_t getCandidatesSpecificKeySetMap(
98 const candidates_t &_candidates,
99 const atomkeyset_t &_atomkeyset) const;
100
101 /** For a given set of candidates atoms in \a _candidates and a \a _keyset
102 * we combine each fragment from either atom and place it into internal
103 * Graph.
104 *
105 * \param _MaxOrder maximum order
106 * \param _candidates all atoms neighboring the current out outside of its molecule
107 * \param _fragmentmap all keysets related to this atom
108 * \param _keyset current keyset (used as base for creating inter-fragments)
109 * \param _InterFragments container for all created inter-fragments
110 * \param _counter counts added fragments
111 */
112 void combineFragments(
113 const candidates_t &_candidates,
114 atomkeyset_t &_fragmentmap,
115 const KeySet &_keyset,
116 Graph &_InterFragments,
117 int &_counter);
118
119private:
120 Graph &TotalGraph;
121};
122
123#endif /* INTERFRAGMENTER_HPP_ */
Note: See TracBrowser for help on using the repository browser.