mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
MRG: Integrated Foundation code to commit ba4dbed
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -35,9 +35,9 @@ License
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(meshSearch, 0);
|
||||
defineTypeNameAndDebug(meshSearch, 0);
|
||||
|
||||
scalar meshSearch::tol_ = 1e-3;
|
||||
scalar meshSearch::tol_ = 1e-3;
|
||||
}
|
||||
|
||||
|
||||
@ -117,7 +117,6 @@ Foam::label Foam::meshSearch::findNearestCellTree(const point& location) const
|
||||
}
|
||||
|
||||
|
||||
// linear searching
|
||||
Foam::label Foam::meshSearch::findNearestCellLinear(const point& location) const
|
||||
{
|
||||
const vectorField& centres = mesh_.cellCentres();
|
||||
@ -137,7 +136,6 @@ Foam::label Foam::meshSearch::findNearestCellLinear(const point& location) const
|
||||
}
|
||||
|
||||
|
||||
// walking from seed
|
||||
Foam::label Foam::meshSearch::findNearestCellWalk
|
||||
(
|
||||
const point& location,
|
||||
@ -174,7 +172,6 @@ Foam::label Foam::meshSearch::findNearestCellWalk
|
||||
}
|
||||
|
||||
|
||||
// tree based searching
|
||||
Foam::label Foam::meshSearch::findNearestFaceTree(const point& location) const
|
||||
{
|
||||
// Search nearest cell centre.
|
||||
@ -214,7 +211,6 @@ Foam::label Foam::meshSearch::findNearestFaceTree(const point& location) const
|
||||
}
|
||||
|
||||
|
||||
// linear searching
|
||||
Foam::label Foam::meshSearch::findNearestFaceLinear(const point& location) const
|
||||
{
|
||||
const vectorField& centres = mesh_.faceCentres();
|
||||
@ -234,7 +230,6 @@ Foam::label Foam::meshSearch::findNearestFaceLinear(const point& location) const
|
||||
}
|
||||
|
||||
|
||||
// walking from seed
|
||||
Foam::label Foam::meshSearch::findNearestFaceWalk
|
||||
(
|
||||
const point& location,
|
||||
@ -322,7 +317,6 @@ Foam::label Foam::meshSearch::findCellLinear(const point& location) const
|
||||
}
|
||||
|
||||
|
||||
// walking from seed
|
||||
Foam::label Foam::meshSearch::findCellWalk
|
||||
(
|
||||
const point& location,
|
||||
@ -514,7 +508,6 @@ Foam::meshSearch::meshSearch
|
||||
}
|
||||
|
||||
|
||||
// Construct with a custom bounding box
|
||||
Foam::meshSearch::meshSearch
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
@ -549,8 +542,8 @@ Foam::meshSearch::~meshSearch()
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
const Foam::indexedOctree<Foam::treeDataFace>& Foam::meshSearch::boundaryTree()
|
||||
const
|
||||
const Foam::indexedOctree<Foam::treeDataFace>&
|
||||
Foam::meshSearch::boundaryTree() const
|
||||
{
|
||||
if (!boundaryTreePtr_.valid())
|
||||
{
|
||||
@ -602,8 +595,8 @@ const Foam::indexedOctree<Foam::treeDataFace>& Foam::meshSearch::boundaryTree()
|
||||
}
|
||||
|
||||
|
||||
const Foam::indexedOctree<Foam::treeDataCell>& Foam::meshSearch::cellTree()
|
||||
const
|
||||
const Foam::indexedOctree<Foam::treeDataCell>&
|
||||
Foam::meshSearch::cellTree() const
|
||||
{
|
||||
if (!cellTreePtr_.valid())
|
||||
{
|
||||
@ -648,92 +641,6 @@ const
|
||||
}
|
||||
|
||||
|
||||
//// Is the point in the cell
|
||||
//// Works by checking if there is a face inbetween the point and the cell
|
||||
//// centre.
|
||||
//// Check for internal uses proper face decomposition or just average normal.
|
||||
//bool Foam::meshSearch::pointInCell(const point& p, label celli) const
|
||||
//{
|
||||
// if (faceDecomp_)
|
||||
// {
|
||||
// const point& ctr = mesh_.cellCentres()[celli];
|
||||
//
|
||||
// vector dir(p - ctr);
|
||||
// scalar magDir = mag(dir);
|
||||
//
|
||||
// // Check if any faces are hit by ray from cell centre to p.
|
||||
// // If none -> p is in cell.
|
||||
// const labelList& cFaces = mesh_.cells()[celli];
|
||||
//
|
||||
// // Make sure half_ray does not pick up any faces on the wrong
|
||||
// // side of the ray.
|
||||
// scalar oldTol = intersection::setPlanarTol(0.0);
|
||||
//
|
||||
// forAll(cFaces, i)
|
||||
// {
|
||||
// label facei = cFaces[i];
|
||||
//
|
||||
// pointHit inter = mesh_.faces()[facei].ray
|
||||
// (
|
||||
// ctr,
|
||||
// dir,
|
||||
// mesh_.points(),
|
||||
// intersection::HALF_RAY,
|
||||
// intersection::VECTOR
|
||||
// );
|
||||
//
|
||||
// if (inter.hit())
|
||||
// {
|
||||
// scalar dist = inter.distance();
|
||||
//
|
||||
// if (dist < magDir)
|
||||
// {
|
||||
// // Valid hit. Hit face so point is not in cell.
|
||||
// intersection::setPlanarTol(oldTol);
|
||||
//
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// intersection::setPlanarTol(oldTol);
|
||||
//
|
||||
// // No face inbetween point and cell centre so point is inside.
|
||||
// return true;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// const labelList& f = mesh_.cells()[celli];
|
||||
// const labelList& owner = mesh_.faceOwner();
|
||||
// const vectorField& cf = mesh_.faceCentres();
|
||||
// const vectorField& Sf = mesh_.faceAreas();
|
||||
//
|
||||
// forAll(f, facei)
|
||||
// {
|
||||
// label nFace = f[facei];
|
||||
// vector proj = p - cf[nFace];
|
||||
// vector normal = Sf[nFace];
|
||||
// if (owner[nFace] == celli)
|
||||
// {
|
||||
// if ((normal & proj) > 0)
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if ((normal & proj) < 0)
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return true;
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
Foam::label Foam::meshSearch::findNearestCell
|
||||
(
|
||||
const point& location,
|
||||
@ -949,7 +856,6 @@ bool Foam::meshSearch::isInside(const point& p) const
|
||||
}
|
||||
|
||||
|
||||
// Delete all storage
|
||||
void Foam::meshSearch::clearOut()
|
||||
{
|
||||
boundaryTreePtr_.clear();
|
||||
|
||||
Reference in New Issue
Block a user