From 8b75035f291a69ffff0e783b1df7fe7057ecf948 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 29 Nov 2016 22:56:08 +0100 Subject: [PATCH] ENH: change UnsortedMeshedSurface -> meshedSurface for sampledTriSurfaceMesh - all sampled surface types now consistently use the same storage, which allows some more simplifications in the future. - before/after comparison of the sampledTriSurfaceMesh tested with motorbike passenger helmet (serial and parallel). Use the newly added 'keepIds' functionality to retain the original ids, and can also compare them to the original obj file with "GenerateIds" in paraview. --- .../sampledTriSurfaceMesh.C | 292 ++++++++++++------ .../sampledTriSurfaceMesh.H | 25 +- .../sampledTriSurfaceMeshTemplates.C | 8 +- 3 files changed, 224 insertions(+), 101 deletions(-) diff --git a/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C b/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C index 7db0fb783e..3b225adc6a 100644 --- a/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C +++ b/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C @@ -78,6 +78,32 @@ namespace Foam } +// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * // + +void Foam::sampledTriSurfaceMesh::setZoneMap +( + const surfZoneList& zoneLst, + labelList& zoneIds +) +{ + label sz = 0; + forAll(zoneLst, zonei) + { + const surfZone& zn = zoneLst[zonei]; + sz += zn.size(); + } + + zoneIds.setSize(sz); + forAll(zoneLst, zonei) + { + const surfZone& zn = zoneLst[zonei]; + + // Assign sub-zone Ids + SubList