[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203
Stephane Popinet
s.popinet at niwa.co.nz
Fri May 15 02:51:49 UTC 2009
The following commit has been merged in the upstream branch:
commit 1aad9278198041cdca6b0eec2787dc1f1a8a5a18
Author: Stephane Popinet <s.popinet at niwa.co.nz>
Date: Wed Apr 20 02:33:29 2005 +1000
Bug fix for InitVorticity
darcs-hash:20050419163329-fbd8f-6ea478e381cebffe8c120fa15319f3df12b58fe8.gz
diff --git a/src/event.c b/src/event.c
index 67b306e..7b9e271 100644
--- a/src/event.c
+++ b/src/event.c
@@ -679,6 +679,7 @@ static void multiply (FttCell * cell, GfsVariable * v)
gdouble size = ftt_cell_size (cell);
GFS_STATE (cell)->div *= size*size;
+ GFS_STATE (cell)->g[0] = 0.;
}
static void stream_from_vorticity (GfsDomain * domain,
@@ -692,12 +693,11 @@ static void stream_from_vorticity (GfsDomain * domain,
g_return_if_fail (domain != NULL);
gfs_poisson_coefficients (domain, NULL, 1.);
- gfs_domain_cell_traverse (domain, FTT_PRE_ORDER, FTT_TRAVERSE_LEAFS, -1,
+ gfs_domain_cell_traverse (domain, FTT_PRE_ORDER, FTT_TRAVERSE_ALL, -1,
(FttCellTraverseFunc) multiply, vorticity);
correct_div (domain); /* enforce solvability condition */
gfs_domain_cell_traverse (domain, FTT_PRE_ORDER, FTT_TRAVERSE_LEAFS, -1,
- (FttCellTraverseFunc) gfs_cell_reset,
- stream);
+ (FttCellTraverseFunc) gfs_cell_reset, stream);
gfs_residual (domain, FTT_DIMENSION, FTT_TRAVERSE_LEAFS, -1, stream, vorticity, gfs_res);
norm = gfs_domain_norm_residual (domain, FTT_TRAVERSE_LEAFS, -1, 1.);
maxlevel = gfs_domain_depth (domain);
@@ -711,12 +711,12 @@ static void stream_from_vorticity (GfsDomain * domain,
" (residual: %g)", norm.infty);
}
-static void init_from_streamfunction (FttCell * cell)
+static void init_from_streamfunction (FttCell * cell, GfsVariable * stream)
{
gdouble size = ftt_cell_size (cell);
- GFS_STATE (cell)->u = - gfs_center_gradient (cell, FTT_Y, GFS_GX)/size;
- GFS_STATE (cell)->v = gfs_center_gradient (cell, FTT_X, GFS_GX)/size;
+ GFS_STATE (cell)->u = - gfs_center_gradient (cell, FTT_Y, stream->i)/size;
+ GFS_STATE (cell)->v = gfs_center_gradient (cell, FTT_X, stream->i)/size;
}
static gboolean gfs_init_vorticity_event (GfsEvent * event,
@@ -724,11 +724,10 @@ static gboolean gfs_init_vorticity_event (GfsEvent * event,
{
if ((* GFS_EVENT_CLASS (GTS_OBJECT_CLASS (gfs_init_vorticity_class ())->parent_class)->event)
(event, sim)) {
- stream_from_vorticity (GFS_DOMAIN (sim), gfs_gx, gfs_div, 1e-9);
+ stream_from_vorticity (GFS_DOMAIN (sim), gfs_gy, gfs_div, 1e-9);
gfs_domain_cell_traverse (GFS_DOMAIN (sim),
FTT_PRE_ORDER, FTT_TRAVERSE_LEAFS, -1,
- (FttCellTraverseFunc) init_from_streamfunction,
- NULL);
+ (FttCellTraverseFunc) init_from_streamfunction, gfs_gy);
return TRUE;
}
return FALSE;
--
Gerris Flow Solver
More information about the debian-science-commits
mailing list