From 84e2df49947c6981bc47df436297856663bda822 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 3 Aug 2018 22:40:19 +0200 Subject: [PATCH] ENH: added ZoneMesh indices(), selection() with wordRes matcher - rationalized code dealing with extraction of name or indices from coordinateSystems, polyBoundaryMesh, faBoundaryMesh, fvBoundaryMesh, ZoneMesh to use internal implementations that allow direct searching/matching without building an intermediate list of names. - simpler and more efficient handling of patch group matching. --- .../faceAgglomerate/faceAgglomerate.C | 5 +- .../viewFactorsGen/viewFactorsGen.C | 13 +- .../GeometricField/GeometricBoundaryField.C | 15 +- .../meshes/Identifiers/DynamicID/DynamicID.H | 16 +- .../pointBoundaryMesh/pointBoundaryMesh.C | 19 +- .../pointBoundaryMesh/pointBoundaryMesh.H | 24 +- .../polyBoundaryMesh/polyBoundaryMesh.C | 280 +++++++++-------- .../polyBoundaryMesh/polyBoundaryMesh.H | 23 +- .../polyBoundaryMeshTemplates.C | 8 +- .../processorCyclicPolyPatch.C | 8 +- .../meshes/polyMesh/zones/ZoneMesh/ZoneMesh.C | 256 ++++++++++------ .../meshes/polyMesh/zones/ZoneMesh/ZoneMesh.H | 65 +++- .../meshes/polyMesh/zones/cellZone/cellZone.H | 17 +- .../meshes/polyMesh/zones/faceZone/faceZone.H | 8 +- .../polyMesh/zones/pointZone/pointZone.H | 19 +- .../faMesh/faBoundaryMesh/faBoundaryMesh.C | 283 +++++++++++------- .../faMesh/faBoundaryMesh/faBoundaryMesh.H | 45 ++- .../porosityModel/porosityModel.C | 6 +- .../fvMesh/fvBoundaryMesh/fvBoundaryMesh.C | 34 ++- .../fvMesh/fvBoundaryMesh/fvBoundaryMesh.H | 47 +-- .../patchInteractionDataList.C | 2 +- .../coordinateSystems/coordinateSystems.C | 143 ++++++--- .../coordinateSystems/coordinateSystems.H | 21 +- .../sampledPlane/sampledPlane.C | 5 +- .../plane/surfMeshSamplePlane.C | 2 +- .../radiationModels/solarLoad/solarLoad.C | 3 +- .../radiationModels/viewFactor/viewFactor.C | 8 +- .../multiphaseMangrovesSource.C | 3 +- .../multiphaseMangrovesTurbulenceModel.C | 2 +- 29 files changed, 854 insertions(+), 526 deletions(-) diff --git a/applications/utilities/preProcessing/faceAgglomerate/faceAgglomerate.C b/applications/utilities/preProcessing/faceAgglomerate/faceAgglomerate.C index aade46b54c..e48f7b48e3 100644 --- a/applications/utilities/preProcessing/faceAgglomerate/faceAgglomerate.C +++ b/applications/utilities/preProcessing/faceAgglomerate/faceAgglomerate.C @@ -88,10 +88,9 @@ int main(int argc, char *argv[]) forAllConstIter(dictionary, agglomDict, iter) { - labelList patchids = boundary.findIndices(iter().keyword()); - forAll(patchids, i) + labelList patchids = boundary.indices(iter().keyword()); + for (const label patchi : patchids) { - label patchi = patchids[i]; const polyPatch& pp = boundary[patchi]; if (!pp.coupled()) diff --git a/applications/utilities/preProcessing/viewFactorsGen/viewFactorsGen.C b/applications/utilities/preProcessing/viewFactorsGen/viewFactorsGen.C index 30ec3a8c8d..7d575efa82 100644 --- a/applications/utilities/preProcessing/viewFactorsGen/viewFactorsGen.C +++ b/applications/utilities/preProcessing/viewFactorsGen/viewFactorsGen.C @@ -338,12 +338,11 @@ int main(int argc, char *argv[]) const polyBoundaryMesh& patches = mesh.boundaryMesh(); const polyBoundaryMesh& coarsePatches = coarseMesh.boundaryMesh(); - labelList viewFactorsPatches(patches.findIndices(viewFactorWall)); - forAll(viewFactorsPatches, i) + labelList viewFactorsPatches(patches.indices(viewFactorWall)); + for (const label patchi : viewFactorsPatches) { - label patchI = viewFactorsPatches[i]; - nCoarseFaces += coarsePatches[patchI].size(); - nFineFaces += patches[patchI].size(); + nCoarseFaces += coarsePatches[patchi].size(); + nFineFaces += patches[patchi].size(); } // total number of coarse faces @@ -370,10 +369,8 @@ int main(int argc, char *argv[]) DynamicList