78 int main(
int argc,
char *argv[])
82 "Information about surface meshes" 93 "Input geometry scaling factor" 98 "Display area of each face" 103 "Write output in XML format" 119 const bool writeAreas =
args.
found(
"areas");
129 surf.scalePoints(scaling);
132 scalar areaTotal = 0;
136 Info<<
"<?xml version='1.0' encoding='utf-8'?>" <<
nl 137 <<
"<surfaceMeshInfo>" <<
nl 138 <<
"<npoints>" << surf.nPoints() <<
"</npoints>" <<
nl 139 <<
"<nfaces>" << surf.size() <<
"</nfaces>" <<
nl;
143 Info<<
"<areas size='" << surf.size() <<
"'>" <<
nl;
148 Info<<
"nPoints : " << surf.nPoints() <<
nl 149 <<
"nFaces : " << surf.size() <<
nl;
159 const scalar fArea(surf[facei].
mag(surf.points()));
175 Info<<
"<area>" << areaTotal <<
"</area>" <<
nl 176 <<
"</surfaceMeshInfo>" <<
nl;
180 Info<<
"area : " << areaTotal <<
nl;
A surface geometry mesh, in which the surface zone information is conveyed by the 'zoneId' associated...
static void addNote(const string ¬e)
Add extra notes for the usage information.
A class for handling file names.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
constexpr char nl
The newline '\n' character (0x0a)
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.
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.
static void disable() noexcept
Disallow profiling - turns the InfoSwitch off.
#define forAll(list, i)
Loop across all elements in list.
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)
const fileName & rootPath() const noexcept
Return root path.
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)
static void noBanner()
Disable emitting the banner information.
Foam::argList args(argc, argv)
bool found(const word &optName) const
Return true if the named option is found.