Rationalize position searching and add cell->tet decomposition as the default cell-search algorithm

Resolves issues with probes and findRefCell for meshes in which all cell face-pyramids are positive.
This commit is contained in:
Henry
2015-02-25 10:57:06 +00:00
parent 25ab8a1a07
commit de2c2fb007
21 changed files with 251 additions and 211 deletions

View File

@ -44,13 +44,11 @@ int main(int argc, char *argv[])
#include "createTime.H" #include "createTime.H"
#include "createMesh.H" #include "createMesh.H"
//label nReps = 100000;
label nReps = 10000; label nReps = 10000;
const point sample = args.argRead<point>(1); const point sample = args.argRead<point>(1);
//const polyMesh::cellRepresentation decompMode = polyMesh::FACEPLANES; const polyMesh::cellDecomposition decompMode = polyMesh::CELL_TETS;
const polyMesh::cellRepresentation decompMode = polyMesh::FACEDIAGTETS;
treeBoundBox meshBb(mesh.bounds()); treeBoundBox meshBb(mesh.bounds());

View File

@ -719,7 +719,7 @@ int main(int argc, char *argv[])
triSurfaceSearch querySurf(surf); triSurfaceSearch querySurf(surf);
// Search engine on mesh. No face decomposition since mesh unwarped. // Search engine on mesh. No face decomposition since mesh unwarped.
meshSearch queryMesh(mesh, polyMesh::FACEPLANES); meshSearch queryMesh(mesh, polyMesh::FACE_PLANES);
// Check all 'outside' points // Check all 'outside' points
forAll(outsidePts, outsideI) forAll(outsidePts, outsideI)

View File

@ -81,7 +81,7 @@ bool Foam::conformalVoronoiMesh::distributeBackground(const Triangulation& mesh)
zeroGradientFvPatchScalarField::typeName zeroGradientFvPatchScalarField::typeName
); );
meshSearch cellSearch(bMesh, polyMesh::FACEPLANES); meshSearch cellSearch(bMesh, polyMesh::FACE_PLANES);
labelList cellVertices(bMesh.nCells(), label(0)); labelList cellVertices(bMesh.nCells(), label(0));

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -59,7 +59,7 @@ static label findCell(const Cloud<passiveParticle>& cloud, const point& pt)
meshSearch meshSearcher meshSearch meshSearcher
( (
mesh, mesh,
polyMesh::FACEPLANES // no decomposition needed polyMesh::FACE_PLANES // no decomposition needed
); );
label faceI = meshSearcher.findNearestBoundaryFace(pt); label faceI = meshSearcher.findNearestBoundaryFace(pt);

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -88,7 +88,7 @@ Foam::treeDataCell::treeDataCell
const bool cacheBb, const bool cacheBb,
const polyMesh& mesh, const polyMesh& mesh,
const labelUList& cellLabels, const labelUList& cellLabels,
const polyMesh::cellRepresentation decompMode const polyMesh::cellDecomposition decompMode
) )
: :
mesh_(mesh), mesh_(mesh),
@ -105,7 +105,7 @@ Foam::treeDataCell::treeDataCell
const bool cacheBb, const bool cacheBb,
const polyMesh& mesh, const polyMesh& mesh,
const Xfer<labelList>& cellLabels, const Xfer<labelList>& cellLabels,
const polyMesh::cellRepresentation decompMode const polyMesh::cellDecomposition decompMode
) )
: :
mesh_(mesh), mesh_(mesh),
@ -121,7 +121,7 @@ Foam::treeDataCell::treeDataCell
( (
const bool cacheBb, const bool cacheBb,
const polyMesh& mesh, const polyMesh& mesh,
const polyMesh::cellRepresentation decompMode const polyMesh::cellDecomposition decompMode
) )
: :
mesh_(mesh), mesh_(mesh),

View File

