diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecomposition.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecomposition.C index afb0baa2cf..796dfd807a 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecomposition.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecomposition.C @@ -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; diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/searchableSurfaceFeatures/searchableBoxFeatures.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/searchableSurfaceFeatures/searchableBoxFeatures.C index bfda76b822..a01bf960a5 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/searchableSurfaceFeatures/searchableBoxFeatures.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/searchableSurfaceFeatures/searchableBoxFeatures.C @@ -83,8 +83,7 @@ Foam::searchableBoxFeatures::features() const { autoPtr features; - List faceNormalsList(treeBoundBox::faceNormals); - vectorField faceNormals(faceNormalsList); + vectorField faceNormals(List(treeBoundBox::faceNormals)); vectorField edgeDirections(12); labelListList normalDirections(12); diff --git a/src/lagrangian/basic/InteractionLists/InteractionLists.C b/src/lagrangian/basic/InteractionLists/InteractionLists.C index eb63c6feca..36ccf7184d 100644 --- a/src/lagrangian/basic/InteractionLists/InteractionLists.C +++ b/src/lagrangian/basic/InteractionLists/InteractionLists.C @@ -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" diff --git a/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappyVoxelMeshDriver.C b/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappyVoxelMeshDriver.C index e52c67799b..d962bec77a 100644 --- a/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappyVoxelMeshDriver.C +++ b/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappyVoxelMeshDriver.C @@ -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(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]; diff --git a/src/overset/cellCellStencil/inverseDistance/inverseDistanceCellCellStencil.C b/src/overset/cellCellStencil/inverseDistance/inverseDistanceCellCellStencil.C index 30a998ce21..a78a239fbd 100644 --- a/src/overset/cellCellStencil/inverseDistance/inverseDistanceCellCellStencil.C +++ b/src/overset/cellCellStencil/inverseDistance/inverseDistanceCellCellStencil.C @@ -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)); }