ENH: surfaceFeatures: search start of string

This commit is contained in:
mattijs
2011-04-07 22:35:34 +01:00
parent d22c89db9a
commit 39de49429d

View File

@ -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)