From eab020daa428b6b5dfd6c009ee6cfe928ee08c31 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 20 Nov 2013 13:04:03 +0000 Subject: [PATCH] STYLE: polyMesh: reuse of triPointRef --- src/OpenFOAM/meshes/polyMesh/polyMesh.C | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/OpenFOAM/meshes/polyMesh/polyMesh.C b/src/OpenFOAM/meshes/polyMesh/polyMesh.C index 1f27017968..af15b5edf5 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMesh.C @@ -1378,15 +1378,16 @@ bool Foam::polyMesh::pointInCell nextPointI = f[fp]; } - const point& p0 = points()[pointI]; - const point& p1 = points()[nextPointI]; - const point& p2 = fc; + triPointRef faceTri + ( + points()[pointI], + points()[nextPointI], + fc + ); - vector twoFaceArea = (p1 - p0)^(p2 - p0); - point centre = (p0 + p1 + p2)/3.0; - vector proj = p - centre; + vector proj = p - faceTri.centre(); - if ((twoFaceArea & proj) > 0) + if ((faceTri.normal() & proj) > 0) { return false; }