ENH: more consistent use of good() or direct testing instead valid()

This commit is contained in:
Mark Olesen
2023-07-19 13:47:19 +02:00
parent 76efcba4c7
commit 945e3e41b1
72 changed files with 139 additions and 148 deletions

View File

@ -103,7 +103,7 @@ void Foam::sampledCuttingPlane::checkBoundsIntersection
// Verify specified bounding box
const boundBox& clipBb = isoParams_.getClipBounds();
if (clipBb.valid())
if (clipBb.good())
{
// Bounding box does not overlap with (global) mesh!
if (!clipBb.overlaps(meshBb))
@ -419,7 +419,7 @@ void Foam::sampledCuttingPlane::createGeometry()
// the initial selection smaller.
const boundBox& clipBb = isoParams_.getClipBounds();
if (clipBb.valid() && cellsToSelect.any())
if (clipBb.good() && cellsToSelect.any())
{
const auto& cellCentres = fvm.C();

View File

@ -166,7 +166,7 @@ Foam::sampledPlane::sampledPlane
<< " origin:" << origin()
<< " normal:" << normal();
if (bounds_.valid())
if (bounds_.good())
{
Info<< " bounds:" << bounds_;
}

View File

@ -42,7 +42,7 @@ void Foam::cuttingPlane::checkOverlap
const plane& pln = *this;
// Plane does not intersect the user bounding box
if (userBounds.valid() && !userBounds.intersects(pln))
if (userBounds.good() && !userBounds.intersects(pln))
{
WarningInFunction
<< nl << callerName

View File

@ -38,7 +38,7 @@ void Foam::cuttingSurfaceBase::checkOverlap
)
{
// User bounding-box does not overlap with (global) mesh!
if (userBounds.valid() && !userBounds.overlaps(meshBounds))
if (userBounds.good() && !userBounds.overlaps(meshBounds))
{
WarningInFunction
<< nl << callerName

View File

@ -183,7 +183,7 @@ Foam::label Foam::isoSurfaceBase::blockCells
{
// Could warn about invalid...
}
else if (bb.valid())
else if (bb.good())
{
const pointField& cc = mesh_.cellCentres();

View File

@ -815,7 +815,7 @@ Foam::triSurface Foam::isoSurfaceCell::stitchTriPoints
triPointReverseMap[rawPointi+2],
0
);
if (tri.valid())
if (tri.good())
{
newToOldTri.append(oldTriI);
dynTris.append(tri);
@ -1300,7 +1300,7 @@ Foam::isoSurfaceCell::isoSurfaceCell
DynamicList<label> trimTriMap;
// Trimmed to original point
labelList trimTriPointMap;
if (getClipBounds().valid())
if (getClipBounds().good())
{
isoSurfacePoint::trimToBox
(
@ -1332,7 +1332,7 @@ Foam::isoSurfaceCell::isoSurfaceCell
<< " merged triangles." << endl;
}
if (getClipBounds().valid())
if (getClipBounds().good())
{
// Adjust interpolatedPoints_
inplaceRenumber(triPointMergeMap_, interpolatedPoints_);

View File

@ -933,7 +933,7 @@ Foam::triSurface Foam::isoSurfacePoint::stitchTriPoints
);
rawPointi += 3;
if (tri.valid())
if (tri.good())
{
newToOldTri.append(oldTriI);
dynTris.append(tri);
@ -1603,7 +1603,7 @@ Foam::isoSurfacePoint::isoSurfacePoint
DynamicList<label> trimTriMap;
// Trimmed to original point
labelList trimTriPointMap;
if (getClipBounds().valid())
if (getClipBounds().good())
{
trimToBox
(
@ -1636,7 +1636,7 @@ Foam::isoSurfacePoint::isoSurfacePoint
}
if (getClipBounds().valid())
if (getClipBounds().good())
{
// Adjust interpolatedPoints_
inplaceRenumber(triPointMergeMap_, interpolatedPoints_);