mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: use boundBox building blocks in misc places
This commit is contained in:
@ -167,14 +167,7 @@ void Foam::backgroundMeshDecomposition::initialRefinement()
|
||||
{
|
||||
if (volumeStatus[celli] == volumeType::UNKNOWN)
|
||||
{
|
||||
treeBoundBox cellBb
|
||||
(
|
||||
mesh_.cells()[celli].points
|
||||
(
|
||||
mesh_.faces(),
|
||||
mesh_.points()
|
||||
)
|
||||
);
|
||||
treeBoundBox cellBb(mesh_.cells()[celli].box(mesh_));
|
||||
|
||||
if (geometry.overlaps(cellBb))
|
||||
{
|
||||
@ -286,14 +279,7 @@ void Foam::backgroundMeshDecomposition::initialRefinement()
|
||||
{
|
||||
if (volumeStatus[celli] == volumeType::UNKNOWN)
|
||||
{
|
||||
treeBoundBox cellBb
|
||||
(
|
||||
mesh_.cells()[celli].points
|
||||
(
|
||||
mesh_.faces(),
|
||||
mesh_.points()
|
||||
)
|
||||
);
|
||||
treeBoundBox cellBb(mesh_.cells()[celli].box(mesh_));
|
||||
|
||||
if (geometry.overlaps(cellBb))
|
||||
{
|
||||
@ -512,14 +498,7 @@ bool Foam::backgroundMeshDecomposition::refineCell
|
||||
|
||||
// const conformationSurfaces& geometry = geometryToConformTo_;
|
||||
|
||||
treeBoundBox cellBb
|
||||
(
|
||||
mesh_.cells()[celli].points
|
||||
(
|
||||
mesh_.faces(),
|
||||
mesh_.points()
|
||||
)
|
||||
);
|
||||
treeBoundBox cellBb(mesh_.cells()[celli].box(mesh_));
|
||||
|
||||
weightEstimate = 1.0;
|
||||
|
||||
|
||||
@ -83,8 +83,7 @@ Foam::searchableBoxFeatures::features() const
|
||||
{
|
||||
autoPtr<extendedFeatureEdgeMesh> features;
|
||||
|
||||
List<vector> faceNormalsList(treeBoundBox::faceNormals);
|
||||
vectorField faceNormals(faceNormalsList);
|
||||
vectorField faceNormals(List<vector>(treeBoundBox::faceNormals));
|
||||
|
||||
vectorField edgeDirections(12);
|
||||
labelListList normalDirections(12);
|
||||
|
||||
@ -29,8 +29,8 @@ License
|
||||
#include "InteractionLists.H"
|
||||
#include "globalIndexAndTransform.H"
|
||||
#include "indexedOctree.H"
|
||||
#include "treeDataFace.H"
|
||||
#include "treeDataCell.H"
|
||||
#include "treeDataFace.H"
|
||||
#include "volFields.H"
|
||||
#include "meshTools.H"
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2018 OpenCFD Ltd.
|
||||
Copyright (C) 2018-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -133,22 +133,10 @@ void Foam::snappyVoxelMeshDriver::isInside
|
||||
}
|
||||
else
|
||||
{
|
||||
const cellList& cells = mesh.cells();
|
||||
const faceList& faces = mesh.faces();
|
||||
const pointField& points = mesh.points();
|
||||
|
||||
for (label celli = 0; celli < mesh.nCells(); celli++)
|
||||
for (const cell& c : mesh.cells())
|
||||
{
|
||||
const cell& cFaces = cells[celli];
|
||||
boundBox cellBb(boundBox::invertedBox);
|
||||
forAll(cFaces, cFacei)
|
||||
{
|
||||
const face& f = faces[cFaces[cFacei]];
|
||||
forAll(f, fp)
|
||||
{
|
||||
cellBb.add(points[f[fp]]);
|
||||
}
|
||||
}
|
||||
const boundBox cellBb(c.box(mesh));
|
||||
|
||||
voxelMeshSearch::fill
|
||||
(
|
||||
isVoxelInMesh,
|
||||
@ -183,11 +171,11 @@ void Foam::snappyVoxelMeshDriver::markSurfaceRefinement
|
||||
const triSurface& ts = refCast<const triSurface>(geom);
|
||||
const pointField& points = ts.points();
|
||||
|
||||
forAll(ts, trii)
|
||||
for (const labelledTri& tri : ts)
|
||||
{
|
||||
label regioni = ts[trii].region();
|
||||
label regioni = tri.region();
|
||||
label globalRegioni = s.regionOffset()[surfi]+regioni;
|
||||
const boundBox triBb(points, ts[trii], false);
|
||||
const boundBox triBb(tri.box(points));
|
||||
|
||||
// Fill cellLevel
|
||||
label level = s.minLevel()[globalRegioni];
|
||||
|
||||
@ -239,31 +239,11 @@ Foam::treeBoundBox Foam::cellCellStencils::inverseDistance::cellBb
|
||||
const label celli
|
||||
)
|
||||
{
|
||||
const cellList& cells = mesh.cells();
|
||||
const faceList& faces = mesh.faces();
|
||||
const pointField& points = mesh.points();
|
||||
|
||||
treeBoundBox bb
|
||||
(
|
||||
vector(GREAT, GREAT, GREAT),
|
||||
vector(-GREAT, -GREAT, -GREAT)
|
||||
);
|
||||
|
||||
const cell& cFaces = cells[celli];
|
||||
|
||||
forAll(cFaces, cFacei)
|
||||
if (mesh.hasCellPoints())
|
||||
{
|
||||
const face& f = faces[cFaces[cFacei]];
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
const point& p = points[f[fp]];
|
||||
|
||||
bb.min() = min(bb.min(), p);
|
||||
bb.max() = max(bb.max(), p);
|
||||
}
|
||||
return treeBoundBox(mesh.points(), mesh.cellPoints(celli));
|
||||
}
|
||||
return bb;
|
||||
return treeBoundBox(mesh.cells()[celli].box(mesh));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user