ENH: blockMesh: enable named blocks and mergePatchPairs. Fixes #2088.

This commit is contained in:
mattijs
2021-05-20 16:13:52 +01:00
parent f99ba1adbd
commit 9a3d27e3df

View File

@ -11,10 +11,12 @@
{ {
Info<< "Creating merge patch pairs" << nl << endl; Info<< "Creating merge patch pairs" << nl << endl;
// Create and add point and face zones and mesh modifiers Info<< "Adding point and face zones" << endl;
List<pointZone*> pz(mergePatchPairs.size()); {
List<faceZone*> fz(3*mergePatchPairs.size()); auto& pzs = mesh.pointZones();
List<cellZone*> cz; pzs.clearAddressing();
auto& fzs = mesh.faceZones();
fzs.clearAddressing();
forAll(mergePatchPairs, pairi) forAll(mergePatchPairs, pairi)
{ {
@ -26,11 +28,14 @@
); );
// An empty zone for cut points // An empty zone for cut points
pz[pairi] = new pointZone pzs.append
(
new pointZone
( (
mergeName + "CutPointZone", mergeName + "CutPointZone",
0, pzs.size(),
mesh.pointZones() pzs
)
); );
// Master patch // Master patch
@ -38,13 +43,16 @@
const polyPatch& masterPatch = const polyPatch& masterPatch =
mesh.boundaryMesh()[masterPatchName]; mesh.boundaryMesh()[masterPatchName];
fz[3*pairi] = new faceZone fzs.append
(
new faceZone
( (
mergeName + "MasterZone", mergeName + "MasterZone",
identity(masterPatch.range()), identity(masterPatch.range()),
false, // none are flipped false, // none are flipped
0, fzs.size(),
mesh.faceZones() fzs
)
); );
// Slave patch // Slave patch
@ -52,26 +60,31 @@
const polyPatch& slavePatch = const polyPatch& slavePatch =
mesh.boundaryMesh()[slavePatchName]; mesh.boundaryMesh()[slavePatchName];
fz[3*pairi + 1] = new faceZone fzs.append
(
new faceZone
( (
mergeName + "SlaveZone", mergeName + "SlaveZone",
identity(slavePatch.range()), identity(slavePatch.range()),
false, // none are flipped false, // none are flipped
1, fzs.size(),
mesh.faceZones() fzs
)
); );
// An empty zone for cut faces // An empty zone for cut faces
fz[3*pairi + 2] = new faceZone fzs.append
(
new faceZone
( (
mergeName + "CutFaceZone", mergeName + "CutFaceZone",
2, fzs.size(),
mesh.faceZones() fzs
)
); );
} // end of all merge pairs } // end of all merge pairs
}
Info<< "Adding point and face zones" << endl;
mesh.addZones(pz, fz, cz);
Info<< "Creating attachPolyTopoChanger" << endl; Info<< "Creating attachPolyTopoChanger" << endl;