diff --git a/source/Applications/Thermoplast/thermoplast.cpp b/source/Applications/Thermoplast/thermoplast.cpp index 481664758b6885dad2e6729e8479dae7545bbd8d..a6c7cc098c31c5816fb19061002ef7626cf8366f 100644 --- a/source/Applications/Thermoplast/thermoplast.cpp +++ b/source/Applications/Thermoplast/thermoplast.cpp @@ -152,15 +152,14 @@ std::shared_ptr<DemCoProcessor> makePeCoProcessor(SPtr<Grid3D> grid, SPtr<Commun void createSpheres(double radius, Vector3D origin, double uLB, SPtr<CreateDemObjectsCoProcessor> createSphereCoProcessor) { double d = 2.0*radius; - int maxX2 = 5; - int maxX3 = 6; + int maxX2 = 5;//5; + int maxX3 = 5;//6; for (int x3 = 0; x3 < maxX3; x3++) for (int x2 = 0; x2 < maxX2; x2++) for (int x1 = 0; x1 < 1; x1++) { - SPtr<GbObject3D> sphere(new GbSphere3D(origin[0]+2.0*d*x1, origin[1]+x2*1.5*d, origin[2]+x3*1.5*d, radius)); - - createSphereCoProcessor->addGeoObject(sphere, Vector3D(uLB, -uLB+uLB/2.0*x2, -uLB+uLB/2.5*x3)); + SPtr<GbObject3D> sphere(new GbSphere3D(origin[0]+2.0*d*(double)x1, origin[1]+(double)x2*1.0*d, origin[2]+(double)x3*1.0*d, radius)); + createSphereCoProcessor->addGeoObject(sphere, Vector3D(uLB, -uLB+uLB/2.0*(double)x2, -uLB+uLB/2.5*(double)x3)); } } @@ -207,9 +206,10 @@ void thermoplast(string configname) double deltax = 1; double rhoLB = 0.0; //double uLB = 0.1; - double radius = 5; + double radiusLB = 7.5; + double radiusWorld = 1.5e-3; double Re = 900; - double nuLB = (uLB*2.0*radius)/Re; + double nuLB = (uLB*2.0*radiusLB)/Re; //geometry definition @@ -295,7 +295,7 @@ void thermoplast(string configname) UBLOG(logINFO, "* rhoLB = " << rhoLB); UBLOG(logINFO, "* nuLB = " << nuLB); UBLOG(logINFO, "* deltaX = " << deltax); - UBLOG(logINFO, "* radius = " << radius); + UBLOG(logINFO, "* radius = " << radiusLB); UBLOG(logINFO, "* Re = " << Re); UBLOG(logINFO, "* number of threads = "<<numOfThreads); UBLOG(logINFO, "* number of processes = "<<comm->getNumberOfProcesses()); @@ -466,8 +466,8 @@ void thermoplast(string configname) } //PE initialization - double refLengthLb = radius*2.0; - double refLengthWorld = 2e-3; + double refLengthLb = radiusLB*2.0; + double refLengthWorld = radiusWorld*2.0; const std::shared_ptr<LBMUnitConverter> lbmUnitConverter = std::make_shared<LBMUnitConverter>(refLengthWorld, LBMUnitConverter::WORLD_MATERIAL::AIR_20C, refLengthLb); if (myid == 0) std::cout << lbmUnitConverter->toString() << std::endl; double rhoSphere = 915 * lbmUnitConverter->getFactorDensityWToLb(); // kg/m^3 @@ -492,7 +492,7 @@ void thermoplast(string configname) SPtr<MPIIORestartCoProcessor> restartCoProcessor(new MPIIORestartCoProcessor(grid, restartSch, pathOut, comm)); restartCoProcessor->setLBMKernel(kernel); restartCoProcessor->setBCProcessor(bcProc); - SPtr<RestartDemObjectsCoProcessor> restartDemObjectsCoProcessor(new RestartDemObjectsCoProcessor(grid, restartSch, pathOut, demCoProcessor, createSphereCoProcessor, radius, comm)); + SPtr<RestartDemObjectsCoProcessor> restartDemObjectsCoProcessor(new RestartDemObjectsCoProcessor(grid, restartSch, pathOut, demCoProcessor, createSphereCoProcessor, radiusLB, comm)); //UBLOG(logINFO, "restart definition - stop, rank="<<myid); if (restart) @@ -516,9 +516,9 @@ void thermoplast(string configname) //sphere prototypes //UBLOG(logINFO, "sphere prototypes - start, rank="<<myid); - double d = 2.0*radius; - Vector3D origin1(g_minX1+peMinOffset[0]+radius, geoInjector5->getX2Minimum()+2.0*d, geoInjector5->getX3Minimum()+2.0*d); - createSpheres(radius,origin1,uLB,createSphereCoProcessor); + double d = 2.0*radiusLB; + Vector3D origin1(g_minX1+peMinOffset[0]+radiusLB, geoInjector5->getX2Minimum()+1.5*d, geoInjector5->getX3Minimum()+1.5*d); + createSpheres(radiusLB,origin1,uLB,createSphereCoProcessor); //Vector3D origin2(g_minX1+peMinOffset[0]+radius, geoInjector4->getX2Minimum()+3.0*d, geoInjector4->getX3Minimum()+2.0*d); //createSpheres(radius, origin2, uLB, createSphereCoProcessor); diff --git a/source/DemCoupling/CreateDemObjectsCoProcessor.cpp b/source/DemCoupling/CreateDemObjectsCoProcessor.cpp index bd24c8ecd7a19caffafb1699a4089e666771e90f..71bd6e678f4bd7532d83f87783858593757009fd 100644 --- a/source/DemCoupling/CreateDemObjectsCoProcessor.cpp +++ b/source/DemCoupling/CreateDemObjectsCoProcessor.cpp @@ -36,6 +36,7 @@ CreateDemObjectsCoProcessor::CreateDemObjectsCoProcessor(SPtr<Grid3D> grid, SPtr std::shared_ptr<Reconstructor> equilibriumReconstructor(new EquilibriumReconstructor()); //const std::shared_ptr<Reconstructor> lbmReconstructor(new LBMReconstructor(false)); extrapolationReconstructor = SPtr<Reconstructor>(new ExtrapolationReconstructor(equilibriumReconstructor)); + demCounter = 0; } ////////////////////////////////////////////////////////////////////////// void CreateDemObjectsCoProcessor::process(double step) @@ -55,6 +56,7 @@ void CreateDemObjectsCoProcessor::process(double step) #ifdef TIMING if (comm->isRoot()) UBLOG(logINFO, "createGeoObjects() time = "<<timer.stop()<<" s"); if (comm->isRoot()) UBLOG(logINFO, "number of objects = "<<(int)(geoObjectPrototypeVector.size())); + if (comm->isRoot()) UBLOG(logINFO, "total number of objects = "<<demCounter); if (comm->isRoot()) UBLOG(logINFO, "CreateDemObjectsCoProcessor::process stop step: " << istep); #endif @@ -88,13 +90,6 @@ void CreateDemObjectsCoProcessor::createGeoObjects() for (int i = 0; i < size; i++) { - //timer.resetAndStart(); - //std::array<double, 6> AABB ={ geoObjectPrototypeVector[i]->getX1Minimum(),geoObjectPrototypeVector[i]->getX2Minimum(),geoObjectPrototypeVector[i]->getX3Minimum(),geoObjectPrototypeVector[i]->getX1Maximum(),geoObjectPrototypeVector[i]->getX2Maximum(),geoObjectPrototypeVector[i]->getX3Maximum() }; - //UBLOG(logINFO, "demCoProcessor->isGeoObjectInAABB(AABB) = " << demCoProcessor->isGeoObjectInAABB(AABB)); - //if (demCoProcessor->isDemObjectInAABB(AABB)) - //{ - // continue; - //} SPtr<GbSphere3D> sphere = std::dynamic_pointer_cast<GbSphere3D>(geoObjectPrototypeVector[i]); if (demCoProcessor->isSpheresIntersection(sphere->getX1Centroid(), sphere->getX2Centroid(), sphere->getX3Centroid(), sphere->getRadius()*2.0)) { @@ -103,24 +98,8 @@ void CreateDemObjectsCoProcessor::createGeoObjects() SPtr<GbObject3D> geoObject((GbObject3D*)(geoObjectPrototypeVector[i]->clone())); SPtr<MovableObjectInteractor> geoObjectInt = SPtr<MovableObjectInteractor>(new MovableObjectInteractor(geoObject, grid, velocityBcParticleAdapter, Interactor3D::SOLID, extrapolationReconstructor, State::UNPIN)); - - //SetBcBlocksBlockVisitor setBcVisitor(geoObjectInt); - //grid->accept(setBcVisitor); - - //std::vector< std::shared_ptr<Block3D> > blockVector; - //blockVector.clear(); - //UbTupleInt3 blockNX=grid->getBlockNX(); - //grid->getAllBlocksByCuboid(AABB[0]-(double)val<1>(blockNX)*2.0, AABB[1]-(double)val<2>(blockNX)*2.0, AABB[2]-(double)val<3>(blockNX)*2.0, AABB[3]+(double)val<1>(blockNX)*2.0, AABB[4]+(double)val<2>(blockNX)*2.0, AABB[5]+(double)val<3>(blockNX)*2.0, blockVector); - //for (std::shared_ptr<Block3D> block : blockVector) - // geoObjectInt->setBCBlock(block); - - - ////UBLOG(logINFO, "grid->accept(setBcVisitor) time = "<<timer.stop()); - //geoObjectInt->initInteractor(); - //UBLOG(logINFO, "geoObjectInt->initInteractor() time = "<<timer.stop()); demCoProcessor->addInteractor(geoObjectInt, demObjectMaterial, initalVelocity[i]); - - //UBLOG(logINFO, "demCoProcessor->addInteractor() time = "<<timer.stop()); + demCounter++; } } diff --git a/source/DemCoupling/CreateDemObjectsCoProcessor.h b/source/DemCoupling/CreateDemObjectsCoProcessor.h index bfd0d0c641d2a7ea0d641e4dcff1f7b475d46b5e..d8a4d990b5bc4a51cbad7789661caad04cd1d545 100644 --- a/source/DemCoupling/CreateDemObjectsCoProcessor.h +++ b/source/DemCoupling/CreateDemObjectsCoProcessor.h @@ -41,6 +41,7 @@ private: std::vector<Vector3D> initalVelocity; SPtr<BCAdapter> velocityBcParticleAdapter; SPtr<Reconstructor> extrapolationReconstructor; + int demCounter; #ifdef TIMING UbTimer timer; #endif diff --git a/source/DemCoupling/DemCoProcessor.cpp b/source/DemCoupling/DemCoProcessor.cpp index f6a7f7fe1ee78e786e13fc87a9e20d942b166ede..f29d76ff175af014fb405a1cd64687c76ee6c863 100644 --- a/source/DemCoupling/DemCoProcessor.cpp +++ b/source/DemCoupling/DemCoProcessor.cpp @@ -71,15 +71,6 @@ DemCoProcessor::~DemCoProcessor() shadowStorage.clearAddCallbacks(); shadowStorage.clearRemoveCallbacks(); - - //bodyStorage->deregisterAddCallback("DemCoProcessor"); - ////bodyStorage->deregisterRemoveCallback("DemCoProcessor"); - - //if (&bodyStorage != &bodyStorageShadowCopies) - //{ - // bodyStorageShadowCopies->deregisterAddCallback("DemCoProcessor"); - // bodyStorageShadowCopies->deregisterRemoveCallback("DemCoProcessor"); - //} } } @@ -87,8 +78,6 @@ void DemCoProcessor::addInteractor(std::shared_ptr<MovableObjectInteractor> inte { interactors.push_back(interactor); const int id = static_cast<int>(interactors.size()-1); - - //if (comm->getProcessID()==2) UBLOG(logINFO, "DemCoProcessor::addInteractor() id = "<<id); interactor->setID(id); const auto peGeometryAdapter = this->createPhysicsEngineGeometryAdapter(interactor, physicsEngineMaterial); if (std::dynamic_pointer_cast<PePhysicsEngineGeometryAdapter>(peGeometryAdapter)->isActive()) @@ -125,20 +114,11 @@ std::shared_ptr<PhysicsEngineGeometryAdapter> DemCoProcessor::createPhysicsEngin const int id = static_cast<int>(interactors.size()-1); SPtr<GbSphere3D> vfSphere = std::static_pointer_cast<GbSphere3D>(interactor->getGbObject3D()); const Vector3D position(vfSphere->getX1Centroid(), vfSphere->getX2Centroid(), vfSphere->getX3Centroid()); - auto peGeometryAdapter = this->physicsEngineSolver->createPhysicsEngineGeometryAdapter(id, position, vfSphere->getRadius(), physicsEngineMaterial); - //if (std::dynamic_pointer_cast<PePhysicsEngineGeometryAdapter>(peGeometry)->isActive()) - //{ interactor->setPhysicsEngineGeometry(peGeometryAdapter); return peGeometryAdapter; - //} - //else - //{ - // return peGeometry; - //} } - void DemCoProcessor::process(double actualTimeStep) { #ifdef TIMING @@ -286,18 +266,6 @@ void DemCoProcessor::calculateDemTimeStep(double step) #ifdef TIMING if (comm->isRoot()) UBLOG(logINFO, " physicsEngineSolver->runTimestep() time = "<< timer.stop() <<" s"); #endif - - //for (int i = 0; i < physicsEngineGeometries.size(); i++) - //{ - // if (std::dynamic_pointer_cast<PePhysicsEngineGeometryAdapter>(physicsEngineGeometries[i])->isActive()) - // { - // interactors[i]->setPhysicsEngineGeometry(physicsEngineGeometries[i]); - // } - //} - -//#ifdef TIMING -// if (comm->isRoot()) UBLOG(logINFO, " physicsEngineSolver->updateGeometry() time = "<<timer.stop()<<" s"); -//#endif } void DemCoProcessor::moveVfGeoObjects() @@ -306,18 +274,6 @@ void DemCoProcessor::moveVfGeoObjects() { if (std::dynamic_pointer_cast<PePhysicsEngineGeometryAdapter>(physicsEngineGeometrieAdapters[i])->isActive()) { - ////walberla::pe::RigidBody* peGeoObject = getPeGeoObject(std::dynamic_pointer_cast<PePhysicsEngineGeometryAdapter>(physicsEngineGeometrieAdapters[i])->getSystemId()); - ////if (peGeoObject != nullptr) - ////{ - //// std::dynamic_pointer_cast<PePhysicsEngineGeometryAdapter>(physicsEngineGeometrieAdapters[i])->setGeometry(peGeoObject); - // interactors[i]->moveGbObjectTo(physicsEngineGeometrieAdapters[i]->getPosition()); - ////} - ////else - ////{ - //// std::dynamic_pointer_cast<PePhysicsEngineGeometryAdapter>(physicsEngineGeometrieAdapters[i])->setInactive(); - ////} - - ////UBLOG(logINFO, "DemCoProcessor::moveVfGeoObject() id = "<<std::dynamic_pointer_cast<PePhysicsEngineGeometryAdapter>(physicsEngineGeometrieAdapters[i])->getId()<<" position="<<physicsEngineGeometrieAdapters[i]->getPosition()<<" rank="<<comm->getProcessID()); if (std::dynamic_pointer_cast<PePhysicsEngineGeometryAdapter>(physicsEngineGeometrieAdapters[i])->getSemiactive()) { walberla::pe::RigidBody* peGeoObject = getPeGeoObject(std::dynamic_pointer_cast<PePhysicsEngineGeometryAdapter>(physicsEngineGeometrieAdapters[i])->getSystemID()); @@ -389,10 +345,8 @@ void DemCoProcessor::addSurfaceTriangleSet(std::vector<UbTupleFloat3>& nodes, st { for (int i = 0; i < interactors.size(); i++) { - //UBLOG(logINFO, "DemCoProcessor::addSurfaceTriangleSet()1"); if (std::dynamic_pointer_cast<PePhysicsEngineGeometryAdapter>(physicsEngineGeometrieAdapters[i])->isActive()) { - //UBLOG(logINFO, "DemCoProcessor::addSurfaceTriangleSet()2"); interactors[i]->getGbObject3D()->addSurfaceTriangleSet(nodes, triangles); } } @@ -417,59 +371,23 @@ void DemCoProcessor::getObjectsPropertiesVector(std::vector<double>& p) void DemCoProcessor::addPeGeo(walberla::pe::RigidBody * peGeo) { - - //UBLOG(logINFO, "DemCoProcessor::addPeGeo() SystemID="<<peGeo->getSystemID()); - - //if (peGeo->getID() < 0 || peGeo->getID() >= physicsEngineGeometrieAdapters.size()) return; - - //auto geometry = std::dynamic_pointer_cast<PePhysicsEngineGeometryAdapter>(physicsEngineGeometrieAdapters[peGeo->getID()]); auto geometry = getPeGeoAdapter(peGeo->getSystemID()); - //geometry->counter++; - //if (comm->getProcessID()==3)UBLOG(logINFO, "DemCoProcessor::addPeGeo() geoID = "<<peGeo->getID()<<" counter="<<geometry->counter<<" shadowCounter="<<geometry->shadowCounter); - if (geometry != nullptr) //(geometry->getSystemId() == peGeo->getSystemID()) + if (geometry != nullptr) { geometry->setActive(); geometry->setGeometry(peGeo); - //geometry->counter++; return; } else - return;//throw UbException(UB_EXARGS, "PeGeo SystemId="+UbSystem::toString(peGeo->getSystemID())+" is not matching geometry ID"); + return; } void DemCoProcessor::removePeGeo(walberla::pe::RigidBody * peGeo) { - //if (comm->getProcessID()==2) UBLOG(logINFO, "DemCoProcessor::removePeGeo() rank = "<<comm->getProcessID()); - - //if (peGeo->getID() < 0 || peGeo->getID() >= physicsEngineGeometrieAdapters.size()) return; - - //UBLOG(logINFO, "DemCoProcessor::removePeGeo() SystemID="<<peGeo->getSystemID()); - - //auto geometry = std::dynamic_pointer_cast<PePhysicsEngineGeometryAdapter>(physicsEngineGeometrieAdapters[peGeo->getID()]); auto geometry = getPeGeoAdapter(peGeo->getSystemID()); - //geometry->counter--; - - if (geometry != nullptr)//(geometry->getSystemID() == peGeo->getSystemID()) + if (geometry != nullptr) { geometry->setSemiactive(true); - //walberla::pe::RigidBody* peGeoObject = getPeGeoObject(peGeo->getSystemID()); - //if (peGeoObject != nullptr) - //{ - // geometry->setGeometry(peGeoObject); - //} - //else - //{ - // geometry->setInactive(); - // geometry->setGeometry(nullptr); - //} - //////if (geometry->shadowCounter == 0) - //////{ - //// geometry->setInactive(); - //// geometry->setGeometry(nullptr); - ////// geometry->counter--; - //////} - ////if (comm->getProcessID()==3)UBLOG(logINFO, "DemCoProcessor::removePeGeo() geoID = "<<peGeo->getID()<<" counter="<<geometry->counter<<" shadowCounter="<<geometry->shadowCounter); - //return; } else throw UbException(UB_EXARGS, "PeGeo SystemId="+UbSystem::toString(peGeo->getSystemID())+" is not matching geometry ID"); @@ -477,26 +395,11 @@ void DemCoProcessor::removePeGeo(walberla::pe::RigidBody * peGeo) void DemCoProcessor::addPeShadowGeo(walberla::pe::RigidBody * peGeo) { - //if (peGeo->getID() < 0 || peGeo->getID() >= physicsEngineGeometrieAdapters.size()) return; - - //UBLOG(logINFO, "DemCoProcessor::addPeShadowGeo()"); - //UBLOG(logINFO, "DemCoProcessor::addPeShadowGeo() SystemID="<<peGeo->getSystemID()); - - - //auto geometry = std::dynamic_pointer_cast<PePhysicsEngineGeometryAdapter>(physicsEngineGeometrieAdapters[peGeo->getID()]); auto geometry = getPeGeoAdapter(peGeo->getSystemID()); - - //if (comm->getProcessID()==3) UBLOG(logINFO, "DemCoProcessor::addPeShadowGeo() geoID = "<<peGeo->getID()<<" counter="<<geometry->counter<<" shadowCounter="<<geometry->shadowCounter); - if (geometry != nullptr)//(geometry->getSystemId() == peGeo->getSystemID()) + if (geometry != nullptr) { - //geometry->shadowCounter++; - //if (geometry->shadowCounter == 1) - //{ geometry->setActive(); geometry->setGeometry(peGeo); - //geometry->shadowCounter++; - //} - return; } else @@ -505,51 +408,11 @@ void DemCoProcessor::addPeShadowGeo(walberla::pe::RigidBody * peGeo) void DemCoProcessor::removePeShadowGeo(walberla::pe::RigidBody * peGeo) { - //if (comm->getProcessID()==2) UBLOG(logINFO, "DemCoProcessor::removePeShadowGeo() rank = "<<comm->getProcessID()); - - //if (peGeo->getID() < 0 || peGeo->getID() >= physicsEngineGeometrieAdapters.size()) return; - - //auto geometry = std::dynamic_pointer_cast<PePhysicsEngineGeometryAdapter>(physicsEngineGeometrieAdapters[peGeo->getID()]); - - //UBLOG(logINFO, "DemCoProcessor::removePeShadowGeo() SystemID="<<peGeo->getSystemID()); - auto geometry = getPeGeoAdapter(peGeo->getSystemID()); - if (geometry != nullptr) //(geometry->getSystemId() == peGeo->getSystemID()) + if (geometry != nullptr) { geometry->setSemiactive(true); - //walberla::pe::RigidBody* peGeoObject = getPeGeoObject(peGeo->getSystemID()); - //if (peGeoObject != nullptr) - //{ - // geometry->setGeometry(peGeoObject); - //} - //else - //{ - // geometry->setInactive(); - // geometry->setGeometry(nullptr); - //} - //////if (geometry->shadowCounter == 0) - //////{ - //// geometry->setInactive(); - //// geometry->setGeometry(nullptr); - ////// geometry->counter--; - //////} - ////if (comm->getProcessID()==3)UBLOG(logINFO, "DemCoProcessor::removePeGeo() geoID = "<<peGeo->getID()<<" counter="<<geometry->counter<<" shadowCounter="<<geometry->shadowCounter); - //return; - //////geometry->shadowCounter--; - //////if (geometry->shadowCounter == 0) - //////{ - //// geometry->setInactive(); - //// geometry->setGeometry(nullptr); - //////} - //////else - //////{ - ////// geometry->setActive(); - ////// geometry->setGeometry(peGeo); - //// //geometry->shadowCounter--; - //////} - //////if (comm->getProcessID()==3)UBLOG(logINFO, "DemCoProcessor::removePeShadowGeo() geoID = "<<peGeo->getID()<<" counter="<<geometry->counter<<" shadowCounter="<<geometry->shadowCounter); - ////return; } else throw UbException(UB_EXARGS, "PeGeo ID="+UbSystem::toString(peGeo->getSystemID())+" is not matching geometry ID"); @@ -622,18 +485,7 @@ void DemCoProcessor::distributeIDs() std::dynamic_pointer_cast<PePhysicsEngineGeometryAdapter>(physicsEngineGeometrieAdapters[i])->setSystemID(it->second); geoIdMap.insert(std::make_pair(it->second, std::dynamic_pointer_cast<PePhysicsEngineGeometryAdapter>(physicsEngineGeometrieAdapters[i]))); - - //std::dynamic_pointer_cast<PePhysicsEngineGeometryAdapter>(physicsEngineGeometries[i])->setId(idMap.find(interactors[i]->getID())->second); } - - //for (int i = 0; i < physicsEngineGeometrieAdapters.size(); i++) - //{ - // //physicsEngineSolver->updateGeometry(physicsEngineGeometries[i]); - // if (std::dynamic_pointer_cast<PePhysicsEngineGeometryAdapter>(physicsEngineGeometrieAdapters[i])->isActive()) - // { - // interactors[i]->setPhysicsEngineGeometry(physicsEngineGeometrieAdapters[i]); - // } - //} } ////////////////////////////////////////////////////////////////////////// void DemCoProcessor::setBlockVisitor(std::shared_ptr<BoundaryConditionsBlockVisitor> boundaryConditionsBlockVisitor) @@ -655,7 +507,6 @@ std::shared_ptr<PePhysicsEngineGeometryAdapter> DemCoProcessor::getPeGeoAdapter( std::map< unsigned long long, std::shared_ptr<PePhysicsEngineGeometryAdapter> >::const_iterator it; if ((it=geoIdMap.find(systemId)) == geoIdMap.end()) { - //throw UbException(UB_EXARGS, "pe SystemId can not be found!"); return nullptr; } else diff --git a/source/DemCoupling/physicsEngineAdapter/pe/PePhysicsEngineSolverAdapter.cpp b/source/DemCoupling/physicsEngineAdapter/pe/PePhysicsEngineSolverAdapter.cpp index 02ce4a783b66c0c77b40084c6c7201ccc8cfc2c1..25034d6a93e7dec8f287222a2a5ab027395acba0 100644 --- a/source/DemCoupling/physicsEngineAdapter/pe/PePhysicsEngineSolverAdapter.cpp +++ b/source/DemCoupling/physicsEngineAdapter/pe/PePhysicsEngineSolverAdapter.cpp @@ -46,13 +46,6 @@ std::shared_ptr<PhysicsEngineGeometryAdapter> PePhysicsEngineSolverAdapter::crea { peGeometryAdapter->setId(id); peGeometryAdapter->setSystemID(peGeometry->getSystemID()); - //unsigned long long sid = peGeometryAdapter->getSystemID(); - //geoIdMap.insert(std::make_pair(sid, peGeometryAdapter)); - //peGeometryAdapter->counter++; - - //if(peGeometry->getSystemID() != id+1) - // UB_THROW(UbException(UB_EXARGS, "id="+UbSystem::toString(id)+" does not match pe::SystemId="+UbSystem::toString(peGeometry->getSystemID()))); - peGeometryAdapter->setActive(); peGeometryAdapter->setGeometry(peGeometry); return peGeometryAdapter; @@ -65,14 +58,12 @@ std::shared_ptr<PhysicsEngineGeometryAdapter> PePhysicsEngineSolverAdapter::crea } walberla::pe::syncNextNeighbors<BodyTypeTuple>(*forest, *storageId); - //walberla::pe::syncShadowOwners<BodyTypeTuple>(*forest, *storageId); } void PePhysicsEngineSolverAdapter::runTimestep(double step) { cr->timestep(walberla::real_c(step)); walberla::pe::syncNextNeighbors<BodyTypeTuple>(*forest, *storageId); - //walberla::pe::syncShadowOwners<BodyTypeTuple>(*forest, *storageId); } @@ -208,15 +199,3 @@ std::shared_ptr<walberla::pe::BodyStorage> PePhysicsEngineSolverAdapter::getGlob { return globalBodyStorage; } -////////////////////////////////////////////////////////////////////////// -//std::shared_ptr<PePhysicsEngineGeometryAdapter> PePhysicsEngineSolverAdapter::getPeGeoAdapter(unsigned long long systemId) -//{ -// std::map< unsigned long long, std::shared_ptr<PePhysicsEngineGeometryAdapter> >::const_iterator it; -// if ((it=geoIdMap.find(systemId)) == geoIdMap.end()) -// { -// //throw UbException(UB_EXARGS, "pe SystemId can not be found!"); -// return nullptr; -// } -// else -// return it->second; -//} \ No newline at end of file diff --git a/source/DemCoupling/physicsEngineAdapter/pe/PePhysicsEngineSolverAdapter.h b/source/DemCoupling/physicsEngineAdapter/pe/PePhysicsEngineSolverAdapter.h index 7ddeed3fb948dcbed20592114fd94b8bcc6e42b4..bb56702abb3129f35d072aa35bacd637e2fa93e8 100644 --- a/source/DemCoupling/physicsEngineAdapter/pe/PePhysicsEngineSolverAdapter.h +++ b/source/DemCoupling/physicsEngineAdapter/pe/PePhysicsEngineSolverAdapter.h @@ -77,7 +77,6 @@ public: std::shared_ptr<walberla::blockforest::BlockForest> getBlockForest(); std::shared_ptr<walberla::domain_decomposition::BlockDataID> getStorageId(); std::shared_ptr<walberla::pe::BodyStorage> getGlobalBodyStorage(); - //std::shared_ptr<PePhysicsEngineGeometryAdapter> getPeGeoAdapter(unsigned long long systemId); private: void initalizePeEnvironment(); @@ -98,7 +97,6 @@ private: std::shared_ptr< walberla::blockforest::BlockForest > forest; std::shared_ptr<walberla::domain_decomposition::BlockDataID> storageId; std::shared_ptr<walberla::pe::cr::HardContactSemiImplicitTimesteppingSolvers> cr; - // std::map< unsigned long long, std::shared_ptr<PePhysicsEngineGeometryAdapter> > geoIdMap; }; #endif