[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203

Stephane Popinet s.popinet at niwa.co.nz
Fri May 15 02:52:24 UTC 2009


The following commit has been merged in the upstream branch:
commit e1e0d86856147af8f19c4fa2c06f892fd954dae6
Author: Stephane Popinet <s.popinet at niwa.co.nz>
Date:   Wed Aug 3 16:01:18 2005 +1000

    gfs_face_ca was failing in particular cases on 3D meshes
    
    darcs-hash:20050803060118-fbd8f-b7f42f21a155969ee3af881bfb816caa5d00c444.gz

diff --git a/src/solid.c b/src/solid.c
index 5903a7f..4ac74ad 100644
--- a/src/solid.c
+++ b/src/solid.c
@@ -1064,14 +1064,16 @@ void gfs_face_ca (const FttCellFace * face, FttVector * ca)
     m.x = fabs (m.x);
     m.y = fabs (m.y);
     n = m.x + m.y;
-    m.x /= n;
-    m.y /= n;
-    alpha = gfs_line_alpha (&m, f);
-    gfs_line_center (&m, alpha, f, &p);
-    if (s1) p.x = 1. - p.x;
-    if (s2) p.y = 1. - p.y;
-    (&ca->x)[c1] += (p.x - 0.5)*h;
-    (&ca->x)[c2] += (p.y - 0.5)*h;
+    if (n > 0.) {
+      m.x /= n;
+      m.y /= n;
+      alpha = gfs_line_alpha (&m, f);
+      gfs_line_center (&m, alpha, f, &p);
+      if (s1) p.x = 1. - p.x;
+      if (s2) p.y = 1. - p.y;
+      (&ca->x)[c1] += (p.x - 0.5)*h;
+      (&ca->x)[c2] += (p.y - 0.5)*h;
+    }
 #endif /* 3D */
   }
 }

-- 
Gerris Flow Solver



More information about the debian-science-commits mailing list