Changeset fa0b18
- Timestamp:
- Jul 8, 2010, 12:51:15 PM (14 years ago)
- Branches:
- 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
- Children:
- 40f928
- Parents:
- 61ea5b
- Location:
- src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/AtomsCalculation_impl.hpp
r61ea5b rfa0b18 33 33 Process::setMaxSteps(steps); 34 34 Process::start(); 35 for(World::AtomIterator iter=world->getAtomIter(descr);iter!=world->atomEnd();++iter){ 35 for(World::internal_AtomIterator 36 iter=world->getAtomIter_internal(descr); 37 iter!=world->atomEnd_internal(); 38 ++iter){ 39 36 40 Process::setCurrStep(iter.getCount()); 37 41 res->push_back(op(*iter)); -
src/Actions/ManipulateAtomsProcess.cpp
r61ea5b rfa0b18 53 53 setMaxSteps(world->numAtoms()); 54 54 start(); 55 for(World::AtomIterator iter=world->getAtomIter(descr);iter!=world->atomEnd();++iter){ 55 for(World::internal_AtomIterator 56 iter=world->getAtomIter_internal(descr); 57 iter!=world->atomEnd_internal(); 58 ++iter){ 59 56 60 setCurrStep(iter.getCount()); 57 61 operation(*iter); -
src/Descriptors/AtomIdDescriptor.cpp
r61ea5b rfa0b18 12 12 13 13 #include "atom.hpp" 14 #include "AtomSet_impl.hpp" 14 15 15 16 using namespace std; -
src/World.cpp
r61ea5b rfa0b18 9 9 10 10 #include "World.hpp" 11 #include "AtomSet_impl.hpp" 11 12 12 13 #include "atom.hpp" … … 265 266 /******************************* Iterators ********************************/ 266 267 268 // external parts with observers 269 270 CONSTRUCT_SELECTIVE_ITERATOR(atom*,World::AtomSet,AtomDescriptor); 271 272 World::AtomIterator 273 World::getAtomIter(AtomDescriptor descr){ 274 return AtomIterator(descr,atoms); 275 } 276 277 World::AtomIterator 278 World::getAtomIter(){ 279 return AtomIterator(AllAtoms(),atoms); 280 } 281 282 World::AtomIterator 283 World::atomEnd(){ 284 return AtomIterator(AllAtoms(),atoms,atoms.end()); 285 } 286 287 // Internal parts, without observers 288 267 289 // Build the AtomIterator from template 268 CONSTRUCT_SELECTIVE_ITERATOR(atom*,World::AtomSet,AtomDescriptor); 269 270 271 World::AtomIterator World::getAtomIter(AtomDescriptor descr){ 272 return AtomIterator(descr,atoms); 273 } 274 275 World::AtomIterator World::atomEnd(){ 276 return AtomIterator(AllAtoms(),atoms,atoms.end()); 290 CONSTRUCT_SELECTIVE_ITERATOR(atom*,World::AtomSet::set_t,AtomDescriptor); 291 292 293 World::internal_AtomIterator 294 World::getAtomIter_internal(AtomDescriptor descr){ 295 return internal_AtomIterator(descr,atoms.getContent()); 296 } 297 298 World::internal_AtomIterator 299 World::atomEnd_internal(){ 300 return internal_AtomIterator(AllAtoms(),atoms.getContent(),atoms.end_internal()); 277 301 } 278 302 … … 296 320 Thermostats(new ThermoStatContainer), 297 321 ExitFlag(0), 298 atoms( ),322 atoms(this), 299 323 currAtomId(0), 300 324 molecules(), -
src/World.hpp
r61ea5b rfa0b18 23 23 #include "Patterns/Cacheable.hpp" 24 24 #include "Patterns/Singleton.hpp" 25 #include "AtomSet.hpp" 25 26 26 27 // include config.h … … 45 46 class ThermoStatContainer; 46 47 48 47 49 /****************************************** forward declarations *****************************/ 48 50 … … 67 69 68 70 // Types for Atom and Molecule structures 69 typedef std::map<atomId_t,atom*>AtomSet;71 typedef _AtomSet AtomSet; 70 72 typedef std::map<moleculeId_t,molecule*> MoleculeSet; 71 73 … … 216 218 ManipulateAtomsProcess* manipulateAtoms(boost::function<void(atom*)>,std::string); 217 219 220 /**** 221 * Iterators to use internal data structures 222 * All these iterators are observed to track changes. 223 * There is a corresponding protected section with unobserved iterators, 224 * which ca be used internally when the extra speed is needed 225 */ 226 227 typedef SelectiveIterator<atom*,AtomSet,AtomDescriptor> AtomIterator; 228 229 /** 230 * returns an iterator over all Atoms matching a given descriptor. 231 * This iterator is observed, so don't keep it around unnecessary to 232 * avoid unintended blocking. 233 */ 234 AtomIterator getAtomIter(AtomDescriptor descr); 235 AtomIterator getAtomIter(); 236 237 AtomIterator atomEnd(); 238 218 239 protected: 219 /**** Iterators to use internal data structures */ 240 /**** 241 * Iterators to use internal data structures 242 * All these iterators are unobserved for speed reasons. 243 * There is a corresponding public section to these methods, 244 * which produce observed iterators.*/ 220 245 221 246 // Atoms 222 typedef SelectiveIterator<atom*,AtomSet,AtomDescriptor>AtomIterator;247 typedef AtomSet::selective_internal_iterator internal_AtomIterator; 223 248 224 249 /** … … 226 251 * used for internal purposes, like AtomProcesses and AtomCalculations. 227 252 */ 228 AtomIterator getAtomIter(AtomDescriptor descr);253 internal_AtomIterator getAtomIter_internal(AtomDescriptor descr); 229 254 230 255 /** … … 234 259 * used for internal purposes, like AtomProcesses and AtomCalculations. 235 260 */ 236 AtomIterator atomEnd();261 internal_AtomIterator atomEnd_internal(); 237 262 238 263 // Molecules
Note:
See TracChangeset
for help on using the changeset viewer.