78int 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"
118 const bool writeXML =
args.found(
"xml");
119 const bool writeAreas =
args.found(
"areas");
125 const scalar scaling =
args.getOrDefault<scalar>(
"scale", -1);
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;
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A surface geometry mesh, in which the surface zone information is conveyed by the 'zoneId' associated...
static bool canRead(const fileName &name, bool verbose=false)
Can we read this file format?
Extract command arguments and options from the supplied argc and argv parameters.
static void noBanner()
Disable emitting the banner information.
static void addArgument(const string &argName, const string &usage="")
Append a (mandatory) argument to validArgs.
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 addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Add an option to validOptions with usage information.
static void addNote(const string ¬e)
Add extra notes for the usage information.
A class for handling file names.
static void disable() noexcept
Disallow profiling - turns the InfoSwitch off.
messageStream Info
Information stream (stdout output on master, null elsewhere).
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
constexpr char nl
The newline '\n' character (0x0a).
Foam::argList args(argc, argv)
#define forAll(list, i)
Loop across all elements in list.