source: src/Fragmentation/Summation/Containers/FragmentationResultContainer.hpp@ a3427f

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 a3427f was a3427f, checked in by Frederik Heber <heber@…>, 12 years ago

Split FragmentationAutomationAction into calculation and analysis.

  • Property mode set to 100644
File size: 3.5 KB
Line 
1/*
2 * FragmentationResultContainer.hpp
3 *
4 * Created on: Mar 8, 2013
5 * Author: heber
6 */
7
8#ifndef FRAGMENTATIONRESULTCONTAINER_HPP_
9#define FRAGMENTATIONRESULTCONTAINER_HPP_
10
11// include config.h
12#ifdef HAVE_CONFIG_H
13#include <config.h>
14#endif
15
16#include "CodePatterns/Singleton.hpp"
17
18#include <map>
19
20#ifdef HAVE_JOBMARKET
21#include "JobMarket/types.hpp"
22#else
23typedef size_t JobId_t;
24#endif
25
26#include "Fragmentation/KeySetsContainer.hpp"
27#include "Fragmentation/Summation/Containers/MPQCData.hpp"
28#ifdef HAVE_VMG
29#include "Fragmentation/Summation/Containers/VMGData.hpp"
30#endif
31
32/** This class stores results from lengthy fragmentation calculations, e.g.
33 * coming out of FragmentationAutomationAction.
34 *
35 * The idea is that we can play around with results without having to recalculate
36 * results in between. Hence, we serialize the FragmentResult into this
37 * container which can also be filled from file.
38 */
39class FragmentationResultContainer: public Singleton<FragmentationResultContainer>
40{
41 //!> Singleton patterns needs access to private cstor/dtor.
42 friend class Singleton<FragmentationResultContainer>;
43private:
44 FragmentationResultContainer() :
45 ResultsType(BothRanges)
46 {}
47 ~FragmentationResultContainer() {}
48
49public:
50 //!> typedef for short range data container
51 typedef std::map<JobId_t, MPQCData> shortrangedata_t;
52#ifdef HAVE_VMG
53 //!> typedef for long range data container
54 typedef std::map<JobId_t, VMGData> longrangedata_t;
55#endif
56
57#ifdef HAVE_VMG
58 /** Adds a a set of both short and long range results.
59 *
60 * Adds all the containers to the ones present in this instance.
61 *
62 * \param _keysets
63 * \param _forcekeysets
64 * \param _shortrangedata
65 * \param _longrangedata
66 */
67 void addFullResults(
68 const KeySetsContainer &_keysets,
69 const KeySetsContainer &_forcekeysets,
70 const shortrangedata_t &_shortrangedata,
71 const longrangedata_t &_longrangedata
72 );
73#endif
74
75 /** Adds a a set of short range results only.
76 *
77 * Adds all the containers to the ones present in this instance.
78 *
79 * \param _keysets
80 * \param _forcekeysets
81 * \param _shortrangedata
82 */
83 void addShortRangeResults(
84 const KeySetsContainer &_keysets,
85 const KeySetsContainer &_forcekeysets,
86 const shortrangedata_t &_shortrangedata
87 );
88
89 /** Clears all internal containers.
90 *
91 * \note Also resets ResultsType.
92 */
93 void clear()
94 {
95 keysets.clear();
96 forcekeysets.clear();
97 shortrangedata.clear();
98#ifdef HAVE_VMG
99 longrangedata.clear();
100#endif
101 ResultsType = BothRanges;
102 }
103
104 const KeySetsContainer &getKeySets() const { return keysets; }
105 const KeySetsContainer &getForceKeySets() const { return forcekeysets; }
106 const shortrangedata_t& getShortRangeResults() const { return shortrangedata; }
107#ifdef HAVE_VMG
108 const longrangedata_t& getLongRangeResults() const;
109#endif
110 bool areFullRangeResultsPresent() const { return (ResultsType == BothRanges); }
111
112private:
113 //!> indicates whether we contain short range only or both results
114 enum ResultsType_t {
115 ShortRangeOnly,
116 BothRanges,
117 } ResultsType;
118
119 //!> container for all KeySet's without hydrogens to the jobs
120 KeySetsContainer keysets;
121 //!> container for all KeySet's with all except saturation hydrogen to the jobs
122 KeySetsContainer forcekeysets;
123 //!> container for all short-range results
124 std::map<JobId_t, MPQCData> shortrangedata;
125
126#ifdef HAVE_VMG
127 //!> container for all long-range results
128 std::map<JobId_t, VMGData> longrangedata;
129#endif
130};
131
132#endif /* FRAGMENTATIONRESULTCONTAINER_HPP_ */
Note: See TracBrowser for help on using the repository browser.