From 39de49429df2b309983ae263d6bdf5d89c4911bb Mon Sep 17 00:00:00 2001 From: mattijs <mattijs> Date: Thu, 7 Apr 2011 22:35:34 +0100 Subject: [PATCH] ENH: surfaceFeatures: search start of string --- .../surfaceFeatures/surfaceFeatures.C | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/meshTools/triSurface/surfaceFeatures/surfaceFeatures.C b/src/meshTools/triSurface/surfaceFeatures/surfaceFeatures.C index 2639f854c1a..06e97a41a18 100644 --- a/src/meshTools/triSurface/surfaceFeatures/surfaceFeatures.C +++ b/src/meshTools/triSurface/surfaceFeatures/surfaceFeatures.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -263,6 +263,16 @@ Foam::surfaceFeatures::labelScalar Foam::surfaceFeatures::walkSegment label vertI = startPointI; + scalar visitedLength = 0.0; + + label nVisited = 0; + + if (findIndex(featurePoints_, startPointI) >= 0) + { + // Do not walk across feature points + + return labelScalar(nVisited, visitedLength); + } // // Now we have: @@ -284,11 +294,6 @@ Foam::surfaceFeatures::labelScalar Foam::surfaceFeatures::walkSegment unsetVal = currentFeatI; } - - scalar visitedLength = 0.0; - - label nVisited = 0; - do { // Step to next feature edge with value unsetVal @@ -620,8 +625,13 @@ void Foam::surfaceFeatures::trimFeatures if ( - (leftPath.len_ + rightPath.len_ < minLen) - || (leftPath.n_ + rightPath.n_ < minElems) + ( + leftPath.len_ + + rightPath.len_ + + startEdge.mag(surf_.localPoints()) + < minLen + ) + || (leftPath.n_ + rightPath.n_ + 1 < minElems) ) { // Rewalk same route (recognizable by featLines == featI) -- GitLab