From e5892377d82cfbecb2cad5b5b3cd7afe271c7548 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Mon, 27 Sep 2021 14:25:58 +0100 Subject: [PATCH] snappyHexMesh::refinementParameters: Rationalised handling of cell region selection parameters --- .../meshRefinement/meshRefinement.C | 18 +++++----- .../meshRefinement/meshRefinement.H | 11 +++--- .../meshRefinement/meshRefinementBaffles.C | 12 +++---- .../refinementParameters.C | 26 ++++++++------ .../refinementParameters.H | 35 ++++++++++++++++--- .../snappyHexMeshDriver/snappyRefineDriver.C | 18 +++++----- 6 files changed, 75 insertions(+), 45 deletions(-) diff --git a/src/mesh/snappyHexMesh/meshRefinement/meshRefinement.C b/src/mesh/snappyHexMesh/meshRefinement/meshRefinement.C index 6b4639d54e..d7ed8def83 100644 --- a/src/mesh/snappyHexMesh/meshRefinement/meshRefinement.C +++ b/src/mesh/snappyHexMesh/meshRefinement/meshRefinement.C @@ -2125,24 +2125,24 @@ void Foam::meshRefinement::findRegions const polyMesh& mesh, labelList& cellRegion, const vector& perturbVec, - const List& locationsInMesh + const refinementParameters::locations& meshLocations ) { // List of all cells inside any of the regions - // which have a point in the locationsInMesh list + // which have a point in the meshLocations.inside() list PackedBoolList insideCells(mesh.nCells()); - // For each of the locationsInMesh find the corresponding region + // For each of the meshLocations.inside() find the corresponding region // and mark the cells - forAll(locationsInMesh, i) + forAll(meshLocations.inside(), i) { - // Find the region corresponding to the locationsInMesh[i] + // Find the region corresponding to the meshLocations.inside()[i] const label regioni = findRegion ( mesh, cellRegion, perturbVec, - locationsInMesh[i] + meshLocations.inside()[i] ); // Add all the cells in the region to insideCells @@ -2170,7 +2170,7 @@ Foam::autoPtr Foam::meshRefinement::splitMeshRegions ( const labelList& globalToMasterPatch, const labelList& globalToSlavePatch, - const List& locationsInMesh + const refinementParameters::locations& meshLocations ) { // Force calculation of face decomposition (used in findCell) @@ -2189,7 +2189,7 @@ Foam::autoPtr Foam::meshRefinement::splitMeshRegions mesh_, cellRegion, mergeDistance_*vector::one, - locationsInMesh + meshLocations ); // Subset @@ -2218,7 +2218,7 @@ Foam::autoPtr Foam::meshRefinement::splitMeshRegions reduce(nCellsToKeep, sumOp