78int main(
int argc,
char *argv[])
82 "Information about surface meshes"
86 argList::noParallel();
87 argList::addArgument(
"surface",
"The input surface file");
93 "Input geometry scaling factor"
95 argList::addBoolOption
98 "Display area of each face"
100 argList::addBoolOption
103 "Write output in XML format"
105 profiling::disable();
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;
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...
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 found(const word &optName) const
Return true if the named option is found.
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)
A class for handling file names.
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.