[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203
Stephane Popinet
popinet at users.sf.net
Fri May 15 02:54:07 UTC 2009
The following commit has been merged in the upstream branch:
commit 43f8e4be9398ca36eeb7465cc43c0518e2e7a095
Author: Stephane Popinet <popinet at users.sf.net>
Date: Fri Mar 16 13:03:01 2007 +1100
Special 2D3 case for interpolate_1D1 upwinding
darcs-hash:20070316020301-d4795-f742f8e0f3d4e1816295ed3014c3a06308844620.gz
diff --git a/src/advection.c b/src/advection.c
index 65002ad..3ab39d4 100644
--- a/src/advection.c
+++ b/src/advection.c
@@ -120,7 +120,7 @@ void gfs_cell_non_advected_face_values (FttCell * cell,
}
}
-#if (FTT_2D || FTT_2D3)
+#if FTT_2D
static gdouble interpolate_1D1 (const FttCell * cell,
FttDirection dright,
@@ -166,6 +166,44 @@ static gdouble interpolate_1D1 (const FttCell * cell,
return s->f[dleft].v;
}
+#elif FTT_2D3
+
+static gdouble interpolate_1D1 (const FttCell * cell,
+ FttDirection dright,
+ FttDirection dup,
+ gdouble x)
+{
+ FttCell * n;
+ FttDirection dleft;
+ GfsStateVector * s;
+
+ g_return_val_if_fail (cell != NULL, 0.);
+
+ dleft = FTT_OPPOSITE_DIRECTION (dright);
+ n = ftt_cell_neighbor (cell, dup);
+ s = GFS_STATE (cell);
+ if (n && !GFS_CELL_IS_BOUNDARY (n)) {
+ /* check for corner refinement violation (topology.fig) */
+ g_assert (ftt_cell_level (n) == ftt_cell_level (cell));
+
+ if (FTT_CELL_IS_LEAF (n))
+ return GFS_STATE (n)->f[dleft].v*x + s->f[dleft].v*(1. - x);
+ else {
+ FttDirection d[FTT_DIMENSION];
+
+ d[0] = dleft;
+ d[1] = FTT_OPPOSITE_DIRECTION (dup);
+ g_assert (d[0] < FTT_NEIGHBORS_2D);
+ g_assert (d[1] < FTT_NEIGHBORS_2D);
+ d[2] = 0;
+ n = ftt_cell_child_corner (n, d);
+ if (n)
+ return (GFS_STATE (n)->f[dleft].v*4.*x + s->f[dleft].v*(3. - 4.*x))/3.;
+ }
+ }
+ return s->f[dleft].v;
+}
+
#else /* FTT_3D */
static gdouble interpolate_2D1 (const FttCell * cell,
--
Gerris Flow Solver
More information about the debian-science-commits
mailing list