source: src/Fragmentation/Homology/AtomFragmentsMap.hpp@ f33ef9

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 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 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 f33ef9 was 70aeed, checked in by Frederik Heber <heber@…>, 9 years ago

Added additional "force" keysets to AtomFragmentsMap.

  • Property mode set to 100644
File size: 3.5 KB
Line 
1/*
2 * AtomFragmentsMap.hpp
3 *
4 * Created on: Mar 7, 2016
5 * Author: heber
6 */
7
8
9#ifndef ATOMFRAGMENTSMAP_HPP_
10#define ATOMFRAGMENTSMAP_HPP_
11
12// include config.h
13#ifdef HAVE_CONFIG_H
14#include <config.h>
15#endif
16
17#include "CodePatterns/Singleton.hpp"
18
19#include <list>
20#include <map>
21#include <vector>
22
23#include <boost/serialization/export.hpp>
24#include <boost/serialization/list.hpp>
25#include <boost/serialization/map.hpp>
26#include <boost/serialization/set.hpp>
27#include <boost/serialization/vector.hpp>
28#include <boost/serialization/version.hpp>
29
30#include "types.hpp"
31
32class KeySet;
33class Graph;
34
35/** This class creates in instantiation a map connecting each atom with
36 * the (known) fragments it takes part in.
37 *
38 * In the HomologyGraph and its -Container we do not have this information
39 * any longer. However, we need this in order to make statements about atomic
40 * properties from calculated fragment properties.
41 *
42 */
43class AtomFragmentsMap : public Singleton<AtomFragmentsMap>
44{
45public:
46 //** Function to insert new fragments into storage container.
47 void insert(
48 const Graph &_graph);
49
50 /** Function to clear the container.
51 *
52 */
53 void clear()
54 { atommap.clear(); }
55
56 typedef std::vector<atomId_t> indices_t;
57 typedef std::list<KeySet> keysets_t;
58 //!> typedef for the internal map
59 typedef std::map<atomId_t, keysets_t> AtomFragmentsMap_t;
60 typedef std::map<KeySet, indices_t > FragmentFullKeysetMap_t;
61
62 /** Getter for full stored map.
63 *
64 * \return const ref to internal map
65 */
66 const AtomFragmentsMap_t& getMap() const
67 { return atommap; }
68
69 /** Allows to add the full keyset, with excluded hydrogens, to add
70 * to a given \a _keyset
71 *
72 * \param _keyset keyset to a fragment without hydrogens
73 * \param _fullkeyset full keyset with excluded hydrogens to associate with \a _keyset
74 * \return true - insertion ok, else - index set already present
75 */
76 bool addFullKeyset(const KeySet &_keyset, const indices_t &_fullkeyset);
77
78 /** Getter for the full key set, i.e. including excluded hydrogens, for a
79 * given \a _keyset without them.
80 *
81 * \param _keyset keyset to a fragment without hydrogens
82 * \return full index set containing all keys from \a _keyset and all excluded
83 * hydrogens
84 */
85 const indices_t &getFullKeyset(const KeySet &_keyset) const;
86
87 /** Getter to map cut down to given selection of atoms.
88 *
89 * \param _candidates subset of atoms
90 * \param _MaxOrder constrain returned fragment list to contain at most this size
91 * \return map with fragments for each of the candidates
92 */
93 AtomFragmentsMap_t getMap(
94 const std::vector<atomId_t> &_candidates,
95 size_t _MaxOrder) const;
96
97 /** Checks whether we have a full keyset for every keyset contained.
98 *
99 * \return true - is complete, false - else
100 */
101 bool checkCompleteness() const;
102
103private:
104 //!> grant singleton pattern access to private cstor/dstor
105 friend class Singleton<AtomFragmentsMap>;
106
107 /** Private default cstor.
108 *
109 */
110 AtomFragmentsMap() {}
111
112 /** Private default dstor.
113 *
114 */
115 ~AtomFragmentsMap() {}
116
117private:
118 //!> internal map associating atoms and fragments
119 AtomFragmentsMap_t atommap;
120
121 //!> internal map to get from keyset (without hydrogens) to full keyset, i.e. forcekeyset
122 FragmentFullKeysetMap_t fullkeysets;
123
124private:
125 friend class boost::serialization::access;
126 // serialization
127 template <typename Archive>
128 void serialize(Archive& ar, const unsigned int version)
129 {
130 ar & atommap;
131 ar & fullkeysets;
132 }
133};
134
135
136#endif /* ATOMFRAGMENTSMAP_HPP_ */
Note: See TracBrowser for help on using the repository browser.