94int main(
int argc,
char *argv[])
98 "Import from various third-party surface formats into surfMesh"
101 argList::noParallel();
102 argList::addArgument(
"surface",
"The input surface file");
104 argList::addBoolOption
107 "Perform some surface checking/cleanup on the input surface"
113 "The surface name when writing (default is 'default')"
119 "Input format (default: use file extension)"
125 "Input geometry scaling factor"
131 "Output geometry scaling factor"
134 argList::addOptionCompat(
"read-scale", {
"scaleIn", 1912});
135 argList::addOptionCompat(
"write-scale", {
"scaleOut", 1912});
137 argList::addOption(
"dict",
"file",
"Alternative coordinateSystems");
143 "The source coordinate system, applied after '-read-scale'",
150 "The target coordinate system, applied before '-write-scale'",
173 const word readFileType
179 if (!meshedSurface::canRead(readFileType,
true))
182 <<
"Unsupported file format(s)" <<
nl
187 scalar scaleFactor(0);
195 IOobject ioCsys = IOobject::selectIO
199 coordinateSystems::typeName,
221 const auto* csPtr = globalCoords.cfind(csName);
226 <<
"Cannot find -from " << csName <<
nl
227 <<
"available coordinateSystems: "
238 const auto* csPtr = globalCoords.cfind(csName);
243 <<
"Cannot find -to " << csName <<
nl
244 <<
"available coordinateSystems: "
253 if (fromCsys && toCsys)
256 <<
"Only allowed '-from' or '-to' option at the moment."
266 Info<<
"scale input " << scaleFactor <<
nl;
267 surf.scalePoints(scaleFactor);
277 Info<<
"move points from coordinate system: "
278 << fromCsys->name() <<
endl;
280 surf.movePoints(tpf());
285 Info<<
"move points to coordinate system: "
286 << toCsys->name() <<
endl;
288 surf.movePoints(tpf());
293 Info<<
"scale output " << scaleFactor <<
nl;
294 surf.scalePoints(scaleFactor);
309 Info<<
"writing surfMesh:\n " << smesh.objectPath() <<
endl;
Defines the attributes of an object for which implicit objectRegistry management is supported,...
bool typeHeaderOk(const bool checkType=true, const bool search=true, const bool verbose=true)
Read header (uses typeFilePath to find file) and check its info.
fileName objectPath() const
The complete path + object name.
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
void size(const label n)
Older name for setAddressableSize.
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.
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.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A centralized collection of named coordinate systems.
A class for handling file names.
An instant of time. Contains the time value and name. Uses Foam::Time when formatting the name.
A surface mesh consisting of general polygon faces that has IO capabilities and a registry for storin...
A class for managing temporary objects.
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.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
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)