60int main(
int argc,
char *argv[])
64 "Extract boundaries from an OpenFOAM mesh and write in a surface format"
66 argList::noParallel();
67 argList::addArgument(
"output",
"The output surface file");
69 timeSelector::addOptions();
75 "Geometry scaling factor - default is 1"
77 argList::addBoolOption
88 const bool doTriangulate =
args.
found(
"tri");
91 word exportExt = exportName.
ext();
93 if (!meshedSurface::canWriteType(exportExt,
true))
104 runTime.setTime(timeDirs[timeI], timeI);
105 #include "getTimeIndex.H"
109 if (timeI == 0 || state != polyMesh::UNCHANGED)
111 if (state == polyMesh::UNCHANGED)
113 exportName = exportBase +
"." + exportExt;
118 exportBase +
'_' +
runTime.timeName() +
"." + exportExt;
122 surf.scalePoints(scaleFactor);
124 Info<<
"writing " << exportName;
127 Info<<
" triangulated";
131 if (scaleFactor <= 0)
137 Info<<
" with scaling " << scaleFactor <<
endl;
139 surf.
write(exportName);
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
T get(const label index) const
Get a value from the argument at index.
bool found(const word &optName) const
Return true if the named option is found.
T getOrDefault(const word &optName, const T &deflt) const
Get a value from the named option if present, or return default.
A class for handling file names.
fileName lessExt() const
Return file name without extension (part before last .)
readUpdateState
Enumeration defining the state of the mesh after a read update.
A class for handling words, derived from Foam::string.
word ext() const
Return file name extension (part after last .)
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
constexpr char nl
The newline '\n' character (0x0a)
Foam::argList args(argc, argv)
#define forAll(list, i)
Loop across all elements in list.