39 int main(
int argc,
char *argv[])
49 Info<<
"Reading surface from " << surfFileName <<
endl;
53 word outExtension = outFileName.ext();
58 bool anyZoneRemoved =
false;
60 label iterationNo = 0;
61 label iterationLimit = 10;
63 Info<<
"Splitting off baffle parts " <<
endl;
67 anyZoneRemoved =
false;
78 if (edFaces[i].size() > 2)
80 multipleEdges[i] =
true;
84 label nZones = surf.markZones(multipleEdges, faceZone);
97 for (
label z = 0; z < nZones; z++)
103 if (faceZone[f] == z)
107 if (edFaces[faceEds[f][fe]].size() < 2)
111 anyZoneRemoved =
true;
126 if (faceZone[f] == z)
128 nonBaffle[
f] = keepZone;
129 baffle[
f] = !keepZone;
134 Info<<
" Iteration " << iterationNo <<
endl;
138 if (baffleSurf.
size())
144 +
"." + outExtension;
146 Info<<
" Writing baffle part to " << bafflePartFileName <<
endl;
148 baffleSurf.write(bafflePartFileName);
151 surf = surf.subsetMesh(nonBaffle, pointMap, faceMap);
153 if (iterationNo == iterationLimit)
156 <<
"Iteration limit of " << iterationLimit <<
"reached" <<
endl;
161 }
while (anyZoneRemoved && iterationNo < iterationLimit);
163 Info<<
"Writing new surface to " << outFileName <<
endl;
165 surf.
write(outFileName);
175 if (edFaces[i].size() > 2)
177 multipleEdges[i] =
true;
181 label nZones = surf.markZones(multipleEdges, faceZone);
183 Info<<
"Splitting remaining multiply connected parts" <<
endl;
185 for (
label z = 0; z < nZones; z++)
194 if (faceZone[f] == z)
207 +
"." + outExtension;
209 Info<<
" Writing multiple part " 210 << z <<
" to " << remainingPartFileName <<
endl;
212 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 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.