57static bool hasReadWriteTypes(
const word& readType,
const word& writeType)
59 volatile bool good =
true;
77int main(
int argc,
char *argv[])
81 "Convert between edgeMesh formats"
90 "The input format (default: use file extension)"
96 "The output format (default: use file extension)"
102 "Input geometry scaling factor"
112 if (importName == exportName)
115 <<
"Output file would overwrite input file."
119 const word readFileType
121 args.getOrDefault<
word>(
"read-format", getExtension(importName))
124 const word writeFileType
126 args.getOrDefault<
word>(
"write-format", getExtension(exportName))
130 if (!hasReadWriteTypes(readFileType, writeFileType))
133 <<
"Unsupported file format(s)" <<
nl
139 Info<<
"\nRead edgeMesh " << importName <<
nl;
142 <<
"\nwriting " << exportName;
144 scalar scaleFactor(0);
145 if (
args.readIfPresent(
"scale", scaleFactor) && scaleFactor > 0)
147 Info<<
" with scaling " << scaleFactor <<
endl;
148 mesh.scalePoints(scaleFactor);
155 mesh.write(exportName, writeFileType);
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Extract command arguments and options from the supplied argc and argv parameters.
static void addArgument(const string &argName, const string &usage="")
Append a (mandatory) argument to validArgs.
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.
static void addNote(const string ¬e)
Add extra notes for the usage information.
Mesh data needed to do the Finite Area discretisation.
static bool canWriteType(const word &fileType, bool verbose=false)
Can we write this file format type?
static bool canReadType(const word &fileType, bool verbose=false)
Can we read this file format?
A class for handling file names.
A class for handling words, derived from Foam::string.
messageStream Info
Information stream (stdout output on master, null elsewhere).
Ostream & endl(Ostream &os)
Add newline and flush stream.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a).
Foam::argList args(argc, argv)