void Structure::model(Structure &structure) { this->null(); // ID, label, box _id = structure._id; _label = structure._label; this->setBoundary(structure._box->getBox()); if (structure.hasLaplacian()) { if (_laplacian) delete _laplacian; laplace_t &lref = structure.getLaplacian(); _laplacian = new laplace_t(lref.size1(), lref.size2()); (*_laplacian) = lref; } // Segments, particles for (segment_it_t sit = structure.beginSegments(); sit != structure.endSegments(); ++sit) { Segment &new_seg = this->addSegment(); for (particle_it_t pit = (*sit)->beginParticles(); pit != (*sit)->endParticles(); ++pit) { Particle &new_part = this->addParticle(new_seg); new_part.model(*(*pit)); } } }