[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203
Stephane Popinet
popinet at users.sf.net
Fri May 15 02:53:46 UTC 2009
The following commit has been merged in the upstream branch:
commit 12d5e9836570e8a091a3acb6beb2c71145bfb309
Author: Stephane Popinet <popinet at users.sf.net>
Date: Fri Nov 3 11:26:59 2006 +1100
Limit on the size of the HF-curvature calculation "stencil"
darcs-hash:20061103002659-d4795-04562a8a3a48eadf3d22b6e2c6426166be966a2a.gz
diff --git a/src/vof.c b/src/vof.c
index 960ff0f..a296fa5 100644
--- a/src/vof.c
+++ b/src/vof.c
@@ -887,6 +887,8 @@ static gdouble fraction (FttVector * p,
return gfs_vof_interpolate (cell, p, level, v);
}
+#define NMAX 10
+
static guint local_height (FttVector * p,
FttVector * origin,
guint level,
@@ -902,7 +904,7 @@ static guint local_height (FttVector * p,
FttVector i = *p;
(&i.x)[c] -= h;
f1 = fraction (&i, level, v);
- while (!GFS_IS_FULL (f1)) {
+ while (!GFS_IS_FULL (f1) && n < NMAX) {
// fprintf (stderr, " f1: %g (%g,%g)\n", f1, i.x, i.y);
*H += f1; n++;
(&i.x)[c] -= h;
@@ -914,7 +916,7 @@ static guint local_height (FttVector * p,
i = *p;
(&i.x)[c] += h;
gdouble f2 = fraction (&i, level, v);
- while (!GFS_IS_FULL (f2)) {
+ while (!GFS_IS_FULL (f2) && n < NMAX) {
// fprintf (stderr, " f2: %g (%g,%g)\n", f2, i.x, i.y);
*H += f2; n++;
(&i.x)[c] += h;
@@ -930,7 +932,7 @@ static guint local_height (FttVector * p,
// fprintf (stderr, " %d %g ", n, *H);
- return n;
+ return n >= NMAX ? 0 : n;
}
static FttComponent orientation (FttVector * m)
--
Gerris Flow Solver
More information about the debian-science-commits
mailing list