/*------------------------------- phasicFlow --------------------------------- O C enter of O O E ngineering and O O M ultiscale modeling of OOOOOOO F luid flow ------------------------------------------------------------------------------ Copyright (C): www.cemf.ir email: hamid.r.norouzi AT gmail.com ------------------------------------------------------------------------------ Licence: This file is part of phasicFlow code. It is a free software for simulating granular and multiphase flows. You can redistribute it and/or modify it under the terms of GNU General Public License v3 or any other later versions. phasicFlow is distributed to help others in their research in the field of granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -----------------------------------------------------------------------------*/ template class cLT> bool pFlow::sphereInteraction::createSphereInteraction() { realVector_D rhoD("densities", this->densities()); auto modelDict = this->subDict("model"); REPORT(1)<<"Createing contact force model . . ."<( this->numMaterials(), rhoD.deviceView(), modelDict ); uint32 nPrtcl = sphParticles_.size(); ppContactList_ = makeUnique(nPrtcl+1); pwContactList_ = makeUnique(nPrtcl/4+1); return true; } template class cLT> bool pFlow::sphereInteraction::sphereSphereInteraction() { auto lastItem = ppContactList_().loopCount(); // create the kernel functor pFlow::sphereInteractionKernels::ppInteractionFunctor ppInteraction( this->dt(), this->forceModel_(), ppContactList_(), // to be read sphParticles_.diameter().deviceViewAll(), sphParticles_.propertyId().deviceViewAll(), sphParticles_.pointPosition().deviceViewAll(), sphParticles_.velocity().deviceViewAll(), sphParticles_.rVelocity().deviceViewAll(), sphParticles_.contactForce().deviceViewAll(), sphParticles_.contactTorque().deviceViewAll() ); Kokkos::parallel_for( "ppInteraction", rpPPInteraction(0,lastItem), ppInteraction ); Kokkos::fence(); return true; } template class cLT> bool pFlow::sphereInteraction::sphereWallInteraction() { uint32 lastItem = pwContactList_().loopCount(); uint32 iter = this->currentIter(); real t = this->currentTime(); real dt = this->dt(); pFlow::sphereInteractionKernels::pwInteractionFunctor pwInteraction( dt, this->forceModel_(), pwContactList_(), geometryMotion_.getTriangleAccessor(), geometryMotion_.getModel(iter, t, dt) , sphParticles_.diameter().deviceViewAll() , sphParticles_.propertyId().deviceViewAll(), sphParticles_.pointPosition().deviceViewAll(), sphParticles_.velocity().deviceViewAll(), sphParticles_.rVelocity().deviceViewAll() , sphParticles_.contactForce().deviceViewAll(), sphParticles_.contactTorque().deviceViewAll() , geometryMotion_.triMotionIndex().deviceViewAll(), geometryMotion_.propertyId().deviceViewAll(), geometryMotion_.contactForceWall().deviceViewAll() ); Kokkos::parallel_for( "", rpPWInteraction(0,lastItem), pwInteraction ); Kokkos::fence(); return true; } template class cLT> pFlow::sphereInteraction::sphereInteraction ( systemControl& control, const particles& prtcl, const geometry& geom ) : interaction(control, prtcl, geom), geometryMotion_(dynamic_cast(geom)), sphParticles_(dynamic_cast(prtcl)), ppInteractionTimer_("sphere-sphere interaction", &this->timers()), pwInteractionTimer_("sphere-wall interaction", &this->timers()), contactListTimer_("contact list management", &this->timers()), contactListTimer0_("contact list clear", &this->timers()) { contactSearch_ = contactSearch::create( subDict("contactSearch"), prtcl.extendedDomain().domainBox(), prtcl, geom, timers()); if(!createSphereInteraction()) { fatalExit; } } template class cLT> bool pFlow::sphereInteraction::beforeIteration() { return true; } template class cLT> bool pFlow::sphereInteraction::iterate() { auto iter = this->currentIter(); auto t = this->currentTime(); auto dt = this->dt(); //output<<"iter, t, dt "<< iter<<" "<< t << " "< class cLT> bool pFlow::sphereInteraction::afterIteration() { return true; } template class cLT> bool pFlow::sphereInteraction::hearChanges ( real t, real dt, uint32 iter, const message& msg, const anyList& varList ) { if(msg.equivalentTo(message::ITEM_REARRANGE)) { notImplementedFunction; } return true; }