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