Go to the documentation of this file.
66 int main(
int argc,
char *argv[])
70 "Write surface mesh regions to separate files"
77 "Specify single patch or multiple patches to extract\n"
78 "Eg, 'top' or '( front \".*back\" )'"
84 "Exclude single or multiple patches (name or regex) from extracting.\n"
85 "Eg, 'outlet' or '( inlet \".*Wall\" )'"
94 const fileName surfBase(surfName.lessExt());
96 const word extension(surfName.ext());
100 <<
"Read surface from " << surfName <<
" ..." <<
nl <<
endl;
106 Info<<
" " << surf.size() <<
" faces with "
107 << zones.size() <<
" zones" <<
nl <<
nl;
110 wordRes includePatches, excludePatches;
136 Info<<
"Writing regions to "
137 << zoneIndices.size() <<
" separate files ..." <<
nl <<
endl;
141 bitSet includeMap(surf.size());
143 for (
const label zonei : zoneIndices)
152 if (patchName.empty())
158 fileName outFile(surfBase +
'_' + patchName +
'.' + extension);
160 Info<<
" Zone " << zonei <<
" (" << zn.
size() <<
" faces) "
162 <<
" to file " << outFile <<
nl;
165 surf.subsetMesh(includeMap).write(outFile);
A class for handling words, derived from Foam::string.
A class for handling file names.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
static void addNote(const string ¬e)
static word defaultName(const label n=-1)
Extract command arguments and options from the supplied argc and argv parameters.
bool readListIfPresent(const word &optName, List< T > &list) const
Ostream & endl(Ostream &os)
T get(const label index) const
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings.
static void addArgument(const string &argName, const string &usage="")
labelList findMatching(const StringListType &input, const wordRes &allow, const wordRes &deny=wordRes(), AccessOp aop=noOp())
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A surface zone on a MeshedSurface.
A List of wordRe with additional matching capabilities.
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type set(const label i, bool val=true)
const word & name() const
Operations on lists of strings.
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Foam::argList args(argc, argv)