From 58d6da27b28e1b90625e4c450f7ae1e13597b53c Mon Sep 17 00:00:00 2001
From: mattijs <m.janssens@opencfd.co.uk>
Date: Thu, 8 May 2008 13:38:54 +0100
Subject: [PATCH] Check for cell found.

---
 src/meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C b/src/meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C
index b9da7468d68..e476bc8348b 100644
--- a/src/meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C
+++ b/src/meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C
@@ -142,7 +142,7 @@ bool Foam::surfaceToCell::differingPointNormals
                     pointToNearest
                 );
 
-            if (pointTriI != cellTriI)
+            if (pointTriI != -1 && pointTriI != cellTriI)
             {
                 scalar cosAngle = normals[pointTriI] & normals[cellTriI];
 
-- 
GitLab