/*------------------------------- 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. -----------------------------------------------------------------------------*/ #include "positionRandom.hpp" #include "uniformRandomReal.hpp" #include "NBSLevel0.hpp" #include "unsortedPairs.hpp" #include "box.hpp" namespace pFlow { using SearchType = NBSLevel0 ; using ContainerType = unsortedPairs; int32 findCollisions( ContainerType& pairs, int32Vector_HD& flags); int32 findCollisions(int32 num, realx3Vector_HD& points, real diam) { int32 res =0; for(auto i=0; iminPoint(); auto maxP = region_->maxPoint(); SearchType search( box(minP, maxP), diameter_, positionHD.deviceVectorAll(), diameter.deviceVectorAll()); ContainerType pairs(3*startNum); REPORT(1)<< "Positioning "<< greenText("(Pass #"<< pass+1<<")")<< ": started with "<< startNum <<" points."<= numPoints_ ) { REPORT(1)<<"Selected "<< cyanText(numPoints_)<< " for the final field.\n"<("diameter") ), numPoints_ ( prDict_.getVal("numPoints") ), maxIterations_ ( prDict_.getValOrSet("maxIterations", 10) ), position_ ( maxNumberOfParticles_, RESERVE() ) { reportInterval_ = max(numPoints_/numReports_, static_cast(2)); if( !positionPointsRandom() ) { fatalExit; } if(!region_) { fatalErrorInFunction<<"You must provided a region (box, cylinder, ...) for positioning particles in dictionary "<< dict.globalName()<100) { fatalErrorInFunction<< "could not find a point inside region"<name()<