mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: remove all references to wallPoint::greatPoint.
Replaced with point::max wherever possible. Is VGREAT, not GREAT so be careful with calculations.
This commit is contained in:
@ -58,7 +58,7 @@ int main(int argc, char *argv[])
|
||||
mesh
|
||||
),
|
||||
mesh,
|
||||
dimensionedVector("n", dimLength, wallPoint::greatPoint)
|
||||
dimensionedVector("n", dimLength, point::max)
|
||||
);
|
||||
|
||||
// Fill wall patches with unit normal
|
||||
|
||||
@ -187,8 +187,6 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
|
||||
);
|
||||
const pointField& localPoints = allBoundary.localPoints();
|
||||
|
||||
const point greatPoint(GREAT, GREAT, GREAT);
|
||||
|
||||
|
||||
// Point data
|
||||
// ~~~~~~~~~~
|
||||
@ -196,7 +194,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
|
||||
{
|
||||
// Create some data. Use slightly perturbed positions.
|
||||
Map<vector> sparseData;
|
||||
pointField fullData(mesh.nPoints(), greatPoint);
|
||||
pointField fullData(mesh.nPoints(), point::max);
|
||||
|
||||
forAll(localPoints, i)
|
||||
{
|
||||
@ -222,7 +220,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
|
||||
mesh,
|
||||
fullData,
|
||||
minEqOp<vector>(),
|
||||
greatPoint,
|
||||
point::max,
|
||||
true // apply separation
|
||||
);
|
||||
|
||||
@ -232,7 +230,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
|
||||
{
|
||||
const point& fullPt = fullData[meshPointI];
|
||||
|
||||
if (fullPt != greatPoint)
|
||||
if (fullPt != point::max)
|
||||
{
|
||||
const point& sparsePt = sparseData[meshPointI];
|
||||
|
||||
@ -272,7 +270,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
|
||||
{
|
||||
// Create some data. Use slightly perturbed positions.
|
||||
EdgeMap<vector> sparseData;
|
||||
pointField fullData(mesh.nEdges(), greatPoint);
|
||||
pointField fullData(mesh.nEdges(), point::max);
|
||||
|
||||
const edgeList& edges = allBoundary.edges();
|
||||
const labelList meshEdges = allBoundary.meshEdges
|
||||
@ -307,7 +305,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
|
||||
mesh,
|
||||
fullData,
|
||||
minEqOp<vector>(),
|
||||
greatPoint,
|
||||
point::max,
|
||||
true
|
||||
);
|
||||
|
||||
@ -317,7 +315,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
|
||||
{
|
||||
const point& fullPt = fullData[meshEdgeI];
|
||||
|
||||
if (fullPt != greatPoint)
|
||||
if (fullPt != point::max)
|
||||
{
|
||||
const point& sparsePt = sparseData[mesh.edges()[meshEdgeI]];
|
||||
|
||||
@ -364,8 +362,6 @@ void testPointSync(const polyMesh& mesh, Random& rndGen)
|
||||
{
|
||||
Info<< nl << "Testing point-wise data synchronisation." << endl;
|
||||
|
||||
const point greatPoint(GREAT, GREAT, GREAT);
|
||||
|
||||
// Test position.
|
||||
|
||||
{
|
||||
@ -379,7 +375,7 @@ void testPointSync(const polyMesh& mesh, Random& rndGen)
|
||||
mesh,
|
||||
syncedPoints,
|
||||
minEqOp<point>(),
|
||||
greatPoint,
|
||||
point::max,
|
||||
true
|
||||
);
|
||||
|
||||
@ -444,8 +440,6 @@ void testEdgeSync(const polyMesh& mesh, Random& rndGen)
|
||||
|
||||
const edgeList& edges = mesh.edges();
|
||||
|
||||
const point greatPoint(GREAT, GREAT, GREAT);
|
||||
|
||||
// Test position.
|
||||
|
||||
{
|
||||
@ -463,7 +457,7 @@ void testEdgeSync(const polyMesh& mesh, Random& rndGen)
|
||||
mesh,
|
||||
syncedMids,
|
||||
minEqOp<point>(),
|
||||
greatPoint,
|
||||
point::max,
|
||||
true
|
||||
);
|
||||
|
||||
|
||||
@ -162,15 +162,13 @@ void Foam::domainDecomposition::distributeCells()
|
||||
// somewhere in the middle of the domain which might not be anywhere
|
||||
// near any of the cells.
|
||||
|
||||
const point greatPoint(GREAT, GREAT, GREAT);
|
||||
|
||||
pointField regionCentres(globalRegion.nRegions(), greatPoint);
|
||||
pointField regionCentres(globalRegion.nRegions(), point::max);
|
||||
|
||||
forAll(globalRegion, cellI)
|
||||
{
|
||||
label regionI = globalRegion[cellI];
|
||||
|
||||
if (regionCentres[regionI] == greatPoint)
|
||||
if (regionCentres[regionI] == point::max)
|
||||
{
|
||||
regionCentres[regionI] = cellCentres()[cellI];
|
||||
}
|
||||
|
||||
@ -34,7 +34,6 @@ License
|
||||
#include "polyAddFace.H"
|
||||
#include "polyModifyFace.H"
|
||||
#include "polyAddCell.H"
|
||||
#include "wallPoint.H"
|
||||
#include "globalIndex.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
@ -713,14 +712,14 @@ void Foam::addPatchCellLayer::setRefinement
|
||||
}
|
||||
|
||||
{
|
||||
pointField d(mesh_.nPoints(), wallPoint::greatPoint);
|
||||
pointField d(mesh_.nPoints(), vector::max);
|
||||
UIndirectList<point>(d, meshPoints) = firstLayerDisp;
|
||||
syncTools::syncPointList
|
||||
(
|
||||
mesh_,
|
||||
d,
|
||||
minEqOp<vector>(),
|
||||
wallPoint::greatPoint,
|
||||
vector::max,
|
||||
false
|
||||
);
|
||||
|
||||
|
||||
@ -49,14 +49,6 @@ namespace Foam
|
||||
}
|
||||
|
||||
|
||||
const Foam::point Foam::polyTopoChange::greatPoint
|
||||
(
|
||||
GREAT,
|
||||
GREAT,
|
||||
GREAT
|
||||
);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
// Renumber with special handling for merged items (marked with <-1)
|
||||
@ -2695,7 +2687,7 @@ void Foam::polyTopoChange::removePoint
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
points_[pointI] = greatPoint;
|
||||
points_[pointI] = point::max;
|
||||
pointMap_[pointI] = -1;
|
||||
if (mergePointI >= 0)
|
||||
{
|
||||
|
||||
@ -45,7 +45,7 @@ Description
|
||||
- no item can be removed more than once.
|
||||
- removed cell: cell set to 0 faces.
|
||||
- removed face: face set to 0 vertices.
|
||||
- removed point: coordinate set to greatPoint (GREAT,GREAT,GREAT).
|
||||
- removed point: coordinate set to vector::max (VGREAT,VGREAT,VGREAT).
|
||||
Note that this might give problems if this value is used already.
|
||||
To see if point is equal to above value we don't use == (which might give
|
||||
problems with roundoff error) but instead compare the individual component
|
||||
@ -98,12 +98,6 @@ template<class T, class Container> class CompactListList;
|
||||
|
||||
class polyTopoChange
|
||||
{
|
||||
// Static data members
|
||||
|
||||
//- Value of deleted point
|
||||
static const point greatPoint;
|
||||
|
||||
|
||||
// Private data
|
||||
|
||||
//- Whether to allow referencing illegal points/cells/faces
|
||||
|
||||
@ -33,9 +33,9 @@ inline bool Foam::polyTopoChange::pointRemoved(const label pointI) const
|
||||
const point& pt = points_[pointI];
|
||||
|
||||
return
|
||||
pt.x() > 0.5*greatPoint.x()
|
||||
&& pt.y() > 0.5*greatPoint.y()
|
||||
&& pt.z() > 0.5*greatPoint.z();
|
||||
pt.x() > 0.5*vector::max.x()
|
||||
&& pt.y() > 0.5*vector::max.y()
|
||||
&& pt.z() > 0.5*vector::max.z();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -33,7 +33,6 @@ License
|
||||
#include "polyAddPoint.H"
|
||||
#include "polyModifyFace.H"
|
||||
#include "syncTools.H"
|
||||
#include "wallPoint.H" // only to use 'greatPoint'
|
||||
#include "faceSet.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
@ -570,7 +569,7 @@ void Foam::removePoints::getUnrefimentSet
|
||||
{
|
||||
label savedPointI = -savedFace[fp]-1;
|
||||
|
||||
if (savedPoints_[savedPointI] == wallPoint::greatPoint)
|
||||
if (savedPoints_[savedPointI] == vector::max)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
@ -745,7 +744,7 @@ void Foam::removePoints::setUnrefinement
|
||||
{
|
||||
label localI = localPoints[i];
|
||||
|
||||
if (savedPoints_[localI] == wallPoint::greatPoint)
|
||||
if (savedPoints_[localI] == vector::max)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
@ -767,7 +766,7 @@ void Foam::removePoints::setUnrefinement
|
||||
);
|
||||
|
||||
// Mark the restored points so they are not restored again.
|
||||
savedPoints_[localI] = wallPoint::greatPoint;
|
||||
savedPoints_[localI] = vector::max;
|
||||
}
|
||||
|
||||
forAll(localFaces, i)
|
||||
|
||||
@ -26,7 +26,6 @@ License
|
||||
|
||||
#include "nearWallDistNoSearch.H"
|
||||
#include "fvMesh.H"
|
||||
#include "wallPoint.H"
|
||||
#include "wallFvPatch.H"
|
||||
#include "surfaceFields.H"
|
||||
|
||||
|
||||
@ -38,7 +38,6 @@ SourceFiles
|
||||
|
||||
#include "autoPtr.H"
|
||||
#include "dictionary.H"
|
||||
#include "wallPoint.H"
|
||||
#include "searchableSurfaces.H"
|
||||
#include "refinementSurfaces.H"
|
||||
#include "shellSurfaces.H"
|
||||
@ -95,9 +94,9 @@ class autoHexMeshDriver
|
||||
|
||||
void operator()(vector& x, const vector& y) const
|
||||
{
|
||||
if (y != wallPoint::greatPoint)
|
||||
if (y != point::max)
|
||||
{
|
||||
if (x == wallPoint::greatPoint)
|
||||
if (x == point::max)
|
||||
{
|
||||
x = y;
|
||||
}
|
||||
|
||||
@ -991,7 +991,7 @@ void Foam::autoLayerDriver::handleFeatureAngle
|
||||
if (minCos < 1-SMALL)
|
||||
{
|
||||
// Normal component of normals of connected faces.
|
||||
vectorField edgeNormal(mesh.nEdges(), wallPoint::greatPoint);
|
||||
vectorField edgeNormal(mesh.nEdges(), point::max);
|
||||
|
||||
const labelListList& edgeFaces = pp.edgeFaces();
|
||||
|
||||
@ -1016,7 +1016,7 @@ void Foam::autoLayerDriver::handleFeatureAngle
|
||||
mesh,
|
||||
edgeNormal,
|
||||
nomalsCombine(),
|
||||
wallPoint::greatPoint, // null value
|
||||
point::max, // null value
|
||||
false // no separation
|
||||
);
|
||||
|
||||
@ -1040,7 +1040,7 @@ void Foam::autoLayerDriver::handleFeatureAngle
|
||||
|
||||
const vector& n = edgeNormal[meshEdgeI];
|
||||
|
||||
if (n != wallPoint::greatPoint)
|
||||
if (n != point::max)
|
||||
{
|
||||
scalar cos = n & pp.faceNormals()[eFaces[0]];
|
||||
|
||||
@ -1640,7 +1640,7 @@ void Foam::autoLayerDriver::syncPatchDisplacement
|
||||
meshPoints,
|
||||
patchDisp,
|
||||
minEqOp<vector>(),
|
||||
wallPoint::greatPoint, // null value
|
||||
point::max, // null value
|
||||
false // no separation
|
||||
);
|
||||
|
||||
|
||||
@ -37,7 +37,6 @@ SourceFiles
|
||||
#define autoLayerDriver_H
|
||||
|
||||
#include "meshRefinement.H"
|
||||
#include "wallPoint.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -50,7 +49,6 @@ class pointSet;
|
||||
class motionSmoother;
|
||||
class addPatchCellLayer;
|
||||
class pointData;
|
||||
class wallPoint;
|
||||
class faceSet;
|
||||
class layerParameters;
|
||||
|
||||
@ -81,9 +79,9 @@ class autoLayerDriver
|
||||
|
||||
void operator()(vector& x, const vector& y) const
|
||||
{
|
||||
if (y != wallPoint::greatPoint)
|
||||
if (y != point::max)
|
||||
{
|
||||
if (x == wallPoint::greatPoint)
|
||||
if (x == point::max)
|
||||
{
|
||||
x = y;
|
||||
}
|
||||
|
||||
@ -26,7 +26,6 @@ License
|
||||
|
||||
#include "polyMesh.H"
|
||||
#include "transform.H"
|
||||
#include "wallPoint.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
@ -138,10 +137,10 @@ inline bool Foam::pointData::update
|
||||
// Null constructor
|
||||
inline Foam::pointData::pointData()
|
||||
:
|
||||
origin_(wallPoint::greatPoint),
|
||||
origin_(point::max),
|
||||
distSqr_(GREAT),
|
||||
s_(GREAT),
|
||||
v_(wallPoint::greatPoint)
|
||||
v_(point::max)
|
||||
{}
|
||||
|
||||
|
||||
@ -199,7 +198,7 @@ inline const Foam::vector& Foam::pointData::v() const
|
||||
|
||||
inline bool Foam::pointData::valid() const
|
||||
{
|
||||
return origin_ != wallPoint::greatPoint;
|
||||
return origin_ != point::max;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -26,10 +26,6 @@ License
|
||||
|
||||
#include "pointEdgePoint.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
Foam::point Foam::pointEdgePoint::greatPoint(GREAT, GREAT, GREAT);
|
||||
|
||||
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
|
||||
|
||||
Foam::Ostream& Foam::operator<<
|
||||
|
||||
@ -92,12 +92,6 @@ class pointEdgePoint
|
||||
|
||||
public:
|
||||
|
||||
// Static data members
|
||||
|
||||
//- initial point far away.
|
||||
static point greatPoint;
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
|
||||
@ -117,7 +117,7 @@ inline bool Foam::pointEdgePoint::update
|
||||
// Null constructor
|
||||
inline Foam::pointEdgePoint::pointEdgePoint()
|
||||
:
|
||||
origin_(greatPoint),
|
||||
origin_(point::max),
|
||||
distSqr_(GREAT)
|
||||
{}
|
||||
|
||||
@ -158,7 +158,7 @@ inline Foam::scalar Foam::pointEdgePoint::distSqr() const
|
||||
|
||||
inline bool Foam::pointEdgePoint::valid() const
|
||||
{
|
||||
return origin_ != greatPoint;
|
||||
return origin_ != point::max;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -106,7 +106,7 @@ Foam::label Foam::patchDataWave<TransferType>::getValues
|
||||
|
||||
distance_[cellI] = dist;
|
||||
|
||||
//cellData_[cellI] = wallPoint::greatPoint;
|
||||
//cellData_[cellI] = point::max;
|
||||
cellData_[cellI] = cellInfo[cellI].data();
|
||||
|
||||
nIllegal++;
|
||||
@ -153,7 +153,7 @@ Foam::label Foam::patchDataWave<TransferType>::getValues
|
||||
|
||||
patchField[patchFaceI] = dist;
|
||||
|
||||
//patchDataField[patchFaceI] = wallPoint::greatPoint;
|
||||
//patchDataField[patchFaceI] = point::max;
|
||||
patchDataField[patchFaceI] = faceInfo[meshFaceI].data();
|
||||
|
||||
nIllegal++;
|
||||
|
||||
@ -26,11 +26,6 @@ License
|
||||
|
||||
#include "wallPoint.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
Foam::point Foam::wallPoint::greatPoint(GREAT, GREAT, GREAT);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
|
||||
|
||||
Foam::Ostream& Foam::operator<<(Foam::Ostream& os, const Foam::wallPoint& wDist)
|
||||
|
||||
@ -87,12 +87,6 @@ class wallPoint
|
||||
|
||||
public:
|
||||
|
||||
// Static data members
|
||||
|
||||
//- initial point far away.
|
||||
static point greatPoint;
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
|
||||
@ -84,7 +84,7 @@ inline bool Foam::wallPoint::update
|
||||
// Null constructor
|
||||
inline Foam::wallPoint::wallPoint()
|
||||
:
|
||||
origin_(greatPoint),
|
||||
origin_(point::max),
|
||||
distSqr_(GREAT)
|
||||
{}
|
||||
|
||||
@ -131,7 +131,7 @@ inline Foam::scalar& Foam::wallPoint::distSqr()
|
||||
|
||||
inline bool Foam::wallPoint::valid() const
|
||||
{
|
||||
return origin_ != greatPoint;
|
||||
return origin_ != point::max;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -800,9 +800,7 @@ void Foam::isoSurface::calcSnappedPoint
|
||||
const pointField& pts = mesh_.points();
|
||||
const pointField& cc = mesh_.cellCentres();
|
||||
|
||||
|
||||
const point greatPoint(VGREAT, VGREAT, VGREAT);
|
||||
pointField collapsedPoint(mesh_.nPoints(), greatPoint);
|
||||
pointField collapsedPoint(mesh_.nPoints(), point::max);
|
||||
|
||||
|
||||
// Work arrays
|
||||
@ -966,7 +964,7 @@ void Foam::isoSurface::calcSnappedPoint
|
||||
|
||||
|
||||
// Synchronise snap location
|
||||
syncUnseparatedPoints(collapsedPoint, greatPoint);
|
||||
syncUnseparatedPoints(collapsedPoint, point::max);
|
||||
|
||||
|
||||
snappedPoint.setSize(mesh_.nPoints());
|
||||
@ -974,7 +972,7 @@ void Foam::isoSurface::calcSnappedPoint
|
||||
|
||||
forAll(collapsedPoint, pointI)
|
||||
{
|
||||
if (collapsedPoint[pointI] != greatPoint)
|
||||
if (collapsedPoint[pointI] != point::max)
|
||||
{
|
||||
snappedPoint[pointI] = snappedPoints.size();
|
||||
snappedPoints.append(collapsedPoint[pointI]);
|
||||
|
||||
@ -630,8 +630,7 @@ void Foam::isoSurfaceCell::calcSnappedPoint
|
||||
labelList& snappedPoint
|
||||
) const
|
||||
{
|
||||
const point greatPoint(VGREAT, VGREAT, VGREAT);
|
||||
pointField collapsedPoint(mesh_.nPoints(), greatPoint);
|
||||
pointField collapsedPoint(mesh_.nPoints(), point::max);
|
||||
|
||||
|
||||
// Work arrays
|
||||
@ -764,7 +763,7 @@ void Foam::isoSurfaceCell::calcSnappedPoint
|
||||
mesh_,
|
||||
collapsedPoint,
|
||||
minEqOp<point>(),
|
||||
greatPoint,
|
||||
point::max,
|
||||
true // are coordinates so separate
|
||||
);
|
||||
|
||||
@ -773,7 +772,7 @@ void Foam::isoSurfaceCell::calcSnappedPoint
|
||||
|
||||
forAll(collapsedPoint, pointI)
|
||||
{
|
||||
if (collapsedPoint[pointI] != greatPoint)
|
||||
if (collapsedPoint[pointI] != point::max)
|
||||
{
|
||||
snappedPoint[pointI] = snappedPoints.size();
|
||||
snappedPoints.append(collapsedPoint[pointI]);
|
||||
|
||||
Reference in New Issue
Block a user