Go to the documentation of this file.
48 int main(
int argc,
char *argv[])
52 "Strips any baffle parts of a surface.\n"
53 "A baffle region is one which is reached by walking from an open edge,"
54 " and stopping when a multiply connected edge is reached."
64 Info<<
"Reading surface from " << surfFileName <<
endl;
68 const word outExtension = outFileName.
ext();
73 bool anyZoneRemoved =
false;
75 label iterationNo = 0;
76 label iterationLimit = 10;
78 Info<<
"Splitting off baffle parts " <<
endl;
82 anyZoneRemoved =
false;
89 boolList multipleEdges(edFaces.size(),
false);
93 if (edFaces[i].size() > 2)
95 multipleEdges[i] =
true;
112 for (label z = 0; z <
nZones; z++)
114 bool keepZone =
true;
122 if (edFaces[faceEds[
f][fe]].size() < 2)
126 anyZoneRemoved =
true;
143 nonBaffle[
f] = keepZone;
144 baffle[
f] = !keepZone;
149 Info<<
" Iteration " << iterationNo <<
endl;
153 if (baffleSurf.size())
159 +
"." + outExtension;
161 Info<<
" Writing baffle part to " << bafflePartFileName <<
endl;
163 baffleSurf.
write(bafflePartFileName);
166 surf = surf.subsetMesh(nonBaffle, pointMap,
faceMap);
168 if (iterationNo == iterationLimit)
171 <<
"Iteration limit of " << iterationLimit <<
"reached" <<
endl;
176 }
while (anyZoneRemoved && iterationNo < iterationLimit);
178 Info<<
"Writing new surface to " << outFileName <<
endl;
180 surf.
write(outFileName);
186 boolList multipleEdges(edFaces.size(),
false);
190 if (edFaces[i].size() > 2)
192 multipleEdges[i] =
true;
198 Info<<
"Splitting remaining multiply connected parts" <<
endl;
200 for (label z = 0; z <
nZones; z++)
218 +
"." + outExtension;
220 Info<<
" Writing multiple part "
221 << z <<
" to " << remainingPartFileName <<
endl;
223 zoneSurf.
write(remainingPartFileName);
triSurface subsetMesh(const UList< bool > &include, labelList &pointMap, labelList &faceMap) const
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)
Extract command arguments and options from the supplied argc and argv parameters.
Ostream & endl(Ostream &os)
T get(const label index) const
static void addArgument(const string &argName, const string &usage="")
void write(Ostream &os) const
Triangulated surface description with patch information.
A subset of mesh faces organised as a primitive patch.
static HashTable< string > validOptions
virtual bool write(const token &tok)=0
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
word name(const expressions::valueTypeCode typeCode)
Foam::argList args(argc, argv)
#define WarningInFunction