source: src/documentation/constructs/world.dox@ 3867a7

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 3867a7 was 3e4fb6, checked in by Frederik Heber <heber@…>, 13 years ago

Added template class IdPool used by World to manage defragmentable id pool.

  • this is stuff from World factored into own class (was doubly present in World anyway).
  • added short documentation to constructs/world.
  • Property mode set to 100644
File size: 4.1 KB
Line 
1/*
2 * Project: MoleCuilder
3 * Description: creates and alters molecular systems
4 * Copyright (C) 2010 University of Bonn. All rights reserved.
5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
6 */
7
8/**
9 * \file world.dox
10 *
11 * Created on: Oct 31, 2011
12 * Author: heber
13 */
14
15/**
16 * \page world World
17 *
18 * The World is a singleton instance that can be obtained from everywhere.
19 * It stores information that globally need to be accessible but in a controlled
20 * manner. Therefore, the World is also an Observable that gives specific
21 * information when atoms or molecules have changed.
22 *
23 * The World is the one most important class of molecule. It contains the
24 * following important structures:
25 * - list of all atoms in the World, accessible via various functions
26 * - list of all molecules, likewise accessible via various functions
27 * - access to the Domain instance
28 * - access to the BondGraph instance
29 * - access to the config instance
30 * - access to the periodentafel instance
31 * - access to Thermostat instances
32 * - setting and getting of the ExitFlag (number returned on program exit)
33 * - access to WorldTime to setting the active time step
34 *
35 * I.e. whenever you need to do something with atoms, the World instance is
36 * involved.
37 *
38 * \section world-usage Howto use the World?
39 *
40 * Usage is a simple as:
41 * -# include the header \b World.hpp
42 * -# get an instance via
43 * \code
44 * World::getInstance()
45 * \endcode
46 *
47 * \section world-standard-procedures Standard Procedures
48 *
49 * In this section we explain various standard procedures wherein the World is
50 * involved.
51 *
52 * \note Accesssing molecules is very similar to accessing atoms, hence we only
53 * give the details for atoms here.
54 *
55 * \subsection world-standard-procedures-atom-const_iteration Iterating over all atoms
56 *
57 * When you want to iterate over all atoms, but only need const access, do this:
58 * \code
59 * for(World::internal_AtomIterator iter = World::getInstance().getAtomIter_internal();
60 * iter != World::getInstance().atomEnd_internal();
61 * ++iter) {
62 * ...access *iter ...
63 * }
64 * \endcode
65 * However, these internal routines are protected. Hence, not every class may access
66 * them. Another variant is therefor to obtain a copy array:
67 * \code
68 * const World::AtomComposite atoms = World::getInstance().getAllAtoms();
69 * for(World::AtomComposite::const_iterator iter = atoms.begin();
70 * iter != atoms.end();
71 * ++iter) {
72 * ...access *iter ...
73 * }
74 * \endcode
75 *
76 * \subsection world-standard-procedures-atom-iteration Iterating over all atoms
77 *
78 * When you want to iterate over all atoms, but only need const access, do this:
79 * \code
80 * for(World::AtomIterator iter = World::getInstance().getAtomIter();
81 * iter != World::getInstance().atomEnd();
82 * ++iter) {
83 * ...access *iter ...
84 * }
85 * \endcode
86 * However, there we obtain an observed iterator. I.e. accessing *iter always
87 * calls forth an OBSERVE mechanism. Another variant is therefore to obtain a copy
88 * array:
89 * \code
90 * World::AtomComposite atoms = World::getInstance().getAllAtoms();
91 * for(World::AtomComposite::iterator iter = atoms.begin();
92 * iter != atoms.end();
93 * ++iter) {
94 * ...access *iter ...
95 * }
96 * \endcode
97 *
98 * \subsection world-standard-procedures-atom-subset-iteration Iterating over subset of atoms
99 *
100 * Iterating over a subset involves giving a specific descriptor to either
101 * World::getAtomIter() or World::getAllAtoms() such as this:
102 * \code
103 * World::AtomIterator iter = World::getInstance().getAtomIter(AtomsBySelection());
104 * \endcode
105 * \code
106 * World::AtomComposite atoms = World::getInstance().getAllAtoms(AtomByType(1));
107 * \endcode
108 * respectively.
109 *
110 * \subsection world-internals-notes Notes on internals of the World
111 *
112 * \paragraph world-internals-notes-idpool
113 *
114 * The World has an idpool to manage the ids of atoms and molecules, i.e. such
115 * that they are:
116 * -# unique
117 * -# not loosely spread over the whole range of possible, but tightly packed
118 *
119 * For the latter to work we have a class IdPool that manages the ids and
120 * defragments the pool from time to time by combining ranges of released ids.
121 *
122 * \date 2011-10-31
123 *
124 */
Note: See TracBrowser for help on using the repository browser.