[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203
Stephane Popinet
popinet at users.sf.net
Fri May 15 02:55:23 UTC 2009
The following commit has been merged in the upstream branch:
commit 21aac9f9be6e177f591aada586cd72fb14f5fbe6
Author: Stephane Popinet <popinet at users.sf.net>
Date: Fri May 9 17:06:54 2008 +1000
UNDO: gfs_domain_add_variable() takes a class parameter
darcs-hash:20080509070654-d4795-830b6ec4758b6b25c640aac246ec9c7a924e022c.gz
diff --git a/src/domain.c b/src/domain.c
index 5bd7d41..6caa042 100644
--- a/src/domain.c
+++ b/src/domain.c
@@ -141,7 +141,7 @@ static void domain_read (GtsObject ** o, GtsFile * fp)
variables1 = g_strdup (variables);
s = strtok (variables1, ",");
while (s) {
- gfs_domain_add_variable (domain, gfs_variable_class (), s, NULL);
+ gfs_domain_add_variable (domain, s, NULL);
s = strtok (NULL, ",");
}
g_free (variables1);
@@ -2615,7 +2615,6 @@ void gfs_domain_free (GfsDomain * domain, guint i)
/**
* gfs_domain_add_variable:
* @domain: a #GfsDomain.
- * @klass: a #GfsVariableClass.
* @name: the name of the variable to add or %NULL.
* @description: the variable description or %NULL.
*
@@ -2625,16 +2624,14 @@ void gfs_domain_free (GfsDomain * domain, guint i)
* already exists.
*/
GfsVariable * gfs_domain_add_variable (GfsDomain * domain,
- gpointer klass,
const gchar * name,
const gchar * description)
{
GfsVariable * v;
g_return_val_if_fail (domain != NULL, NULL);
- g_return_val_if_fail (klass != NULL, NULL);
- if ((v = gfs_variable_new (klass, domain, name, description)) == NULL)
+ if ((v = gfs_variable_new (gfs_variable_class (), domain, name, description)) == NULL)
return NULL;
domain->variables = g_slist_append (domain->variables, v);
return v;
@@ -2669,7 +2666,7 @@ GfsVariable * gfs_domain_get_or_add_variable (GfsDomain * domain,
v->description = description ? g_strdup (description) : NULL;
}
else
- v = gfs_domain_add_variable (domain, gfs_variable_class (), name, description);
+ v = gfs_domain_add_variable (domain, name, description);
return v;
}
diff --git a/src/domain.h b/src/domain.h
index ce4b113..b0862d5 100644
--- a/src/domain.h
+++ b/src/domain.h
@@ -237,8 +237,7 @@ void gfs_cell_write_binary (const FttCell * cell,
guint gfs_domain_alloc (GfsDomain * domain);
void gfs_domain_free (GfsDomain * domain,
guint i);
-GfsVariable * gfs_domain_add_variable (GfsDomain * domain,
- gpointer klass,
+GfsVariable * gfs_domain_add_variable (GfsDomain * domain,
const gchar * name,
const gchar * description);
GfsVariable * gfs_domain_get_or_add_variable (GfsDomain * domain,
diff --git a/src/event.c b/src/event.c
index 94eeb87..e0d5334 100644
--- a/src/event.c
+++ b/src/event.c
@@ -1448,7 +1448,7 @@ static void gfs_event_stop_read (GtsObject ** o, GtsFile * fp)
s->max = gfs_read_constant (fp, domain);
if (fp->type == GTS_ERROR)
return;
- s->oldv = gfs_domain_add_variable (domain, gfs_variable_class (), NULL, NULL);
+ s->oldv = gfs_domain_add_variable (domain, NULL, NULL);
/* fixme: the lines below are necessary in the general case (e.g. when dealing with a VOF tracer)
* but will crash if s->oldv is not of the same class as s->v.
* s->oldv->fine_coarse = s->v->fine_coarse;
diff --git a/src/ocean.c b/src/ocean.c
index d1f2ee4..be09036 100644
--- a/src/ocean.c
+++ b/src/ocean.c
@@ -787,7 +787,7 @@ static void gfs_ocean_class_init (GfsSimulationClass * klass)
static void gfs_ocean_init (GfsOcean * object)
{
- gfs_domain_add_variable (GFS_DOMAIN (object), gfs_variable_class (), "H", "Depth");
+ gfs_domain_add_variable (GFS_DOMAIN (object), "H", "Depth");
GFS_SIMULATION (object)->approx_projection_params.weighted = 1;
object->layer = g_ptr_array_new ();
new_layer (object);
diff --git a/src/simulation.c b/src/simulation.c
index e8b4635..c31884a 100644
--- a/src/simulation.c
+++ b/src/simulation.c
@@ -815,17 +815,15 @@ static void simulation_init (GfsSimulation * object)
{ NULL, NULL, NULL}
};
- gfs_domain_add_variable (domain, gfs_variable_class (),
- "P", "Approximate projection pressure")->centered = TRUE;
- gfs_domain_add_variable (domain, gfs_variable_class (),
- "Pmac", "MAC projection pressure")->centered = TRUE;
- gfs_variable_set_vector (gfs_domain_add_variable (domain, gfs_variable_class (),
- "U", "x-component of the velocity"), FTT_X);
- gfs_variable_set_vector (gfs_domain_add_variable (domain, gfs_variable_class (),
- "V", "y-component of the velocity"), FTT_Y);
+ gfs_domain_add_variable (domain, "P", "Approximate projection pressure")->centered = TRUE;
+ gfs_domain_add_variable (domain, "Pmac", "MAC projection pressure")->centered = TRUE;
+ gfs_variable_set_vector (gfs_domain_add_variable (domain, "U",
+ "x-component of the velocity"), FTT_X);
+ gfs_variable_set_vector (gfs_domain_add_variable (domain, "V",
+ "y-component of the velocity"), FTT_Y);
#if (!FTT_2D)
- gfs_variable_set_vector (gfs_domain_add_variable (domain, gfs_variable_class (),
- "W", "z-component of the velocity"), FTT_Z);
+ gfs_variable_set_vector (gfs_domain_add_variable (domain, "W",
+ "z-component of the velocity"), FTT_Z);
#endif /* FTT_3D */
GfsDerivedVariableInfo * v = derived_variable;
@@ -1691,8 +1689,7 @@ static void poisson_class_init (GfsSimulationClass * klass)
static void poisson_init (GfsDomain * domain)
{
- gfs_domain_add_variable (domain, gfs_variable_class (),
- "Div", "Right-hand-side of the Poisson equation");
+ gfs_domain_add_variable (domain, "Div", "Right-hand-side of the Poisson equation");
}
GfsSimulationClass * gfs_poisson_class (void)
diff --git a/src/tension.c b/src/tension.c
index afebeb4..5936c1d 100644
--- a/src/tension.c
+++ b/src/tension.c
@@ -145,7 +145,7 @@ static void gfs_source_tension_css_read (GtsObject ** o, GtsFile * fp)
for (c = 0; c < FTT_DIMENSION; c++) {
static gchar * name[3] = {"_Tx", "_Ty", "_Tz"};
if ((s->t[c] = gfs_variable_from_name (domain->variables, name[c])) == NULL)
- s->t[c] = gfs_domain_add_variable (domain, gfs_variable_class (), name[c], NULL);
+ s->t[c] = gfs_domain_add_variable (domain, name[c], NULL);
}
}
--
Gerris Flow Solver
More information about the debian-science-commits
mailing list