mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Merge searchableSurface and indexedOctree volumeType
This commit is contained in:
@ -31,6 +31,7 @@ Description
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "triSurface.H"
|
||||
#include "triSurfaceSearch.H"
|
||||
#include "argList.H"
|
||||
#include "OFstream.H"
|
||||
#include "IFstream.H"
|
||||
@ -40,6 +41,7 @@ Description
|
||||
#include "indexedOctree.H"
|
||||
#include "treeDataTriSurface.H"
|
||||
#include "Random.H"
|
||||
#include "volumeType.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
@ -242,26 +244,16 @@ int main(int argc, char *argv[])
|
||||
// Read surface to select on
|
||||
triSurface selectSurf(surfName);
|
||||
|
||||
// bb of surface
|
||||
treeBoundBox bb(selectSurf.localPoints());
|
||||
|
||||
// Random number generator
|
||||
Random rndGen(354543);
|
||||
|
||||
// search engine
|
||||
indexedOctree<treeDataTriSurface> selectTree
|
||||
triSurfaceSearch searchSelectSurf
|
||||
(
|
||||
treeDataTriSurface
|
||||
(
|
||||
selectSurf,
|
||||
indexedOctree<treeDataTriSurface>::perturbTol()
|
||||
),
|
||||
bb.extend(rndGen, 1e-4), // slightly randomize bb
|
||||
8, // maxLevel
|
||||
10, // leafsize
|
||||
3.0 // duplicity
|
||||
selectSurf,
|
||||
indexedOctree<treeDataTriSurface>::perturbTol(),
|
||||
8
|
||||
);
|
||||
|
||||
const indexedOctree<treeDataTriSurface>& selectTree =
|
||||
searchSelectSurf.tree();
|
||||
|
||||
// Check if face (centre) is in outside or inside.
|
||||
forAll(facesToSubset, faceI)
|
||||
{
|
||||
@ -269,14 +261,13 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
const point fc(surf1[faceI].centre(surf1.points()));
|
||||
|
||||
indexedOctree<treeDataTriSurface>::volumeType t =
|
||||
selectTree.getVolumeType(fc);
|
||||
volumeType t = selectTree.getVolumeType(fc);
|
||||
|
||||
if
|
||||
(
|
||||
outside
|
||||
? (t == indexedOctree<treeDataTriSurface>::OUTSIDE)
|
||||
: (t == indexedOctree<treeDataTriSurface>::INSIDE)
|
||||
? (t == volumeType::OUTSIDE)
|
||||
: (t == volumeType::INSIDE)
|
||||
)
|
||||
{
|
||||
facesToSubset[faceI] = true;
|
||||
|
||||
Reference in New Issue
Block a user