Go to the documentation of this file.
47 int main(
int argc,
char *argv[])
51 "Strips any baffle parts of a surface.\n"
52 "A baffle region is one which is reached by walking from an open edge,"
53 " and stopping when a multiply connected edge is reached."
63 Info<<
"Reading surface from " << surfFileName <<
endl;
67 word outExtension = outFileName.
ext();
72 bool anyZoneRemoved =
false;
74 label iterationNo = 0;
75 label iterationLimit = 10;
77 Info<<
"Splitting off baffle parts " <<
endl;
81 anyZoneRemoved =
false;
88 boolList multipleEdges(edFaces.size(),
false);
92 if (edFaces[i].size() > 2)
94 multipleEdges[i] =
true;
111 for (label z = 0; z <
nZones; z++)
113 bool keepZone =
true;
121 if (edFaces[faceEds[
f][fe]].size() < 2)
125 anyZoneRemoved =
true;
142 nonBaffle[
f] = keepZone;
143 baffle[
f] = !keepZone;
148 Info<<
" Iteration " << iterationNo <<
endl;
152 if (baffleSurf.size())
158 +
"." + outExtension;
160 Info<<
" Writing baffle part to " << bafflePartFileName <<
endl;
162 baffleSurf.
write(bafflePartFileName);
165 surf = surf.subsetMesh(nonBaffle, pointMap,
faceMap);
167 if (iterationNo == iterationLimit)
170 <<
"Iteration limit of " << iterationLimit <<
"reached" <<
endl;
175 }
while (anyZoneRemoved && iterationNo < iterationLimit);
177 Info<<
"Writing new surface to " << outFileName <<
endl;
179 surf.
write(outFileName);
185 boolList multipleEdges(edFaces.size(),
false);
189 if (edFaces[i].size() > 2)
191 multipleEdges[i] =
true;
197 Info<<
"Splitting remaining multiply connected parts" <<
endl;
199 for (label z = 0; z <
nZones; z++)
217 +
"." + outExtension;
219 Info<<
" Writing multiple part "
220 << z <<
" to " << remainingPartFileName <<
endl;
222 zoneSurf.
write(remainingPartFileName);
triSurface subsetMesh(const UList< bool > &include, labelList &pointMap, labelList &faceMap) const
Return a new surface subsetted on the selected faces.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
A class for handling words, derived from Foam::string.
A class for handling file names.
static void addNote(const string ¬e)
Add extra notes for the usage information.
Extract command arguments and options from the supplied argc and argv parameters.
Ostream & endl(Ostream &os)
Add newline and flush stream.
fileName lessExt() const
Return file name without extension (part before last .)
word ext() const
Return file name extension (part after last .)
#define forAll(list, i)
Loop across all elements in list.
static void addArgument(const string &argName, const string &usage="")
Append a (mandatory) argument to validArgs.
void write(Ostream &os) const
Write to Ostream in simple OpenFOAM format.
Triangulated surface description with patch information.
A subset of mesh faces organised as a primitive patch.
messageStream Info
Information stream (uses stdout - output is on the master only)
word name(const complex &c)
Return string representation of complex.
static HashTable< string > validOptions
A list of valid options.
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
static void noParallel()
Remove the parallel options.
Foam::argList args(argc, argv)
#define WarningInFunction
Report a warning using Foam::Warning.