src/OpenFOAM: Rationalised use of enumerations by using the C++11 scoped form

for Time, treeBoundBox, indexedOctree, dynamicIndexedOctree, CirculatorBase
This commit is contained in:
Henry Weller
2018-08-31 16:11:16 +01:00
parent de456c4f94
commit e750f2555c
51 changed files with 467 additions and 437 deletions

View File

@ -58,13 +58,13 @@ int main(int argc, char *argv[])
<< cStart.prev() << " / " << cStart() << " / " << cStart.next()
<< endl;
} while (cStart.circulate(CirculatorBase::CLOCKWISE));
} while (cStart.circulate(CirculatorBase::direction::clockwise));
if (cStart.size()) do
{
Info<< "Iterate backwards over face : " << cStart() << endl;
} while (cStart.circulate(CirculatorBase::ANTICLOCKWISE));
} while (cStart.circulate(CirculatorBase::direction::anticlockwise));
Info<< nl << nl << "Test non-const circulator" << nl << endl;
@ -79,7 +79,7 @@ int main(int argc, char *argv[])
<< cStart2.prev() << " / " << cStart2() << " / " << cStart2.next()
<< endl;
} while (cStart2.circulate(CirculatorBase::CLOCKWISE));
} while (cStart2.circulate(CirculatorBase::direction::clockwise));
if (cStart2.size()) do
{
@ -89,7 +89,7 @@ int main(int argc, char *argv[])
cStart2() += 1;
Info<< " -> " << cStart2() << endl;
} while (cStart2.circulate(CirculatorBase::CLOCKWISE));
} while (cStart2.circulate(CirculatorBase::direction::clockwise));
Info<< "Face after : " << f << endl;
@ -144,7 +144,7 @@ int main(int argc, char *argv[])
{
Info<< "Iterate forwards over face : " << cZero() << endl;
} while (cZero.circulate(CirculatorBase::CLOCKWISE));
} while (cZero.circulate(CirculatorBase::direction::clockwise));
fZero = face(identity(5));
@ -155,7 +155,7 @@ int main(int argc, char *argv[])
{
Info<< "Iterate forwards over face : " << cZero() << endl;
} while (cZero.circulate(CirculatorBase::CLOCKWISE));
} while (cZero.circulate(CirculatorBase::direction::clockwise));
Info<< nl << nl << "Simultaneously go forwards/backwards over face " << f
@ -171,8 +171,8 @@ int main(int argc, char *argv[])
}
while
(
circForward.circulate(CirculatorBase::CLOCKWISE),
circBackward.circulate(CirculatorBase::ANTICLOCKWISE)
circForward.circulate(CirculatorBase::direction::clockwise),
circBackward.circulate(CirculatorBase::direction::anticlockwise)
);
Info<< "\nEnd\n" << endl;

View File

