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

Stephane Popinet popinet at users.sf.net
Fri May 15 02:53:45 UTC 2009


The following commit has been merged in the upstream branch:
commit 71f3442fb8aa0dd6a72c8f95613ad7c295ab4523
Author: Stephane Popinet <popinet at users.sf.net>
Date:   Thu Nov 2 09:39:24 2006 +1100

    Singular 3D VOF volume calculations use the 2D algorithm
    
    This guarantees exact volume representation.
    
    darcs-hash:20061101223924-d4795-80d1ee3c68585e6f7524cfbe17988fc23e664c48.gz

diff --git a/src/vof.c b/src/vof.c
index e2e31e6..8ddbe91 100644
--- a/src/vof.c
+++ b/src/vof.c
@@ -141,6 +141,17 @@ gdouble gfs_plane_volume (FttVector * m, gdouble alpha)
   guint j;
 
   g_return_val_if_fail (m != NULL, 0.);
+
+  if (m->x == 0.) {
+    n.x = m->y; n.y = m->z;
+    return gfs_line_area (&n, alpha);
+  }
+  if (m->y == 0.) {
+    n.x = m->x; n.y = m->z;
+    return gfs_line_area (&n, alpha);
+  }
+  if (m->z == 0.)
+    return gfs_line_area (m, alpha);
   
   n = *m;
   alpha1 = alpha;
@@ -163,7 +174,6 @@ gdouble gfs_plane_volume (FttVector * m, gdouble alpha)
   if (alpha1 >= n.x + n.y + n.z)
     return 1.;
 
-  n.x += 1e-4; n.y += 1e-4; n.z += 1e-4;
   amax = n.x + n.y + n.z;
 
   md = &n.x;

-- 
Gerris Flow Solver



More information about the debian-science-commits mailing list