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\" )'"
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...
labelRange range() const
The start/size range of this zone.
static void addNote(const string ¬e)
Add extra notes for the usage information.
static word defaultName(const label n=-1)
Default patch name: "patch" or "patchN".
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)
Add newline and flush stream.
fileName lessExt() const
Return file name without extension (part before last .)
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="")
Append a (mandatory) argument to validArgs.
messageStream Info
Information stream (uses stdout - output is on the master only)
Extract name (as a word) from an object, typically using its name() method.
labelList findMatching(const StringListType &input, const wordRes &whitelist, const wordRes &blacklist=wordRes(), AccessOp aop=noOp())
Return ids for items with matching names.
label size() const
The size of this zone in the face list.
word ext() const
Return file name extension (part after last .)
FlatOutput< Container > flatOutput(const Container &obj, label len=0)
Global flatOutput function.
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)
A bitSet::set() method for a list of bool.
const word & name() const
The patch/zone name.
Operations on lists of strings.
static void noParallel()
Remove the parallel options.
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Add an option to validOptions with usage information.
Foam::argList args(argc, argv)