@ -155,7 +155,7 @@ void Foam::backgroundMeshDecomposition::initialRefinement()
List<volumeType> volumeStatus
(
mesh_.nCells(),
volumeType::UNKNOWN
volumeType::unknown
);
// Surface refinement
@ -165,7 +165,7 @@ void Foam::backgroundMeshDecomposition::initialRefinement()
// Determine/update the status of each cell
forAll(volumeStatus, celli)
{
if (volumeStatus[celli] == volumeType::UNKNOWN)
if (volumeStatus[celli] == volumeType::unknown)
{
treeBoundBox cellBb
(
@ -178,15 +178,15 @@ void Foam::backgroundMeshDecomposition::initialRefinement()
if (geometry.overlaps(cellBb))
{
volumeStatus[celli] = volumeType::MIXED;
volumeStatus[celli] = volumeType::mixed;
}
else if (geometry.inside(cellBb.midpoint()))
{
volumeStatus[celli] = volumeType::INSIDE;
volumeStatus[celli] = volumeType::inside;
}
else
{
volumeStatus[celli] = volumeType::OUTSIDE;
volumeStatus[celli] = volumeType::outside;
}
}
}
@ -212,9 +212,9 @@ void Foam::backgroundMeshDecomposition::initialRefinement()
{
label celli = newCellsToRefine[nCTRI];
if (volumeStatus[celli] == volumeType::MIXED)
if (volumeStatus[celli] == volumeType::mixed)
{
volumeStatus[celli] = volumeType::UNKNOWN;
volumeStatus[celli] = volumeType::unknown;
}
icellWeights[celli] = max
@ -264,7 +264,7 @@ void Foam::backgroundMeshDecomposition::initialRefinement()
if (oldCelli == -1)
{
newVolumeStatus[newCelli] = volumeType::UNKNOWN;
newVolumeStatus[newCelli] = volumeType::unknown;
}
else
{
@ -284,7 +284,7 @@ void Foam::backgroundMeshDecomposition::initialRefinement()
// Determine/update the status of each cell
forAll(volumeStatus, celli)
{
if (volumeStatus[celli] == volumeType::UNKNOWN)
if (volumeStatus[celli] == volumeType::unknown)
{
treeBoundBox cellBb
(
@ -297,15 +297,15 @@ void Foam::backgroundMeshDecomposition::initialRefinement()
if (geometry.overlaps(cellBb))
{
volumeStatus[celli] = volumeType::MIXED;
volumeStatus[celli] = volumeType::mixed;
}
else if (geometry.inside(cellBb.midpoint()))
{
volumeStatus[celli] = volumeType::INSIDE;
volumeStatus[celli] = volumeType::inside;
}
else
{
volumeStatus[celli] = volumeType::OUTSIDE;
volumeStatus[celli] = volumeType::outside;
}
}
}
@ -319,7 +319,7 @@ void Foam::backgroundMeshDecomposition::initialRefinement()
forAll(volumeStatus, celli)
{
if (volumeStatus[celli] == volumeType::OUTSIDE)
if (volumeStatus[celli] == volumeType::outside)
{
cellsToRemove.append(celli);
}
@ -374,7 +374,7 @@ void Foam::backgroundMeshDecomposition::initialRefinement()
if (oldCelli == -1)
{
newVolumeStatus[newCelli] = volumeType::UNKNOWN;
newVolumeStatus[newCelli] = volumeType::unknown;
}
else
{
@ -523,7 +523,7 @@ bool Foam::backgroundMeshDecomposition::refineCell
weightEstimate = 1.0;
if (volType == volumeType::MIXED)
if (volType == volumeType::mixed)
{
// // Assess the cell size at the nearest point on the surface for the
// // MIXED cells, if the cell is large with respect to the cell size,
@ -603,7 +603,7 @@ bool Foam::backgroundMeshDecomposition::refineCell
// return true;
// }
}
else if (volType == volumeType::INSIDE)
else if (volType == volumeType::inside)
{
// scalar s =
// foamyHexMesh_.cellShapeControl_.cellSize(cellBb.midpoint());
@ -638,7 +638,7 @@ Foam::labelList Foam::backgroundMeshDecomposition::selectRefinementCells
// Determine/update the status of each cell
forAll(volumeStatus, celli)
{
if (volumeStatus[celli] == volumeType::MIXED)
if (volumeStatus[celli] == volumeType::mixed)
{
if (meshCutter_.cellLevel()[celli] < minLevels_)
{
@ -646,7 +646,7 @@ Foam::labelList Foam::backgroundMeshDecomposition::selectRefinementCells
}
}
if (volumeStatus[celli] != volumeType::OUTSIDE)
if (volumeStatus[celli] != volumeType::outside)
{
if
(
@ -1036,7 +1036,7 @@ bool Foam::backgroundMeshDecomposition::positionOnThisProcessor
{
// return bFTreePtr_().findAnyOverlap(pt, 0.0);
return (bFTreePtr_().getVolumeType(pt) == volumeType::INSIDE);
return (bFTreePtr_().getVolumeType(pt) == volumeType::inside);
}

View File

@ -186,7 +186,7 @@ bool linearDistance::cellSize(const point& pt, scalar& size) const
if
(
sideMode_ == smInside
&& vTL[0] == volumeType::INSIDE
&& vTL[0] == volumeType::inside
)
{
size = sizeFunction(hitPt, dist, hitIndex);
@ -196,7 +196,7 @@ bool linearDistance::cellSize(const point& pt, scalar& size) const
else if
(
sideMode_ == smOutside
&& vTL[0] == volumeType::OUTSIDE
&& vTL[0] == volumeType::outside
)
{
size = sizeFunction(hitPt, dist, hitIndex);

View File

@ -150,7 +150,7 @@ bool linearSpatial::cellSize
if
(
sideMode_ == smInside
&& vTL[0] == volumeType::INSIDE
&& vTL[0] == volumeType::inside
)
{
size = sizeFunction(pt);
@ -160,7 +160,7 @@ bool linearSpatial::cellSize
else if
(
sideMode_ == smOutside
&& vTL[0] == volumeType::OUTSIDE
&& vTL[0] == volumeType::outside
)
{
size = sizeFunction(pt);

View File

@ -250,7 +250,7 @@ bool surfaceOffsetLinearDistance::cellSize
if
(
sideMode_ == smInside
&& vTL[0] == volumeType::INSIDE
&& vTL[0] == volumeType::inside
)
{
size = sizeFunction(hitPt, dist, hitIndex);
@ -260,7 +260,7 @@ bool surfaceOffsetLinearDistance::cellSize
else if
(
sideMode_ == smOutside
&& vTL[0] == volumeType::OUTSIDE
&& vTL[0] == volumeType::outside
)
{
size = sizeFunction(hitPt, dist, hitIndex);

View File

@ -138,7 +138,7 @@ bool uniform::cellSize
if
(
sideMode_ == smInside
&& vTL[0] == volumeType::INSIDE
&& vTL[0] == volumeType::inside
)
{
size = surfaceCellSizeFunction_().interpolate(hitPt, index);
@ -148,7 +148,7 @@ bool uniform::cellSize
else if
(
sideMode_ == smOutside
&& vTL[0] == volumeType::OUTSIDE
&& vTL[0] == volumeType::outside
)
{
size = surfaceCellSizeFunction_().interpolate(hitPt, index);

View File

@ -162,7 +162,7 @@ bool uniformDistance::cellSize
if
(
sideMode_ == smInside
&& vTL[0] == volumeType::INSIDE
&& vTL[0] == volumeType::inside
)
{
size = surfaceCellSizeFunction_().interpolate(hitPt, index);
@ -172,7 +172,7 @@ bool uniformDistance::cellSize
else if
(
sideMode_ == smOutside
&& vTL[0] == volumeType::OUTSIDE
&& vTL[0] == volumeType::outside
)
{
size = surfaceCellSizeFunction_().interpolate(hitPt, index);

View File

@ -407,8 +407,8 @@ void Foam::conformalVoronoiMesh::createEdgePointGroupByCirculating
}
while
(
circ.circulate(CirculatorBase::CLOCKWISE),
circNormalDirs.circulate(CirculatorBase::CLOCKWISE)
circ.circulate(CirculatorBase::direction::clockwise),
circNormalDirs.circulate(CirculatorBase::direction::clockwise)
);

View File

@ -266,7 +266,7 @@ Foam::labelList Foam::conformalVoronoiMesh::calcCellZones
volTypeInsidePoint
);
if (volTypeInsidePoint[0] == volumeType::OUTSIDE)
if (volTypeInsidePoint[0] == volumeType::outside)
{
selectInside = false;
}
@ -283,11 +283,11 @@ Foam::labelList Foam::conformalVoronoiMesh::calcCellZones
if
(
(
volType[pointi] == volumeType::INSIDE
volType[pointi] == volumeType::inside
&& selectInside
)
|| (
volType[pointi] == volumeType::OUTSIDE
volType[pointi] == volumeType::outside
&& !selectInside
)
)

View File

@ -340,7 +340,7 @@ void Foam::featurePointConformer::createMasterAndSlavePoints
);
}
} while (circ.circulate(CirculatorBase::CLOCKWISE));
} while (circ.circulate(CirculatorBase::direction::clockwise));
addMasterAndSlavePoints
(

View File

@ -64,7 +64,7 @@ void Foam::conformationSurfaces::hasBoundedVolume
List<volumeType> vTypes
(
pts.size(),
volumeType::UNKNOWN
volumeType::unknown
);
surface.getVolumeType(pts, vTypes);
@ -569,7 +569,7 @@ Foam::conformationSurfaces::conformationSurfaces
referenceVolumeTypes_.setSize
(
surfaces_.size(),
volumeType::UNKNOWN
volumeType::unknown
);
Info<< endl
@ -666,7 +666,7 @@ Foam::Field<bool> Foam::conformationSurfaces::wellInOutSide
List<volumeType>
(
samplePts.size(),
volumeType::UNKNOWN
volumeType::unknown
)
);
@ -731,7 +731,7 @@ Foam::Field<bool> Foam::conformationSurfaces::wellInOutSide
if
(
!surface.hasVolumeType()
//&& surfaceVolumeTests[s][i] == volumeType::UNKNOWN
//&& surfaceVolumeTests[s][i] == volumeType::unknown
)
{
pointField sample(1, samplePts[i]);
@ -760,7 +760,7 @@ Foam::Field<bool> Foam::conformationSurfaces::wellInOutSide
}
}
if (surfaceVolumeTests[s][i] == volumeType::OUTSIDE)
if (surfaceVolumeTests[s][i] == volumeType::outside)
{
if
(
@ -772,7 +772,7 @@ Foam::Field<bool> Foam::conformationSurfaces::wellInOutSide
break;
}
}
else if (surfaceVolumeTests[s][i] == volumeType::INSIDE)
else if (surfaceVolumeTests[s][i] == volumeType::inside)
{
if
(

View File

@ -357,11 +357,11 @@ tmp<scalarField> signedDistance
volumeType vT = volType[i];
if (vT == volumeType::OUTSIDE)
if (vT == volumeType::outside)
{
fld[pointi] = dist;
}
else if (vT == volumeType::INSIDE)
else if (vT == volumeType::inside)
{
fld[i] = -dist;
}

View File

@ -112,7 +112,7 @@ class distanceCalc
surfaces,
samples,
scalarField(1, great),
volumeType::OUTSIDE,
volumeType::outside,
nearestSurfaces,
distance
);

View File

@ -268,8 +268,8 @@ int main(int argc, char *argv[])
if
(
outside
? (t == volumeType::OUTSIDE)
: (t == volumeType::INSIDE)
? (t == volumeType::outside)
: (t == volumeType::inside)
)
{
facesToSubset[facei] = true;

View File

@ -100,7 +100,7 @@ void Foam::sigStopAtWriteNow::sigHandler(int)
Info<< "sigStopAtWriteNow :"
<< " setting up write and stop at end of the next iteration"
<< nl << endl;
runTimePtr_->stopAt(Time::saWriteNow);
runTimePtr_->stopAt(Time::stopAtControl::writeNow);
//// Throw signal (to old handler)
// raise(signal_);

View File

@ -101,7 +101,7 @@ bool Foam::dynamicIndexedOctree<Type>::overlaps
point other;
if (octant & treeBoundBox::RIGHTHALF)
if (octant & treeBoundBox::octantBit::rightHalf)
{
other.x() = max.x();
}
@ -110,7 +110,7 @@ bool Foam::dynamicIndexedOctree<Type>::overlaps
other.x() = min.x();
}
if (octant & treeBoundBox::TOPHALF)
if (octant & treeBoundBox::octantBit::topHalf)
{
other.y() = max.y();
}
@ -119,7 +119,7 @@ bool Foam::dynamicIndexedOctree<Type>::overlaps
other.y() = min.y();
}
if (octant & treeBoundBox::FRONTHALF)
if (octant & treeBoundBox::octantBit::frontHalf)
{
other.z() = max.z();
}
@ -330,7 +330,7 @@ Foam::volumeType Foam::dynamicIndexedOctree<Type>::calcVolumeType
const node& nod = nodes_[nodeI];
volumeType myType = volumeType::UNKNOWN;
volumeType myType = volumeType::unknown;
for (direction octant = 0; octant < nod.subNodes_.size(); octant++)
{
@ -347,7 +347,7 @@ Foam::volumeType Foam::dynamicIndexedOctree<Type>::calcVolumeType
{
// Contents. Depending on position in box might be on either
// side.
subType = volumeType::MIXED;
subType = volumeType::mixed;
}
else
{
@ -366,13 +366,13 @@ Foam::volumeType Foam::dynamicIndexedOctree<Type>::calcVolumeType
// Combine sub node types into type for treeNode. Result is 'mixed' if
// types differ among subnodes.
if (myType == volumeType::UNKNOWN)
if (myType == volumeType::unknown)
{
myType = subType;
}
else if (subType != myType)
{
myType = volumeType::MIXED;
myType = volumeType::mixed;
}
}
return myType;
@ -392,20 +392,20 @@ Foam::volumeType Foam::dynamicIndexedOctree<Type>::getVolumeType
volumeType octantType = volumeType::type(nodeTypes_.get((nodeI<<3)+octant));
if (octantType == volumeType::INSIDE)
if (octantType == volumeType::inside)
{
return octantType;
}
else if (octantType == volumeType::OUTSIDE)
else if (octantType == volumeType::outside)
{
return octantType;
}
else if (octantType == volumeType::UNKNOWN)
else if (octantType == volumeType::unknown)
{
// Can happen for e.g. non-manifold surfaces.
return octantType;
}
else if (octantType == volumeType::MIXED)
else if (octantType == volumeType::mixed)
{
labelBits index = nod.subNodes_[octant];
@ -431,7 +431,7 @@ Foam::volumeType Foam::dynamicIndexedOctree<Type>::getVolumeType
<< "Empty subnode has invalid volume type MIXED."
<< abort(FatalError);
return volumeType::UNKNOWN;
return volumeType::unknown;
}
}
else
@ -443,7 +443,7 @@ Foam::volumeType Foam::dynamicIndexedOctree<Type>::getVolumeType
<< "Node has invalid volume type " << octantType
<< abort(FatalError);
return volumeType::UNKNOWN;
return volumeType::unknown;
}
}
@ -457,11 +457,11 @@ Foam::volumeType Foam::dynamicIndexedOctree<Type>::getSide
{
if ((outsideNormal&vec) >= 0)
{
return volumeType::OUTSIDE;
return volumeType::outside;
}
else
{
return volumeType::INSIDE;
return volumeType::inside;
}
}
@ -725,7 +725,7 @@ Foam::point Foam::dynamicIndexedOctree<Type>::pushPoint
<< abort(FatalError);
}
if (faceID & treeBoundBox::LEFTBIT)
if (faceID & treeBoundBox::faceBit::left)
{
if (pushInside)
{
@ -736,7 +736,7 @@ Foam::point Foam::dynamicIndexedOctree<Type>::pushPoint
perturbedPt[0] = bb.min()[0] - (perturbVec[0] + rootVSmall);
}
}
else if (faceID & treeBoundBox::RIGHTBIT)
else if (faceID & treeBoundBox::faceBit::right)
{
if (pushInside)
{
@ -748,7 +748,7 @@ Foam::point Foam::dynamicIndexedOctree<Type>::pushPoint
}
}
if (faceID & treeBoundBox::BOTTOMBIT)
if (faceID & treeBoundBox::faceBit::bottom)
{
if (pushInside)
{
@ -759,7 +759,7 @@ Foam::point Foam::dynamicIndexedOctree<Type>::pushPoint
perturbedPt[1] = bb.min()[1] - (perturbVec[1] + rootVSmall);
}
}
else if (faceID & treeBoundBox::TOPBIT)
else if (faceID & treeBoundBox::faceBit::top)
{
if (pushInside)
{
@ -771,7 +771,7 @@ Foam::point Foam::dynamicIndexedOctree<Type>::pushPoint
}
}
if (faceID & treeBoundBox::BACKBIT)
if (faceID & treeBoundBox::faceBit::back)
{
if (pushInside)
{
@ -782,7 +782,7 @@ Foam::point Foam::dynamicIndexedOctree<Type>::pushPoint
perturbedPt[2] = bb.min()[2] - (perturbVec[2] + rootVSmall);
}
}
else if (faceID & treeBoundBox::FRONTBIT)
else if (faceID & treeBoundBox::faceBit::front)
{
if (pushInside)
{
@ -840,31 +840,31 @@ Foam::point Foam::dynamicIndexedOctree<Type>::pushPointIntoFace
direction nFaces = 0;
FixedList<direction, 3> faceIndices;
if (ptFaceID & treeBoundBox::LEFTBIT)
if (ptFaceID & treeBoundBox::faceBit::left)
{
faceIndices[nFaces++] = treeBoundBox::LEFT;
faceIndices[nFaces++] = treeBoundBox::faceId::left;
}
else if (ptFaceID & treeBoundBox::RIGHTBIT)
else if (ptFaceID & treeBoundBox::faceBit::right)
{
faceIndices[nFaces++] = treeBoundBox::RIGHT;
faceIndices[nFaces++] = treeBoundBox::faceId::right;
}
if (ptFaceID & treeBoundBox::BOTTOMBIT)
if (ptFaceID & treeBoundBox::faceBit::bottom)
{
faceIndices[nFaces++] = treeBoundBox::BOTTOM;
faceIndices[nFaces++] = treeBoundBox::faceId::bottom;
}
else if (ptFaceID & treeBoundBox::TOPBIT)
else if (ptFaceID & treeBoundBox::faceBit::top)
{
faceIndices[nFaces++] = treeBoundBox::TOP;
faceIndices[nFaces++] = treeBoundBox::faceId::top;
}
if (ptFaceID & treeBoundBox::BACKBIT)
if (ptFaceID & treeBoundBox::faceBit::back)
{
faceIndices[nFaces++] = treeBoundBox::BACK;
faceIndices[nFaces++] = treeBoundBox::faceId::back;
}
else if (ptFaceID & treeBoundBox::FRONTBIT)
else if (ptFaceID & treeBoundBox::faceBit::front)
{
faceIndices[nFaces++] = treeBoundBox::FRONT;
faceIndices[nFaces++] = treeBoundBox::faceId::front;
}
@ -910,35 +910,35 @@ Foam::point Foam::dynamicIndexedOctree<Type>::pushPointIntoFace
// 2. Snap it back onto the preferred face
if (keepFaceID == treeBoundBox::LEFT)
if (keepFaceID == treeBoundBox::faceId::left)
{
facePoint.x() = bb.min().x();
faceID = treeBoundBox::LEFTBIT;
faceID = treeBoundBox::faceBit::left;
}
else if (keepFaceID == treeBoundBox::RIGHT)
else if (keepFaceID == treeBoundBox::faceId::right)
{
facePoint.x() = bb.max().x();
faceID = treeBoundBox::RIGHTBIT;
faceID = treeBoundBox::faceBit::right;
}
else if (keepFaceID == treeBoundBox::BOTTOM)
else if (keepFaceID == treeBoundBox::faceId::bottom)
{
facePoint.y() = bb.min().y();
faceID = treeBoundBox::BOTTOMBIT;
faceID = treeBoundBox::faceBit::bottom;
}
else if (keepFaceID == treeBoundBox::TOP)
else if (keepFaceID == treeBoundBox::faceId::top)
{
facePoint.y() = bb.max().y();
faceID = treeBoundBox::TOPBIT;
faceID = treeBoundBox::faceBit::top;
}
else if (keepFaceID == treeBoundBox::BACK)
else if (keepFaceID == treeBoundBox::faceId::back)
{
facePoint.z() = bb.min().z();
faceID = treeBoundBox::BACKBIT;
faceID = treeBoundBox::faceBit::back;
}
else if (keepFaceID == treeBoundBox::FRONT)
else if (keepFaceID == treeBoundBox::faceId::front)
{
facePoint.z() = bb.max().z();
faceID = treeBoundBox::FRONTBIT;
faceID = treeBoundBox::faceBit::front;
}
@ -1027,7 +1027,7 @@ bool Foam::dynamicIndexedOctree<Type>::walkToNeighbour
{
// Walk tree to neighbouring node. Gets current position as node and octant
// in this node and walks in the direction given by the facePointBits
// (combination of treeBoundBox::LEFTBIT, TOPBIT etc.) Returns false if
// (combination of treeBoundBox::left, top etc.) Returns false if
// edge of tree hit.
label oldNodeI = nodeI;
@ -1038,42 +1038,42 @@ bool Foam::dynamicIndexedOctree<Type>::walkToNeighbour
// on the right.
// Coordinate direction to test
const direction X = treeBoundBox::RIGHTHALF;
const direction Y = treeBoundBox::TOPHALF;
const direction Z = treeBoundBox::FRONTHALF;
const direction X = treeBoundBox::octantBit::rightHalf;
const direction Y = treeBoundBox::octantBit::topHalf;
const direction Z = treeBoundBox::octantBit::frontHalf;
direction octantMask = 0;
direction wantedValue = 0;
if ((faceID & treeBoundBox::LEFTBIT) != 0)
if ((faceID & treeBoundBox::faceBit::left) != 0)
{
// We want to go left so check if in right octant (i.e. x-bit is set)
octantMask |= X;
wantedValue |= X;
}
else if ((faceID & treeBoundBox::RIGHTBIT) != 0)
else if ((faceID & treeBoundBox::faceBit::right) != 0)
{
octantMask |= X; // wantedValue already 0
}
if ((faceID & treeBoundBox::BOTTOMBIT) != 0)
if ((faceID & treeBoundBox::faceBit::bottom) != 0)
{
// Want to go down so check for y-bit set.
octantMask |= Y;
wantedValue |= Y;
}
else if ((faceID & treeBoundBox::TOPBIT) != 0)
else if ((faceID & treeBoundBox::faceBit::top) != 0)
{
// Want to go up so check for y-bit not set.
octantMask |= Y;
}
if ((faceID & treeBoundBox::BACKBIT) != 0)
if ((faceID & treeBoundBox::faceBit::back) != 0)
{
octantMask |= Z;
wantedValue |= Z;
}
else if ((faceID & treeBoundBox::FRONTBIT) != 0)
else if ((faceID & treeBoundBox::faceBit::front) != 0)
{
octantMask |= Z;
}
@ -1093,7 +1093,7 @@ bool Foam::dynamicIndexedOctree<Type>::walkToNeighbour
// +---+-+-+
// \
//
// e.g. ray is at (a) in octant 0(or 4) with faceIDs : LEFTBIT+TOPBIT.
// e.g. ray is at (a) in octant 0(or 4) with faceIDs : left+top.
// If we would be in octant 1(or 5) we could go to the correct octant
// in the same node by just flipping the x and y bits (exoring).
// But if we are not in octant 1/5 we have to go up until we are.
@ -1271,32 +1271,32 @@ Foam::word Foam::dynamicIndexedOctree<Type>::faceString
{
desc = "noFace";
}
if (faceID & treeBoundBox::LEFTBIT)
if (faceID & treeBoundBox::faceBit::left)
{
if (!desc.empty()) desc += "+";
desc += "left";
}
if (faceID & treeBoundBox::RIGHTBIT)
if (faceID & treeBoundBox::faceBit::right)
{
if (!desc.empty()) desc += "+";
desc += "right";
}
if (faceID & treeBoundBox::BOTTOMBIT)
if (faceID & treeBoundBox::faceBit::bottom)
{
if (!desc.empty()) desc += "+";
desc += "bottom";
}
if (faceID & treeBoundBox::TOPBIT)
if (faceID & treeBoundBox::faceBit::top)
{
if (!desc.empty()) desc += "+";
desc += "top";
}
if (faceID & treeBoundBox::BACKBIT)
if (faceID & treeBoundBox::faceBit::back)
{
if (!desc.empty()) desc += "+";
desc += "back";
}
if (faceID & treeBoundBox::FRONTBIT)
if (faceID & treeBoundBox::faceBit::front)
{
if (!desc.empty()) desc += "+";
desc += "front";
@ -2351,7 +2351,7 @@ Foam::volumeType Foam::dynamicIndexedOctree<Type>::getVolumeType
{
if (nodes_.empty())
{
return volumeType::UNKNOWN;
return volumeType::unknown;
}
if (nodeTypes_.size() != 8*nodes_.size())
@ -2359,36 +2359,36 @@ Foam::volumeType Foam::dynamicIndexedOctree<Type>::getVolumeType
// Calculate type for every octant of node.
nodeTypes_.setSize(8*nodes_.size());
nodeTypes_ = volumeType::UNKNOWN;
nodeTypes_ = volumeType::unknown;
calcVolumeType(0);
if (debug)
{
label nUNKNOWN = 0;
label nMIXED = 0;
label nINSIDE = 0;
label nOUTSIDE = 0;
label nUnknown = 0;
label nMixed = 0;
label nInside = 0;
label nOutside = 0;
forAll(nodeTypes_, i)
{
volumeType type = volumeType::type(nodeTypes_.get(i));
if (type == volumeType::UNKNOWN)
if (type == volumeType::unknown)
{
nUNKNOWN++;
nUnknown++;
}
else if (type == volumeType::MIXED)
else if (type == volumeType::mixed)
{
nMIXED++;
nMixed++;
}
else if (type == volumeType::INSIDE)
else if (type == volumeType::inside)
{
nINSIDE++;
nInside++;
}
else if (type == volumeType::OUTSIDE)
else if (type == volumeType::outside)
{
nOUTSIDE++;
nOutside++;
}
else
{
@ -2400,10 +2400,10 @@ Foam::volumeType Foam::dynamicIndexedOctree<Type>::getVolumeType
<< " bb:" << bb()
<< " nodes_:" << nodes_.size()
<< " nodeTypes_:" << nodeTypes_.size()
<< " nUNKNOWN:" << nUNKNOWN
<< " nMIXED:" << nMIXED
<< " nINSIDE:" << nINSIDE
<< " nOUTSIDE:" << nOUTSIDE
<< " nUnknown:" << nUnknown
<< " nMixed:" << nMixed
<< " nInside:" << nInside
<< " nOutside:" << nOutside
<< endl;
}
}

View File

@ -61,7 +61,7 @@ Foam::volumeType Foam::dynamicTreeDataPoint::getVolumeType
const point& sample
) const
{
return volumeType::UNKNOWN;
return volumeType::unknown;
}

View File

@ -76,7 +76,7 @@ bool Foam::indexedOctree<Type>::overlaps
point other;
if (octant & treeBoundBox::RIGHTHALF)
if (octant & treeBoundBox::octantBit::rightHalf)
{
other.x() = max.x();
}
@ -85,7 +85,7 @@ bool Foam::indexedOctree<Type>::overlaps
other.x() = min.x();
}
if (octant & treeBoundBox::TOPHALF)
if (octant & treeBoundBox::octantBit::topHalf)
{
other.y() = max.y();
}
@ -94,7 +94,7 @@ bool Foam::indexedOctree<Type>::overlaps
other.y() = min.y();
}
if (octant & treeBoundBox::FRONTHALF)
if (octant & treeBoundBox::octantBit::frontHalf)
{
other.z() = max.z();
}
@ -351,7 +351,7 @@ Foam::volumeType Foam::indexedOctree<Type>::calcVolumeType
const node& nod = nodes_[nodeI];
volumeType myType = volumeType::UNKNOWN;
volumeType myType = volumeType::unknown;
for (direction octant = 0; octant < nod.subNodes_.size(); octant++)
{
@ -368,7 +368,7 @@ Foam::volumeType Foam::indexedOctree<Type>::calcVolumeType
{
// Contents. Depending on position in box might be on either
// side.
subType = volumeType::MIXED;
subType = volumeType::mixed;
}
else
{
@ -384,13 +384,13 @@ Foam::volumeType Foam::indexedOctree<Type>::calcVolumeType
// Combine sub node types into type for treeNode. Result is 'mixed' if
// types differ among subnodes.
if (myType == volumeType::UNKNOWN)
if (myType == volumeType::unknown)
{
myType = subType;
}
else if (subType != myType)
{
myType = volumeType::MIXED;
myType = volumeType::mixed;
}
}
return myType;
@ -410,20 +410,20 @@ Foam::volumeType Foam::indexedOctree<Type>::getVolumeType
volumeType octantType = volumeType::type(nodeTypes_.get((nodeI<<3)+octant));
if (octantType == volumeType::INSIDE)
if (octantType == volumeType::inside)
{
return octantType;
}
else if (octantType == volumeType::OUTSIDE)
else if (octantType == volumeType::outside)
{
return octantType;
}
else if (octantType == volumeType::UNKNOWN)
else if (octantType == volumeType::unknown)
{
// Can happen for e.g. non-manifold surfaces.
return octantType;
}
else if (octantType == volumeType::MIXED)
else if (octantType == volumeType::mixed)
{
labelBits index = nod.subNodes_[octant];
@ -446,10 +446,10 @@ Foam::volumeType Foam::indexedOctree<Type>::getVolumeType
FatalErrorInFunction
<< "Sample:" << sample << " node:" << nodeI
<< " with bb:" << nodes_[nodeI].bb_ << nl
<< "Empty subnode has invalid volume type MIXED."
<< "Empty subnode has invalid volume type mixed."
<< abort(FatalError);
return volumeType::UNKNOWN;
return volumeType::unknown;
}
}
else
@ -461,7 +461,7 @@ Foam::volumeType Foam::indexedOctree<Type>::getVolumeType
<< "Node has invalid volume type " << octantType
<< abort(FatalError);
return volumeType::UNKNOWN;
return volumeType::unknown;
}
}
@ -475,11 +475,11 @@ Foam::volumeType Foam::indexedOctree<Type>::getSide
{
if ((outsideNormal&vec) >= 0)
{
return volumeType::OUTSIDE;
return volumeType::outside;
}
else
{
return volumeType::INSIDE;
return volumeType::inside;
}
}
@ -747,7 +747,7 @@ Foam::point Foam::indexedOctree<Type>::pushPoint
<< abort(FatalError);
}
if (faceID & treeBoundBox::LEFTBIT)
if (faceID & treeBoundBox::faceBit::left)
{
if (pushInside)
{
@ -758,7 +758,7 @@ Foam::point Foam::indexedOctree<Type>::pushPoint
perturbedPt[0] = bb.min()[0] - (perturbVec[0] + rootVSmall);
}
}
else if (faceID & treeBoundBox::RIGHTBIT)
else if (faceID & treeBoundBox::faceBit::right)
{
if (pushInside)
{
@ -770,7 +770,7 @@ Foam::point Foam::indexedOctree<Type>::pushPoint
}
}
if (faceID & treeBoundBox::BOTTOMBIT)
if (faceID & treeBoundBox::faceBit::bottom)
{
if (pushInside)
{
@ -781,7 +781,7 @@ Foam::point Foam::indexedOctree<Type>::pushPoint
perturbedPt[1] = bb.min()[1] - (perturbVec[1] + rootVSmall);
}
}
else if (faceID & treeBoundBox::TOPBIT)
else if (faceID & treeBoundBox::faceBit::top)
{
if (pushInside)
{
@ -793,7 +793,7 @@ Foam::point Foam::indexedOctree<Type>::pushPoint
}
}
if (faceID & treeBoundBox::BACKBIT)
if (faceID & treeBoundBox::faceBit::back)
{
if (pushInside)
{
@ -804,7 +804,7 @@ Foam::point Foam::indexedOctree<Type>::pushPoint
perturbedPt[2] = bb.min()[2] - (perturbVec[2] + rootVSmall);
}
}
else if (faceID & treeBoundBox::FRONTBIT)
else if (faceID & treeBoundBox::faceBit::front)
{
if (pushInside)
{
@ -862,31 +862,31 @@ Foam::point Foam::indexedOctree<Type>::pushPointIntoFace
direction nFaces = 0;
FixedList<direction, 3> faceIndices;
if (ptFaceID & treeBoundBox::LEFTBIT)
if (ptFaceID & treeBoundBox::faceBit::left)
{
faceIndices[nFaces++] = treeBoundBox::LEFT;
faceIndices[nFaces++] = treeBoundBox::faceId::left;
}
else if (ptFaceID & treeBoundBox::RIGHTBIT)
else if (ptFaceID & treeBoundBox::faceBit::right)
{
faceIndices[nFaces++] = treeBoundBox::RIGHT;
faceIndices[nFaces++] = treeBoundBox::faceId::right;
}
if (ptFaceID & treeBoundBox::BOTTOMBIT)
if (ptFaceID & treeBoundBox::faceBit::bottom)
{
faceIndices[nFaces++] = treeBoundBox::BOTTOM;
faceIndices[nFaces++] = treeBoundBox::faceId::bottom;
}
else if (ptFaceID & treeBoundBox::TOPBIT)
else if (ptFaceID & treeBoundBox::faceBit::top)
{
faceIndices[nFaces++] = treeBoundBox::TOP;
faceIndices[nFaces++] = treeBoundBox::faceId::top;
}
if (ptFaceID & treeBoundBox::BACKBIT)
if (ptFaceID & treeBoundBox::faceBit::back)
{
faceIndices[nFaces++] = treeBoundBox::BACK;
faceIndices[nFaces++] = treeBoundBox::faceId::back;
}
else if (ptFaceID & treeBoundBox::FRONTBIT)
else if (ptFaceID & treeBoundBox::faceBit::front)
{
faceIndices[nFaces++] = treeBoundBox::FRONT;
faceIndices[nFaces++] = treeBoundBox::faceId::front;
}
@ -932,35 +932,35 @@ Foam::point Foam::indexedOctree<Type>::pushPointIntoFace
// 2. Snap it back onto the preferred face
if (keepFaceID == treeBoundBox::LEFT)
if (keepFaceID == treeBoundBox::faceId::left)
{
facePoint.x() = bb.min().x();
faceID = treeBoundBox::LEFTBIT;
faceID = treeBoundBox::faceBit::left;
}
else if (keepFaceID == treeBoundBox::RIGHT)
else if (keepFaceID == treeBoundBox::faceId::right)
{
facePoint.x() = bb.max().x();
faceID = treeBoundBox::RIGHTBIT;
faceID = treeBoundBox::faceBit::right;
}
else if (keepFaceID == treeBoundBox::BOTTOM)
else if (keepFaceID == treeBoundBox::faceId::bottom)
{
facePoint.y() = bb.min().y();
faceID = treeBoundBox::BOTTOMBIT;
faceID = treeBoundBox::faceBit::bottom;
}
else if (keepFaceID == treeBoundBox::TOP)
else if (keepFaceID == treeBoundBox::faceId::top)
{
facePoint.y() = bb.max().y();
faceID = treeBoundBox::TOPBIT;
faceID = treeBoundBox::faceBit::top;
}
else if (keepFaceID == treeBoundBox::BACK)
else if (keepFaceID == treeBoundBox::faceId::back)
{
facePoint.z() = bb.min().z();
faceID = treeBoundBox::BACKBIT;
faceID = treeBoundBox::faceBit::back;
}
else if (keepFaceID == treeBoundBox::FRONT)
else if (keepFaceID == treeBoundBox::faceId::front)
{
facePoint.z() = bb.max().z();
faceID = treeBoundBox::FRONTBIT;
faceID = treeBoundBox::faceBit::front;
}
@ -1048,7 +1048,7 @@ bool Foam::indexedOctree<Type>::walkToNeighbour
{
// Gets current position as node and octant in this node and walks in the
// direction given by the facePointBits (combination of
// treeBoundBox::LEFTBIT, TOPBIT etc.) Returns false if edge of tree hit.
// treeBoundBox::left, top etc.) Returns false if edge of tree hit.
label oldNodeI = nodeI;
direction oldOctant = octant;
@ -1058,42 +1058,42 @@ bool Foam::indexedOctree<Type>::walkToNeighbour
// on the right.
// Coordinate direction to test
const direction X = treeBoundBox::RIGHTHALF;
const direction Y = treeBoundBox::TOPHALF;
const direction Z = treeBoundBox::FRONTHALF;
const direction X = treeBoundBox::octantBit::rightHalf;
const direction Y = treeBoundBox::octantBit::topHalf;
const direction Z = treeBoundBox::octantBit::frontHalf;
direction octantMask = 0;
direction wantedValue = 0;
if ((faceID & treeBoundBox::LEFTBIT) != 0)
if ((faceID & treeBoundBox::faceBit::left) != 0)
{
// We want to go left so check if in right octant (i.e. x-bit is set)
octantMask |= X;
wantedValue |= X;
}
else if ((faceID & treeBoundBox::RIGHTBIT) != 0)
else if ((faceID & treeBoundBox::faceBit::right) != 0)
{
octantMask |= X; // wantedValue already 0
}
if ((faceID & treeBoundBox::BOTTOMBIT) != 0)
if ((faceID & treeBoundBox::faceBit::bottom) != 0)
{
// Want to go down so check for y-bit set.
octantMask |= Y;
wantedValue |= Y;
}
else if ((faceID & treeBoundBox::TOPBIT) != 0)
else if ((faceID & treeBoundBox::faceBit::top) != 0)
{
// Want to go up so check for y-bit not set.
octantMask |= Y;
}
if ((faceID & treeBoundBox::BACKBIT) != 0)
if ((faceID & treeBoundBox::faceBit::back) != 0)
{
octantMask |= Z;
wantedValue |= Z;
}
else if ((faceID & treeBoundBox::FRONTBIT) != 0)
else if ((faceID & treeBoundBox::faceBit::front) != 0)
{
octantMask |= Z;
}
@ -1113,7 +1113,7 @@ bool Foam::indexedOctree<Type>::walkToNeighbour
// +---+-+-+
// \
//
// e.g. ray is at (a) in octant 0(or 4) with faceIDs : LEFTBIT+TOPBIT.
// e.g. ray is at (a) in octant 0(or 4) with faceIDs : left+top.
// If we would be in octant 1(or 5) we could go to the correct octant
// in the same node by just flipping the x and y bits (exoring).
// But if we are not in octant 1/5 we have to go up until we are.
@ -1291,32 +1291,32 @@ Foam::word Foam::indexedOctree<Type>::faceString
{
desc = "noFace";
}
if (faceID & treeBoundBox::LEFTBIT)
if (faceID & treeBoundBox::faceBit::left)
{
if (!desc.empty()) desc += "+";
desc += "left";
}
if (faceID & treeBoundBox::RIGHTBIT)
if (faceID & treeBoundBox::faceBit::right)
{
if (!desc.empty()) desc += "+";
desc += "right";
}
if (faceID & treeBoundBox::BOTTOMBIT)
if (faceID & treeBoundBox::faceBit::bottom)
{
if (!desc.empty()) desc += "+";
desc += "bottom";
}
if (faceID & treeBoundBox::TOPBIT)
if (faceID & treeBoundBox::faceBit::top)
{
if (!desc.empty()) desc += "+";
desc += "top";
}
if (faceID & treeBoundBox::BACKBIT)
if (faceID & treeBoundBox::faceBit::back)
{
if (!desc.empty()) desc += "+";
desc += "back";
}
if (faceID & treeBoundBox::FRONTBIT)
if (faceID & treeBoundBox::faceBit::front)
{
if (!desc.empty()) desc += "+";
desc += "front";
@ -2628,7 +2628,7 @@ Foam::volumeType Foam::indexedOctree<Type>::getVolumeType
{
if (nodes_.empty())
{
return volumeType::UNKNOWN;
return volumeType::unknown;
}
if (nodeTypes_.size() != 8*nodes_.size())
@ -2636,36 +2636,36 @@ Foam::volumeType Foam::indexedOctree<Type>::getVolumeType
// Calculate type for every octant of node.
nodeTypes_.setSize(8*nodes_.size());
nodeTypes_ = volumeType::UNKNOWN;
nodeTypes_ = volumeType::unknown;
calcVolumeType(0);
if (debug)
{
label nUNKNOWN = 0;
label nMIXED = 0;
label nINSIDE = 0;
label nOUTSIDE = 0;
label nUnknown = 0;
label nMixed = 0;
label nInside = 0;
label nOutside = 0;
forAll(nodeTypes_, i)
{
volumeType type = volumeType::type(nodeTypes_.get(i));
if (type == volumeType::UNKNOWN)
if (type == volumeType::unknown)
{
nUNKNOWN++;
nUnknown++;
}
else if (type == volumeType::MIXED)
else if (type == volumeType::mixed)
{
nMIXED++;
nMixed++;
}
else if (type == volumeType::INSIDE)
else if (type == volumeType::inside)
{
nINSIDE++;
nInside++;
}
else if (type == volumeType::OUTSIDE)
else if (type == volumeType::outside)
{
nOUTSIDE++;
nOutside++;
}
else
{
@ -2677,10 +2677,10 @@ Foam::volumeType Foam::indexedOctree<Type>::getVolumeType
<< " bb:" << bb()
<< " nodes_:" << nodes_.size()
<< " nodeTypes_:" << nodeTypes_.size()
<< " nUNKNOWN:" << nUNKNOWN
<< " nMIXED:" << nMIXED
<< " nINSIDE:" << nINSIDE
<< " nOUTSIDE:" << nOUTSIDE
<< " nUnknown:" << nUnknown
<< " nMixed:" << nMixed
<< " nInside:" << nInside
<< " nOutside:" << nOutside
<< endl;
}
}

View File

@ -204,7 +204,7 @@ public:
) const
{
NotImplemented;
return volumeType::UNKNOWN;
return volumeType::unknown;
}
//- Does (bb of) shape at index overlap bb

View File

@ -59,10 +59,10 @@ public:
//- Volume types
enum type
{
UNKNOWN = 0,
MIXED = 1,
INSIDE = 2,
OUTSIDE = 3
unknown = 0,
mixed = 1,
inside = 2,
outside = 3
};
@ -86,7 +86,7 @@ public:
//- Construct null
volumeType()
:
t_(UNKNOWN)
t_(unknown)
{}
//- Construct from components

View File

@ -49,7 +49,7 @@ Description
Info<< "Iterate forwards over face : " << circ() << endl;
} while (circ.circulate(CirculatorBase::CLOCKWISE));
} while (circ.circulate(CirculatorBase::direction::clockwise));
\endcode
SourceFiles
@ -144,7 +144,11 @@ public:
inline size_type size() const;
//- Circulate around the list in the given direction
inline bool circulate(const CirculatorBase::direction dir = NONE);
inline bool circulate
(
const CirculatorBase::direction dir =
CirculatorBase::direction::none
);
//- Set the fulcrum to the current position of the iterator
inline void setFulcrumToIterator();

View File

@ -99,11 +99,11 @@ bool Foam::Circulator<ContainerType>::circulate
const CirculatorBase::direction dir
)
{
if (dir == CirculatorBase::CLOCKWISE)
if (dir == CirculatorBase::direction::clockwise)
{
operator++();
}
else if (dir == CirculatorBase::ANTICLOCKWISE)
else if (dir == CirculatorBase::direction::anticlockwise)
{
operator--();
}

View File

@ -49,19 +49,19 @@ public:
// Public data
//- Direction type enumeration
enum direction
enum class direction
{
NONE,
CLOCKWISE,
ANTICLOCKWISE
none,
clockwise,
anticlockwise
};
// Constructors
//- Construct null
CirculatorBase(){};
CirculatorBase()
{}
};

View File

@ -47,7 +47,7 @@ Description
{
Info<< "Iterate forwards over face : " << circ() << endl;
} while (circ.circulate(CirculatorBase::CLOCKWISE));
} while (circ.circulate(CirculatorBase::direction::clockwise));
\endcode
\code
@ -63,8 +63,11 @@ Description
}
while
(
circClockwise.circulate(CirculatorBase::CLOCKWISE),
circAnticlockwise.circulate(CirculatorBase::ANTICLOCKWISE)
circClockwise.circulate(CirculatorBase::direction::clockwise),
circAnticlockwise.circulate
(
CirculatorBase::direction::anticlockwise
)
);
\endcode
@ -164,7 +167,11 @@ public:
inline size_type size() const;
//- Circulate around the list in the given direction
inline bool circulate(const CirculatorBase::direction dir = NONE);
inline bool circulate
(
const CirculatorBase::direction dir =
CirculatorBase::direction::none
);
//- Set the fulcrum to the current position of the iterator
inline void setFulcrumToIterator();

View File

@ -102,11 +102,11 @@ bool Foam::ConstCirculator<ContainerType>::circulate
const CirculatorBase::direction dir
)
{
if (dir == CirculatorBase::CLOCKWISE)
if (dir == CirculatorBase::direction::clockwise)
{
operator++();
}
else if (dir == CirculatorBase::ANTICLOCKWISE)
else if (dir == CirculatorBase::direction::anticlockwise)
{
operator--();
}

View File

@ -39,7 +39,7 @@ namespace Foam
template<>
const char* Foam::NamedEnum
<
Foam::Time::stopAtControls,
Foam::Time::stopAtControl,
4
>::names[] =
{
@ -52,7 +52,7 @@ namespace Foam
template<>
const char* Foam::NamedEnum
<
Foam::Time::writeControls,
Foam::Time::writeControl,
5
>::names[] =
{
@ -64,13 +64,13 @@ namespace Foam
};
}
const Foam::NamedEnum<Foam::Time::stopAtControls, 4>
const Foam::NamedEnum<Foam::Time::stopAtControl, 4>
Foam::Time::stopAtControlNames_;
const Foam::NamedEnum<Foam::Time::writeControls, 5>
const Foam::NamedEnum<Foam::Time::writeControl, 5>
Foam::Time::writeControlNames_;
Foam::Time::fmtflags Foam::Time::format_(Foam::Time::general);
Foam::Time::format Foam::Time::format_(Foam::Time::format::general);
int Foam::Time::precision_(6);
@ -350,8 +350,8 @@ Foam::Time::Time
startTime_(0),
endTime_(0),
stopAt_(saEndTime),
writeControl_(wcTimeStep),
stopAt_(stopAtControl::endTime),
writeControl_(writeControl::timeStep),
writeInterval_(great),
purgeWrite_(0),
writeOnce_(false),
@ -426,8 +426,8 @@ Foam::Time::Time
startTime_(0),
endTime_(0),
stopAt_(saEndTime),
writeControl_(wcTimeStep),
stopAt_(stopAtControl::endTime),
writeControl_(writeControl::timeStep),
writeInterval_(great),
purgeWrite_(0),
writeOnce_(false),
@ -509,8 +509,8 @@ Foam::Time::Time
startTime_(0),
endTime_(0),
stopAt_(saEndTime),
writeControl_(wcTimeStep),
stopAt_(stopAtControl::endTime),
writeControl_(writeControl::timeStep),
writeInterval_(great),
purgeWrite_(0),
writeOnce_(false),
@ -588,8 +588,8 @@ Foam::Time::Time
startTime_(0),
endTime_(0),
stopAt_(saEndTime),
writeControl_(wcTimeStep),
stopAt_(stopAtControl::endTime),
writeControl_(writeControl::timeStep),
writeInterval_(great),
purgeWrite_(0),
writeOnce_(false),
@ -852,13 +852,13 @@ bool Foam::Time::end() const
}
bool Foam::Time::stopAt(const stopAtControls sa) const
bool Foam::Time::stopAt(const stopAtControl sa) const
{
const bool changed = (stopAt_ != sa);
stopAt_ = sa;
// adjust endTime
if (sa == saEndTime)
if (sa == stopAtControl::endTime)
{
controlDict_.lookup("endTime") >> endTime_;
}
@ -945,7 +945,7 @@ void Foam::Time::setDeltaT(const scalar deltaT)
functionObjects_.setTimeStep();
if (writeControl_ == wcAdjustableRunTime)
if (writeControl_ == writeControl::adjustableRunTime)
{
adjustDeltaT();
}
@ -1025,7 +1025,11 @@ Foam::Time& Foam::Time::operator++()
// Reduce so all decide the same.
label flag = 0;
if (sigStopAtWriteNow_.active() && stopAt_ == saWriteNow)
if
(
sigStopAtWriteNow_.active()
&& stopAt_ == stopAtControl::writeNow
)
{
flag += 1;
}
@ -1037,7 +1041,7 @@ Foam::Time& Foam::Time::operator++()
if (flag & 1)
{
stopAt_ = saWriteNow;
stopAt_ = stopAtControl::writeNow;
}
if (flag & 2)
{
@ -1049,12 +1053,12 @@ Foam::Time& Foam::Time::operator++()
switch (writeControl_)
{
case wcTimeStep:
case writeControl::timeStep:
writeTime_ = !(timeIndex_ % label(writeInterval_));
break;
case wcRunTime:
case wcAdjustableRunTime:
case writeControl::runTime:
case writeControl::adjustableRunTime:
{
label writeIndex = label
(
@ -1070,7 +1074,7 @@ Foam::Time& Foam::Time::operator++()
}
break;
case wcCpuTime:
case writeControl::cpuTime:
{
label writeIndex = label
(
@ -1085,7 +1089,7 @@ Foam::Time& Foam::Time::operator++()
}
break;
case wcClockTime:
case writeControl::clockTime:
{
label writeIndex = label
(
@ -1105,16 +1109,16 @@ Foam::Time& Foam::Time::operator++()
// Check if endTime needs adjustment to stop at the next run()/end()
if (!end())
{
if (stopAt_ == saNoWriteNow)
if (stopAt_ == stopAtControl::noWriteNow)
{
endTime_ = value();
}
else if (stopAt_ == saWriteNow)
else if (stopAt_ == stopAtControl::writeNow)
{
endTime_ = value();
writeTime_ = true;
}
else if (stopAt_ == saNextWrite && writeTime_ == true)
else if (stopAt_ == stopAtControl::nextWrite && writeTime_ == true)
{
endTime_ = value();
}

View File

@ -86,26 +86,26 @@ class Time
public:
//- Write control options
enum writeControls
enum class writeControl
{
wcTimeStep,
wcRunTime,
wcAdjustableRunTime,
wcClockTime,
wcCpuTime
timeStep,
runTime,
adjustableRunTime,
clockTime,
cpuTime
};
//- Stop-run control options
enum stopAtControls
enum class stopAtControl
{
saEndTime, //!< stop when Time reaches the prescribed endTime
saNoWriteNow, //!< set endTime to stop immediately w/o writing
saWriteNow, //!< set endTime to stop immediately w/ writing
saNextWrite //!< stop the next time data are written
endTime, //!< stop when Time reaches the prescribed endTime
noWriteNow, //!< set endTime to stop immediately w/o writing
writeNow, //!< set endTime to stop immediately w/ writing
nextWrite //!< stop the next time data are written
};
//- Supported time directory name formats
enum fmtflags
enum class format
{
general = 0,
fixed = ios_base::fixed,
@ -121,11 +121,11 @@ protected:
scalar startTime_;
mutable scalar endTime_;
static const NamedEnum<stopAtControls, 4> stopAtControlNames_;
mutable stopAtControls stopAt_;
static const NamedEnum<stopAtControl, 4> stopAtControlNames_;
mutable stopAtControl stopAt_;
static const NamedEnum<writeControls, 5> writeControlNames_;
writeControls writeControl_;
static const NamedEnum<writeControl, 5> writeControlNames_;
writeControl writeControl_;
scalar writeInterval_;
@ -152,7 +152,7 @@ protected:
//- Time directory name format
static fmtflags format_;
static format format_;
//- Time directory name precision
static int precision_;
@ -488,7 +488,7 @@ public:
//- Adjust the current stopAtControl. Note that this value
// only persists until the next time the dictionary is read.
// Return true if the stopAtControl changed.
virtual bool stopAt(const stopAtControls) const;
virtual bool stopAt(const stopAtControl) const;
//- Reset the time and time-index to those of the given time
virtual void setTime(const Time&);

View File

@ -258,7 +258,11 @@ void Foam::Time::readDict()
if (controlDict_.readIfPresent("writeInterval", writeInterval_))
{
if (writeControl_ == wcTimeStep && label(writeInterval_) < 1)
if
(
writeControl_ == writeControl::timeStep
&& label(writeInterval_) < 1
)
{
FatalIOErrorInFunction(controlDict_)
<< "writeInterval < 1 for writeControl timeStep"
@ -275,8 +279,8 @@ void Foam::Time::readDict()
{
switch (writeControl_)
{
case wcRunTime:
case wcAdjustableRunTime:
case writeControl::runTime:
case writeControl::adjustableRunTime:
// Recalculate writeTimeIndex_ to be in units of current
// writeInterval.
writeTimeIndex_ = label
@ -311,15 +315,15 @@ void Foam::Time::readDict()
if (formatName == "general")
{
format_ = general;
format_ = format::general;
}
else if (formatName == "fixed")
{
format_ = fixed;
format_ = format::fixed;
}
else if (formatName == "scientific")
{
format_ = scientific;
format_ = format::scientific;
}
else
{
@ -337,7 +341,7 @@ void Foam::Time::readDict()
{
stopAt_ = stopAtControlNames_.read(controlDict_.lookup("stopAt"));
if (stopAt_ == saEndTime)
if (stopAt_ == stopAtControl::endTime)
{
controlDict_.lookup("endTime") >> endTime_;
}
@ -596,7 +600,7 @@ bool Foam::Time::writeNow()
bool Foam::Time::writeAndEnd()
{
stopAt_ = saWriteNow;
stopAt_ = stopAtControl::writeNow;
endTime_ = value();
return writeNow();

View File

@ -336,7 +336,7 @@ int Foam::face::compare(const face& a, const face& b)
break;
}
} while (bCirc.circulate(CirculatorBase::CLOCKWISE));
} while (bCirc.circulate(CirculatorBase::direction::clockwise));
// If the circulator has stopped then faces a and b do not share a matching
// point. Doesn't work on matching, single element face.
@ -355,8 +355,8 @@ int Foam::face::compare(const face& a, const face& b)
}
while
(
aCirc.circulate(CirculatorBase::CLOCKWISE),
bCirc.circulate(CirculatorBase::CLOCKWISE)
aCirc.circulate(CirculatorBase::direction::clockwise),
bCirc.circulate(CirculatorBase::direction::clockwise)
);
// If the circulator has stopped then faces a and b matched.
@ -383,8 +383,8 @@ int Foam::face::compare(const face& a, const face& b)
}
while
(
aCirc.circulate(CirculatorBase::CLOCKWISE),
bCirc.circulate(CirculatorBase::ANTICLOCKWISE)
aCirc.circulate(CirculatorBase::direction::clockwise),
bCirc.circulate(CirculatorBase::direction::anticlockwise)
);
// If the circulator has stopped then faces a and b matched.

View File

@ -627,12 +627,11 @@ Foam::label Foam::processorPolyPatch::matchFace
return -1;
}
enum CirculatorBase::direction circulateDirection
= CirculatorBase::CLOCKWISE;
CirculatorBase::direction circulateDirection = CirculatorBase::direction::clockwise;
if (!sameOrientation)
{
circulateDirection = CirculatorBase::ANTICLOCKWISE;
circulateDirection = CirculatorBase::direction::anticlockwise;
}
label matchFp = -1;
@ -679,7 +678,7 @@ Foam::label Foam::processorPolyPatch::matchFace
}
while
(
aCirc.circulate(CirculatorBase::CLOCKWISE),
aCirc.circulate(CirculatorBase::direction::clockwise),
bCirc2.circulate(circulateDirection)
);

View File

@ -115,12 +115,12 @@ Foam::edgeList Foam::treeBoundBox::calcEdges(const label edgesArray[12][2])
Foam::FixedList<Foam::vector, 6> Foam::treeBoundBox::calcFaceNormals()
{
FixedList<vector, 6> normals;
normals[LEFT] = vector(-1, 0, 0);
normals[RIGHT] = vector( 1, 0, 0);
normals[BOTTOM] = vector( 0, -1, 0);
normals[TOP] = vector( 0, 1, 0);
normals[BACK] = vector( 0, 0, -1);
normals[FRONT] = vector( 0, 0, 1);
normals[faceId::left] = vector(-1, 0, 0);
normals[faceId::right] = vector( 1, 0, 0);
normals[faceId::bottom] = vector( 0, -1, 0);
normals[faceId::top] = vector( 0, 1, 0);
normals[faceId::back] = vector( 0, 0, -1);
normals[faceId::front] = vector( 0, 0, 1);
return normals;
}
@ -201,7 +201,7 @@ Foam::treeBoundBox Foam::treeBoundBox::subBbox
point& bbMin = subBb.min();
point& bbMax = subBb.max();
if (octant & treeBoundBox::RIGHTHALF)
if (octant & octantBit::rightHalf)
{
bbMin.x() = mid.x(); // mid -> max
}
@ -210,7 +210,7 @@ Foam::treeBoundBox Foam::treeBoundBox::subBbox
bbMax.x() = mid.x(); // min -> mid
}
if (octant & treeBoundBox::TOPHALF)
if (octant & octantBit::topHalf)
{
bbMin.y() = mid.y(); // mid -> max
}
@ -219,7 +219,7 @@ Foam::treeBoundBox Foam::treeBoundBox::subBbox
bbMax.y() = mid.y(); // min -> mid
}
if (octant & treeBoundBox::FRONTHALF)
if (octant & octantBit::frontHalf)
{
bbMin.z() = mid.z(); // mid -> max
}
@ -280,7 +280,7 @@ bool Foam::treeBoundBox::intersects
return false;
}
if (ptBits & LEFTBIT)
if (ptBits & faceBit::left)
{
// Intersect with plane V=min, n=-1,0,0
if (Foam::mag(overallVec.x()) > vSmall)
@ -297,7 +297,7 @@ bool Foam::treeBoundBox::intersects
pt.x() = min().x();
}
}
else if (ptBits & RIGHTBIT)
else if (ptBits & faceBit::right)
{
// Intersect with plane V=max, n=1,0,0
if (Foam::mag(overallVec.x()) > vSmall)
@ -312,7 +312,7 @@ bool Foam::treeBoundBox::intersects
pt.x() = max().x();
}
}
else if (ptBits & BOTTOMBIT)
else if (ptBits & faceBit::bottom)
{
// Intersect with plane V=min, n=0,-1,0
if (Foam::mag(overallVec.y()) > vSmall)
@ -327,7 +327,7 @@ bool Foam::treeBoundBox::intersects
pt.x() = min().y();
}
}
else if (ptBits & TOPBIT)
else if (ptBits & faceBit::top)
{
// Intersect with plane V=max, n=0,1,0
if (Foam::mag(overallVec.y()) > vSmall)
@ -342,7 +342,7 @@ bool Foam::treeBoundBox::intersects
pt.y() = max().y();
}
}
else if (ptBits & BACKBIT)
else if (ptBits & faceBit::back)
{
// Intersect with plane V=min, n=0,0,-1
if (Foam::mag(overallVec.z()) > vSmall)
@ -357,7 +357,7 @@ bool Foam::treeBoundBox::intersects
pt.z() = min().z();
}
}
else if (ptBits & FRONTBIT)
else if (ptBits & faceBit::front)
{
// Intersect with plane V=max, n=0,0,1
if (Foam::mag(overallVec.z()) > vSmall)
@ -434,29 +434,29 @@ Foam::direction Foam::treeBoundBox::faceBits(const point& pt) const
direction faceBits = 0;
if (pt.x() == min().x())
{
faceBits |= LEFTBIT;
faceBits |= faceBit::left;
}
else if (pt.x() == max().x())
{
faceBits |= RIGHTBIT;
faceBits |= faceBit::right;
}
if (pt.y() == min().y())
{
faceBits |= BOTTOMBIT;
faceBits |= faceBit::bottom;
}
else if (pt.y() == max().y())
{
faceBits |= TOPBIT;
faceBits |= faceBit::top;
}
if (pt.z() == min().z())
{
faceBits |= BACKBIT;
faceBits |= faceBit::back;
}
else if (pt.z() == max().z())
{
faceBits |= FRONTBIT;
faceBits |= faceBit::front;
}
return faceBits;
}
@ -468,29 +468,29 @@ Foam::direction Foam::treeBoundBox::posBits(const point& pt) const
if (pt.x() < min().x())
{
posBits |= LEFTBIT;
posBits |= faceBit::left;
}
else if (pt.x() > max().x())
{
posBits |= RIGHTBIT;
posBits |= faceBit::right;
}
if (pt.y() < min().y())
{
posBits |= BOTTOMBIT;
posBits |= faceBit::bottom;
}
else if (pt.y() > max().y())
{
posBits |= TOPBIT;
posBits |= faceBit::top;
}
if (pt.z() < min().z())
{
posBits |= BACKBIT;
posBits |= faceBit::back;
}
else if (pt.z() > max().z())
{
posBits |= FRONTBIT;
posBits |= faceBit::front;
}
return posBits;
}

View File

@ -113,54 +113,66 @@ public:
//- Bits used for octant/point coding.
// Every octant/corner point is the combination of three faces.
enum octantBit
struct octantBit
{
RIGHTHALF = 0x1 << 0,
TOPHALF = 0x1 << 1,
FRONTHALF = 0x1 << 2
enum
{
rightHalf = 0x1 << 0,
topHalf = 0x1 << 1,
frontHalf = 0x1 << 2
};
};
//- Face codes
enum faceId
struct faceId
{
LEFT = 0,
RIGHT = 1,
BOTTOM = 2,
TOP = 3,
BACK = 4,
FRONT = 5
enum
{
left = 0,
right = 1,
bottom = 2,
top = 3,
back = 4,
front = 5
};
};
//- Bits used for face coding
enum faceBit
struct faceBit
{
NOFACE = 0,
LEFTBIT = 0x1 << LEFT, //1
RIGHTBIT = 0x1 << RIGHT, //2
BOTTOMBIT = 0x1 << BOTTOM, //4
TOPBIT = 0x1 << TOP, //8
BACKBIT = 0x1 << BACK, //16
FRONTBIT = 0x1 << FRONT, //32
enum
{
noFace = 0,
left = 0x1 << faceId::left, //1
right = 0x1 << faceId::right, //2
bottom = 0x1 << faceId::bottom, //4
top = 0x1 << faceId::top, //8
back = 0x1 << faceId::back, //16
front = 0x1 << faceId::front, //32
};
};
//- Edges codes.
// E01 = edge between 0 and 1.
enum edgeId
// e01 = edge between 0 and 1.
struct edgeId
{
E01 = 0,
E13 = 1,
E23 = 2,
E02 = 3,
enum
{
e01 = 0,
e13 = 1,
e23 = 2,
e02 = 3,
E45 = 4,
E57 = 5,
E67 = 6,
E46 = 7,
e45 = 4,
e57 = 5,
e67 = 6,
e46 = 7,
E04 = 8,
E15 = 9,
E37 = 10,
E26 = 11
e04 = 8,
e15 = 9,
e37 = 10,
e26 = 11
};
};
//- Face to point addressing

View File

@ -64,9 +64,9 @@ inline Foam::point Foam::treeBoundBox::corner(const direction octant) const
{
return point
(
(octant & RIGHTHALF) ? max().x() : min().x(),
(octant & TOPHALF) ? max().y() : min().y(),
(octant & FRONTHALF) ? max().z() : min().z()
(octant & octantBit::rightHalf) ? max().x() : min().x(),
(octant & octantBit::topHalf) ? max().y() : min().y(),
(octant & octantBit::frontHalf) ? max().z() : min().z()
);
}
@ -90,17 +90,17 @@ inline Foam::direction Foam::treeBoundBox::subOctant
if (pt.x() > mid.x())
{
octant |= treeBoundBox::RIGHTHALF;
octant |= octantBit::rightHalf;
}
if (pt.y() > mid.y())
{
octant |= treeBoundBox::TOPHALF;
octant |= octantBit::topHalf;
}
if (pt.z() > mid.z())
{
octant |= treeBoundBox::FRONTHALF;
octant |= octantBit::frontHalf;
}
return octant;
@ -133,7 +133,7 @@ inline Foam::direction Foam::treeBoundBox::subOctant
if (pt.x() > mid.x())
{
octant |= treeBoundBox::RIGHTHALF;
octant |= octantBit::rightHalf;
}
else if (pt.x() == mid.x())
{
@ -142,7 +142,7 @@ inline Foam::direction Foam::treeBoundBox::subOctant
if (pt.y() > mid.y())
{
octant |= treeBoundBox::TOPHALF;
octant |= octantBit::topHalf;
}
else if (pt.y() == mid.y())
{
@ -151,7 +151,7 @@ inline Foam::direction Foam::treeBoundBox::subOctant
if (pt.z() > mid.z())
{
octant |= treeBoundBox::FRONTHALF;
octant |= octantBit::frontHalf;
}
else if (pt.z() == mid.z())
{
@ -179,40 +179,40 @@ inline Foam::direction Foam::treeBoundBox::subOctant
if (pt.x() > mid.x())
{
octant |= treeBoundBox::RIGHTHALF;
octant |= octantBit::rightHalf;
}
else if (pt.x() == mid.x())
{
onEdge = true;
if (dir.x() > 0)
{
octant |= treeBoundBox::RIGHTHALF;
octant |= octantBit::rightHalf;
}
}
if (pt.y() > mid.y())
{
octant |= treeBoundBox::TOPHALF;
octant |= octantBit::topHalf;
}
else if (pt.y() == mid.y())
{
onEdge = true;
if (dir.y() > 0)
{
octant |= treeBoundBox::TOPHALF;
octant |= octantBit::topHalf;
}
}
if (pt.z() > mid.z())
{
octant |= treeBoundBox::FRONTHALF;
octant |= octantBit::frontHalf;
}
else if (pt.z() == mid.z())
{
onEdge = true;
if (dir.z() > 0)
{
octant |= treeBoundBox::FRONTHALF;
octant |= octantBit::frontHalf;
}
}
@ -234,19 +234,19 @@ inline void Foam::treeBoundBox::searchOrder
if (dist.x() < 0)
{
octant |= treeBoundBox::RIGHTHALF;
octant |= octantBit::rightHalf;
dist.x() *= -1;
}
if (dist.y() < 0)
{
octant |= treeBoundBox::TOPHALF;
octant |= octantBit::topHalf;
dist.y() *= -1;
}
if (dist.z() < 0)
{
octant |= treeBoundBox::FRONTHALF;
octant |= octantBit::frontHalf;
dist.z() *= -1;
}
@ -258,42 +258,42 @@ inline void Foam::treeBoundBox::searchOrder
{
if (dist.y() < dist.z())
{
min = treeBoundBox::RIGHTHALF;
mid = treeBoundBox::TOPHALF;
max = treeBoundBox::FRONTHALF;
min = octantBit::rightHalf;
mid = octantBit::topHalf;
max = octantBit::frontHalf;
}
else if (dist.z() < dist.x())
{
min = treeBoundBox::FRONTHALF;
mid = treeBoundBox::RIGHTHALF;
max = treeBoundBox::TOPHALF;
min = octantBit::frontHalf;
mid = octantBit::rightHalf;
max = octantBit::topHalf;
}
else
{
min = treeBoundBox::RIGHTHALF;
mid = treeBoundBox::FRONTHALF;
max = treeBoundBox::TOPHALF;
min = octantBit::rightHalf;
mid = octantBit::frontHalf;
max = octantBit::topHalf;
}
}
else
{
if (dist.z() < dist.y())
{
min = treeBoundBox::FRONTHALF;
mid = treeBoundBox::TOPHALF;
max = treeBoundBox::RIGHTHALF;
min = octantBit::frontHalf;
mid = octantBit::topHalf;
max = octantBit::rightHalf;
}
else if (dist.x() < dist.z())
{
min = treeBoundBox::TOPHALF;
mid = treeBoundBox::RIGHTHALF;
max = treeBoundBox::FRONTHALF;
min = octantBit::topHalf;
mid = octantBit::rightHalf;
max = octantBit::frontHalf;
}
else
{
min = treeBoundBox::TOPHALF;
mid = treeBoundBox::FRONTHALF;
max = treeBoundBox::RIGHTHALF;
min = octantBit::topHalf;
mid = octantBit::frontHalf;
max = octantBit::rightHalf;
}
}

View File

@ -45,8 +45,8 @@ void Foam::crankConRod::timeAdjustment()
if
(
writeControl_ == wcRunTime
|| writeControl_ == wcAdjustableRunTime
writeControl_ == writeControl::runTime
|| writeControl_ == writeControl::adjustableRunTime
)
{
writeInterval_ = degToTime(writeInterval_);

View File

@ -102,7 +102,7 @@ bool Foam::convergenceControl::endIfConverged(Time& time)
{
if (time.writeTime())
{
time.stopAt(Time::saNoWriteNow);
time.stopAt(Time::stopAtControl::noWriteNow);
time.setEndTime(time);
}
else

View File

@ -143,7 +143,7 @@ bool Foam::functionObjects::abort::execute()
{
case actionType::noWriteNow :
{
if (time_.stopAt(Time::saNoWriteNow))
if (time_.stopAt(Time::stopAtControl::noWriteNow))
{
Info<< "USER REQUESTED ABORT (timeIndex="
<< time_.timeIndex()
@ -155,7 +155,7 @@ bool Foam::functionObjects::abort::execute()
case actionType::writeNow :
{
if (time_.stopAt(Time::saWriteNow))
if (time_.stopAt(Time::stopAtControl::writeNow))
{
Info<< "USER REQUESTED ABORT (timeIndex="
<< time_.timeIndex()
@ -167,7 +167,7 @@ bool Foam::functionObjects::abort::execute()
case actionType::nextWrite :
{
if (time_.stopAt(Time::saNextWrite))
if (time_.stopAt(Time::stopAtControl::nextWrite))
{
Info<< "USER REQUESTED ABORT (timeIndex="
<< time_.timeIndex()

View File

@ -1314,11 +1314,11 @@ void Foam::refinementSurfaces::findInside
if
(
(
volType[pointi] == volumeType::INSIDE
volType[pointi] == volumeType::inside
&& selectionMethod == surfaceZonesInfo::INSIDE
)
|| (
volType[pointi] == volumeType::OUTSIDE
volType[pointi] == volumeType::outside
&& selectionMethod == surfaceZonesInfo::OUTSIDE
)
)

View File

@ -331,11 +331,11 @@ void Foam::shellSurfaces::findHigherLevel
(
(
modes_[shellI] == INSIDE
&& volType[i] == volumeType::INSIDE
&& volType[i] == volumeType::inside
)
|| (
modes_[shellI] == OUTSIDE
&& volType[i] == volumeType::OUTSIDE
&& volType[i] == volumeType::outside
)
)
{

View File

@ -134,7 +134,7 @@ Foam::volumeType Foam::treeDataEdge::getVolumeType
const point& sample
) const
{
return volumeType::UNKNOWN;
return volumeType::unknown;
}

View File

@ -428,7 +428,7 @@ Foam::volumeType Foam::treeDataFace::getVolumeType
// - tolerances are wrong. (if e.g. face has zero area)
// - or (more likely) surface is not closed.
return volumeType::UNKNOWN;
return volumeType::unknown;
}

View File

@ -94,7 +94,7 @@ Foam::volumeType Foam::treeDataPoint::getVolumeType
const point& sample
) const
{
return volumeType::UNKNOWN;
return volumeType::unknown;
}

View File

@ -374,7 +374,7 @@ Foam::volumeType Foam::treeDataPrimitivePatch<PatchType>::getVolumeType
// - tolerances are wrong. (if e.g. face has zero area)
// - or (more likely) surface is not closed.
return volumeType::UNKNOWN;
return volumeType::unknown;
}

View File

@ -57,21 +57,21 @@ Foam::volumeType Foam::treeDataPrimitivePatch<Foam::triSurface>::getVolumeType
if (t == triSurfaceTools::UNKNOWN)
{
return volumeType::UNKNOWN;
return volumeType::unknown;
}
else if (t == triSurfaceTools::INSIDE)
{
return volumeType::INSIDE;
return volumeType::inside;
}
else if (t == triSurfaceTools::OUTSIDE)
{
return volumeType::OUTSIDE;
return volumeType::outside;
}
else
{
FatalErrorInFunction
<< "problem" << abort(FatalError);
return volumeType::UNKNOWN;
return volumeType::unknown;
}
}

View File

@ -847,7 +847,7 @@ Foam::List<Foam::pointIndexHit> Foam::meshSearch::intersections
bool Foam::meshSearch::isInside(const point& p) const
{
return (boundaryTree().getVolumeType(p) == volumeType::INSIDE);
return (boundaryTree().getVolumeType(p) == volumeType::inside);
}

View File

@ -602,7 +602,7 @@ void Foam::searchableBox::getVolumeType
) const
{
volType.setSize(points.size());
volType = volumeType::INSIDE;
volType = volumeType::inside;
forAll(points, pointi)
{
@ -612,7 +612,7 @@ void Foam::searchableBox::getVolumeType
{
if (pt[dir] < min()[dir] || pt[dir] > max()[dir])
{
volType[pointi] = volumeType::OUTSIDE;
volType[pointi] = volumeType::outside;
break;
}
}

View File

@ -728,7 +728,7 @@ void Foam::searchableCylinder::getVolumeType
) const
{
volType.setSize(points.size());
volType = volumeType::INSIDE;
volType = volumeType::inside;
forAll(points, pointi)
{
@ -742,12 +742,12 @@ void Foam::searchableCylinder::getVolumeType
if (parallel < 0)
{
// left of point1 endcap
volType[pointi] = volumeType::OUTSIDE;
volType[pointi] = volumeType::outside;
}
else if (parallel > magDir_)
{
// right of point2 endcap
volType[pointi] = volumeType::OUTSIDE;
volType[pointi] = volumeType::outside;
}
else
{
@ -756,11 +756,11 @@ void Foam::searchableCylinder::getVolumeType
if (mag(v) > radius_)
{
volType[pointi] = volumeType::OUTSIDE;
volType[pointi] = volumeType::outside;
}
else
{
volType[pointi] = volumeType::INSIDE;
volType[pointi] = volumeType::inside;
}
}
}

View File

@ -351,7 +351,7 @@ void Foam::searchableSphere::getVolumeType
) const
{
volType.setSize(points.size());
volType = volumeType::INSIDE;
volType = volumeType::inside;
forAll(points, pointi)
{
@ -359,11 +359,11 @@ void Foam::searchableSphere::getVolumeType
if (magSqr(pt - centre_) <= sqr(radius_))
{
volType[pointi] = volumeType::INSIDE;
volType[pointi] = volumeType::inside;
}
else
{
volType[pointi] = volumeType::OUTSIDE;
volType[pointi] = volumeType::outside;
}
}
}

View File

@ -609,11 +609,11 @@ void Foam::searchableSurfacesQueries::signedDistance
volumeType vT = volType[i];
if (vT == volumeType::OUTSIDE)
if (vT == volumeType::outside)
{
distance[pointi] = dist;
}
else if (vT == volumeType::INSIDE)
else if (vT == volumeType::inside)
{
distance[i] = -dist;
}
@ -621,12 +621,12 @@ void Foam::searchableSurfacesQueries::signedDistance
{
switch (illegalHandling)
{
case volumeType::OUTSIDE:
case volumeType::outside:
{
distance[pointi] = dist;
break;
}
case volumeType::INSIDE:
case volumeType::inside:
{
distance[pointi] = -dist;
break;

View File

@ -260,7 +260,7 @@ Foam::boolList Foam::triSurfaceSearch::calcInside
{
inside[sampleI] = false;
}
else if (tree().getVolumeType(sample) == volumeType::INSIDE)
else if (tree().getVolumeType(sample) == volumeType::inside)
{
inside[sampleI] = true;
}

View File

@ -103,11 +103,11 @@ void Foam::distanceSurface::createGeometry()
{
volumeType vT = volType[i];
if (vT == volumeType::OUTSIDE)
if (vT == volumeType::outside)
{
fld[i] = Foam::mag(cc[i] - nearest[i].hitPoint());
}
else if (vT == volumeType::INSIDE)
else if (vT == volumeType::inside)
{
fld[i] = -Foam::mag(cc[i] - nearest[i].hitPoint());
}
@ -156,11 +156,11 @@ void Foam::distanceSurface::createGeometry()
{
volumeType vT = volType[i];
if (vT == volumeType::OUTSIDE)
if (vT == volumeType::outside)
{
fld[i] = Foam::mag(cc[i] - nearest[i].hitPoint());
}
else if (vT == volumeType::INSIDE)
else if (vT == volumeType::inside)
{
fld[i] = -Foam::mag(cc[i] - nearest[i].hitPoint());
}
@ -211,12 +211,12 @@ void Foam::distanceSurface::createGeometry()
{
volumeType vT = volType[i];
if (vT == volumeType::OUTSIDE)
if (vT == volumeType::outside)
{
pointDistance_[i] =
Foam::mag(pts[i] - nearest[i].hitPoint());
}
else if (vT == volumeType::INSIDE)
else if (vT == volumeType::inside)
{
pointDistance_[i] =
-Foam::mag(pts[i] - nearest[i].hitPoint());

View File

@ -109,7 +109,7 @@ bool Foam::functionObjects::sixDoFRigidBodyControl::execute()
&& meanAngularVelocity_ < convergedAngularVelocity_
)
{
time_.stopAt(Time::saWriteNow);
time_.stopAt(Time::stopAtControl::writeNow);
}
return true;