ENH: surfaceFeatures: special case for minCos=1

This commit is contained in:
mattijs
2012-05-29 10:37:56 +01:00
parent d061a8350b
commit fdeaf393d7

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -217,6 +217,9 @@ void Foam::surfaceFeatures::classifyFeatureAngles
const vectorField& faceNormals = surf_.faceNormals(); const vectorField& faceNormals = surf_.faceNormals();
const pointField& points = surf_.points(); const pointField& points = surf_.points();
// Special case: minCos=1
bool selectAll = (mag(minCos-1.0) < SMALL);
forAll(edgeFaces, edgeI) forAll(edgeFaces, edgeI)
{ {
const labelList& eFaces = edgeFaces[edgeI]; const labelList& eFaces = edgeFaces[edgeI];
@ -235,18 +238,19 @@ void Foam::surfaceFeatures::classifyFeatureAngles
{ {
edgeStat[edgeI] = REGION; edgeStat[edgeI] = REGION;
} }
else else if
(
selectAll
|| ((faceNormals[face0] & faceNormals[face1]) < minCos)
)
{ {
if ((faceNormals[face0] & faceNormals[face1]) < minCos)
{
// Check if convex or concave by looking at angle // Check if convex or concave by looking at angle
// between face centres and normal // between face centres and normal
vector f0Tof1 = vector f0Tof1 =
surf_[face1].centre(points) surf_[face1].centre(points)
- surf_[face0].centre(points); - surf_[face0].centre(points);
if ((f0Tof1 & faceNormals[face0]) > 0.0) if ((f0Tof1 & faceNormals[face0]) >= 0.0)
{ {
edgeStat[edgeI] = INTERNAL; edgeStat[edgeI] = INTERNAL;
} }
@ -258,7 +262,6 @@ void Foam::surfaceFeatures::classifyFeatureAngles
} }
} }
} }
}
// Returns next feature edge connected to pointI with correct value. // Returns next feature edge connected to pointI with correct value.