From 3c1982e2050ebe5d87edc65929c040991edd2a8c Mon Sep 17 00:00:00 2001 From: Chris Greenshields Date: Fri, 2 Jun 2017 21:02:01 +0100 Subject: [PATCH] surfaceFind: output region/zone number of found face --- .../surface/surfaceFind/surfaceFind.C | 28 +++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/applications/utilities/surface/surfaceFind/surfaceFind.C b/applications/utilities/surface/surfaceFind/surfaceFind.C index f0dd8c39a2..debfe657a7 100644 --- a/applications/utilities/surface/surfaceFind/surfaceFind.C +++ b/applications/utilities/surface/surfaceFind/surfaceFind.C @@ -84,10 +84,10 @@ int main(int argc, char *argv[]) } Info<< "Nearest vertex:" << nl - << " index :" << minIndex << " (in localPoints)" << nl - << " index :" << surf1.meshPoints()[minIndex] + << " index : " << minIndex << " (in localPoints)" << nl + << " index : " << surf1.meshPoints()[minIndex] << " (in points)" << nl - << " coordinates:" << localPoints[minIndex] << nl + << " coordinates: " << localPoints[minIndex] << nl << endl; // @@ -114,15 +114,27 @@ int main(int argc, char *argv[]) const face& f = surf1[minIndex]; Info<< "Face with nearest centre:" << nl - << " index :" << minIndex << nl - << " centre :" << f.centre(points) << nl - << " face :" << f << nl - << " vertex coords:\n"; + << " index : " << minIndex << nl + << " centre : " << f.centre(points) << nl + << " face : " << f << nl + << " vertex coords:" << endl; + forAll(f, fp) { - Info<< " " << points[f[fp]] << "\n"; + Info<< " " << points[f[fp]] << nl; } + const List& surfZones = surf1.surfZones(); + label surfZone = -1; + forAll(surfZones, zonei) + { + if (minIndex >= surfZones[zonei].start()) + { + surfZone = zonei; + } + } + Info<< " zone/region : " << surfZone << endl; + Info<< nl << "End\n" << endl;