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 99b99a46d4
commit 8cd3023439
21 changed files with 251 additions and 211 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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