From 523f8d6915a1eecd552deea43e259340dd7ee0c5 Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 6 Dec 2011 21:16:12 +0000 Subject: [PATCH] BUG: GeometricBoundaryField: handle patch groups --- .../GeometricField/GeometricBoundaryField.C | 38 +++++++++---------- src/OpenFOAM/meshes/polyMesh/polyMesh.C | 8 ++-- .../motorBike/system/snappyHexMeshDict | 8 ++++ 3 files changed, 31 insertions(+), 23 deletions(-) diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C index e80da7c9ca..0b2a45c473 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C +++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C @@ -249,7 +249,7 @@ GeometricBoundaryField } - // Check for groups first. (using non-wild card entries of dictionaries) + // Patch or patch-groups. (using non-wild card entries of dictionaries) forAllConstIter(dictionary, dict, iter) { if (iter().isDict()) @@ -277,12 +277,12 @@ GeometricBoundaryField } } - // Check for explicit patch overrides + // Check for wildcard patch overrides forAll(bmesh_, patchi) { - if (bmesh_[patchi].type() == emptyPolyPatch::typeName) + if (!this->set(patchi)) { - if (!this->set(patchi)) + if (bmesh_[patchi].type() == emptyPolyPatch::typeName) { this->set ( @@ -295,23 +295,23 @@ GeometricBoundaryField ) ); } - } - else - { - bool found = dict.found(bmesh_[patchi].name()); - - if (found) + else { - this->set - ( - patchi, - PatchField::New + bool found = dict.found(bmesh_[patchi].name()); + + if (found) + { + this->set ( - bmesh_[patchi], - field, - dict.subDict(bmesh_[patchi].name()) - ) - ); + patchi, + PatchField::New + ( + bmesh_[patchi], + field, + dict.subDict(bmesh_[patchi].name()) + ) + ); + } } } } diff --git a/src/OpenFOAM/meshes/polyMesh/polyMesh.C b/src/OpenFOAM/meshes/polyMesh/polyMesh.C index cbc223c583..960e35ddd4 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMesh.C @@ -703,11 +703,11 @@ void Foam::polyMesh::resetPrimitives { boundary_[patchI] = polyPatch ( - boundary_[patchI].name(), - patchSizes[patchI], - patchStarts[patchI], + boundary_[patchI], + boundary_, patchI, - boundary_ + patchSizes[patchI], + patchStarts[patchI] ); } diff --git a/tutorials/incompressible/simpleFoam/motorBike/system/snappyHexMeshDict b/tutorials/incompressible/simpleFoam/motorBike/system/snappyHexMeshDict index ca4ad66e33..68819f01c4 100644 --- a/tutorials/incompressible/simpleFoam/motorBike/system/snappyHexMeshDict +++ b/tutorials/incompressible/simpleFoam/motorBike/system/snappyHexMeshDict @@ -113,6 +113,14 @@ castellatedMeshControls { // Surface-wise min and max refinement level level (5 6); + + // Optional specification of patch type (default is wall). No + // constraint types (cyclic, symmetry) etc. are allowed. + patchInfo + { + type wall; + inGroups (motorBike); + } } }