39 int main(
int argc,
char *argv[])
48 Info<<
"Reading surface from " << surfFileName <<
endl;
52 word outExtension = outFileName.ext();
57 bool anyZoneRemoved =
false;
59 label iterationNo = 0;
60 label iterationLimit = 10;
62 Info<<
"Splitting off baffle parts " <<
endl;
66 anyZoneRemoved =
false;
77 if (edFaces[i].size() > 2)
79 multipleEdges[i] =
true;
83 label nZones = surf.markZones(multipleEdges, faceZone);
96 for (
label z = 0; z < nZones; z++)
102 if (faceZone[f] == z)
106 if (edFaces[faceEds[f][fe]].size() < 2)
110 anyZoneRemoved =
true;
125 if (faceZone[f] == z)
127 nonBaffle[
f] = keepZone;
128 baffle[
f] = !keepZone;
133 Info<<
" Iteration " << iterationNo <<
endl;
137 if (baffleSurf.
size())
143 +
"." + outExtension;
145 Info<<
" Writing baffle part to " << bafflePartFileName <<
endl;
147 baffleSurf.write(bafflePartFileName);
150 surf = surf.subsetMesh(nonBaffle, pointMap, faceMap);
152 if (iterationNo == iterationLimit)
155 <<
"Iteration limit of " << iterationLimit <<
"reached" <<
endl;
160 }
while (anyZoneRemoved && iterationNo < iterationLimit);
162 Info<<
"Writing new surface to " << outFileName <<
endl;
164 surf.
write(outFileName);
174 if (edFaces[i].size() > 2)
176 multipleEdges[i] =
true;
180 label nZones = surf.markZones(multipleEdges, faceZone);
182 Info<<
"Splitting remaining multiply connected parts" <<
endl;
184 for (
label z = 0; z < nZones; z++)
193 if (faceZone[f] == z)
206 +
"." + outExtension;
208 Info<<
" Writing mulitple part " 209 << z <<
" to " << remainingPartFileName <<
endl;
211 zoneSurf.write(remainingPartFileName);
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A class for handling file names.
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static void noParallel()
Remove the parallel options.
static SLList< string > validArgs
A list of valid (mandatory) arguments.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
A class for handling words, derived from string.
Extract command arguments and options from the supplied argc and argv parameters. ...
word name(const complex &)
Return a string representation of a complex.
#define WarningInFunction
Report a warning using Foam::Warning.
fileName lessExt() const
Return file name without extension (part before last .)
virtual Ostream & write(const token &)=0
Write next token to stream.
triSurface subsetMesh(const boolList &include, labelList &pointMap, labelList &faceMap) const
Return new surface. Returns pointMap, faceMap from.
Triangulated surface description with patch information.
Foam::argList args(argc, argv)
static HashTable< string > validOptions
A list of valid options.