mirror of
https://github.com/PhasicFlow/phasicFlow.git
synced 2025-06-22 16:28:30 +00:00
Merge branch 'develop' into MPIdev
This commit is contained in:
@ -160,7 +160,8 @@ public:
|
||||
csPairContainerType& pwPairs,
|
||||
bool force = false)override
|
||||
{
|
||||
Particles().boundingSphere().updateBoundaries(DataDirection::SlaveToMaster);
|
||||
if(i==0u)
|
||||
Particles().boundingSphere().updateBoundaries(DataDirection::SlaveToMaster);
|
||||
return csBoundaries_[i].broadSearch(
|
||||
iter,
|
||||
t,
|
||||
@ -183,6 +184,23 @@ public:
|
||||
{
|
||||
return ppwContactSearch_().performedSearch();
|
||||
}
|
||||
|
||||
|
||||
uint32 updateInterval()const override
|
||||
{
|
||||
return ppwContactSearch_().updateInterval();
|
||||
}
|
||||
|
||||
real sizeRatio()const override
|
||||
{
|
||||
return ppwContactSearch_().sizeRatio();
|
||||
}
|
||||
|
||||
|
||||
real cellExtent()const override
|
||||
{
|
||||
return ppwContactSearch_().cellExtent();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
@ -72,11 +72,6 @@ public:
|
||||
return contactSearch_;
|
||||
}
|
||||
|
||||
void fill(const std::any &val) override
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
bool hearChanges(
|
||||
real t,
|
||||
real dt,
|
||||
|
@ -80,14 +80,14 @@ pFlow::uint32 pFlow::pweBndryContactSearchKernels::broadSearchPP
|
||||
if(!searchCells.inCellRange(ind))continue;
|
||||
|
||||
uint32 thisI = head(ind.x(),ind.y(),ind.z());
|
||||
while (thisI!=-1)
|
||||
while (thisI!=static_cast<uint32>(-1))
|
||||
{
|
||||
|
||||
auto d_n = sizeRatio*diams[thisI];
|
||||
|
||||
// first item is for this boundary and second itme, for mirror
|
||||
if(sphereSphereCheckB(p_m, points[thisI], d_m, d_n)&&
|
||||
ppPairs.insert(thisI,mrrI) == -1)
|
||||
ppPairs.insert(thisI,mrrI) == static_cast<uint32>(-1))
|
||||
{
|
||||
getFullUpdate++;
|
||||
}
|
||||
|
@ -113,7 +113,10 @@ pFlow::uint32 pFlow::wallBoundaryContactSearch::findPairsElementRangeCount
|
||||
|
||||
uint32 nNotInserted = 0;
|
||||
uint32 nThis = pPoints.size();
|
||||
|
||||
const auto& numElements = numElements_;
|
||||
const auto& elementBox = elementBox_;
|
||||
const auto& validBox = validBox_;
|
||||
|
||||
Kokkos::parallel_reduce(
|
||||
"pFlow::wallBoundaryContactSearch::findPairsElementRangeCount",
|
||||
deviceRPolicyDynamic(0,nThis),
|
||||
@ -123,11 +126,11 @@ pFlow::uint32 pFlow::wallBoundaryContactSearch::findPairsElementRangeCount
|
||||
int32x3 ind;
|
||||
if( searchCells.pointIndexInDomain(p, ind) )
|
||||
{
|
||||
for(uint32 nTri=0; nTri<numElements_; nTri++)
|
||||
for(uint32 nTri=0; nTri<numElements; nTri++)
|
||||
{
|
||||
if( validBox_[nTri]== 0)continue;
|
||||
if( elementBox_[nTri].isInside(ind)&&
|
||||
pairs.insert(i,nTri+baseTriIndex) == -1)
|
||||
if( validBox[nTri]== 0)continue;
|
||||
if( elementBox[nTri].isInside(ind)&&
|
||||
pairs.insert(i,nTri+baseTriIndex) == static_cast<uint32>(-1))
|
||||
{
|
||||
notInsertedUpdate++;
|
||||
}
|
||||
|
@ -140,6 +140,15 @@ public:
|
||||
virtual
|
||||
bool performedBroadSearch()const = 0;
|
||||
|
||||
virtual
|
||||
uint32 updateInterval()const = 0;
|
||||
|
||||
virtual
|
||||
real sizeRatio()const = 0;
|
||||
|
||||
virtual
|
||||
real cellExtent()const = 0;
|
||||
|
||||
static
|
||||
uniquePtr<contactSearch> create(
|
||||
const dictionary& dict,
|
||||
|
@ -134,6 +134,16 @@ public:
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
real sizeRatio()const
|
||||
{
|
||||
return sizeRatio_;
|
||||
}
|
||||
|
||||
real cellExtent()const
|
||||
{
|
||||
return cellExtent_;
|
||||
}
|
||||
|
||||
auto getCellIterator([[maybe_unused]] uint32 lvl)const
|
||||
{
|
||||
|
@ -43,7 +43,7 @@ while( m != mapperNBS::NoPos)
|
||||
auto lm = m;
|
||||
|
||||
if(lm>ln) Swap(lm,ln);
|
||||
if( pairs.insert(lm,ln) == -1)
|
||||
if( pairs.insert(lm,ln) == static_cast<uint32>(-1))
|
||||
{
|
||||
getFullUpdate++;
|
||||
}
|
||||
@ -86,7 +86,7 @@ while( m != mapperNBS::NoPos)
|
||||
auto ln = n;
|
||||
auto lm = m;
|
||||
if(lm>ln) Swap(lm,ln);
|
||||
if( pairs.insert(lm,ln) == -1)
|
||||
if( pairs.insert(lm,ln) == static_cast<uint32>(-1))
|
||||
{
|
||||
getFullUpdate++;
|
||||
}
|
||||
|
@ -85,21 +85,26 @@ bool pFlow::cellsWallLevel0::broadSearch
|
||||
bool pFlow::cellsWallLevel0::build(const cells & searchBox)
|
||||
{
|
||||
|
||||
const auto& points = points_;
|
||||
const auto& vertices = vertices_;
|
||||
const auto& elementBox = elementBox_;
|
||||
const auto cellExtent = cellExtent_;
|
||||
|
||||
Kokkos::parallel_for(
|
||||
"pFlow::cellsWallLevel0::build",
|
||||
deviceRPolicyStatic(0,numElements_),
|
||||
CLASS_LAMBDA_HD(uint32 i)
|
||||
LAMBDA_HD(uint32 i)
|
||||
{
|
||||
auto v = vertices_[i];
|
||||
auto p1 = points_[v.x()];
|
||||
auto p2 = points_[v.y()];
|
||||
auto p3 = points_[v.z()];
|
||||
auto v = vertices[i];
|
||||
auto p1 = points[v.x()];
|
||||
auto p2 = points[v.y()];
|
||||
auto p3 = points[v.z()];
|
||||
|
||||
realx3 minP;
|
||||
realx3 maxP;
|
||||
|
||||
searchBox.extendBox(p1, p2, p3, cellExtent_, minP, maxP);
|
||||
elementBox_[i] = iBoxType(searchBox.pointIndex(minP), searchBox.pointIndex(maxP));
|
||||
searchBox.extendBox(p1, p2, p3, cellExtent, minP, maxP);
|
||||
elementBox[i] = iBoxType(searchBox.pointIndex(minP), searchBox.pointIndex(maxP));
|
||||
});
|
||||
Kokkos::fence();
|
||||
|
||||
@ -153,7 +158,12 @@ pFlow::int32 pFlow::cellsWallLevel0::findPairsElementRangeCount
|
||||
{
|
||||
uint32 getFull =0;
|
||||
|
||||
|
||||
const auto& elementBox = elementBox_;
|
||||
const auto& normals = normals_;
|
||||
const auto& points = points_;
|
||||
const auto& vertices = vertices_;
|
||||
const auto cellExtent = cellExtent_;
|
||||
|
||||
Kokkos::parallel_reduce(
|
||||
"pFlow::cellsWallLevel0::findPairsElementRangeCount",
|
||||
tpPWContactSearch(numElements_, Kokkos::AUTO),
|
||||
@ -163,10 +173,10 @@ pFlow::int32 pFlow::cellsWallLevel0::findPairsElementRangeCount
|
||||
|
||||
const uint32 iTri = teamMember.league_rank();
|
||||
|
||||
const auto triBox = elementBox_[iTri];
|
||||
const auto triBox = elementBox[iTri];
|
||||
const auto triPlane = infinitePlane(
|
||||
normals_[iTri],
|
||||
points_[vertices_[iTri].x()]);
|
||||
normals[iTri],
|
||||
points[vertices[iTri].x()]);
|
||||
|
||||
uint32 getFull2 = 0;
|
||||
|
||||
@ -186,11 +196,12 @@ pFlow::int32 pFlow::cellsWallLevel0::findPairsElementRangeCount
|
||||
while( n != particleMap.NoPos)
|
||||
{
|
||||
// id is wall id the pair is (particle id, wall id)
|
||||
if( abs(triPlane.pointFromPlane(pPoints[n]))< pDiams[n]*sizeRatio*cellExtent_)
|
||||
if( abs(triPlane.pointFromPlane(pPoints[n]))< pDiams[n]*sizeRatio*cellExtent)
|
||||
{
|
||||
if( pairs.insert(
|
||||
static_cast<csIdType>(n),
|
||||
static_cast<csIdType>(iTri) ) == -1 )
|
||||
static_cast<csIdType>(iTri) ) == static_cast<csIdType>(-1)
|
||||
)
|
||||
innerUpdate++;
|
||||
}
|
||||
n = particleMap.next(n);
|
||||
|
@ -113,6 +113,21 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32 updateInterval()const
|
||||
{
|
||||
return updateInterval_;
|
||||
}
|
||||
|
||||
real sizeRatio()const
|
||||
{
|
||||
return getMethod().sizeRatio();
|
||||
}
|
||||
|
||||
real cellExtent()const
|
||||
{
|
||||
return getMethod().cellExtent();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user