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