[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203

Stephane Popinet popinet at users.sf.net
Fri May 15 02:56:29 UTC 2009


The following commit has been merged in the upstream branch:
commit 6c1d8b1ac15f3be2961b8593946e1f12cd8acc41
Author: Stephane Popinet <popinet at users.sf.net>
Date:   Tue May 12 13:04:30 2009 +1000

    Renamed GfsMovingSimulation to GfsSimulationMoving
    
    darcs-hash:20090512030430-d4795-19a48e37eb68276d16c47efb4f6eae1849c9474d.gz

diff --git a/src/init.c b/src/init.c
index 482a8ff..a1a2c88 100644
--- a/src/init.c
+++ b/src/init.c
@@ -101,7 +101,7 @@ GtsObjectClass ** gfs_classes (void)
     gfs_ocean_class (),
     gfs_advection_class (),
     gfs_poisson_class (),
-    gfs_moving_simulation_class (),
+    gfs_simulation_moving_class (),
     gfs_axi_class (),
     gfs_wave_class (),
     gfs_river_class (),
diff --git a/src/moving.c b/src/moving.c
index f9aed47..b745027 100644
--- a/src/moving.c
+++ b/src/moving.c
@@ -121,7 +121,7 @@ static void moving_cell_init (FttCell * cell, SolidInfo * solid_info)
   GSList * i;
   gint k;
   GfsDomain * domain = GFS_DOMAIN (solid_info->sim);
-  GfsVariable * old_solid_v = GFS_MOVING_SIMULATION (domain)->old_solid;
+  GfsVariable * old_solid_v = GFS_SIMULATION_MOVING (domain)->old_solid;
 
   gfs_cell_init (cell, domain);
 
@@ -151,7 +151,7 @@ static void moving_cell_init (FttCell * cell, SolidInfo * solid_info)
 static void moving_cell_fine_init (FttCell * cell, SolidInfo * solid_info)
 {
   GfsDomain * domain = GFS_DOMAIN(solid_info->sim);
-  GfsVariable * old_solid_v = GFS_MOVING_SIMULATION (domain)->old_solid;
+  GfsVariable * old_solid_v = GFS_SIMULATION_MOVING (domain)->old_solid;
   GfsVariable ** sold2 = solid_info->sold2;
   FttCellChildren child;
   guint n;
@@ -200,7 +200,7 @@ static void remesh_surface_moving (GfsSimulation * sim, GfsSolidMoving * s)
 
   solid_info.sim = sim;
   solid_info.s = s;
-  solid_info.sold2 = GFS_MOVING_SIMULATION (sim)->sold2;
+  solid_info.sold2 = GFS_SIMULATION_MOVING (sim)->sold2;
   solid_info.v = gfs_domain_velocity (domain);
   gfs_domain_traverse_cut (domain, GFS_SOLID (s)->s,
 			   FTT_POST_ORDER, FTT_TRAVERSE_LEAFS | FTT_TRAVERSE_DESTROYED,
@@ -328,7 +328,7 @@ static void redistribute_destroyed_cells_content (FttCell * cell, ReInitParams *
     return;
 
   GfsDomain * domain = p->domain;
-  GfsVariable * old_solid_v = GFS_MOVING_SIMULATION (domain)->old_solid;
+  GfsVariable * old_solid_v = GFS_SIMULATION_MOVING (domain)->old_solid;
   GSList * i;
   FttCell * merged, * next;
   gdouble s1, s2;
@@ -371,7 +371,7 @@ static void redistribute_destroyed_cells_content (FttCell * cell, ReInitParams *
   }
   OLD_SOLID (merged)->a += s1/s2*OLD_SOLID (cell)->a;
   if (GFS_SIMULATION (domain)->advection_params.moving_order == 2)
-    redistribute_old_face (cell, merged, GFS_MOVING_SIMULATION (domain)->old_solid);
+    redistribute_old_face (cell, merged, GFS_SIMULATION_MOVING (domain)->old_solid);
 }
 
 /**
@@ -460,7 +460,7 @@ static void reinit_solid_fractions (GfsSimulation * sim)
 /* see gfs_advection_update() for a description of what this function does */
 static void moving_advection_update (GSList * merged, const GfsAdvectionParams * par)
 {
-  GfsVariable * old_solid_v = GFS_MOVING_SIMULATION (par->v->domain)->old_solid;
+  GfsVariable * old_solid_v = GFS_SIMULATION_MOVING (par->v->domain)->old_solid;
 
   if (merged->next == NULL) { /* cell is not merged */
     FttCell * cell = merged->data;
@@ -618,7 +618,7 @@ static void set_dtmax (FttCell * cell, SolidInfo * p)
   }
 }
 
-static void moving_simulation_set_timestep (GfsSimulation * sim)
+static void simulation_moving_set_timestep (GfsSimulation * sim)
 {
   gdouble dtmax = sim->time.dtmax;
   SolidInfo p;
@@ -663,7 +663,7 @@ static void solid_move_remesh (GfsSolidMoving * solid, GfsSimulation * sim)
 static void move_solids (GfsSimulation * sim)
 {
   GfsDomain * domain = GFS_DOMAIN (sim);
-  GfsVariable * old_solid = GFS_MOVING_SIMULATION (sim)->old_solid;
+  GfsVariable * old_solid = GFS_SIMULATION_MOVING (sim)->old_solid;
   GfsVariable * sold2[FTT_NEIGHBORS];
 
   gfs_domain_cell_traverse (domain, FTT_PRE_ORDER, FTT_TRAVERSE_ALL, -1,
@@ -675,7 +675,7 @@ static void move_solids (GfsSimulation * sim)
       sold2[d] = gfs_domain_add_variable (domain, NULL, NULL);
       sold2[d]->coarse_fine = sold2_fine_init;
     }
-    GFS_MOVING_SIMULATION (sim)->sold2 = sold2;
+    GFS_SIMULATION_MOVING (sim)->sold2 = sold2;
     gfs_domain_cell_traverse (domain, FTT_PRE_ORDER, FTT_TRAVERSE_ALL, -1,
 			      (FttCellTraverseFunc) set_sold2, sim);
   }
@@ -696,7 +696,7 @@ static void move_solids (GfsSimulation * sim)
     FttDirection d;
     for (d = 0; d < FTT_NEIGHBORS; d++)
       gts_object_destroy (GTS_OBJECT (sold2[d]));    
-    GFS_MOVING_SIMULATION (sim)->sold2 = NULL;
+    GFS_SIMULATION_MOVING (sim)->sold2 = NULL;
   }
 }
 
@@ -740,7 +740,7 @@ static void moving_approximate_projection (GfsDomain * domain,
 
 static void moving_divergence_mac (FttCell * cell, DivergenceData * p)
 {
-  GfsVariable * old_solid_v = GFS_MOVING_SIMULATION (p->domain)->old_solid;
+  GfsVariable * old_solid_v = GFS_SIMULATION_MOVING (p->domain)->old_solid;
   gdouble size = ftt_cell_size (cell);
   gdouble a = GFS_STATE (cell)->solid ? GFS_STATE (cell)->solid->a : 1.;
   gdouble olda = OLD_SOLID (cell) ? OLD_SOLID (cell)->a : 1.;
@@ -776,7 +776,7 @@ static void moving_mac_projection (GfsSimulation * sim,
     swap_face_fractions_back (sim);
 }
 
-static void moving_simulation_run (GfsSimulation * sim)
+static void simulation_moving_run (GfsSimulation * sim)
 {
   GfsVariable * p, * pmac, * res = NULL, * g[FTT_DIMENSION], * gmac[FTT_DIMENSION];
   GfsVariable ** gc = sim->advection_params.gc ? g : NULL;
@@ -813,7 +813,7 @@ static void moving_simulation_run (GfsSimulation * sim)
 
   moving_init (sim);
 
-  moving_simulation_set_timestep (sim);
+  simulation_moving_set_timestep (sim);
   if (sim->time.i == 0)
     moving_approximate_projection (domain,
 				   &sim->approx_projection_params,
@@ -875,7 +875,7 @@ static void moving_simulation_run (GfsSimulation * sim)
     sim->time.t = sim->tnext;
     sim->time.i++;
 
-    moving_simulation_set_timestep (sim);
+    simulation_moving_set_timestep (sim);
 
     gts_range_add_value (&domain->timestep, gfs_clock_elapsed (domain->timer) - tstart);
     gts_range_update (&domain->timestep);
@@ -892,9 +892,9 @@ static void moving_simulation_run (GfsSimulation * sim)
   }
 }
 
-static void moving_simulation_class_init (GfsSimulationClass * klass)
+static void simulation_moving_class_init (GfsSimulationClass * klass)
 {
-  klass->run = moving_simulation_run;
+  klass->run = simulation_moving_run;
 }
 
 static void old_solid_cleanup (FttCell * cell, GfsVariable * old_solid_v)
@@ -905,13 +905,13 @@ static void old_solid_cleanup (FttCell * cell, GfsVariable * old_solid_v)
 
 static void none (void) {}
 
-static void moving_simulation_init (GfsDomain * domain)
+static void simulation_moving_init (GfsDomain * domain)
 {
   gfs_domain_add_variable (domain, "div", "Divergence")->centered = TRUE;
 
   /* old_solid will hold a pointer to a GfsSolidVector */
   GfsVariable * old_solid = gfs_domain_add_variable (domain, NULL, NULL); 
-  GFS_MOVING_SIMULATION (domain)->old_solid = old_solid;
+  GFS_SIMULATION_MOVING (domain)->old_solid = old_solid;
   /* pointers need to be "interpolated" correctly (i.e. not at all) */
   old_solid->coarse_fine = (GfsVariableFineCoarseFunc) none;
   old_solid->fine_coarse = (GfsVariableFineCoarseFunc) none;
@@ -923,22 +923,22 @@ static void moving_simulation_init (GfsDomain * domain)
   gfs_variable_set_default_bc (old_solid, bc);
 }
 
-GfsSimulationClass * gfs_moving_simulation_class (void)
+GfsSimulationClass * gfs_simulation_moving_class (void)
 {
   static GfsSimulationClass * klass = NULL;
 
   if (klass == NULL) {
-    GtsObjectClassInfo gfs_moving_simulation_info = {
-      "GfsMovingSimulation",
-      sizeof (GfsMovingSimulation),
+    GtsObjectClassInfo gfs_simulation_moving_info = {
+      "GfsSimulationMoving",
+      sizeof (GfsSimulationMoving),
       sizeof (GfsSimulationClass),
-      (GtsObjectClassInitFunc) moving_simulation_class_init,
-      (GtsObjectInitFunc) moving_simulation_init,
+      (GtsObjectClassInitFunc) simulation_moving_class_init,
+      (GtsObjectInitFunc) simulation_moving_init,
       (GtsArgSetFunc) NULL,
       (GtsArgGetFunc) NULL
     };
     klass = gts_object_class_new (GTS_OBJECT_CLASS (gfs_simulation_class ()), 
-				  &gfs_moving_simulation_info);
+				  &gfs_simulation_moving_info);
   }
 
   return klass;
diff --git a/src/moving.h b/src/moving.h
index 4216676..7ec87ce 100644
--- a/src/moving.h
+++ b/src/moving.h
@@ -49,11 +49,11 @@ GfsEventClass * gfs_solid_moving_class (void);
 #define GFS_IS_SOLID_MOVING(obj)         (gts_object_is_from_class (obj,\
 						 gfs_solid_moving_class ()))
 
-/* GfsMovingSimulation: Header */
+/* GfsSimulationMoving: Header */
 
-typedef struct _GfsMovingSimulation         GfsMovingSimulation;
+typedef struct _GfsSimulationMoving         GfsSimulationMoving;
 
-struct _GfsMovingSimulation {
+struct _GfsSimulationMoving {
   /*< private >*/
   GfsSimulation parent;
 
@@ -61,13 +61,13 @@ struct _GfsMovingSimulation {
   GfsVariable * old_solid, ** sold2;
 };
 
-#define GFS_MOVING_SIMULATION(obj)            GTS_OBJECT_CAST (obj,\
-					         GfsMovingSimulation,\
-					         gfs_moving_simulation_class ())
-#define GFS_IS_MOVING_SIMULATION(obj)         (gts_object_is_from_class (obj,\
-						 gfs_moving_simulation_class ()))
+#define GFS_SIMULATION_MOVING(obj)            GTS_OBJECT_CAST (obj,\
+					         GfsSimulationMoving,\
+					         gfs_simulation_moving_class ())
+#define GFS_IS_SIMULATION_MOVING(obj)         (gts_object_is_from_class (obj,\
+						 gfs_simulation_moving_class ()))
 
