mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Modified bounds functions
This commit is contained in:
@ -79,23 +79,6 @@ bool Foam::distributedTriSurfaceMesh::read()
|
||||
// Merge distance
|
||||
mergeDist_ = readScalar(dict_.lookup("mergeDistance"));
|
||||
|
||||
// Calculate the overall boundBox of the undistributed surface
|
||||
point overallMin(VGREAT, VGREAT, VGREAT);
|
||||
point overallMax(-VGREAT, -VGREAT, -VGREAT);
|
||||
|
||||
forAll(procBb_, procI)
|
||||
{
|
||||
const List<treeBoundBox>& bbs = procBb_[procI];
|
||||
|
||||
forAll(bbs, bbI)
|
||||
{
|
||||
overallMin = ::Foam::min(overallMin, bbs[bbI].min());
|
||||
overallMax = ::Foam::max(overallMax, bbs[bbI].max());
|
||||
}
|
||||
}
|
||||
|
||||
bounds() = boundBox(overallMin, overallMax);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1357,6 +1340,9 @@ Foam::distributedTriSurfaceMesh::distributedTriSurfaceMesh
|
||||
{
|
||||
read();
|
||||
|
||||
reduce(bounds().min(), minOp<point>());
|
||||
reduce(bounds().max(), maxOp<point>());
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Constructed from triSurface:" << endl;
|
||||
@ -1410,6 +1396,9 @@ Foam::distributedTriSurfaceMesh::distributedTriSurfaceMesh(const IOobject& io)
|
||||
{
|
||||
read();
|
||||
|
||||
reduce(bounds().min(), minOp<point>());
|
||||
reduce(bounds().max(), maxOp<point>());
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Read distributedTriSurface from " << io.objectPath()
|
||||
@ -1469,6 +1458,9 @@ Foam::distributedTriSurfaceMesh::distributedTriSurfaceMesh
|
||||
{
|
||||
read();
|
||||
|
||||
reduce(bounds().min(), minOp<point>());
|
||||
reduce(bounds().max(), maxOp<point>());
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Read distributedTriSurface from " << io.objectPath()
|
||||
@ -2189,23 +2181,6 @@ void Foam::distributedTriSurfaceMesh::distribute
|
||||
{
|
||||
procBb_.transfer(newProcBb);
|
||||
dict_.set("bounds", procBb_[Pstream::myProcNo()]);
|
||||
|
||||
// Calculate the overall boundBox of the undistributed surface
|
||||
point overallMin(VGREAT, VGREAT, VGREAT);
|
||||
point overallMax(-VGREAT, -VGREAT, -VGREAT);
|
||||
|
||||
forAll(procBb_, procI)
|
||||
{
|
||||
const List<treeBoundBox>& bbs = procBb_[procI];
|
||||
|
||||
forAll(bbs, bbI)
|
||||
{
|
||||
overallMin = ::Foam::min(overallMin, bbs[bbI].min());
|
||||
overallMax = ::Foam::max(overallMax, bbs[bbI].max());
|
||||
}
|
||||
}
|
||||
|
||||
bounds() = boundBox(overallMin, overallMax);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2454,6 +2429,12 @@ void Foam::distributedTriSurfaceMesh::distribute
|
||||
|
||||
clearOut();
|
||||
|
||||
// Set the bounds() value to the boundBox of the undecomposed surface
|
||||
triSurfaceMesh::bounds() = boundBox(points());
|
||||
|
||||
reduce(bounds().min(), minOp<point>());
|
||||
reduce(bounds().max(), maxOp<point>());
|
||||
|
||||
// Regions stays same
|
||||
// Volume type stays same.
|
||||
|
||||
|
||||
@ -71,19 +71,14 @@ Foam::boundBox Foam::searchablePlane::calcBounds() const
|
||||
{
|
||||
point max(VGREAT, VGREAT, VGREAT);
|
||||
|
||||
if (mag(normal() & vector(1,0,0)) > 1 - SMALL)
|
||||
for (direction dir = 0; dir < vector::nComponents; dir++)
|
||||
{
|
||||
max.x() = 0;
|
||||
}
|
||||
if (mag(normal()[dir]) - 1 < SMALL)
|
||||
{
|
||||
max[dir] = 0;
|
||||
|
||||
if (mag(normal() & vector(0,1,0)) > 1 - SMALL)
|
||||
{
|
||||
max.y() = 0;
|
||||
}
|
||||
|
||||
if (mag(normal() & vector(0,0,1)) > 1 - SMALL)
|
||||
{
|
||||
max.z() = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
point min = -max;
|
||||
|
||||
Reference in New Issue
Block a user