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;
97 for (
label z = 0; z < nZones; z++)
107 if (edFaces[faceEds[
f][fe]].size() < 2)
111 anyZoneRemoved =
true;
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;
183 Info<<
"Splitting remaining multiply connected parts" <<
endl;
185 for (
label z = 0; z < nZones; 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.
void size(const label)
Override size to be inconsistent with allocated storage.
virtual Ostream & write(const char)=0
Write character.
Extract command arguments and options from the supplied argc and argv parameters.
static HashTable< string > validOptions
A list of valid options.
static SLList< string > validArgs
A list of valid (mandatory) arguments.
A subset of mesh faces organised as a primitive patch.
A class for handling file names.
fileName lessExt() const
Return file name without extension (part before last .)
Triangulated surface description with patch information.
triSurface subsetMesh(const boolList &include, labelList &pointMap, labelList &faceMap) const
Return new surface. Returns pointMap, faceMap from.
A class for handling words, derived from string.
int main(int argc, char *argv[])
#define WarningInFunction
Report a warning using Foam::Warning.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
Foam::argList args(argc, argv)