mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: extrudeToRegionMesh : generate columns of 1D cells
This commit is contained in:
@ -955,6 +955,12 @@ int main(int argc, char *argv[])
|
|||||||
argList::validArgs.append("faceZones");
|
argList::validArgs.append("faceZones");
|
||||||
argList::validArgs.append("thickness");
|
argList::validArgs.append("thickness");
|
||||||
|
|
||||||
|
Foam::argList::addBoolOption
|
||||||
|
(
|
||||||
|
"oneD",
|
||||||
|
"generate columns of 1D cells"
|
||||||
|
);
|
||||||
|
|
||||||
#include "addRegionOption.H"
|
#include "addRegionOption.H"
|
||||||
#include "addOverwriteOption.H"
|
#include "addOverwriteOption.H"
|
||||||
#include "setRootCase.H"
|
#include "setRootCase.H"
|
||||||
@ -966,6 +972,7 @@ int main(int argc, char *argv[])
|
|||||||
const wordList zoneNames(IStringStream(args.additionalArgs()[1])());
|
const wordList zoneNames(IStringStream(args.additionalArgs()[1])());
|
||||||
scalar thickness = readScalar(IStringStream(args.additionalArgs()[2])());
|
scalar thickness = readScalar(IStringStream(args.additionalArgs()[2])());
|
||||||
bool overwrite = args.optionFound("overwrite");
|
bool overwrite = args.optionFound("overwrite");
|
||||||
|
bool oneD = args.optionFound("oneD");
|
||||||
|
|
||||||
|
|
||||||
Info<< "Extruding zones " << zoneNames
|
Info<< "Extruding zones " << zoneNames
|
||||||
@ -1225,9 +1232,25 @@ int main(int argc, char *argv[])
|
|||||||
label nSide = 0;
|
label nSide = 0;
|
||||||
forAll(zoneSidePatch, zoneI)
|
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";
|
word patchName = faceZones[zoneI].name() + "_" + "side";
|
||||||
|
|
||||||
zoneSidePatch[zoneI] = addPatch<polyPatch>
|
zoneSidePatch[zoneI] = addPatch<polyPatch>
|
||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
@ -1257,6 +1280,8 @@ int main(int argc, char *argv[])
|
|||||||
);
|
);
|
||||||
|
|
||||||
label nInter = 0;
|
label nInter = 0;
|
||||||
|
if (!oneD)
|
||||||
|
{
|
||||||
forAll(zoneZonePatch_min, minZone)
|
forAll(zoneZonePatch_min, minZone)
|
||||||
{
|
{
|
||||||
for (label maxZone = minZone; maxZone < faceZones.size(); maxZone++)
|
for (label maxZone = minZone; maxZone < faceZones.size(); maxZone++)
|
||||||
@ -1273,6 +1298,7 @@ int main(int argc, char *argv[])
|
|||||||
faceZones[maxZone].name()
|
faceZones[maxZone].name()
|
||||||
+ "_to_"
|
+ "_to_"
|
||||||
+ faceZones[minZone].name();
|
+ faceZones[minZone].name();
|
||||||
|
|
||||||
{
|
{
|
||||||
transformDict.set("neighbourPatch", maxToMin);
|
transformDict.set("neighbourPatch", maxToMin);
|
||||||
zoneZonePatch_min[index] =
|
zoneZonePatch_min[index] =
|
||||||
@ -1282,7 +1308,8 @@ int main(int argc, char *argv[])
|
|||||||
minToMax,
|
minToMax,
|
||||||
transformDict
|
transformDict
|
||||||
);
|
);
|
||||||
Info<< zoneZonePatch_min[index] << '\t' << minToMax << nl;
|
Info<< zoneZonePatch_min[index] << '\t' << minToMax
|
||||||
|
<< nl;
|
||||||
nInter++;
|
nInter++;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
@ -1294,13 +1321,15 @@ int main(int argc, char *argv[])
|
|||||||
maxToMin,
|
maxToMin,
|
||||||
transformDict
|
transformDict
|
||||||
);
|
);
|
||||||
Info<< zoneZonePatch_max[index] << '\t' << maxToMin << nl;
|
Info<< zoneZonePatch_max[index] << '\t' << maxToMin
|
||||||
|
<< nl;
|
||||||
nInter++;
|
nInter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Info<< "Added " << nInter << " inter-zone patches." << nl
|
Info<< "Added " << nInter << " inter-zone patches." << nl
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
@ -1323,7 +1352,16 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
labelList& ePatches = extrudeEdgePatches[edgeI];
|
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 zone0 = zoneID[eFaces[0]];
|
||||||
label zone1 = zoneID[eFaces[1]];
|
label zone1 = zoneID[eFaces[1]];
|
||||||
|
|||||||
Reference in New Issue
Block a user