Changes in src/World.hpp [cf0ca1:43dad6]
- File:
-
- 1 edited
-
src/World.hpp (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/World.hpp
rcf0ca1 r43dad6 23 23 #include "Patterns/Cacheable.hpp" 24 24 #include "Patterns/Singleton.hpp" 25 #include "Patterns/ObservedContainer.hpp"26 25 27 26 // include config.h … … 35 34 class AtomDescriptor_impl; 36 35 template<typename T> class AtomsCalculation; 37 class Box;38 36 class config; 39 37 class ManipulateAtomsProcess; 40 class Matrix;41 38 class molecule; 42 39 class MoleculeDescriptor; … … 46 43 class ThermoStatContainer; 47 44 48 49 45 /****************************************** forward declarations *****************************/ 50 46 … … 62 58 friend class MoleculeDescriptor_impl; 63 59 friend class MoleculeDescriptor; 64 // coupling with descriptors over selection65 friend class AtomSelectionDescriptor_impl;66 friend class MoleculeSelectionDescriptor_impl;67 60 68 61 // Actions, calculations etc associated with the World … … 72 65 73 66 // Types for Atom and Molecule structures 74 typedef ObservedContainer<std::map<atomId_t,atom*>> AtomSet;75 typedef ObservedContainer<std::map<moleculeId_t,molecule*>> MoleculeSet;67 typedef std::map<atomId_t,atom*> AtomSet; 68 typedef std::map<moleculeId_t,molecule*> MoleculeSet; 76 69 77 70 /***** getter and setter *****/ … … 132 125 * get the domain size as a symmetric matrix (6 components) 133 126 */ 134 Box& getDomain(); 135 136 /** 137 * Set the domain size from a matrix object 138 * 139 * Matrix needs to be symmetric 140 */ 141 void setDomain(const Matrix &mat); 127 double * getDomain(); 142 128 143 129 /** … … 221 207 ManipulateAtomsProcess* manipulateAtoms(boost::function<void(atom*)>,std::string); 222 208 223 /****224 * Iterators to use internal data structures225 * All these iterators are observed to track changes.226 * There is a corresponding protected section with unobserved iterators,227 * which can be used internally when the extra speed is needed228 */229 230 typedef SelectiveIterator<atom*,AtomSet,AtomDescriptor> AtomIterator;231 232 /**233 * returns an iterator over all Atoms matching a given descriptor.234 * This iterator is observed, so don't keep it around unnecessary to235 * avoid unintended blocking.236 */237 AtomIterator getAtomIter(AtomDescriptor descr);238 AtomIterator getAtomIter();239 240 AtomIterator atomEnd();241 242 typedef SelectiveIterator<molecule*,MoleculeSet,MoleculeDescriptor> MoleculeIterator;243 244 /**245 * returns an iterator over all Molecules matching a given descriptor.246 * This iterator is observed, so don't keep it around unnecessary to247 * avoid unintended blocking.248 */249 MoleculeIterator getMoleculeIter(MoleculeDescriptor descr);250 MoleculeIterator getMoleculeIter();251 252 MoleculeIterator moleculeEnd();253 254 /******** Selections of molecules and Atoms *************/255 void clearAtomSelection();256 void selectAtom(atom*);257 void selectAtom(atomId_t);258 void selectAllAtoms(AtomDescriptor);259 void selectAtomsOfMolecule(molecule*);260 void selectAtomsOfMolecule(moleculeId_t);261 void unselectAtom(atom*);262 void unselectAtom(atomId_t);263 void unselectAllAtoms(AtomDescriptor);264 void unselectAtomsOfMolecule(molecule*);265 void unselectAtomsOfMolecule(moleculeId_t);266 267 void clearMoleculeSelection();268 void selectMolecule(molecule*);269 void selectMolecule(moleculeId_t);270 void selectAllMoleculess(MoleculeDescriptor);271 void selectMoleculeOfAtom(atom*);272 void selectMoleculeOfAtom(atomId_t);273 void unselectMolecule(molecule*);274 void unselectMolecule(moleculeId_t);275 void unselectAllMoleculess(MoleculeDescriptor);276 void unselectMoleculeOfAtom(atom*);277 void unselectMoleculeOfAtom(atomId_t);278 279 /******************** Iterators to selections *****************/280 typedef AtomSet::iterator AtomSelectionIterator;281 AtomSelectionIterator beginAtomSelection();282 AtomSelectionIterator endAtomSelection();283 284 typedef MoleculeSet::iterator MoleculeSelectionIterator;285 MoleculeSelectionIterator beginMoleculeSelection();286 MoleculeSelectionIterator endMoleculeSelection();287 288 209 protected: 289 /**** 290 * Iterators to use internal data structures 291 * All these iterators are unobserved for speed reasons. 292 * There is a corresponding public section to these methods, 293 * which produce observed iterators.*/ 210 /**** Iterators to use internal data structures */ 294 211 295 212 // Atoms 296 typedef SelectiveIterator<atom*,AtomSet ::set_t,AtomDescriptor> internal_AtomIterator;213 typedef SelectiveIterator<atom*,AtomSet,AtomDescriptor> AtomIterator; 297 214 298 215 /** … … 300 217 * used for internal purposes, like AtomProcesses and AtomCalculations. 301 218 */ 302 internal_AtomIterator getAtomIter_internal(AtomDescriptor descr);219 AtomIterator getAtomIter(AtomDescriptor descr); 303 220 304 221 /** … … 308 225 * used for internal purposes, like AtomProcesses and AtomCalculations. 309 226 */ 310 internal_AtomIterator atomEnd_internal();227 AtomIterator atomEnd(); 311 228 312 229 // Molecules 313 typedef SelectiveIterator<molecule*,MoleculeSet::set_t,MoleculeDescriptor> internal_MoleculeIterator; 314 230 231 typedef SelectiveIterator<molecule*,MoleculeSet,MoleculeDescriptor> MoleculeIterator; 315 232 316 233 /** … … 318 235 * used for internal purposes, like MoleculeProcesses and MoleculeCalculations. 319 236 */ 320 internal_MoleculeIterator getMoleculeIter_internal(MoleculeDescriptor descr);237 MoleculeIterator getMoleculeIter(MoleculeDescriptor descr); 321 238 322 239 /** … … 326 243 * used for internal purposes, like MoleculeProcesses and MoleculeCalculations. 327 244 */ 328 internal_MoleculeIterator moleculeEnd_internal();245 MoleculeIterator moleculeEnd(); 329 246 330 247 … … 337 254 void releaseAtomId(atomId_t); 338 255 bool reserveAtomId(atomId_t); 339 void defragAtomIdPool();340 341 moleculeId_t getNextMoleculeId();342 void releaseMoleculeId(moleculeId_t);343 bool reserveMoleculeId(moleculeId_t);344 void defragMoleculeIdPool();345 256 346 257 periodentafel *periode; 347 258 config *configuration; 348 Box*cell_size;259 static double *cell_size; 349 260 std::string defaultName; 350 261 class ThermoStatContainer *Thermostats; 351 262 int ExitFlag; 352 private: 353 263 public: 354 264 AtomSet atoms; 355 AtomSet selectedAtoms; 356 typedef std::set<std::pair<atomId_t, atomId_t> > atomIdPool_t; 357 /** 358 * stores the pool for all available AtomIds below currAtomId 359 * 360 * The pool contains ranges of free ids in the form [bottom,top). 361 */ 362 atomIdPool_t atomIdPool; 265 private: 266 std::set<atomId_t> atomIdPool; //<!stores the pool for all available AtomIds below currAtomId 363 267 atomId_t currAtomId; //!< stores the next available Id for atoms 364 size_t lastAtomPoolSize; //!< size of the pool after last defrag, to skip some defrags365 unsigned int numAtomDefragSkips;366 367 268 MoleculeSet molecules; 368 MoleculeSet selectedMolecules;369 typedef std::set<std::pair<moleculeId_t, moleculeId_t> > moleculeIdPool_t;370 /**371 * stores the pool for all available AtomIds below currAtomId372 *373 * The pool contains ranges of free ids in the form [bottom,top).374 */375 moleculeIdPool_t moleculeIdPool;376 269 moleculeId_t currMoleculeId; 377 size_t lastMoleculePoolSize; //!< size of the pool after last defrag, to skip some defrags378 unsigned int numMoleculeDefragSkips;379 270 private: 380 271 /**
Note:
See TracChangeset
for help on using the changeset viewer.