@ -65,7 +65,7 @@ class treeDataCell
const bool cacheBb_; const bool cacheBb_;
//- How to decide if point is inside cell //- How to decide if point is inside cell
const polyMesh::cellRepresentation decompMode_; const polyMesh::cellDecomposition decompMode_;
//- Cell bounding boxes (valid only if cacheBb_) //- Cell bounding boxes (valid only if cacheBb_)
treeBoundBoxList bbs_; treeBoundBoxList bbs_;
@ -143,7 +143,7 @@ public:
const bool cacheBb, const bool cacheBb,
const polyMesh&, const polyMesh&,
const labelUList&, const labelUList&,
const polyMesh::cellRepresentation decompMode const polyMesh::cellDecomposition decompMode
); );
//- Construct from mesh and subset of cells, transferring contents //- Construct from mesh and subset of cells, transferring contents
@ -152,7 +152,7 @@ public:
const bool cacheBb, const bool cacheBb,
const polyMesh&, const polyMesh&,
const Xfer<labelList>&, const Xfer<labelList>&,
const polyMesh::cellRepresentation decompMode const polyMesh::cellDecomposition decompMode
); );
//- Construct from mesh. Uses all cells in mesh. //- Construct from mesh. Uses all cells in mesh.
@ -160,7 +160,7 @@ public:
( (
const bool cacheBb, const bool cacheBb,
const polyMesh&, const polyMesh&,
const polyMesh::cellRepresentation decompMode const polyMesh::cellDecomposition decompMode
); );
@ -178,7 +178,7 @@ public:
return mesh_; return mesh_;
} }
inline polyMesh::cellRepresentation decompMode() const inline polyMesh::cellDecomposition decompMode() const
{ {
return decompMode_; return decompMode_;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -452,9 +452,9 @@ Foam::polyMesh::polyMesh
oldPointsPtr_(NULL) oldPointsPtr_(NULL)
{ {
// Check if the faces and cells are valid // Check if the faces and cells are valid
forAll(faces_, faceI) forAll(faces_, facei)
{ {
const face& curFace = faces_[faceI]; const face& curFace = faces_[facei];
if (min(curFace) < 0 || max(curFace) > points_.size()) if (min(curFace) < 0 || max(curFace) > points_.size())
{ {
@ -467,7 +467,7 @@ Foam::polyMesh::polyMesh
" const faceList& faces,\n" " const faceList& faces,\n"
" const cellList& cells\n" " const cellList& cells\n"
")\n" ")\n"
) << "Face " << faceI << "contains vertex labels out of range: " ) << "Face " << facei << "contains vertex labels out of range: "
<< curFace << " Max point index = " << points_.size() << curFace << " Max point index = " << points_.size()
<< abort(FatalError); << abort(FatalError);
} }
@ -611,9 +611,9 @@ Foam::polyMesh::polyMesh
oldPointsPtr_(NULL) oldPointsPtr_(NULL)
{ {
// Check if faces are valid // Check if faces are valid
forAll(faces_, faceI) forAll(faces_, facei)
{ {
const face& curFace = faces_[faceI]; const face& curFace = faces_[facei];
if (min(curFace) < 0 || max(curFace) > points_.size()) if (min(curFace) < 0 || max(curFace) > points_.size())
{ {
@ -626,7 +626,7 @@ Foam::polyMesh::polyMesh
" const Xfer<faceList>&,\n" " const Xfer<faceList>&,\n"
" const Xfer<cellList>&\n" " const Xfer<cellList>&\n"
")\n" ")\n"
) << "Face " << faceI << "contains vertex labels out of range: " ) << "Face " << facei << "contains vertex labels out of range: "
<< curFace << " Max point index = " << points_.size() << curFace << " Max point index = " << points_.size()
<< abort(FatalError); << abort(FatalError);
} }
@ -636,9 +636,9 @@ Foam::polyMesh::polyMesh
cellList cLst(cells); cellList cLst(cells);
// Check if cells are valid // Check if cells are valid
forAll(cLst, cellI) forAll(cLst, celli)
{ {
const cell& curCell = cLst[cellI]; const cell& curCell = cLst[celli];
if (min(curCell) < 0 || max(curCell) > faces_.size()) if (min(curCell) < 0 || max(curCell) > faces_.size())
{ {
@ -651,7 +651,7 @@ Foam::polyMesh::polyMesh
" const Xfer<faceList>&,\n" " const Xfer<faceList>&,\n"
" const Xfer<cellList>&\n" " const Xfer<cellList>&\n"
")\n" ")\n"
) << "Cell " << cellI << "contains face labels out of range: " ) << "Cell " << celli << "contains face labels out of range: "
<< curCell << " Max face index = " << faces_.size() << curCell << " Max face index = " << faces_.size()
<< abort(FatalError); << abort(FatalError);
} }
@ -718,9 +718,9 @@ void Foam::polyMesh::resetPrimitives
setInstance(time().timeName()); setInstance(time().timeName());
// Check if the faces and cells are valid // Check if the faces and cells are valid
forAll(faces_, faceI) forAll(faces_, facei)
{ {
const face& curFace = faces_[faceI]; const face& curFace = faces_[facei];
if (min(curFace) < 0 || max(curFace) > points_.size()) if (min(curFace) < 0 || max(curFace) > points_.size())
{ {
@ -736,7 +736,7 @@ void Foam::polyMesh::resetPrimitives
" const labelList& patchStarts\n" " const labelList& patchStarts\n"
" const bool validBoundary\n" " const bool validBoundary\n"
")\n" ")\n"
) << "Face " << faceI << " contains vertex labels out of range: " ) << "Face " << facei << " contains vertex labels out of range: "
<< curFace << " Max point index = " << points_.size() << curFace << " Max point index = " << points_.size()
<< abort(FatalError); << abort(FatalError);
} }
@ -907,7 +907,7 @@ Foam::polyMesh::cellTree() const
( (
false, // not cache bb false, // not cache bb
*this, *this,
FACEDIAGTETS // use tetDecomposition for any inside test CELL_TETS // use tet-decomposition for any inside test
), ),
overallBb, overallBb,
8, // maxLevel 8, // maxLevel
@ -1259,34 +1259,33 @@ void Foam::polyMesh::removeFiles() const
void Foam::polyMesh::findCellFacePt void Foam::polyMesh::findCellFacePt
( (
const point& pt, const point& p,
label& cellI, label& celli,
label& tetFaceI, label& tetFacei,
label& tetPtI label& tetPti
) const ) const
{ {
cellI = -1; celli = -1;
tetFaceI = -1; tetFacei = -1;
tetPtI = -1; tetPti = -1;
const indexedOctree<treeDataCell>& tree = cellTree(); const indexedOctree<treeDataCell>& tree = cellTree();
// Find nearest cell to the point // Find nearest cell to the point
pointIndexHit info = tree.findNearest(p, sqr(GREAT));
pointIndexHit info = tree.findNearest(pt, sqr(GREAT));
if (info.hit()) if (info.hit())
{ {
label nearestCellI = tree.shapes().cellLabels()[info.index()]; label nearestCellI = tree.shapes().cellLabels()[info.index()];
// Check the nearest cell to see if the point is inside. // Check the nearest cell to see if the point is inside.
findTetFacePt(nearestCellI, pt, tetFaceI, tetPtI); findTetFacePt(nearestCellI, p, tetFacei, tetPti);
if (tetFaceI != -1) if (tetFacei != -1)
{ {
// Point was in the nearest cell // Point was in the nearest cell
cellI = nearestCellI; celli = nearestCellI;
return; return;
} }
@ -1294,7 +1293,7 @@ void Foam::polyMesh::findCellFacePt
{ {
// Check the other possible cells that the point may be in // Check the other possible cells that the point may be in
labelList testCells = tree.findIndices(pt); labelList testCells = tree.findIndices(p);
forAll(testCells, pCI) forAll(testCells, pCI)
{ {
@ -1308,13 +1307,13 @@ void Foam::polyMesh::findCellFacePt
} }
// Check the test cell to see if the point is inside. // Check the test cell to see if the point is inside.
findTetFacePt(testCellI, pt, tetFaceI, tetPtI); findTetFacePt(testCellI, p, tetFacei, tetPti);
if (tetFaceI != -1) if (tetFacei != -1)
{ {
// Point was in the test cell // Point was in the test cell
cellI = testCellI; celli = testCellI;
return; return;
} }
@ -1327,10 +1326,10 @@ void Foam::polyMesh::findCellFacePt
( (
"void Foam::polyMesh::findCellFacePt" "void Foam::polyMesh::findCellFacePt"
"(" "("
"const point&, " "const point& p, "
"label&, " "label& celli, "
"label&, " "label& tetFacei, "
"label&" "label& tetPti"
") const" ") const"
) << "Did not find nearest cell in search tree." ) << "Did not find nearest cell in search tree."
<< abort(FatalError); << abort(FatalError);
@ -1340,47 +1339,47 @@ void Foam::polyMesh::findCellFacePt
void Foam::polyMesh::findTetFacePt void Foam::polyMesh::findTetFacePt
( (
const label cellI, const label celli,
const point& pt, const point& p,
label& tetFaceI, label& tetFacei,
label& tetPtI label& tetPti
) const ) const
{ {
const polyMesh& mesh = *this; const polyMesh& mesh = *this;
tetIndices tet(polyMeshTetDecomposition::findTet(mesh, cellI, pt)); tetIndices tet(polyMeshTetDecomposition::findTet(mesh, celli, p));
tetFaceI = tet.face(); tetFacei = tet.face();
tetPtI = tet.tetPt(); tetPti = tet.tetPt();
} }
bool Foam::polyMesh::pointInCell bool Foam::polyMesh::pointInCell
( (
const point& p, const point& p,
label cellI, label celli,
const cellRepresentation decompMode const cellDecomposition decompMode
) const ) const
{ {
switch (decompMode) switch (decompMode)
{ {
case FACEPLANES: case FACE_PLANES:
{ {
return primitiveMesh::pointInCell(p, cellI); return primitiveMesh::pointInCell(p, celli);
} }
break; break;
case FACECENTRETETS: case FACE_CENTRE_TRIS:
{ {
// only test that point is on inside of plane defined by cell face // only test that point is on inside of plane defined by cell face
// triangles // triangles
const cell& cFaces = cells()[cellI]; const cell& cFaces = cells()[celli];
forAll(cFaces, cFaceI) forAll(cFaces, cFacei)
{ {
label faceI = cFaces[cFaceI]; label facei = cFaces[cFacei];
const face& f = faces_[faceI]; const face& f = faces_[facei];
const point& fc = faceCentres()[faceI]; const point& fc = faceCentres()[facei];
bool isOwn = (owner_[faceI] == cellI); bool isOwn = (owner_[facei] == celli);
forAll(f, fp) forAll(f, fp)
{ {
@ -1417,18 +1416,18 @@ bool Foam::polyMesh::pointInCell
} }
break; break;
case FACEDIAGTETS: case FACE_DIAG_TRIS:
{ {
// only test that point is on inside of plane defined by cell face // only test that point is on inside of plane defined by cell face
// triangles // triangles
const cell& cFaces = cells()[cellI]; const cell& cFaces = cells()[celli];
forAll(cFaces, cFaceI) forAll(cFaces, cFacei)
{ {
label faceI = cFaces[cFaceI]; label facei = cFaces[cFacei];
const face& f = faces_[faceI]; const face& f = faces_[facei];
for (label tetPtI = 1; tetPtI < f.size() - 1; tetPtI++) for (label tetPti = 1; tetPti < f.size() - 1; tetPti++)
{ {
// Get tetIndices of face triangle // Get tetIndices of face triangle
tetIndices faceTetIs tetIndices faceTetIs
@ -1436,9 +1435,9 @@ bool Foam::polyMesh::pointInCell
polyMeshTetDecomposition::triangleTetIndices polyMeshTetDecomposition::triangleTetIndices
( (
*this, *this,
faceI, facei,
cellI, celli,
tetPtI tetPti
) )
); );
@ -1456,50 +1455,84 @@ bool Foam::polyMesh::pointInCell
return true; return true;
} }
break; break;
case CELL_TETS:
{
label tetFacei;
label tetPti;
findTetFacePt(celli, p, tetFacei, tetPti);
return tetFacei != -1;
} }
break;
}
return false; return false;
} }
Foam::label Foam::polyMesh::findCell Foam::label Foam::polyMesh::findCell
( (
const point& location, const point& p,
const cellRepresentation decompMode const cellDecomposition decompMode
) const ) const
{ {
if (Pstream::parRun() && decompMode == FACEDIAGTETS)
{
// Force construction of face-diagonal decomposition before testing
// for zero cells. If parallel running a local domain might have zero
// cells so never construct the face-diagonal decomposition (which
// uses parallel transfers)
(void)tetBasePtIs();
}
if (nCells() == 0) if (nCells() == 0)
{ {
return -1; return -1;
} }
if (decompMode == CELL_TETS)
{
// Advanced search method utilizing an octree
// and tet-decomposition of the cells
label celli;
label tetFacei;
label tetPti;
findCellFacePt(p, celli, tetFacei, tetPti);
return celli;
}
else
{
// Approximate search avoiding the construction of an octree
// and cell decomposition
if (Pstream::parRun() && decompMode == FACE_DIAG_TRIS)
{
// Force construction of face-diagonal decomposition before testing
// for zero cells. If parallel running a local domain might have
// zero cells so never construct the face-diagonal decomposition
// (which uses parallel transfers)
(void)tetBasePtIs();
}
// Find the nearest cell centre to this location // Find the nearest cell centre to this location
label cellI = findNearestCell(location); label celli = findNearestCell(p);
// If point is in the nearest cell return // If point is in the nearest cell return
if (pointInCell(location, cellI, decompMode)) if (pointInCell(p, celli, decompMode))
{ {
return cellI; return celli;
} }
else // point is not in the nearest cell so search all cells else
{ {
for (label cellI = 0; cellI < nCells(); cellI++) // Point is not in the nearest cell so search all cells
for (label celli = 0; celli < nCells(); celli++)
{ {
if (pointInCell(location, cellI, decompMode)) if (pointInCell(p, celli, decompMode))
{ {
return cellI; return celli;
} }
} }
return -1; return -1;
} }
}
} }

View File

@ -94,13 +94,18 @@ public:
TOPO_PATCH_CHANGE TOPO_PATCH_CHANGE
}; };
//- Enumeration defining the representation of the cell for //- Enumeration defining the decomposition of the cell for
// inside checking // inside/outside test
enum cellRepresentation enum cellDecomposition
{ {
FACEPLANES, // cell bound by planes of faces FACE_PLANES, //- Faces considered as planes
FACECENTRETETS, // tet decomposition using facectr and cellctr
FACEDIAGTETS // tet decomposition using face diagonal and cellctr FACE_CENTRE_TRIS, //- Faces decomposed into triangles
// using face-centre
FACE_DIAG_TRIS, //- Faces decomposed into triangles diagonally
CELL_TETS //- Cell decomposed into tets
}; };
@ -667,40 +672,41 @@ public:
) const; ) const;
// Helper functions // Position search functions
//- Find the cell, tetFaceI and tetPtI for the given position //- Find the cell, tetFacei and tetPti for point p
void findCellFacePt void findCellFacePt
( (
const point& pt, const point& p,
label& cellI, label& celli,
label& tetFaceI, label& tetFacei,
label& tetPtI label& tetPti
) const; ) const;
//- Find the tetFaceI and tetPtI for the given position in //- Find the tetFacei and tetPti for point p in celli.
// the supplied cell, tetFaceI and tetPtI = -1 if not found // tetFaceI and tetPtI are set to -1 if not found
void findTetFacePt void findTetFacePt
( (
const label cellI, const label celli,
const point& pt, const point& p,
label& tetFaceI, label& tetFacei,
label& tetPtI label& tetPti
) const; ) const;
//- Is the point in the cell //- Test if point p is in the celli
bool pointInCell bool pointInCell
( (
const point&, const point& p,
label cellI, label celli,
const cellRepresentation = FACEDIAGTETS const cellDecomposition = CELL_TETS
) const; ) const;
//- Find cell enclosing this location (-1 if not in mesh) //- Find cell enclosing this location and return index
// If not found -1 is returned
label findCell label findCell
( (
const point&, const point& p,
const cellRepresentation = FACEDIAGTETS const cellDecomposition = CELL_TETS
) const; ) const;
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -55,7 +55,7 @@ void Foam::setRefCell
FatalIOErrorIn FatalIOErrorIn
( (
"void Foam::setRefCell\n" "void Foam::setRefCell\n"
"(\n" " (\n"
" const volScalarField&,\n" " const volScalarField&,\n"
" const volScalarField&,\n" " const volScalarField&,\n"
" const dictionary&,\n" " const dictionary&,\n"
@ -77,30 +77,34 @@ void Foam::setRefCell
{ {
point refPointi(dict.lookup(refPointName)); point refPointi(dict.lookup(refPointName));
// Note: find reference cell using facePlanes to avoid constructing // Try fast approximate search avoiding octree construction
// face decomposition structure. Most likely the reference refCelli = field.mesh().findCell(refPointi, polyMesh::FACE_PLANES);
// cell is an undistorted one so this should not be a
// problem.
refCelli = field.mesh().findCell
(
refPointi,
polyMesh::FACEPLANES
);
label hasRef = (refCelli >= 0 ? 1 : 0); label hasRef = (refCelli >= 0 ? 1 : 0);
label sumHasRef = returnReduce<label>(hasRef, sumOp<label>()); label sumHasRef = returnReduce<label>(hasRef, sumOp<label>());
// If reference cell no found use octree search
// with cell tet-decompositoin
if (sumHasRef != 1)
{
refCelli = field.mesh().findCell(refPointi);
hasRef = (refCelli >= 0 ? 1 : 0);
sumHasRef = returnReduce<label>(hasRef, sumOp<label>());
}
if (sumHasRef != 1) if (sumHasRef != 1)
{ {
FatalIOErrorIn FatalIOErrorIn
( (
"void Foam::setRefCell\n" "void Foam::setRefCell\n"
"(\n" " (\n"
" const volScalarField&,\n" " const volScalarField&,\n"
" const volScalarField&,\n" " const volScalarField&,\n"
" const dictionary&,\n" " const dictionary&,\n"
" label& scalar&,\n" " label& scalar&,\n"
" bool\n" " bool\n"
")", " )",
dict dict
) << "Unable to set reference cell for field " << field.name() ) << "Unable to set reference cell for field " << field.name()
<< nl << " Reference point " << refPointName << nl << " Reference point " << refPointName
@ -114,13 +118,13 @@ void Foam::setRefCell
FatalIOErrorIn FatalIOErrorIn
( (
"void Foam::setRefCell\n" "void Foam::setRefCell\n"
"(\n" " (\n"
" const volScalarField&,\n" " const volScalarField&,\n"
" const volScalarField&,\n" " const volScalarField&,\n"
" const dictionary&,\n" " const dictionary&,\n"
" label& scalar&,\n" " label& scalar&,\n"
" bool\n" " bool\n"
")", " )",
dict dict
) << "Unable to set reference cell for field " << field.name() ) << "Unable to set reference cell for field " << field.name()
<< nl << nl

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -165,10 +165,10 @@ void Foam::InteractionLists<ParticleType>::buildInteractionLists()
( (
treeDataCell treeDataCell
( (
true, // cache cell bb true, // Cache cell bb
mesh_, mesh_,
coupledPatchRangeCells, // subset of mesh coupledPatchRangeCells, // Subset of mesh
polyMesh::FACEDIAGTETS // consistent with tracking polyMesh::CELL_TETS // Consistent with tracking
), ),
procBbRndExt, procBbRndExt,
8, // maxLevel, 8, // maxLevel,
@ -388,7 +388,7 @@ void Foam::InteractionLists<ParticleType>::buildInteractionLists()
indexedOctree<treeDataCell> allCellsTree indexedOctree<treeDataCell> allCellsTree
( (
treeDataCell(true, mesh_, polyMesh::FACEDIAGTETS), treeDataCell(true, mesh_, polyMesh::CELL_TETS),
procBbRndExt, procBbRndExt,
8, // maxLevel, 8, // maxLevel,
10, // leafSize, 10, // leafSize,

View File

@ -28,7 +28,7 @@ polyMeshZipUpCells/polyMeshZipUpCells.C
primitiveMeshGeometry/primitiveMeshGeometry.C primitiveMeshGeometry/primitiveMeshGeometry.C
meshSearch/meshSearch.C meshSearch/meshSearch.C
meshSearch/meshSearchFACECENTRETETSMeshObject.C meshSearch/meshSearchFACE_CENTRE_TRISMeshObject.C
meshSearch/meshSearchMeshObject.C meshSearch/meshSearchMeshObject.C
meshTools/meshTools.C meshTools/meshTools.C

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -107,7 +107,7 @@ Foam::tmp<Foam::pointField> Foam::mappedPatchBase::facePoints
( (
mesh, mesh,
pp.start()+faceI, pp.start()+faceI,
polyMesh::FACEDIAGTETS polyMesh::FACE_DIAG_TRIS
).rawPoint(); ).rawPoint();
} }
@ -1349,15 +1349,15 @@ Foam::pointIndexHit Foam::mappedPatchBase::facePoint
( (
const polyMesh& mesh, const polyMesh& mesh,
const label faceI, const label faceI,
const polyMesh::cellRepresentation decompMode const polyMesh::cellDecomposition decompMode
) )
{ {
const point& fc = mesh.faceCentres()[faceI]; const point& fc = mesh.faceCentres()[faceI];
switch (decompMode) switch (decompMode)
{ {
case polyMesh::FACEPLANES: case polyMesh::FACE_PLANES:
case polyMesh::FACECENTRETETS: case polyMesh::FACE_CENTRE_TRIS:
{ {
// For both decompositions the face centre is guaranteed to be // For both decompositions the face centre is guaranteed to be
// on the face // on the face
@ -1365,10 +1365,10 @@ Foam::pointIndexHit Foam::mappedPatchBase::facePoint
} }
break; break;
case polyMesh::FACEDIAGTETS: case polyMesh::FACE_DIAG_TRIS:
case polyMesh::CELL_TETS:
{ {
// Find the intersection of a ray from face centre to cell // Find the intersection of a ray from face centre to cell centre
// centre
// Find intersection of (face-centre-decomposition) centre to // Find intersection of (face-centre-decomposition) centre to
// cell-centre with face-diagonal-decomposition triangles. // cell-centre with face-diagonal-decomposition triangles.

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -412,7 +412,7 @@ public:
( (
const polyMesh&, const polyMesh&,
const label faceI, const label faceI,
const polyMesh::cellRepresentation const polyMesh::cellDecomposition
); );

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -502,17 +502,16 @@ Foam::vector Foam::meshSearch::offset
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::meshSearch::meshSearch Foam::meshSearch::meshSearch
( (
const polyMesh& mesh, const polyMesh& mesh,
const polyMesh::cellRepresentation cellDecompMode const polyMesh::cellDecomposition cellDecompMode
) )
: :
mesh_(mesh), mesh_(mesh),
cellDecompMode_(cellDecompMode) cellDecompMode_(cellDecompMode)
{ {
if (cellDecompMode_ == polyMesh::FACEDIAGTETS) if (cellDecompMode_ == polyMesh::FACE_DIAG_TRIS)
{ {
// Force construction of face diagonals // Force construction of face diagonals
(void)mesh.tetBasePtIs(); (void)mesh.tetBasePtIs();
@ -525,7 +524,7 @@ Foam::meshSearch::meshSearch
( (
const polyMesh& mesh, const polyMesh& mesh,
const treeBoundBox& bb, const treeBoundBox& bb,
const polyMesh::cellRepresentation cellDecompMode const polyMesh::cellDecomposition cellDecompMode
) )
: :
mesh_(mesh), mesh_(mesh),
@ -533,7 +532,7 @@ Foam::meshSearch::meshSearch
{ {
overallBbPtr_.reset(new treeBoundBox(bb)); overallBbPtr_.reset(new treeBoundBox(bb));
if (cellDecompMode_ == polyMesh::FACEDIAGTETS) if (cellDecompMode_ == polyMesh::FACE_DIAG_TRIS)
{ {
// Force construction of face diagonals // Force construction of face diagonals
(void)mesh.tetBasePtIs(); (void)mesh.tetBasePtIs();

View File

@ -63,7 +63,7 @@ class meshSearch
const polyMesh& mesh_; const polyMesh& mesh_;
//- Whether to use cell decomposition for all geometric tests //- Whether to use cell decomposition for all geometric tests
const polyMesh::cellRepresentation cellDecompMode_; const polyMesh::cellDecomposition cellDecompMode_;
//- Data bounding box //- Data bounding box
mutable autoPtr<treeBoundBox> overallBbPtr_; mutable autoPtr<treeBoundBox> overallBbPtr_;
@ -171,7 +171,7 @@ public:
meshSearch meshSearch
( (
const polyMesh& mesh, const polyMesh& mesh,
const polyMesh::cellRepresentation = polyMesh::FACEDIAGTETS const polyMesh::cellDecomposition = polyMesh::CELL_TETS
); );
//- Construct with a custom bounding box. Any mesh element outside //- Construct with a custom bounding box. Any mesh element outside
@ -181,7 +181,7 @@ public:
( (
const polyMesh& mesh, const polyMesh& mesh,
const treeBoundBox& bb, const treeBoundBox& bb,
const polyMesh::cellRepresentation = polyMesh::FACEDIAGTETS const polyMesh::cellDecomposition = polyMesh::CELL_TETS
); );
//- Destructor //- Destructor
@ -197,7 +197,7 @@ public:
return mesh_; return mesh_;
} }
polyMesh::cellRepresentation decompMode() const polyMesh::cellDecomposition decompMode() const
{ {
return cellDecompMode_; return cellDecompMode_;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -23,19 +23,19 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "meshSearchFACECENTRETETSMeshObject.H" #include "meshSearchFACE_CENTRE_TRISMeshObject.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
defineTypeNameAndDebug(meshSearchFACECENTRETETSMeshObject, 0); defineTypeNameAndDebug(meshSearchFACE_CENTRE_TRISMeshObject, 0);
} }
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::meshSearchFACECENTRETETSMeshObject::meshSearchFACECENTRETETSMeshObject Foam::meshSearchFACE_CENTRE_TRISMeshObject::meshSearchFACE_CENTRE_TRISMeshObject
( (
const polyMesh& mesh const polyMesh& mesh
) )
@ -44,9 +44,9 @@ Foam::meshSearchFACECENTRETETSMeshObject::meshSearchFACECENTRETETSMeshObject
< <
polyMesh, polyMesh,
Foam::GeometricMeshObject, Foam::GeometricMeshObject,
meshSearchFACECENTRETETSMeshObject meshSearchFACE_CENTRE_TRISMeshObject
>(mesh), >(mesh),
meshSearch(mesh, polyMesh::FACECENTRETETS) meshSearch(mesh, polyMesh::FACE_CENTRE_TRIS)
{} {}

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -22,17 +22,17 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class Class
Foam::meshSearchFACECENTRETETSMeshObject Foam::meshSearchFACE_CENTRE_TRISMeshObject
Description Description
MeshObject wrapper around meshSearch(mesh, polyMesh::FACECENTRETETS). MeshObject wrapper around meshSearch(mesh, polyMesh::FACE_CENTRE_TRIS).
SourceFiles SourceFiles
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef meshSearchFACECENTRETETSMeshObject_H #ifndef meshSearchFACE_CENTRE_TRISMeshObject_H
#define meshSearchFACECENTRETETSMeshObject_H #define meshSearchFACE_CENTRE_TRISMeshObject_H
#include "MeshObject.H" #include "MeshObject.H"
#include "meshSearch.H" #include "meshSearch.H"
@ -43,16 +43,16 @@ namespace Foam
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class meshSearchFACECENTRETETSMeshObject Declaration Class meshSearchFACE_CENTRE_TRISMeshObject Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class meshSearchFACECENTRETETSMeshObject class meshSearchFACE_CENTRE_TRISMeshObject
: :
public MeshObject public MeshObject
< <
polyMesh, polyMesh,
GeometricMeshObject, GeometricMeshObject,
meshSearchFACECENTRETETSMeshObject meshSearchFACE_CENTRE_TRISMeshObject
>, >,
public meshSearch public meshSearch
{ {
@ -60,16 +60,16 @@ class meshSearchFACECENTRETETSMeshObject
public: public:
// Declare name of the class and its debug switch // Declare name of the class and its debug switch
TypeName("meshSearchFACECENTRETETSMeshObject"); TypeName("meshSearchFACE_CENTRE_TRISMeshObject");
// Constructors // Constructors
//- Constructor given polyMesh //- Constructor given polyMesh
explicit meshSearchFACECENTRETETSMeshObject(const polyMesh& mesh); explicit meshSearchFACE_CENTRE_TRISMeshObject(const polyMesh& mesh);
//- Destructor //- Destructor
virtual ~meshSearchFACECENTRETETSMeshObject() virtual ~meshSearchFACE_CENTRE_TRISMeshObject()
{} {}
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -86,7 +86,7 @@ void Foam::nearWallFields::calcAddressing()
( (
mesh, mesh,
meshFaceI, meshFaceI,
polyMesh::FACEDIAGTETS polyMesh::FACE_DIAG_TRIS
) )
); );

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -48,7 +48,7 @@ bool Foam::directMethod::intersect
( (
src_.cellCentres()[srcCellI], src_.cellCentres()[srcCellI],
tgtCellI, tgtCellI,
polyMesh::FACEPLANES polyMesh::FACE_PLANES
); );
} }
@ -200,7 +200,7 @@ void Foam::directMethod::appendToDirectSeeds
( (
srcCentre[srcI], srcCentre[srcI],
tgtI, tgtI,
polyMesh::FACEPLANES polyMesh::FACE_PLANES
) )
) )
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -139,7 +139,7 @@ void Foam::patchSeedSet::calcSamples
( (
mesh(), mesh(),
faceI, faceI,
polyMesh::FACEDIAGTETS polyMesh::FACE_DIAG_TRIS
); );
label cellI = mesh().faceOwner()[faceI]; label cellI = mesh().faceOwner()[faceI];

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -645,7 +645,7 @@ bool Foam::sampledTriSurfaceMesh::update()
} }
// Mesh search engine, no triangulation of faces. // Mesh search engine, no triangulation of faces.
meshSearch meshSearcher(mesh(), polyMesh::FACEPLANES); meshSearch meshSearcher(mesh(), polyMesh::FACE_PLANES);
return update(meshSearcher); return update(meshSearcher);
} }
@ -659,7 +659,7 @@ bool Foam::sampledTriSurfaceMesh::update(const treeBoundBox& bb)
} }
// Mesh search engine on subset, no triangulation of faces. // Mesh search engine on subset, no triangulation of faces.
meshSearch meshSearcher(mesh(), bb, polyMesh::FACEPLANES); meshSearch meshSearcher(mesh(), bb, polyMesh::FACE_PLANES);
return update(meshSearcher); return update(meshSearcher);
} }