From 1950db74b0277cb519ded0e7fe3729f1fd44a035 Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 20 Aug 2012 21:57:11 +0100 Subject: [PATCH] ENH: snappyHexMesh: allow patch groups in layer specification --- .../layerParameters/layerParameters.C | 289 +++--------------- .../layerParameters/layerParameters.H | 23 +- 2 files changed, 39 insertions(+), 273 deletions(-) diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/layerParameters/layerParameters.C b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/layerParameters/layerParameters.C index d1f66fb6e9..95d9bf0dd4 100644 --- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/layerParameters/layerParameters.C +++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/layerParameters/layerParameters.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,209 +28,14 @@ License #include "unitConversion.H" #include "refinementSurfaces.H" #include "searchableSurfaces.H" -#include "regExp.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // const Foam::scalar Foam::layerParameters::defaultConcaveAngle = 90; -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - -// Read the number of layers from dictionary. Per patch 0 or the number -// of layers. -Foam::labelList Foam::layerParameters::readNumLayers -( - const PtrList& surfaceDicts, - const refinementSurfaces& refineSurfaces, - const labelList& globalToPatch, - const polyBoundaryMesh& boundaryMesh -) -{ - // Per surface the number of layers - labelList globalSurfLayers(surfaceDicts.size()); - // Per surface, per region the number of layers - List > regionSurfLayers(surfaceDicts.size()); - - const labelList& surfaceIndices = refineSurfaces.surfaces(); - - forAll(surfaceDicts, surfI) - { - const dictionary& dict = surfaceDicts[surfI]; - - globalSurfLayers[surfI] = readLabel(dict.lookup("surfaceLayers")); - - if (dict.found("regions")) - { - // Per-region layer information - - PtrList regionDicts(dict.lookup("regions")); - - const wordList& regionNames = - refineSurfaces.geometry()[surfaceIndices[surfI]].regions(); - - forAll(regionDicts, dictI) - { - const dictionary& regionDict = regionDicts[dictI]; - - const word regionName(regionDict.lookup("name")); - - label regionI = findIndex(regionNames, regionName); - - label nLayers = readLabel(regionDict.lookup("surfaceLayers")); - - Info<< " region " << regionName << ':'<< nl - << " surface layers:" << nLayers << nl; - - regionSurfLayers[surfI].insert(regionI, nLayers); - } - } - } - - - // Transfer per surface/region information into patchwise region info - - labelList nLayers(boundaryMesh.size(), 0); - - forAll(surfaceIndices, surfI) - { - const wordList& regionNames = - refineSurfaces.geometry()[surfaceIndices[surfI]].regions(); - - forAll(regionNames, regionI) - { - const word& regionName = regionNames[regionI]; - - label global = refineSurfaces.globalRegion(surfI, regionI); - - label patchI = globalToPatch[global]; - - // Initialise to surface-wise layers - nLayers[patchI] = globalSurfLayers[surfI]; - - // Override with region specific data if available - Map