[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203
Stephane Popinet
popinet at users.sf.net
Fri May 15 02:54:03 UTC 2009
The following commit has been merged in the upstream branch:
commit 8104f318113dd6aae7b51a5fa925ca0e04f72f48
Author: Stephane Popinet <popinet at users.sf.net>
Date: Thu Mar 8 08:04:53 2007 +1100
GfsVariablePosition takes an optional 'ref' argument
darcs-hash:20070307210453-d4795-559652f707e337fd78761f7385869f90f89756e3.gz
diff --git a/src/tension.c b/src/tension.c
index 17ccd75..0a67fd4 100644
--- a/src/tension.c
+++ b/src/tension.c
@@ -652,7 +652,11 @@ static void variable_position_read (GtsObject ** o, GtsFile * fp)
GFS_VARIABLE1 (v)->description = g_strjoin (" ", fp->token->str,
"coordinate of the interface defined by tracer",
GFS_VARIABLE_CURVATURE (v)->f->name, NULL);
- gts_file_next_token (fp);
+ gts_file_next_token (fp);
+ if (fp->type == GTS_INT || fp->type == GTS_FLOAT) {
+ v->ref = atof (fp->token->str);
+ gts_file_next_token (fp);
+ }
}
static void variable_position_write (GtsObject * o, FILE * fp)
@@ -662,6 +666,8 @@ static void variable_position_write (GtsObject * o, FILE * fp)
(* GTS_OBJECT_CLASS (gfs_variable_position_class ())->parent_class->write) (o, fp);
fprintf (fp, " %s", v->c == FTT_X ? "x" : v->c == FTT_Y ? "y" : "z");
+ if (v->ref != 0.)
+ fprintf (fp, " %g", v->ref);
}
static void position (FttCell * cell, GfsVariable * v)
@@ -669,7 +675,8 @@ static void position (FttCell * cell, GfsVariable * v)
FttVector p;
if (gfs_vof_center (cell, GFS_VARIABLE_TRACER_VOF (GFS_VARIABLE_CURVATURE (v)->f), &p))
- GFS_VARIABLE (cell, v->i) = (&p.x)[GFS_VARIABLE_POSITION (v)->c];
+ GFS_VARIABLE (cell, v->i) = (&p.x)[GFS_VARIABLE_POSITION (v)->c] -
+ GFS_VARIABLE_POSITION (v)->ref;
else
GFS_VARIABLE (cell, v->i) = G_MAXDOUBLE;
}
diff --git a/src/tension.h b/src/tension.h
index bcdc9cf..6fcbcdd 100644
--- a/src/tension.h
+++ b/src/tension.h
@@ -121,6 +121,7 @@ struct _GfsVariablePosition {
/*< public >*/
FttComponent c;
+ gdouble ref;
};
#define GFS_VARIABLE_POSITION(obj) GTS_OBJECT_CAST (obj,\
--
Gerris Flow Solver
More information about the debian-science-commits
mailing list