mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Rename utility surfaceRemoveBaffles -> surfaceSplitByTopology
This commit is contained in:
@ -1,4 +0,0 @@
|
|||||||
|
|
||||||
surfaceRemoveBaffles.C
|
|
||||||
|
|
||||||
EXE = $(FOAM_APPBIN)/surfaceRemoveBaffles
|
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
surfaceSplitByTopology.C
|
||||||
|
|
||||||
|
EXE = $(FOAM_APPBIN)/surfaceSplitByTopology
|
||||||
@ -48,7 +48,6 @@ int main(int argc, char *argv[])
|
|||||||
fileName surfFileName(args.additionalArgs()[0]);
|
fileName surfFileName(args.additionalArgs()[0]);
|
||||||
Info<< "Reading surface from " << surfFileName << endl;
|
Info<< "Reading surface from " << surfFileName << endl;
|
||||||
|
|
||||||
|
|
||||||
fileName outFileName(args.additionalArgs()[1]);
|
fileName outFileName(args.additionalArgs()[1]);
|
||||||
fileName outFileBaseName = outFileName.lessExt();
|
fileName outFileBaseName = outFileName.lessExt();
|
||||||
word outExtension = outFileName.ext();
|
word outExtension = outFileName.ext();
|
||||||
@ -61,6 +60,8 @@ int main(int argc, char *argv[])
|
|||||||
label iterationNo = 0;
|
label iterationNo = 0;
|
||||||
label iterationLimit = 10;
|
label iterationLimit = 10;
|
||||||
|
|
||||||
|
Info<< "Splitting off baffle parts " << endl;
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
anyZoneRemoved = false;
|
anyZoneRemoved = false;
|
||||||
@ -151,7 +152,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (iterationNo == iterationLimit)
|
if (iterationNo == iterationLimit)
|
||||||
{
|
{
|
||||||
WarningIn("surfaceRemoveBaffles")
|
WarningIn("surfaceSplitByTopology")
|
||||||
<< "Iteration limit of " << iterationLimit << "reached" << endl;
|
<< "Iteration limit of " << iterationLimit << "reached" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -163,6 +164,54 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
surf.write(outFileName);
|
surf.write(outFileName);
|
||||||
|
|
||||||
|
labelList faceZone;
|
||||||
|
|
||||||
|
const labelListList& edFaces = surf.edgeFaces();
|
||||||
|
|
||||||
|
boolList multipleEdges(edFaces.size(), false);
|
||||||
|
|
||||||
|
forAll(multipleEdges, i)
|
||||||
|
{
|
||||||
|
if (edFaces[i].size() > 2)
|
||||||
|
{
|
||||||
|
multipleEdges[i] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
label nZones = surf.markZones(multipleEdges, faceZone);
|
||||||
|
|
||||||
|
Info<< "Splitting remaining multiply connected parts" << endl;
|
||||||
|
|
||||||
|
for (label z = 0; z < nZones; z++)
|
||||||
|
{
|
||||||
|
|
||||||
|
boolList include(faceZone.size(), false);
|
||||||
|
labelList pointMap;
|
||||||
|
labelList faceMap;
|
||||||
|
|
||||||
|
forAll(faceZone, f)
|
||||||
|
{
|
||||||
|
if (faceZone[f] == z)
|
||||||
|
{
|
||||||
|
include[f] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
triSurface zoneSurf = surf.subsetMesh(include, pointMap, faceMap);
|
||||||
|
|
||||||
|
|
||||||
|
fileName remainingPartFileName =
|
||||||
|
outFileBaseName
|
||||||
|
+ "_multiplePart_"
|
||||||
|
+ name(z)
|
||||||
|
+ "." + outExtension;
|
||||||
|
|
||||||
|
Info<< " Writing mulitple part "
|
||||||
|
<< z << " to " << remainingPartFileName << endl;
|
||||||
|
|
||||||
|
zoneSurf.write(remainingPartFileName);
|
||||||
|
}
|
||||||
|
|
||||||
Info << "End\n" << endl;
|
Info << "End\n" << endl;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
Reference in New Issue
Block a user