From f0f8e973ec83707bde65358a69941682b228b608 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Wed, 12 Dec 2012 19:04:25 +0000 Subject: [PATCH] Added surface area report --- .../surface/surfaceCheck/surfaceCheck.C | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/applications/utilities/surface/surfaceCheck/surfaceCheck.C b/applications/utilities/surface/surfaceCheck/surfaceCheck.C index 532183320..efee5d117 100644 --- a/applications/utilities/surface/surfaceCheck/surfaceCheck.C +++ b/applications/utilities/surface/surfaceCheck/surfaceCheck.C @@ -68,7 +68,7 @@ bool validTri(const bool verbose, const triSurface& surf, const label faceI) return false; } - // duplicate triangle check + // Duplicate triangle check const labelList& fFaces = surf.faceFaces()[faceI]; @@ -187,6 +187,7 @@ int main(int argc, char *argv[]) // ~~~~ triSurface surf(surfFileName); + const pointField& surfPoints = surf.points(); Pout<< "Statistics:" << endl; @@ -199,6 +200,7 @@ int main(int argc, char *argv[]) { labelList regionSize(surf.patches().size(), 0); + scalarField regionSumArea(surf.patches().size(), 0); forAll(surf, faceI) { @@ -208,22 +210,24 @@ int main(int argc, char *argv[]) { WarningIn(args.executable()) << "Triangle " << faceI << " vertices " << surf[faceI] - << " has region " << region << " which is outside the range" - << " of regions 0.." << surf.patches().size()-1 + << " has region " << region + << " which is outside the range" + << " of regions 0.." << surf.patches().size() - 1 << endl; } else { regionSize[region]++; + regionSumArea[region] += surf[faceI].mag(surfPoints); } } - Pout<< "Region\tSize" << nl - << "------\t----" << nl; + Pout<< "Region\tSize\tArea" << nl + << "------\t----\t----" << nl; forAll(surf.patches(), patchI) { - Pout<< surf.patches()[patchI].name() << '\t' - << regionSize[patchI] << nl; + Pout<< surf.patches()[patchI].name() << tab + << regionSize[patchI] << tab << regionSumArea[patchI] << nl; } Pout<< nl << endl; }