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

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


The following commit has been merged in the upstream branch:
commit 46173fab962f93ab2fe95c263236f4ec274b30f7
Author: Stephane Popinet <popinet at users.sf.net>
Date:   Wed May 6 15:58:23 2009 +1000

    Fix for SurfaceBc implementation of moving boundaries
    
    darcs-hash:20090506055823-d4795-5fb421e91dab70a67a9e276c6b363fb4ed27a224.gz

diff --git a/src/domain.c b/src/domain.c
index 71931d9..084b971 100644
--- a/src/domain.c
+++ b/src/domain.c
@@ -1996,12 +1996,16 @@ static void box_locate (GfsBox * box, LocateArgs * a)
  * gfs_domain_locate:
  * @domain: a #GfsDomain.
  * @target: position of the point to look for.
- * @max_depth: maximum depth to consider (-1 means no restriction).
+ * @max_depth: maximum depth to consider (-1 means no restriction, see below for -2).
  *
  * Locates the cell of @domain containing @target. This is done
  * efficiently in log(n) operations by using the topology of the cell
  * trees.
  *
+ * If @max_depth is set to -2, the finest cell containing @target is
+ * returned. This cell is not necessarily a leaf-cell in contrast to
+ * the case where @max_depth is set to -1.
+ *
  * Returns: a #FttCell of @domain containing (boundary included) the
  * point defined by @target or %NULL if @target is not contained in
  * any cell of @domain.  
diff --git a/src/ftt.c b/src/ftt.c
index ad001c6..7e4c9e3 100644
--- a/src/ftt.c
+++ b/src/ftt.c
@@ -1531,12 +1531,16 @@ void ftt_cell_flatten (FttCell * root,
  * ftt_cell_locate:
  * @root: a #FttCell.
  * @target: position of the point to look for.
- * @max_depth: maximum depth to consider (-1 means no restriction).
+ * @max_depth: maximum depth to consider (-1 means no restriction, see below for -2).
  *
  * Locates the cell of the tree defined by @root containing
  * @target. This is done efficiently in log(n) operations by using the
  * topology of the tree.
  *
+ * If @max_depth is set to -2, the finest cell containing @target is
+ * returned. This cell is not necessarily a leaf-cell in contrast to
+ * the case where @max_depth is set to -1.
+ *
  * Returns: a #FttCell of the tree defined by @root and
  * containing (boundary included) the point defined by @target or
  * %NULL if @target is not contained in any cell of @root.  
@@ -1581,7 +1585,7 @@ FttCell * ftt_cell_locate (FttCell * root,
     pos.z += coords[n][2]*size;
 #endif /* 3D */
   } while (!FTT_CELL_IS_DESTROYED (root));
-  return NULL;
+  return max_depth == -2 ? ftt_cell_parent (root) : NULL;
 }
 
 static void bubble_sort (FttCellChildren * child, gdouble * d)
diff --git a/src/moving.c b/src/moving.c
index 6c14fca..6cdd57e 100644
--- a/src/moving.c
+++ b/src/moving.c
@@ -1357,13 +1357,15 @@ static void swap_face_fractions_back (GfsSimulation * sim)
 static void move_vertex (GtsPoint * p, SolidInfo * par)
 { 
   FttVector pos = *((FttVector *) &p->x);
-  FttCell * cell = gfs_domain_locate (GFS_DOMAIN (par->sim), pos, -1);
+  FttCell * cell = gfs_domain_locate (GFS_DOMAIN (par->sim), pos, -2);
   if (cell) {
     gdouble dt = par->sim->advection_params.dt;
     FttComponent c;
     for (c = 0; c < FTT_DIMENSION; c++)
       (&p->x)[c] += surface_value (cell, par->v[c], &pos)*dt;
   }
+  else
+    g_warning ("point %g,%g not in domain", pos.x, pos.y);
 }
 
 static void solid_move_remesh (GfsSolidMoving * solid, GfsSimulation * sim)

-- 
Gerris Flow Solver



More information about the debian-science-commits mailing list