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

Stephane Popinet popinet at users.sourceforge.net
Fri May 15 02:51:20 UTC 2009


The following commit has been merged in the upstream branch:
commit b41a4c3f89f35415c3f9ad0b57368cc5654cd30b
Author: Stephane Popinet <popinet at users.sourceforge.net>
Date:   Mon Nov 1 16:35:18 2004 +1100

    Fixed bug when computing fractions of degenerate intersections (gerris--mainline--0.7--patch-18)
    
    gerris--mainline--0.7--patch-18
    Keywords:
    
    We don't want to use VOF when the normal is undefined (|n|
    
    darcs-hash:20041101053518-aabb8-a309f0f3185582dcb3d03741e789a585554c4257.gz

diff --git a/src/solid.c b/src/solid.c
index 60463a3..4327fc7 100644
--- a/src/solid.c
+++ b/src/solid.c
@@ -393,12 +393,23 @@ static void set_solid_fractions_from_surface (FttCell * cell, GtsSurface * s)
 	(&m.x)[c] = - (&m.x)[c];
 	(&ca.x)[c] = 1. - (&ca.x)[c];
       }
-      (&m.x)[c] += 1e-6;
       n += (&m.x)[c];
     }
-    m.x /= n; m.y /= n; m.z /= n;
-    alpha = m.x*ca.x + m.y*ca.y + m.z*ca.z;
-    solid->a = gfs_plane_volume (&m, alpha, 1.);
+    if (n > 0.) {
+      m.x /= n; m.y /= n; m.z /= n;
+      alpha = m.x*ca.x + m.y*ca.y + m.z*ca.z;
+      solid->a = gfs_plane_volume (&m, alpha, 1.);
+    }
+    else { /* degenerate intersections */
+      solid->a = 0.;
+      for (i = 0; i < FTT_NEIGHBORS; i++)
+	solid->a += solid->s[i];
+      solid->a /= FTT_NEIGHBORS;
+      if (solid->a == 0. || solid->a == 1.) {
+	g_free (solid);
+	GFS_STATE (cell)->solid = NULL;
+      }
+    }
   }
 }
 #endif /* 3D */

-- 
Gerris Flow Solver



More information about the debian-science-commits mailing list