[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203
Stephane Popinet
popinet at users.sf.net
Fri May 15 02:53:12 UTC 2009
The following commit has been merged in the upstream branch:
commit 7d90cf4eae88df9a98697f0fb6d83645f5b94ad4
Author: Stephane Popinet <popinet at users.sf.net>
Date: Sat Apr 22 12:08:47 2006 +1000
GfsFunction understands dx(), dy() and dz()
darcs-hash:20060422020847-d4795-c5b4a6c06f9a42dcc79a81f5d30782f6f5954948.gz
diff --git a/src/utils.c b/src/utils.c
index 4249f93..85035a1 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -403,8 +403,20 @@ static void function_read (GtsObject ** o, GtsFile * fp)
" gpointer data);\n"
"static double Dirichlet = 1.;\n"
"static double Neumann = 0.;\n"
- "double f (FttCell * cell, FttCellFace * face, GfsSimulation * sim) {\n",
- fin);
+ "double f (FttCell * cell, FttCellFace * face, GfsSimulation * sim) {\n"
+ " double dd (const gchar * name, FttComponent c) {\n"
+ " GfsVariable * v = gfs_variable_from_name (GFS_DOMAIN (sim)->variables, name);\n"
+ " if (v == NULL)\n"
+ " return 0.;\n"
+ " g_return_val_if_fail (cell != NULL, 0.);\n"
+ " return gfs_center_gradient (cell, c, v->i)/ftt_cell_size (cell);\n"
+ " }\n"
+ " double dx (const gchar * name) { return dd (name, FTT_X); }\n"
+ " double dy (const gchar * name) { return dd (name, FTT_Y); }\n"
+#if !FTT_2D
+ " double dz (const gchar * name) { return dd (name, FTT_Z); }\n"
+#endif /* 3D */
+ , fin);
i = domain->variables;
while (i) {
if (find_identifier (f->expr->str, GFS_VARIABLE1 (i->data)->name))
--
Gerris Flow Solver
More information about the debian-science-commits
mailing list