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

Stephane Popinet popinet at users.sf.net
Fri May 15 02:55:49 UTC 2009


The following commit has been merged in the upstream branch:
commit 9b09b9877b1563a4d3d36679d0845b5569abd4d1
Author: Stephane Popinet <popinet at users.sf.net>
Date:   Wed Oct 22 13:31:41 2008 +1100

    GTS and CGD files take mapping into account
    
    darcs-hash:20081022023141-d4795-572fc838be7833ed947ea8afa34955d0dbaa6c79.gz

diff --git a/src/surface.c b/src/surface.c
index 576d5cc..97d355a 100644
--- a/src/surface.c
+++ b/src/surface.c
@@ -259,9 +259,15 @@ static void check_solid_surface (GtsSurface * s,
   g_string_free (name, TRUE);
 }
 
+static void point_map (GtsPoint * p, GfsSimulation * sim)
+{
+  gfs_simulation_map (sim, (FttVector *) &p->x);
+}
+
 static void surface_read (GtsObject ** o, GtsFile * fp)
 {
   GfsSurface * surface = GFS_SURFACE (*o);
+  gboolean dimensional = FALSE;
 
   if (fp->type == '(') { /* implicit surface */
     gts_file_next_token (fp);
@@ -326,6 +332,7 @@ static void surface_read (GtsObject ** o, GtsFile * fp)
     check_solid_surface (surface->s, fp->token->str, fp);
     if (fp->type == GTS_ERROR)
       return;
+    dimensional = TRUE;
   }
   gts_file_next_token (fp);
 
@@ -407,6 +414,11 @@ static void surface_read (GtsObject ** o, GtsFile * fp)
       surface->m = i;
     }
   }
+
+  if (dimensional) {
+    g_assert (surface->s);
+    gts_surface_foreach_vertex (surface->s, (GtsFunc) point_map, gfs_object_simulation (*o));
+  }
 }
 
 static void surface_write (GtsObject * o, FILE * fp)
diff --git a/src/utils.c b/src/utils.c
index 2566cf7..4baba51 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -281,6 +281,7 @@ static gdouble interpolated_cgd (GfsFunction * f, FttVector * p)
   gdouble val;
   guint i;
 
+  gfs_simulation_map_inverse (gfs_object_simulation (f), p);
   for (i = 0; i < f->g->N; i++)
     switch (f->index[i]) {
     case 0: vecteur[i] = p->x; break;
@@ -876,6 +877,7 @@ static gdouble interpolated_value (GfsFunction * f, FttVector * p)
   GtsPoint q;
   GtsFace * t;
 
+  gfs_simulation_map_inverse (gfs_object_simulation (f), p);
   q.x = p->x; q.y = p->y;
   t = gts_point_locate (&q, f->s, NULL);
   if (t == NULL)

-- 
Gerris Flow Solver



More information about the debian-science-commits mailing list