Changes in src/World.cpp [387b36:6cb9c76]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/World.cpp
r387b36 r6cb9c76 6 6 */ 7 7 8 #include "Helpers/MemDebug.hpp" 9 8 10 #include "World.hpp" 11 12 #include <functional> 9 13 10 14 #include "atom.hpp" … … 12 16 #include "molecule.hpp" 13 17 #include "periodentafel.hpp" 18 #include "ThermoStatContainer.hpp" 14 19 #include "Descriptors/AtomDescriptor.hpp" 15 20 #include "Descriptors/AtomDescriptor_impl.hpp" … … 18 23 #include "Descriptors/SelectiveIterator_impl.hpp" 19 24 #include "Actions/ManipulateAtomsProcess.hpp" 25 #include "Helpers/Assert.hpp" 26 #include "Box.hpp" 27 #include "Matrix.hpp" 28 #include "defs.hpp" 20 29 21 30 #include "Patterns/Singleton_impl.hpp" 31 #include "Patterns/ObservedContainer_impl.hpp" 22 32 23 33 using namespace std; 34 35 const unsigned int MAX_POOL_FRAGMENTATION=20; 36 const unsigned int MAX_FRAGMENTATION_SKIPS=100; 24 37 25 38 /******************************* getter and setter ************************/ … … 38 51 } 39 52 40 vector<atom*>World::getAllAtoms(AtomDescriptor descriptor){53 World::AtomComposite World::getAllAtoms(AtomDescriptor descriptor){ 41 54 return descriptor.findAll(); 42 55 } 43 56 44 vector<atom*>World::getAllAtoms(){57 World::AtomComposite World::getAllAtoms(){ 45 58 return getAllAtoms(AllAtoms()); 46 59 } … … 70 83 // system 71 84 72 double * World::getDomain() { 73 return cell_size; 85 Box& World::getDomain() { 86 return *cell_size; 87 } 88 89 void World::setDomain(const Matrix &mat){ 90 OBSERVE; 91 *cell_size = mat; 74 92 } 75 93 76 94 void World::setDomain(double * matrix) 77 95 { 78 96 OBSERVE; 97 Matrix M = ReturnFullMatrixforSymmetric(matrix); 98 cell_size->setM(M); 79 99 } 80 100 … … 85 105 void World::setDefaultName(std::string name) 86 106 { 107 OBSERVE; 87 108 defaultName = name; 88 109 }; 110 111 class ThermoStatContainer * World::getThermostats() 112 { 113 return Thermostats; 114 } 115 89 116 90 117 int World::getExitFlag() { … … 103 130 molecule *mol = NULL; 104 131 mol = NewMolecule(); 105 assert(!molecules.count(currMoleculeId)); 106 mol->setId(currMoleculeId++); 132 moleculeId_t id = getNextMoleculeId(); 133 ASSERT(!molecules.count(id),"proposed id did not specify an unused ID"); 134 mol->setId(id); 107 135 // store the molecule by ID 108 136 molecules[mol->getId()] = mol; … … 119 147 OBSERVE; 120 148 molecule *mol = molecules[id]; 121 assert(mol);149 ASSERT(mol,"Molecule id that was meant to be destroyed did not exist"); 122 150 DeleteMolecule(mol); 123 151 molecules.erase(id); 124 } 125 126 double *World::cell_size = NULL; 152 releaseMoleculeId(id); 153 } 127 154 128 155 atom *World::createAtom(){ 129 156 OBSERVE; 130 157 atomId_t id = getNextAtomId(); 158 ASSERT(!atoms.count(id),"proposed id did not specify an unused ID"); 131 159 atom *res = NewAtom(id); 132 160 res->setWorld(this); … … 155 183 OBSERVE; 156 184 atom *atom = atoms[id]; 157 assert(atom);185 ASSERT(atom,"Atom ID that was meant to be destroyed did not exist"); 158 186 DeleteAtom(atom); 159 187 atoms.erase(id); … … 167 195 if(!target){ 168 196 target = atoms[oldId]; 169 assert(target &&"Atom with that ID not found");197 ASSERT(target,"Atom with that ID not found"); 170 198 return target->changeId(newId); 171 199 } … … 205 233 206 234 atomId_t World::getNextAtomId(){ 207 // see if we can reuse some Id 208 if(atomIdPool.empty()){ 209 return currAtomId++; 210 } 211 else{ 212 // we give out the first ID from the pool 213 atomId_t id = *(atomIdPool.begin()); 214 atomIdPool.erase(id); 235 // try to find an Id in the pool; 236 if(!atomIdPool.empty()){ 237 atomIdPool_t::iterator iter=atomIdPool.begin(); 238 atomId_t id = iter->first; 239 range<atomId_t> newRange = makeRange(id+1,iter->last); 240 // we wont use this iterator anymore, so we don't care about invalidating 241 atomIdPool.erase(iter); 242 if(newRange.first<newRange.last){ 243 atomIdPool.insert(newRange); 244 } 215 245 return id; 216 246 } 247 // Nothing in the pool... we are out of luck 248 return currAtomId++; 217 249 } 218 250 219 251 void World::releaseAtomId(atomId_t id){ 220 atomIdPool.insert(id); 221 // defragmentation of the pool 222 set<atomId_t>::reverse_iterator iter; 223 // go through all Ids in the pool that lie immediately below the border 224 while(!atomIdPool.empty() && *(atomIdPool.rbegin())==(currAtomId-1)){ 225 atomIdPool.erase(--currAtomId); 226 } 252 atomIdPool.insert(makeRange(id,id+1)); 253 defragAtomIdPool(); 227 254 } 228 255 229 256 bool World::reserveAtomId(atomId_t id){ 230 257 if(id>=currAtomId ){ 231 // add all ids between the new one and current border as available232 for(atomId_t pos=currAtomId; pos<id; ++pos){233 atomIdPool.insert( pos);258 range<atomId_t> newRange = makeRange(currAtomId,id); 259 if(newRange.first<newRange.last){ 260 atomIdPool.insert(newRange); 234 261 } 235 262 currAtomId=id+1; 263 defragAtomIdPool(); 236 264 return true; 237 265 } 238 else if(atomIdPool.count(id)){ 239 atomIdPool.erase(id); 266 // look for a range that matches the request 267 for(atomIdPool_t::iterator iter=atomIdPool.begin();iter!=atomIdPool.end();++iter){ 268 if(iter->isBefore(id)){ 269 // we have covered all available ranges... nothing to be found here 270 break; 271 } 272 // no need to check first, since it has to be <=id, since otherwise we would have broken out 273 if(!iter->isBeyond(id)){ 274 // we found a matching range... get the id from this range 275 276 // split up this range at the point of id 277 range<atomId_t> bottomRange = makeRange(iter->first,id); 278 range<atomId_t> topRange = makeRange(id+1,iter->last); 279 // remove this range 280 atomIdPool.erase(iter); 281 if(bottomRange.first<bottomRange.last){ 282 atomIdPool.insert(bottomRange); 283 } 284 if(topRange.first<topRange.last){ 285 atomIdPool.insert(topRange); 286 } 287 defragAtomIdPool(); 288 return true; 289 } 290 } 291 // this ID could not be reserved 292 return false; 293 } 294 295 void World::defragAtomIdPool(){ 296 // check if the situation is bad enough to make defragging neccessary 297 if((numAtomDefragSkips<MAX_FRAGMENTATION_SKIPS) && 298 (atomIdPool.size()<lastAtomPoolSize+MAX_POOL_FRAGMENTATION)){ 299 ++numAtomDefragSkips; 300 return; 301 } 302 for(atomIdPool_t::iterator iter = atomIdPool.begin();iter!=atomIdPool.end();){ 303 // see if this range is adjacent to the next one 304 atomIdPool_t::iterator next = iter; 305 next++; 306 if(next!=atomIdPool.end() && (next->first==iter->last)){ 307 // merge the two ranges 308 range<atomId_t> newRange = makeRange(iter->first,next->last); 309 atomIdPool.erase(iter); 310 atomIdPool.erase(next); 311 pair<atomIdPool_t::iterator,bool> res = atomIdPool.insert(newRange); 312 ASSERT(res.second,"Id-Pool was confused"); 313 iter=res.first; 314 continue; 315 } 316 ++iter; 317 } 318 if(!atomIdPool.empty()){ 319 // check if the last range is at the border 320 atomIdPool_t::iterator iter = atomIdPool.end(); 321 iter--; 322 if(iter->last==currAtomId){ 323 currAtomId=iter->first; 324 atomIdPool.erase(iter); 325 } 326 } 327 lastAtomPoolSize=atomIdPool.size(); 328 numAtomDefragSkips=0; 329 } 330 331 // Molecules 332 333 moleculeId_t World::getNextMoleculeId(){ 334 // try to find an Id in the pool; 335 if(!moleculeIdPool.empty()){ 336 moleculeIdPool_t::iterator iter=moleculeIdPool.begin(); 337 moleculeId_t id = iter->first; 338 range<moleculeId_t> newRange = makeRange(id+1,iter->last); 339 // we wont use this iterator anymore, so we don't care about invalidating 340 moleculeIdPool.erase(iter); 341 if(newRange.first<newRange.last){ 342 moleculeIdPool.insert(newRange); 343 } 344 return id; 345 } 346 // Nothing in the pool... we are out of luck 347 return currMoleculeId++; 348 } 349 350 void World::releaseMoleculeId(moleculeId_t id){ 351 moleculeIdPool.insert(makeRange(id,id+1)); 352 defragMoleculeIdPool(); 353 } 354 355 bool World::reserveMoleculeId(moleculeId_t id){ 356 if(id>=currMoleculeId ){ 357 range<moleculeId_t> newRange = makeRange(currMoleculeId,id); 358 if(newRange.first<newRange.last){ 359 moleculeIdPool.insert(newRange); 360 } 361 currMoleculeId=id+1; 362 defragMoleculeIdPool(); 240 363 return true; 241 364 } 242 else{ 243 // this ID could not be reserved 244 return false; 245 } 246 } 365 // look for a range that matches the request 366 for(moleculeIdPool_t::iterator iter=moleculeIdPool.begin();iter!=moleculeIdPool.end();++iter){ 367 if(iter->isBefore(id)){ 368 // we have coverd all available ranges... nothing to be found here 369 break; 370 } 371 // no need to check first, since it has to be <=id, since otherwise we would have broken out 372 if(!iter->isBeyond(id)){ 373 // we found a matching range... get the id from this range 374 375 // split up this range at the point of id 376 range<moleculeId_t> bottomRange = makeRange(iter->first,id); 377 range<moleculeId_t> topRange = makeRange(id+1,iter->last); 378 // remove this range 379 moleculeIdPool.erase(iter); 380 if(bottomRange.first<bottomRange.last){ 381 moleculeIdPool.insert(bottomRange); 382 } 383 if(topRange.first<topRange.last){ 384 moleculeIdPool.insert(topRange); 385 } 386 defragMoleculeIdPool(); 387 return true; 388 } 389 } 390 // this ID could not be reserved 391 return false; 392 } 393 394 void World::defragMoleculeIdPool(){ 395 // check if the situation is bad enough to make defragging neccessary 396 if((numMoleculeDefragSkips<MAX_FRAGMENTATION_SKIPS) && 397 (moleculeIdPool.size()<lastMoleculePoolSize+MAX_POOL_FRAGMENTATION)){ 398 ++numMoleculeDefragSkips; 399 return; 400 } 401 for(moleculeIdPool_t::iterator iter = moleculeIdPool.begin();iter!=moleculeIdPool.end();){ 402 // see if this range is adjacent to the next one 403 moleculeIdPool_t::iterator next = iter; 404 next++; 405 if(next!=moleculeIdPool.end() && (next->first==iter->last)){ 406 // merge the two ranges 407 range<moleculeId_t> newRange = makeRange(iter->first,next->last); 408 moleculeIdPool.erase(iter); 409 moleculeIdPool.erase(next); 410 pair<moleculeIdPool_t::iterator,bool> res = moleculeIdPool.insert(newRange); 411 ASSERT(res.second,"Id-Pool was confused"); 412 iter=res.first; 413 continue; 414 } 415 ++iter; 416 } 417 if(!moleculeIdPool.empty()){ 418 // check if the last range is at the border 419 moleculeIdPool_t::iterator iter = moleculeIdPool.end(); 420 iter--; 421 if(iter->last==currMoleculeId){ 422 currMoleculeId=iter->first; 423 moleculeIdPool.erase(iter); 424 } 425 } 426 lastMoleculePoolSize=moleculeIdPool.size(); 427 numMoleculeDefragSkips=0; 428 } 429 430 /******************************* Iterators ********************************/ 431 432 // external parts with observers 433 434 CONSTRUCT_SELECTIVE_ITERATOR(atom*,World::AtomSet,AtomDescriptor); 435 436 World::AtomIterator 437 World::getAtomIter(AtomDescriptor descr){ 438 return AtomIterator(descr,atoms); 439 } 440 441 World::AtomIterator 442 World::getAtomIter(){ 443 return AtomIterator(AllAtoms(),atoms); 444 } 445 446 World::AtomIterator 447 World::atomEnd(){ 448 return AtomIterator(AllAtoms(),atoms,atoms.end()); 449 } 450 451 CONSTRUCT_SELECTIVE_ITERATOR(molecule*,World::MoleculeSet,MoleculeDescriptor); 452 453 World::MoleculeIterator 454 World::getMoleculeIter(MoleculeDescriptor descr){ 455 return MoleculeIterator(descr,molecules); 456 } 457 458 World::MoleculeIterator 459 World::getMoleculeIter(){ 460 return MoleculeIterator(AllMolecules(),molecules); 461 } 462 463 World::MoleculeIterator 464 World::moleculeEnd(){ 465 return MoleculeIterator(AllMolecules(),molecules,molecules.end()); 466 } 467 468 // Internal parts, without observers 469 470 // Build the AtomIterator from template 471 CONSTRUCT_SELECTIVE_ITERATOR(atom*,World::AtomSet::set_t,AtomDescriptor); 472 473 474 World::internal_AtomIterator 475 World::getAtomIter_internal(AtomDescriptor descr){ 476 return internal_AtomIterator(descr,atoms.getContent()); 477 } 478 479 World::internal_AtomIterator 480 World::atomEnd_internal(){ 481 return internal_AtomIterator(AllAtoms(),atoms.getContent(),atoms.end_internal()); 482 } 483 484 // build the MoleculeIterator from template 485 CONSTRUCT_SELECTIVE_ITERATOR(molecule*,World::MoleculeSet::set_t,MoleculeDescriptor); 486 487 World::internal_MoleculeIterator World::getMoleculeIter_internal(MoleculeDescriptor descr){ 488 return internal_MoleculeIterator(descr,molecules.getContent()); 489 } 490 491 World::internal_MoleculeIterator World::moleculeEnd_internal(){ 492 return internal_MoleculeIterator(AllMolecules(),molecules.getContent(),molecules.end_internal()); 493 } 494 495 /************************** Selection of Atoms and molecules ******************/ 496 497 // Atoms 498 499 void World::clearAtomSelection(){ 500 selectedAtoms.clear(); 501 } 502 503 void World::selectAtom(atom *atom){ 504 ASSERT(atom,"Invalid pointer in selection of atom"); 505 selectedAtoms[atom->getId()]=atom; 506 } 507 508 void World::selectAtom(atomId_t id){ 509 ASSERT(atoms.count(id),"Atom Id selected that was not in the world"); 510 selectedAtoms[id]=atoms[id]; 511 } 512 513 void World::selectAllAtoms(AtomDescriptor descr){ 514 internal_AtomIterator begin = getAtomIter_internal(descr); 515 internal_AtomIterator end = atomEnd_internal(); 516 void (World::*func)(atom*) = &World::selectAtom; // needed for type resolution of overloaded function 517 for_each(begin,end,bind1st(mem_fun(func),this)); // func is select... see above 518 } 519 520 void World::selectAtomsOfMolecule(molecule *_mol){ 521 ASSERT(_mol,"Invalid pointer to molecule in selection of Atoms of Molecule"); 522 // need to make it const to get the fast iterators 523 const molecule *mol = _mol; 524 void (World::*func)(atom*) = &World::selectAtom; // needed for type resolution of overloaded function 525 for_each(mol->begin(),mol->end(),bind1st(mem_fun(func),this)); // func is select... see above 526 } 527 528 void World::selectAtomsOfMolecule(moleculeId_t id){ 529 ASSERT(molecules.count(id),"No molecule with the given id upon Selection of atoms from molecule"); 530 selectAtomsOfMolecule(molecules[id]); 531 } 532 533 void World::unselectAtom(atom *atom){ 534 ASSERT(atom,"Invalid pointer in unselection of atom"); 535 unselectAtom(atom->getId()); 536 } 537 538 void World::unselectAtom(atomId_t id){ 539 ASSERT(atoms.count(id),"Atom Id unselected that was not in the world"); 540 selectedAtoms.erase(id); 541 } 542 543 void World::unselectAllAtoms(AtomDescriptor descr){ 544 internal_AtomIterator begin = getAtomIter_internal(descr); 545 internal_AtomIterator end = atomEnd_internal(); 546 void (World::*func)(atom*) = &World::unselectAtom; // needed for type resolution of overloaded function 547 for_each(begin,end,bind1st(mem_fun(func),this)); // func is unselect... see above 548 } 549 550 void World::unselectAtomsOfMolecule(molecule *_mol){ 551 ASSERT(_mol,"Invalid pointer to molecule in selection of Atoms of Molecule"); 552 // need to make it const to get the fast iterators 553 const molecule *mol = _mol; 554 void (World::*func)(atom*) = &World::unselectAtom; // needed for type resolution of overloaded function 555 for_each(mol->begin(),mol->end(),bind1st(mem_fun(func),this)); // func is unsselect... see above 556 } 557 558 void World::unselectAtomsOfMolecule(moleculeId_t id){ 559 ASSERT(molecules.count(id),"No molecule with the given id upon Selection of atoms from molecule"); 560 unselectAtomsOfMolecule(molecules[id]); 561 } 562 563 size_t World::countSelectedAtoms() const { 564 size_t count = 0; 565 for (AtomSet::const_iterator iter = selectedAtoms.begin(); iter != selectedAtoms.end(); ++iter) 566 count++; 567 return count; 568 } 569 570 bool World::isSelected(atom *atom) const { 571 return selectedAtoms.find(atom->getId()) != selectedAtoms.end(); 572 } 573 574 const std::vector<atom *> World::getSelectedAtoms() const { 575 std::vector<atom *> returnAtoms; 576 returnAtoms.resize(countSelectedAtoms()); 577 int count = 0; 578 for (AtomSet::const_iterator iter = selectedAtoms.begin(); iter != selectedAtoms.end(); ++iter) 579 returnAtoms[count++] = iter->second; 580 return returnAtoms; 581 } 582 247 583 248 584 // Molecules 249 585 250 /******************************* Iterators ********************************/ 251 252 // Build the AtomIterator from template 253 CONSTRUCT_SELECTIVE_ITERATOR(atom*,World::AtomSet,AtomDescriptor); 254 255 256 World::AtomIterator World::getAtomIter(AtomDescriptor descr){ 257 return AtomIterator(descr,atoms); 258 } 259 260 World::AtomIterator World::atomEnd(){ 261 return AtomIterator(AllAtoms(),atoms,atoms.end()); 262 } 263 264 // build the MoleculeIterator from template 265 CONSTRUCT_SELECTIVE_ITERATOR(molecule*,World::MoleculeSet,MoleculeDescriptor); 266 267 World::MoleculeIterator World::getMoleculeIter(MoleculeDescriptor descr){ 268 return MoleculeIterator(descr,molecules); 269 } 270 271 World::MoleculeIterator World::moleculeEnd(){ 272 return MoleculeIterator(AllMolecules(),molecules,molecules.end()); 586 void World::clearMoleculeSelection(){ 587 selectedMolecules.clear(); 588 } 589 590 void World::selectMolecule(molecule *mol){ 591 ASSERT(mol,"Invalid pointer to molecule in selection"); 592 selectedMolecules[mol->getId()]=mol; 593 } 594 595 void World::selectMolecule(moleculeId_t id){ 596 ASSERT(molecules.count(id),"Molecule Id selected that was not in the world"); 597 selectedMolecules[id]=molecules[id]; 598 } 599 600 void World::selectAllMolecules(MoleculeDescriptor descr){ 601 internal_MoleculeIterator begin = getMoleculeIter_internal(descr); 602 internal_MoleculeIterator end = moleculeEnd_internal(); 603 void (World::*func)(molecule*) = &World::selectMolecule; // needed for type resolution of overloaded function 604 for_each(begin,end,bind1st(mem_fun(func),this)); // func is select... see above 605 } 606 607 void World::selectMoleculeOfAtom(atom *atom){ 608 ASSERT(atom,"Invalid atom pointer in selection of MoleculeOfAtom"); 609 molecule *mol=atom->getMolecule(); 610 // the atom might not be part of a molecule 611 if(mol){ 612 selectMolecule(mol); 613 } 614 } 615 616 void World::selectMoleculeOfAtom(atomId_t id){ 617 ASSERT(atoms.count(id),"No such atom with given ID in selection of Molecules of Atom");\ 618 selectMoleculeOfAtom(atoms[id]); 619 } 620 621 void World::unselectMolecule(molecule *mol){ 622 ASSERT(mol,"invalid pointer in unselection of molecule"); 623 unselectMolecule(mol->getId()); 624 } 625 626 void World::unselectMolecule(moleculeId_t id){ 627 ASSERT(molecules.count(id),"No such molecule with ID in unselection"); 628 selectedMolecules.erase(id); 629 } 630 631 void World::unselectAllMolecules(MoleculeDescriptor descr){ 632 internal_MoleculeIterator begin = getMoleculeIter_internal(descr); 633 internal_MoleculeIterator end = moleculeEnd_internal(); 634 void (World::*func)(molecule*) = &World::unselectMolecule; // needed for type resolution of overloaded function 635 for_each(begin,end,bind1st(mem_fun(func),this)); // func is unselect... see above 636 } 637 638 void World::unselectMoleculeOfAtom(atom *atom){ 639 ASSERT(atom,"Invalid atom pointer in selection of MoleculeOfAtom"); 640 molecule *mol=atom->getMolecule(); 641 // the atom might not be part of a molecule 642 if(mol){ 643 unselectMolecule(mol); 644 } 645 } 646 647 void World::unselectMoleculeOfAtom(atomId_t id){ 648 ASSERT(atoms.count(id),"No such atom with given ID in selection of Molecules of Atom");\ 649 unselectMoleculeOfAtom(atoms[id]); 650 } 651 652 size_t World::countSelectedMolecules() const { 653 size_t count = 0; 654 for (MoleculeSet::const_iterator iter = selectedMolecules.begin(); iter != selectedMolecules.end(); ++iter) 655 count++; 656 return count; 657 } 658 659 bool World::isSelected(molecule *mol) const { 660 return selectedMolecules.find(mol->getId()) != selectedMolecules.end(); 661 } 662 663 const std::vector<molecule *> World::getSelectedMolecules() const { 664 std::vector<molecule *> returnMolecules; 665 returnMolecules.resize(countSelectedMolecules()); 666 int count = 0; 667 for (MoleculeSet::const_iterator iter = selectedMolecules.begin(); iter != selectedMolecules.end(); ++iter) 668 returnMolecules[count++] = iter->second; 669 return returnMolecules; 670 } 671 672 /******************* Iterators over Selection *****************************/ 673 World::AtomSelectionIterator World::beginAtomSelection(){ 674 return selectedAtoms.begin(); 675 } 676 677 World::AtomSelectionIterator World::endAtomSelection(){ 678 return selectedAtoms.end(); 679 } 680 681 682 World::MoleculeSelectionIterator World::beginMoleculeSelection(){ 683 return selectedMolecules.begin(); 684 } 685 686 World::MoleculeSelectionIterator World::endMoleculeSelection(){ 687 return selectedMolecules.end(); 273 688 } 274 689 … … 276 691 277 692 World::World() : 693 Observable("World"), 278 694 periode(new periodentafel), 279 695 configuration(new config), 696 Thermostats(new ThermoStatContainer), 280 697 ExitFlag(0), 281 atoms(), 698 atoms(this), 699 selectedAtoms(this), 282 700 currAtomId(0), 283 molecules(), 701 lastAtomPoolSize(0), 702 numAtomDefragSkips(0), 703 molecules(this), 704 selectedMolecules(this), 284 705 currMoleculeId(0), 285 706 molecules_deprecated(new MoleculeListClass(this)) 286 707 { 287 cell_size = new double[6]; 288 cell_size[0] = 20.; 289 cell_size[1] = 0.; 290 cell_size[2] = 20.; 291 cell_size[3] = 0.; 292 cell_size[4] = 0.; 293 cell_size[5] = 20.; 708 cell_size = new Box; 709 Matrix domain; 710 domain.at(0,0) = 20; 711 domain.at(1,1) = 20; 712 domain.at(2,2) = 20; 713 cell_size->setM(domain); 294 714 defaultName = "none"; 295 715 molecules_deprecated->signOn(this); … … 299 719 { 300 720 molecules_deprecated->signOff(this); 301 delete []cell_size;721 delete cell_size; 302 722 delete molecules_deprecated; 303 delete periode;304 delete configuration;305 723 MoleculeSet::iterator molIter; 306 724 for(molIter=molecules.begin();molIter!=molecules.end();++molIter){ … … 313 731 } 314 732 atoms.clear(); 733 delete periode; 734 delete configuration; 735 delete Thermostats; 315 736 } 316 737
Note:
See TracChangeset
for help on using the changeset viewer.