[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203
Stephane Popinet
popinet at users.sf.net
Fri May 15 02:53:44 UTC 2009
The following commit has been merged in the upstream branch:
commit 15c6cfa1646090b0b647b6048ebde7e19979c302
Author: Stephane Popinet <popinet at users.sf.net>
Date: Sat Oct 21 14:58:40 2006 +1000
Fixed VOF-plane calculation for isolated interface fragments
The zero-norm of the singular interface normal in this case was causing NaN
problems.
darcs-hash:20061021045840-d4795-661d117c2151ca4d5e1e0d94e62391523c871227.gz
diff --git a/src/vof.c b/src/vof.c
index 8b3776c..aea1ad8 100644
--- a/src/vof.c
+++ b/src/vof.c
@@ -767,8 +767,11 @@ gboolean gfs_vof_plane (FttCell * cell, GfsVariable * v,
gfs_youngs_normal (cell, v, m);
for (c = 0; c < FTT_DIMENSION; c++)
n += fabs ((&m->x)[c]);
- for (c = 0; c < FTT_DIMENSION; c++)
- (&m->x)[c] /= n;
+ if (n > 0.)
+ for (c = 0; c < FTT_DIMENSION; c++)
+ (&m->x)[c] /= n;
+ else /* fixme: this is a small fragment */
+ m->x = 1.;
*alpha = gfs_plane_alpha (m, f);
return TRUE;
}
--
Gerris Flow Solver
More information about the debian-science-commits
mailing list