57 static bool hasReadWriteTypes(
const word& readType,
const word& writeType)
59 volatile bool good =
true;
77 int 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
124 const word writeFileType
130 if (!hasReadWriteTypes(readFileType, writeFileType))
133 <<
"Unsupported file format(s)" <<
nl 139 Info<<
"\nRead edgeMesh " << importName <<
nl;
142 <<
"\nwriting " << exportName;
144 scalar scaleFactor(0);
147 Info<<
" with scaling " << scaleFactor <<
endl;
148 mesh.scalePoints(scaleFactor);
static void addNote(const string ¬e)
Add extra notes for the usage information.
A class for handling file names.
errorManipArg< error, int > exit(error &err, const int errNo=1)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
static bool canReadType(const word &fileType, bool verbose=false)
Can we read this file format?
virtual bool write(const bool valid=true) const
Write mesh using IO settings from time.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static void noParallel()
Remove the parallel options.
T getOrDefault(const word &optName, const T &deflt) const
Get a value from the named option if present, or return default.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
word ext() const
Return file name extension (part after last .)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
bool has_ext() const
Various checks for extensions.
A class for handling words, derived from Foam::string.
Extract command arguments and options from the supplied argc and argv parameters. ...
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Add an option to validOptions with usage information.
const fileName & caseName() const noexcept
Return case name (parallel run) or global case (serial run)
static bool canWriteType(const word &fileType, bool verbose=false)
Can we write this file format type?
const fileName & rootPath() const noexcept
Return root path.
Mesh data needed to do the Finite Area discretisation.
T get(const label index) const
Get a value from the argument at index.
static void addArgument(const string &argName, const string &usage="")
Append a (mandatory) argument to validArgs.
messageStream Info
Information stream (stdout output on master, null elsewhere)
bool readIfPresent(const word &optName, T &val) const
Read a value from the named option if present.
Foam::argList args(argc, argv)