mirror of
https://github.com/PhasicFlow/phasicFlow.git
synced 2025-06-12 16:26:23 +00:00
Collision check and particlePosition -> random
- A new class is added for simple collision check - position particles in utility is upgraded - morton sorting is not active yet for particlesPhasicFlow
This commit is contained in:
@ -18,11 +18,9 @@ Licence:
|
||||
|
||||
-----------------------------------------------------------------------------*/
|
||||
|
||||
#include "positionOrdered.hpp"
|
||||
#include "error.hpp"
|
||||
|
||||
|
||||
#include "streams.hpp"
|
||||
#include "dictionary.hpp"
|
||||
#include "positionOrdered.hpp"
|
||||
|
||||
|
||||
bool pFlow::positionOrdered::findAxisIndex()
|
||||
@ -45,9 +43,9 @@ bool pFlow::positionOrdered::findAxisIndex()
|
||||
return false;
|
||||
}
|
||||
|
||||
realx3 uV[3];
|
||||
std::array<realx3,3> uV;
|
||||
size_t i=0;
|
||||
for(auto& ca: axisOrder_)
|
||||
for(const auto& ca: axisOrder_)
|
||||
{
|
||||
if(ca == "x")
|
||||
{
|
||||
@ -82,15 +80,16 @@ bool pFlow::positionOrdered::positionPointsOrdered()
|
||||
position_.clear();
|
||||
|
||||
realx3 dl(diameter_);
|
||||
auto minP = region_->minPoint();
|
||||
auto maxP = region_->maxPoint();
|
||||
const auto& region = pRegion();
|
||||
auto minP = region.minPoint();
|
||||
auto maxP = region.maxPoint();
|
||||
|
||||
auto cntr = minP;
|
||||
|
||||
size_t n = 0;
|
||||
while( n < numPoints_ )
|
||||
{
|
||||
if(region_->isInside(cntr))
|
||||
if(region.isInside(cntr))
|
||||
{
|
||||
position_.push_back(cntr);
|
||||
n++;
|
||||
@ -130,7 +129,7 @@ pFlow::positionOrdered::positionOrdered
|
||||
positionParticles(control, dict),
|
||||
poDict_
|
||||
(
|
||||
dict.subDict("positionOrderedInfo")
|
||||
dict.subDict("orderedInfo")
|
||||
),
|
||||
diameter_
|
||||
(
|
||||
@ -146,7 +145,10 @@ pFlow::positionOrdered::positionOrdered
|
||||
),
|
||||
position_
|
||||
(
|
||||
"positionOrdered", maxNumberOfParticles_, numPoints_ ,RESERVE()
|
||||
"positionOrdered",
|
||||
max(maxNumberOfParticles(), numPoints_),
|
||||
numPoints_ ,
|
||||
RESERVE()
|
||||
)
|
||||
{
|
||||
|
||||
@ -155,13 +157,6 @@ pFlow::positionOrdered::positionOrdered
|
||||
fatalExit;
|
||||
}
|
||||
|
||||
if(!region_)
|
||||
{
|
||||
fatalErrorInFunction<<"You must provided a region (box, cylinder, ...) for positioning particles in dictionary "<<
|
||||
dict.globalName()<<endl;
|
||||
fatalExit;
|
||||
}
|
||||
|
||||
if(!positionPointsOrdered())
|
||||
{
|
||||
fatalExit;
|
||||
|
Reference in New Issue
Block a user