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:
mattijs
2010-03-17 11:48:44 +00:00
parent 56acb3752c
commit f1ab396a66
22 changed files with 44 additions and 97 deletions

View File

@ -58,7 +58,7 @@ int main(int argc, char *argv[])
mesh mesh
), ),
mesh, mesh,
dimensionedVector("n", dimLength, wallPoint::greatPoint) dimensionedVector("n", dimLength, point::max)
); );
// Fill wall patches with unit normal // Fill wall patches with unit normal

View File

@ -187,8 +187,6 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
); );
const pointField& localPoints = allBoundary.localPoints(); const pointField& localPoints = allBoundary.localPoints();
const point greatPoint(GREAT, GREAT, GREAT);
// Point data // Point data
// ~~~~~~~~~~ // ~~~~~~~~~~
@ -196,7 +194,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
{ {
// Create some data. Use slightly perturbed positions. // Create some data. Use slightly perturbed positions.
Map<vector> sparseData; Map<vector> sparseData;
pointField fullData(mesh.nPoints(), greatPoint); pointField fullData(mesh.nPoints(), point::max);
forAll(localPoints, i) forAll(localPoints, i)
{ {
@ -222,7 +220,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
mesh, mesh,
fullData, fullData,
minEqOp<vector>(), minEqOp<vector>(),
greatPoint, point::max,
true // apply separation true // apply separation
); );
@ -232,7 +230,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
{ {
const point& fullPt = fullData[meshPointI]; const point& fullPt = fullData[meshPointI];
if (fullPt != greatPoint) if (fullPt != point::max)
{ {
const point& sparsePt = sparseData[meshPointI]; const point& sparsePt = sparseData[meshPointI];
@ -272,7 +270,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
{ {
// Create some data. Use slightly perturbed positions. // Create some data. Use slightly perturbed positions.
EdgeMap<vector> sparseData; EdgeMap<vector> sparseData;
pointField fullData(mesh.nEdges(), greatPoint); pointField fullData(mesh.nEdges(), point::max);
const edgeList& edges = allBoundary.edges(); const edgeList& edges = allBoundary.edges();
const labelList meshEdges = allBoundary.meshEdges const labelList meshEdges = allBoundary.meshEdges
@ -307,7 +305,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
mesh, mesh,
fullData, fullData,
minEqOp<vector>(), minEqOp<vector>(),
greatPoint, point::max,
true true
); );
@ -317,7 +315,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
{ {
const point& fullPt = fullData[meshEdgeI]; const point& fullPt = fullData[meshEdgeI];
if (fullPt != greatPoint) if (fullPt != point::max)
{ {
const point& sparsePt = sparseData[mesh.edges()[meshEdgeI]]; 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; Info<< nl << "Testing point-wise data synchronisation." << endl;
const point greatPoint(GREAT, GREAT, GREAT);
// Test position. // Test position.
{ {
@ -379,7 +375,7 @@ void testPointSync(const polyMesh& mesh, Random& rndGen)
mesh, mesh,
syncedPoints, syncedPoints,
minEqOp<point>(), minEqOp<point>(),
greatPoint, point::max,
true true
); );
@ -444,8 +440,6 @@ void testEdgeSync(const polyMesh& mesh, Random& rndGen)
const edgeList& edges = mesh.edges(); const edgeList& edges = mesh.edges();
const point greatPoint(GREAT, GREAT, GREAT);
// Test position. // Test position.
{ {
@ -463,7 +457,7 @@ void testEdgeSync(const polyMesh& mesh, Random& rndGen)
mesh, mesh,
syncedMids, syncedMids,
minEqOp<point>(), minEqOp<point>(),
greatPoint, point::max,
true true
); );

View File

@ -162,15 +162,13 @@ void Foam::domainDecomposition::distributeCells()
// somewhere in the middle of the domain which might not be anywhere // somewhere in the middle of the domain which might not be anywhere
// near any of the cells. // near any of the cells.
const point greatPoint(GREAT, GREAT, GREAT); pointField regionCentres(globalRegion.nRegions(), point::max);
pointField regionCentres(globalRegion.nRegions(), greatPoint);
forAll(globalRegion, cellI) forAll(globalRegion, cellI)
{ {
label regionI = globalRegion[cellI]; label regionI = globalRegion[cellI];
if (regionCentres[regionI] == greatPoint) if (regionCentres[regionI] == point::max)
{ {
regionCentres[regionI] = cellCentres()[cellI]; regionCentres[regionI] = cellCentres()[cellI];
} }

View File

@ -34,7 +34,6 @@ License
#include "polyAddFace.H" #include "polyAddFace.H"
#include "polyModifyFace.H" #include "polyModifyFace.H"
#include "polyAddCell.H" #include "polyAddCell.H"
#include "wallPoint.H"
#include "globalIndex.H" #include "globalIndex.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * 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; UIndirectList<point>(d, meshPoints) = firstLayerDisp;
syncTools::syncPointList syncTools::syncPointList
( (
mesh_, mesh_,
d, d,
minEqOp<vector>(), minEqOp<vector>(),
wallPoint::greatPoint, vector::max,
false false
); );

View File

@ -49,14 +49,6 @@ namespace Foam
} }
const Foam::point Foam::polyTopoChange::greatPoint
(
GREAT,
GREAT,
GREAT
);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// Renumber with special handling for merged items (marked with <-1) // Renumber with special handling for merged items (marked with <-1)
@ -2695,7 +2687,7 @@ void Foam::polyTopoChange::removePoint
<< abort(FatalError); << abort(FatalError);
} }
points_[pointI] = greatPoint; points_[pointI] = point::max;
pointMap_[pointI] = -1; pointMap_[pointI] = -1;
if (mergePointI >= 0) if (mergePointI >= 0)
{ {

View File

@ -45,7 +45,7 @@ Description
- no item can be removed more than once. - no item can be removed more than once.
- removed cell: cell set to 0 faces. - removed cell: cell set to 0 faces.
- removed face: face set to 0 vertices. - 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. 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 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 problems with roundoff error) but instead compare the individual component
@ -98,12 +98,6 @@ template<class T, class Container> class CompactListList;
class polyTopoChange class polyTopoChange
{ {
// Static data members
//- Value of deleted point
static const point greatPoint;
// Private data // Private data
//- Whether to allow referencing illegal points/cells/faces //- Whether to allow referencing illegal points/cells/faces

View File

@ -33,9 +33,9 @@ inline bool Foam::polyTopoChange::pointRemoved(const label pointI) const
const point& pt = points_[pointI]; const point& pt = points_[pointI];
return return
pt.x() > 0.5*greatPoint.x() pt.x() > 0.5*vector::max.x()
&& pt.y() > 0.5*greatPoint.y() && pt.y() > 0.5*vector::max.y()
&& pt.z() > 0.5*greatPoint.z(); && pt.z() > 0.5*vector::max.z();
} }

View File

@ -33,7 +33,6 @@ License
#include "polyAddPoint.H" #include "polyAddPoint.H"
#include "polyModifyFace.H" #include "polyModifyFace.H"
#include "syncTools.H" #include "syncTools.H"
#include "wallPoint.H" // only to use 'greatPoint'
#include "faceSet.H" #include "faceSet.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -570,7 +569,7 @@ void Foam::removePoints::getUnrefimentSet
{ {
label savedPointI = -savedFace[fp]-1; label savedPointI = -savedFace[fp]-1;
if (savedPoints_[savedPointI] == wallPoint::greatPoint) if (savedPoints_[savedPointI] == vector::max)
{ {
FatalErrorIn FatalErrorIn
( (
@ -745,7 +744,7 @@ void Foam::removePoints::setUnrefinement
{ {
label localI = localPoints[i]; label localI = localPoints[i];
if (savedPoints_[localI] == wallPoint::greatPoint) if (savedPoints_[localI] == vector::max)
{ {
FatalErrorIn FatalErrorIn
( (
@ -767,7 +766,7 @@ void Foam::removePoints::setUnrefinement
); );
// Mark the restored points so they are not restored again. // Mark the restored points so they are not restored again.
savedPoints_[localI] = wallPoint::greatPoint; savedPoints_[localI] = vector::max;
} }
forAll(localFaces, i) forAll(localFaces, i)

View File

@ -26,7 +26,6 @@ License
#include "nearWallDistNoSearch.H" #include "nearWallDistNoSearch.H"
#include "fvMesh.H" #include "fvMesh.H"
#include "wallPoint.H"
#include "wallFvPatch.H" #include "wallFvPatch.H"
#include "surfaceFields.H" #include "surfaceFields.H"

View File

@ -38,7 +38,6 @@ SourceFiles
#include "autoPtr.H" #include "autoPtr.H"
#include "dictionary.H" #include "dictionary.H"
#include "wallPoint.H"
#include "searchableSurfaces.H" #include "searchableSurfaces.H"
#include "refinementSurfaces.H" #include "refinementSurfaces.H"
#include "shellSurfaces.H" #include "shellSurfaces.H"
@ -95,9 +94,9 @@ class autoHexMeshDriver
void operator()(vector& x, const vector& y) const 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; x = y;
} }

View File

@ -991,7 +991,7 @@ void Foam::autoLayerDriver::handleFeatureAngle
if (minCos < 1-SMALL) if (minCos < 1-SMALL)
{ {
// Normal component of normals of connected faces. // Normal component of normals of connected faces.
vectorField edgeNormal(mesh.nEdges(), wallPoint::greatPoint); vectorField edgeNormal(mesh.nEdges(), point::max);
const labelListList& edgeFaces = pp.edgeFaces(); const labelListList& edgeFaces = pp.edgeFaces();
@ -1016,7 +1016,7 @@ void Foam::autoLayerDriver::handleFeatureAngle
mesh, mesh,
edgeNormal, edgeNormal,
nomalsCombine(), nomalsCombine(),
wallPoint::greatPoint, // null value point::max, // null value
false // no separation false // no separation
); );
@ -1040,7 +1040,7 @@ void Foam::autoLayerDriver::handleFeatureAngle
const vector& n = edgeNormal[meshEdgeI]; const vector& n = edgeNormal[meshEdgeI];
if (n != wallPoint::greatPoint) if (n != point::max)
{ {
scalar cos = n & pp.faceNormals()[eFaces[0]]; scalar cos = n & pp.faceNormals()[eFaces[0]];
@ -1640,7 +1640,7 @@ void Foam::autoLayerDriver::syncPatchDisplacement
meshPoints, meshPoints,
patchDisp, patchDisp,
minEqOp<vector>(), minEqOp<vector>(),
wallPoint::greatPoint, // null value point::max, // null value
false // no separation false // no separation
); );

View File

@ -37,7 +37,6 @@ SourceFiles
#define autoLayerDriver_H #define autoLayerDriver_H
#include "meshRefinement.H" #include "meshRefinement.H"
#include "wallPoint.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -50,7 +49,6 @@ class pointSet;
class motionSmoother; class motionSmoother;
class addPatchCellLayer; class addPatchCellLayer;
class pointData; class pointData;
class wallPoint;
class faceSet; class faceSet;
class layerParameters; class layerParameters;
@ -81,9 +79,9 @@ class autoLayerDriver
void operator()(vector& x, const vector& y) const 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; x = y;
} }

View File

@ -26,7 +26,6 @@ License
#include "polyMesh.H" #include "polyMesh.H"
#include "transform.H" #include "transform.H"
#include "wallPoint.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -138,10 +137,10 @@ inline bool Foam::pointData::update
// Null constructor // Null constructor
inline Foam::pointData::pointData() inline Foam::pointData::pointData()
: :
origin_(wallPoint::greatPoint), origin_(point::max),
distSqr_(GREAT), distSqr_(GREAT),
s_(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 inline bool Foam::pointData::valid() const
{ {
return origin_ != wallPoint::greatPoint; return origin_ != point::max;
} }

View File

@ -26,10 +26,6 @@ License
#include "pointEdgePoint.H" #include "pointEdgePoint.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
Foam::point Foam::pointEdgePoint::greatPoint(GREAT, GREAT, GREAT);
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<< Foam::Ostream& Foam::operator<<

View File

@ -92,12 +92,6 @@ class pointEdgePoint
public: public:
// Static data members
//- initial point far away.
static point greatPoint;
// Constructors // Constructors
//- Construct null //- Construct null

View File

@ -117,7 +117,7 @@ inline bool Foam::pointEdgePoint::update
// Null constructor // Null constructor
inline Foam::pointEdgePoint::pointEdgePoint() inline Foam::pointEdgePoint::pointEdgePoint()
: :
origin_(greatPoint), origin_(point::max),
distSqr_(GREAT) distSqr_(GREAT)
{} {}
@ -158,7 +158,7 @@ inline Foam::scalar Foam::pointEdgePoint::distSqr() const
inline bool Foam::pointEdgePoint::valid() const inline bool Foam::pointEdgePoint::valid() const
{ {
return origin_ != greatPoint; return origin_ != point::max;
} }

View File

@ -106,7 +106,7 @@ Foam::label Foam::patchDataWave<TransferType>::getValues
distance_[cellI] = dist; distance_[cellI] = dist;
//cellData_[cellI] = wallPoint::greatPoint; //cellData_[cellI] = point::max;
cellData_[cellI] = cellInfo[cellI].data(); cellData_[cellI] = cellInfo[cellI].data();
nIllegal++; nIllegal++;
@ -153,7 +153,7 @@ Foam::label Foam::patchDataWave<TransferType>::getValues
patchField[patchFaceI] = dist; patchField[patchFaceI] = dist;
//patchDataField[patchFaceI] = wallPoint::greatPoint; //patchDataField[patchFaceI] = point::max;
patchDataField[patchFaceI] = faceInfo[meshFaceI].data(); patchDataField[patchFaceI] = faceInfo[meshFaceI].data();
nIllegal++; nIllegal++;

View File

@ -26,11 +26,6 @@ License
#include "wallPoint.H" #include "wallPoint.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
Foam::point Foam::wallPoint::greatPoint(GREAT, GREAT, GREAT);
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<(Foam::Ostream& os, const Foam::wallPoint& wDist) Foam::Ostream& Foam::operator<<(Foam::Ostream& os, const Foam::wallPoint& wDist)

View File

@ -87,12 +87,6 @@ class wallPoint
public: public:
// Static data members
//- initial point far away.
static point greatPoint;
// Constructors // Constructors
//- Construct null //- Construct null

View File

@ -84,7 +84,7 @@ inline bool Foam::wallPoint::update
// Null constructor // Null constructor
inline Foam::wallPoint::wallPoint() inline Foam::wallPoint::wallPoint()
: :
origin_(greatPoint), origin_(point::max),
distSqr_(GREAT) distSqr_(GREAT)
{} {}
@ -131,7 +131,7 @@ inline Foam::scalar& Foam::wallPoint::distSqr()
inline bool Foam::wallPoint::valid() const inline bool Foam::wallPoint::valid() const
{ {
return origin_ != greatPoint; return origin_ != point::max;
} }

View File

@ -800,9 +800,7 @@ void Foam::isoSurface::calcSnappedPoint
const pointField& pts = mesh_.points(); const pointField& pts = mesh_.points();
const pointField& cc = mesh_.cellCentres(); const pointField& cc = mesh_.cellCentres();
pointField collapsedPoint(mesh_.nPoints(), point::max);
const point greatPoint(VGREAT, VGREAT, VGREAT);
pointField collapsedPoint(mesh_.nPoints(), greatPoint);
// Work arrays // Work arrays
@ -966,7 +964,7 @@ void Foam::isoSurface::calcSnappedPoint
// Synchronise snap location // Synchronise snap location
syncUnseparatedPoints(collapsedPoint, greatPoint); syncUnseparatedPoints(collapsedPoint, point::max);
snappedPoint.setSize(mesh_.nPoints()); snappedPoint.setSize(mesh_.nPoints());
@ -974,7 +972,7 @@ void Foam::isoSurface::calcSnappedPoint
forAll(collapsedPoint, pointI) forAll(collapsedPoint, pointI)
{ {
if (collapsedPoint[pointI] != greatPoint) if (collapsedPoint[pointI] != point::max)
{ {
snappedPoint[pointI] = snappedPoints.size(); snappedPoint[pointI] = snappedPoints.size();
snappedPoints.append(collapsedPoint[pointI]); snappedPoints.append(collapsedPoint[pointI]);

View File

@ -630,8 +630,7 @@ void Foam::isoSurfaceCell::calcSnappedPoint
labelList& snappedPoint labelList& snappedPoint
) const ) const
{ {
const point greatPoint(VGREAT, VGREAT, VGREAT); pointField collapsedPoint(mesh_.nPoints(), point::max);
pointField collapsedPoint(mesh_.nPoints(), greatPoint);
// Work arrays // Work arrays
@ -764,7 +763,7 @@ void Foam::isoSurfaceCell::calcSnappedPoint
mesh_, mesh_,
collapsedPoint, collapsedPoint,
minEqOp<point>(), minEqOp<point>(),
greatPoint, point::max,
true // are coordinates so separate true // are coordinates so separate
); );
@ -773,7 +772,7 @@ void Foam::isoSurfaceCell::calcSnappedPoint
forAll(collapsedPoint, pointI) forAll(collapsedPoint, pointI)
{ {
if (collapsedPoint[pointI] != greatPoint) if (collapsedPoint[pointI] != point::max)
{ {
snappedPoint[pointI] = snappedPoints.size(); snappedPoint[pointI] = snappedPoints.size();
snappedPoints.append(collapsedPoint[pointI]); snappedPoints.append(collapsedPoint[pointI]);