Changes in src/World.cpp [387b36:84c494]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/World.cpp
r387b36 r84c494 6 6 */ 7 7 8 #include "Helpers/MemDebug.hpp" 9 8 10 #include "World.hpp" 9 11 … … 12 14 #include "molecule.hpp" 13 15 #include "periodentafel.hpp" 16 #include "ThermoStatContainer.hpp" 14 17 #include "Descriptors/AtomDescriptor.hpp" 15 18 #include "Descriptors/AtomDescriptor_impl.hpp" … … 18 21 #include "Descriptors/SelectiveIterator_impl.hpp" 19 22 #include "Actions/ManipulateAtomsProcess.hpp" 23 #include "Helpers/Assert.hpp" 24 #include "Box.hpp" 25 #include "Matrix.hpp" 20 26 21 27 #include "Patterns/Singleton_impl.hpp" … … 70 76 // system 71 77 72 double * World::getDomain() { 73 return cell_size; 78 Box& World::getDomain() { 79 return *cell_size; 80 } 81 82 void World::setDomain(const Matrix &mat){ 83 *cell_size = mat; 74 84 } 75 85 76 86 void World::setDomain(double * matrix) 77 87 { 78 88 Matrix M = ReturnFullMatrixforSymmetric(matrix); 89 cell_size->setM(M); 79 90 } 80 91 … … 87 98 defaultName = name; 88 99 }; 100 101 class ThermoStatContainer * World::getThermostats() 102 { 103 return Thermostats; 104 } 105 89 106 90 107 int World::getExitFlag() { … … 103 120 molecule *mol = NULL; 104 121 mol = NewMolecule(); 105 assert(!molecules.count(currMoleculeId));122 ASSERT(!molecules.count(currMoleculeId),"currMoleculeId did not specify an unused ID"); 106 123 mol->setId(currMoleculeId++); 107 124 // store the molecule by ID … … 119 136 OBSERVE; 120 137 molecule *mol = molecules[id]; 121 assert(mol);138 ASSERT(mol,"Molecule id that was meant to be destroyed did not exist"); 122 139 DeleteMolecule(mol); 123 140 molecules.erase(id); 124 141 } 125 126 double *World::cell_size = NULL;127 142 128 143 atom *World::createAtom(){ … … 155 170 OBSERVE; 156 171 atom *atom = atoms[id]; 157 assert(atom);172 ASSERT(atom,"Atom ID that was meant to be destroyed did not exist"); 158 173 DeleteAtom(atom); 159 174 atoms.erase(id); … … 167 182 if(!target){ 168 183 target = atoms[oldId]; 169 assert(target &&"Atom with that ID not found");184 ASSERT(target,"Atom with that ID not found"); 170 185 return target->changeId(newId); 171 186 } … … 276 291 277 292 World::World() : 293 Observable("World"), 278 294 periode(new periodentafel), 279 295 configuration(new config), 296 Thermostats(new ThermoStatContainer), 280 297 ExitFlag(0), 281 298 atoms(), … … 285 302 molecules_deprecated(new MoleculeListClass(this)) 286 303 { 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.; 304 cell_size = new Box; 305 Matrix domain; 306 domain.at(0,0) = 20; 307 domain.at(1,1) = 20; 308 domain.at(2,2) = 20; 309 cell_size->setM(domain); 294 310 defaultName = "none"; 295 311 molecules_deprecated->signOn(this); … … 299 315 { 300 316 molecules_deprecated->signOff(this); 301 delete []cell_size;317 delete cell_size; 302 318 delete molecules_deprecated; 303 319 delete periode; 304 320 delete configuration; 321 delete Thermostats; 305 322 MoleculeSet::iterator molIter; 306 323 for(molIter=molecules.begin();molIter!=molecules.end();++molIter){
Note:
See TracChangeset
for help on using the changeset viewer.