58static bool hasReadWriteTypes(
const word& readType,
const word& writeType)
60 volatile bool good =
true;
62 if (!edgeMesh::canReadType(readType,
true))
67 if (!edgeMesh::canWriteType(writeType,
true))
78int main(
int argc,
char *argv[])
82 "Convert between edgeMesh formats"
84 argList::noParallel();
85 argList::addArgument(
"input",
"The input edge file");
86 argList::addArgument(
"output",
"The output edge file");
91 "The input format (default: use file extension)"
97 "The output format (default: use file extension)"
103 "Input geometry scaling factor"
113 if (importName == exportName)
116 <<
"Output file would overwrite input file."
120 const word readFileType
125 const word writeFileType
131 if (!hasReadWriteTypes(readFileType, writeFileType))
134 <<
"Unsupported file format(s)" <<
nl
140 Info<<
"\nRead edgeMesh " << importName <<
nl;
141 mesh.writeStats(Info);
143 <<
"\nwriting " << exportName;
145 scalar scaleFactor(0);
148 Info<<
" with scaling " << scaleFactor <<
endl;
149 mesh.scalePoints(scaleFactor);
156 mesh.write(exportName, writeFileType);
157 mesh.writeStats(Info);
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.
T get(const label index) const
Get a value from the argument at index.
const fileName & rootPath() const noexcept
Return root path.
bool readIfPresent(const word &optName, T &val) const
Read a value from the named option if present.
T getOrDefault(const word &optName, const T &deflt) const
Get a value from the named option if present, or return default.
const fileName & caseName() const noexcept
Return case name (parallel run) or global case (serial run)
Mesh data needed to do the Finite Area discretisation.
A class for handling file names.
A class for handling words, derived from Foam::string.
word ext() const
Return file name extension (part after last .)
word lessExt() const
Return word without extension (part before last .)
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)
Foam::argList args(argc, argv)