93 int main(
int argc,
char *argv[])
97 "Import from various third-party surface formats into surfMesh" 106 "Perform some surface checking/cleanup on the input surface" 112 "The surface name when writing (default is 'default')" 118 "Input format (default: use file extension)" 124 "Input geometry scaling factor" 130 "Output geometry scaling factor" 142 "The source coordinate system, applied after '-read-scale'",
149 "The target coordinate system, applied before '-write-scale'",
172 const word readFileType
181 <<
"Unsupported file format(s)" <<
nl 186 scalar scaleFactor(0);
198 coordinateSystems::typeName,
220 const auto* csPtr = globalCoords.cfind(csName);
225 <<
"Cannot find -from " << csName <<
nl 226 <<
"available coordinateSystems: " 237 const auto* csPtr = globalCoords.cfind(csName);
242 <<
"Cannot find -to " << csName <<
nl 243 <<
"available coordinateSystems: " 252 if (fromCsys && toCsys)
255 <<
"Only allowed '-from' or '-to' option at the moment." 265 Info<<
"scale input " << scaleFactor <<
nl;
266 surf.scalePoints(scaleFactor);
276 Info<<
"move points from coordinate system: " 279 surf.movePoints(tpf());
284 Info<<
"move points to coordinate system: " 287 surf.movePoints(tpf());
292 Info<<
"scale output " << scaleFactor <<
nl;
293 surf.scalePoints(scaleFactor);
308 Info<<
"writing surfMesh:\n " << smesh.objectPath() <<
endl;
point globalPosition(const point &local) const
From local coordinate position to global (cartesian) position.
static void addNote(const string ¬e)
Add extra notes for the usage information.
void size(const label n)
Older name for setAddressableSize.
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 canRead(const fileName &name, bool verbose=false)
Can we read this file format?
constexpr char nl
The newline '\n' character (0x0a)
A centralized collection of named coordinate systems.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static void addBoolOption(const word &optName, const string &usage="", bool advanced=false)
Add a bool option to validOptions with usage information.
static void noParallel()
Remove the parallel options.
static void addOptionCompat(const word &optName, std::pair< const char *, int > compat)
Specify an alias for the option name.
Ignore writing from objectRegistry::writeObject()
T getOrDefault(const word &optName, const T &deflt) const
Get a value from the named option if present, or return default.
fileName objectPath() const
The complete path + object name.
point localPosition(const point &global) const
From global (cartesian) position to local coordinate position.
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.
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Add an option to validOptions with usage information.
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
virtual void setTime(const Time &t)
Reset the time and time-index to those of the given time.
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.
A surface mesh consisting of general polygon faces that has IO capabilities and a registry for storin...
const word & constant() const noexcept
Return constant name.
An instant of time. Contains the time value and name. Uses Foam::Time when formatting the name...
instantList times() const
Search the case for valid time directories.
T get(const label index) const
Get a value from the argument at index.
virtual const word & name() const
Return the name.
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)
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
bool readIfPresent(const word &optName, T &val) const
Read a value from the named option if present.
A class for managing temporary objects.
static autoPtr< T > New(Args &&... args)
Construct autoPtr with forwarding arguments.
Foam::argList args(argc, argv)
Defines the attributes of an object for which implicit objectRegistry management is supported...
bool found(const word &optName) const
Return true if the named option is found.
static IOobject selectIO(const IOobject &io, const fileName &altFile, const word &ioName="")
Return the IOobject, but also consider an alternative file name.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.