ENH: extrudeToRegionMesh : generate columns of 1D cells

This commit is contained in:
mattijs
2010-08-19 05:18:03 +01:00
parent b8216e22a4
commit 79a12e1dd8

View File

@ -955,6 +955,12 @@ int main(int argc, char *argv[])
argList::validArgs.append("faceZones");
argList::validArgs.append("thickness");
Foam::argList::addBoolOption
(
"oneD",
"generate columns of 1D cells"
);
#include "addRegionOption.H"
#include "addOverwriteOption.H"
#include "setRootCase.H"
@ -966,6 +972,7 @@ int main(int argc, char *argv[])
const wordList zoneNames(IStringStream(args.additionalArgs()[1])());
scalar thickness = readScalar(IStringStream(args.additionalArgs()[2])());
bool overwrite = args.optionFound("overwrite");
bool oneD = args.optionFound("oneD");
Info<< "Extruding zones " << zoneNames
@ -1225,9 +1232,25 @@ int main(int argc, char *argv[])
label nSide = 0;
forAll(zoneSidePatch, zoneI)
{
if (zoneSidePatch[zoneI] > 0)
if (oneD)
{
// Always add empty patches, one per zone.
word patchName = faceZones[zoneI].name() + "_" + "side";
zoneSidePatch[zoneI] = addPatch<emptyPolyPatch>
(
mesh,
patchName
);
Info<< zoneSidePatch[zoneI] << '\t' << patchName << nl;
nSide++;
}
else if (zoneSidePatch[zoneI] > 0)
{
word patchName = faceZones[zoneI].name() + "_" + "side";
zoneSidePatch[zoneI] = addPatch<polyPatch>
(
mesh,
@ -1257,6 +1280,8 @@ int main(int argc, char *argv[])
);
label nInter = 0;
if (!oneD)
{
forAll(zoneZonePatch_min, minZone)
{
for (label maxZone = minZone; maxZone < faceZones.size(); maxZone++)
@ -1273,6 +1298,7 @@ int main(int argc, char *argv[])
faceZones[maxZone].name()
+ "_to_"
+ faceZones[minZone].name();
{
transformDict.set("neighbourPatch", maxToMin);
zoneZonePatch_min[index] =
@ -1282,7 +1308,8 @@ int main(int argc, char *argv[])
minToMax,
transformDict
);
Info<< zoneZonePatch_min[index] << '\t' << minToMax << nl;
Info<< zoneZonePatch_min[index] << '\t' << minToMax
<< nl;
nInter++;
}
{
@ -1294,13 +1321,15 @@ int main(int argc, char *argv[])
maxToMin,
transformDict
);
Info<< zoneZonePatch_max[index] << '\t' << maxToMin << nl;
Info<< zoneZonePatch_max[index] << '\t' << maxToMin
<< nl;
nInter++;
}
}
}
}
}
Info<< "Added " << nInter << " inter-zone patches." << nl
<< endl;
@ -1323,7 +1352,16 @@ int main(int argc, char *argv[])
labelList& ePatches = extrudeEdgePatches[edgeI];
if (eFaces.size() == 2)
if (oneD)
{
nonManifoldEdge[edgeI] = 1;
ePatches.setSize(eFaces.size());
forAll(eFaces, i)
{
ePatches[i] = zoneSidePatch[zoneID[eFaces[i]]];
}
}
else if (eFaces.size() == 2)
{
label zone0 = zoneID[eFaces[0]];
label zone1 = zoneID[eFaces[1]];