-GfsSimulationClass * gfs_moving_simulation_class            (void);
+GfsSimulationClass * gfs_simulation_moving_class            (void);
 
 #ifdef __cplusplus
 }
diff --git a/src/moving2.c b/src/moving2.c
index c72ac60..4d93d8c 100644
--- a/src/moving2.c
+++ b/src/moving2.c
@@ -243,7 +243,7 @@ static double new_solid_old_solid (FttCell * cell, FttDirection d1,
   return -1.;
 }
 
-static void second_order_face_fractions (FttCell * cell, GfsMovingSimulation * sim)
+static void second_order_face_fractions (FttCell * cell, GfsSimulationMoving * sim)
 {
 #ifndef FTT_2D /* 3D */
   g_assert_not_implemented ();
@@ -464,7 +464,7 @@ static void second_order_face_fractions (FttCell * cell, GfsMovingSimulation * s
 	OLD_SOLID (cell)->s[d] = -1.+dto1+dto2;
 }
 
-static void set_sold2 (FttCell * cell, GfsMovingSimulation * sim)
+static void set_sold2 (FttCell * cell, GfsSimulationMoving * sim)
 {
   GfsVariable * old_solid_v = sim->old_solid;
   GfsVariable ** sold2 = sim->sold2;
@@ -555,7 +555,7 @@ static void redistribute_old_face (FttCell * cell, FttCell * merged, GfsVariable
 
 static double face_fraction_half (const FttCellFace * face, const GfsAdvectionParams * par)
 {
-  GfsVariable * old_solid_v = GFS_MOVING_SIMULATION (par->v->domain)->old_solid;
+  GfsVariable * old_solid_v = GFS_SIMULATION_MOVING (par->v->domain)->old_solid;
   if (face->cell && OLD_SOLID (face->cell))
     return OLD_SOLID (face->cell)->s[face->d];
   return 1.;
@@ -704,7 +704,7 @@ static void swap_face_fractions (GfsSimulation * sim)
   GfsDomain * domain = GFS_DOMAIN (sim);
   gfs_domain_cell_traverse (domain, FTT_PRE_ORDER, FTT_TRAVERSE_ALL, -1,
 			    (FttCellTraverseFunc) swap_fractions, 
-			    GFS_MOVING_SIMULATION (sim)->old_solid);
+			    GFS_SIMULATION_MOVING (sim)->old_solid);
   gts_container_foreach (GTS_CONTAINER (domain), (GtsFunc) foreach_box, NULL);
 }
 
@@ -732,5 +732,5 @@ static void swap_face_fractions_back (GfsSimulation * sim)
 {
   gfs_domain_cell_traverse (GFS_DOMAIN (sim), FTT_PRE_ORDER, FTT_TRAVERSE_ALL, -1,
 			    (FttCellTraverseFunc) swap_fractions_back,
-			    GFS_MOVING_SIMULATION (sim)->old_solid);
+			    GFS_SIMULATION_MOVING (sim)->old_solid);
 }
diff --git a/src/timestep.c b/src/timestep.c
index b29179c..8d98c48 100644
--- a/src/timestep.c
+++ b/src/timestep.c
@@ -143,8 +143,8 @@ static void correct_normal_velocity (FttCellFace * face,
  * Assumes that the Poisson weighting coefficients have already been
  * computed using gfs_poisson_coefficients().
  *
- * Also allocates the @g variables (if @g is not %NULL) and fills them
- * with the centered gradient of @p.
+ * Also fills the @g variables (if not %NULL) with the centered
+ * gradient of @p.
  */
 void gfs_correct_normal_velocities (GfsDomain * domain,
 				    guint dimension,
diff --git a/test/hexagon/hexagon.gfs b/test/hexagon/hexagon.gfs
index e99f8de..e8dab9f 100644
--- a/test/hexagon/hexagon.gfs
+++ b/test/hexagon/hexagon.gfs
@@ -31,7 +31,7 @@
 # Required files: hexagon.sh hexagon.gts hexagon.gfv
 # Generated files: error.eps end-2.eps
 #
-2 1 GfsMovingSimulation GfsBox GfsGEdge {} {
+2 1 GfsSimulationMoving GfsBox GfsGEdge {} {
   Time { end = .1875 }
   Refine 7
 

-- 
Gerris Flow Solver



More information about the debian-science-commits mailing list