From 011bbf46bc09fe870b5565cfac1d69942bf7a689 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 27 Jan 2010 13:24:06 +0000 Subject: [PATCH] ENH: splitMeshRegions now fills in coupling information in directMapped patch. - added directMapped*Patch constructors with uniform offset - changed splitMeshRegions to use it - adapted chtMultiRegionFoam tutorials --- .../splitMeshRegions/splitMeshRegions.C | 62 ++++++++++++------- .../directMappedPatchBase.C | 21 +++++++ .../directMappedPatchBase.H | 10 +++ .../directMappedPolyPatch.C | 25 ++++++++ .../directMappedPolyPatch.H | 14 +++++ .../directMappedWallPolyPatch.C | 25 ++++++++ .../directMappedWallPolyPatch.H | 14 +++++ .../system/bottomAir/changeDictionaryDict | 23 +------ .../system/heater/changeDictionaryDict | 30 ++------- .../system/leftSolid/changeDictionaryDict | 23 +------ .../system/rightSolid/changeDictionaryDict | 23 +------ .../system/topAir/changeDictionaryDict | 37 ----------- .../system/bottomAir/changeDictionaryDict | 25 -------- .../system/heater/changeDictionaryDict | 32 ---------- .../system/leftSolid/changeDictionaryDict | 25 -------- .../system/rightSolid/changeDictionaryDict | 25 -------- .../system/topAir/changeDictionaryDict | 25 -------- 17 files changed, 164 insertions(+), 275 deletions(-) diff --git a/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C b/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C index 9f378cbfe3..a584789167 100644 --- a/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C +++ b/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C @@ -64,6 +64,7 @@ Description #include "syncTools.H" #include "ReadFields.H" #include "directMappedWallPolyPatch.H" +#include "zeroGradientFvPatchFields.H" using namespace Foam; @@ -164,25 +165,24 @@ void reorderPatchFields(fvMesh& mesh, const labelList& oldToNew) // Adds patch if not yet there. Returns patchID. -template -label addPatch(fvMesh& mesh, const word& patchName) +label addPatch(fvMesh& mesh, const polyPatch& patch) { polyBoundaryMesh& polyPatches = const_cast(mesh.boundaryMesh()); - label patchI = polyPatches.findPatchID(patchName); + label patchI = polyPatches.findPatchID(patch.name()); if (patchI != -1) { - if (isA(polyPatches[patchI])) + if (polyPatches[patchI].type() == patch.type()) { // Already there return patchI; } else { - FatalErrorIn("addPatch(fvMesh&, const word&)") - << "Already have patch " << patchName - << " but of type " << PatchType::typeName + FatalErrorIn("addPatch(fvMesh&, const polyPatch*)") + << "Already have patch " << patch.name() + << " but of type " << patch.type() << exit(FatalError); } } @@ -219,14 +219,12 @@ label addPatch(fvMesh& mesh, const word& patchName) polyPatches.set ( sz, - polyPatch::New + patch.clone ( - PatchType::typeName, - patchName, - 0, // size - startFaceI, - insertPatchI, - polyPatches + polyPatches, + insertPatchI, //index + 0, //size + startFaceI //start ) ); fvPatches.setSize(sz+1); @@ -1086,16 +1084,37 @@ EdgeMap