[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203
Stephane Popinet
popinet at users.sf.net
Fri May 15 02:53:48 UTC 2009
The following commit has been merged in the upstream branch:
commit 7afd226aa0b3f53c1fd4288a27d79b9c70a58125
Author: Stephane Popinet <popinet at users.sf.net>
Date: Tue Nov 28 10:30:19 2006 +1100
VOF plane is defined in full cells
This prevents floating point exceptions when assigning undefined values to VOF
plane variables.
darcs-hash:20061127233019-d4795-3dfa37850416e6cb1a6e7a8dd10b6cf26c63a94a.gz
diff --git a/src/vof.c b/src/vof.c
index f84b290..2e432ae 100644
--- a/src/vof.c
+++ b/src/vof.c
@@ -533,21 +533,19 @@ typedef struct {
static void vof_plane (FttCell * cell, VofParms * p)
{
+ FttComponent c;
FttVector m;
gdouble alpha;
if (GFS_IS_MIXED (cell))
g_assert_not_implemented ();
- if (gfs_vof_plane (cell, p->par->v, &m, &alpha)) {
- FttComponent c;
-
- for (c = 0; c < FTT_DIMENSION; c++) {
- GFS_VARIABLE (cell, p->m[c]->i) = - (&m.x)[c];
- alpha -= (&m.x)[c];
- }
- GFS_VARIABLE (cell, p->alpha->i) = alpha;
+ gfs_vof_plane (cell, p->par->v, &m, &alpha);
+ for (c = 0; c < FTT_DIMENSION; c++) {
+ GFS_VARIABLE (cell, p->m[c]->i) = - (&m.x)[c];
+ alpha -= (&m.x)[c];
}
+ GFS_VARIABLE (cell, p->alpha->i) = alpha;
}
static gdouble fine_fraction (FttCellFace * face, VofParms * p, gdouble un)
@@ -754,6 +752,7 @@ void gfs_vof_coarse_fine (FttCell * parent, GfsVariable * v)
gboolean gfs_vof_plane (FttCell * cell, GfsVariable * v,
FttVector * m, gdouble * alpha)
{
+ FttComponent c;
gdouble f;
g_return_val_if_fail (cell != NULL, FALSE);
@@ -764,10 +763,14 @@ gboolean gfs_vof_plane (FttCell * cell, GfsVariable * v,
f = GFS_VARIABLE (cell, v->i);
THRESHOLD (f);
- if (GFS_IS_FULL (f))
+ if (GFS_IS_FULL (f)) {
+ for (c = 1; c < FTT_DIMENSION; c++)
+ (&m->x)[c] = 0.;
+ m->x = 1.;
+ *alpha = f;
return FALSE;
+ }
else {
- FttComponent c;
gdouble n = 0.;
gfs_youngs_normal (cell, v, m);
--
Gerris Flow Solver
More information about the debian-science-commits
mailing list