[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203
Stephane Popinet
popinet at users.sourceforge.net
Fri May 15 02:51:26 UTC 2009
The following commit has been merged in the upstream branch:
commit 04e23d01d0023c63f6b9f2b63c4be011c5f82093
Author: Stephane Popinet <popinet at users.sourceforge.net>
Date: Wed Nov 17 15:57:12 2004 +1100
In 2D3 ftt_cell_child_corner() now works for all directions (gerris--ocean--0.7--patch-17)
gerris--ocean--0.7--patch-17
Keywords:
darcs-hash:20041117045712-aabb8-6b69f935d4afd9a6f0340d3920630348ebf885af.gz
diff --git a/src/ftt.c b/src/ftt.c
index de4d844..52402a9 100644
--- a/src/ftt.c
+++ b/src/ftt.c
@@ -197,14 +197,18 @@ FttCell * ftt_cell_child_corner (const FttCell * cell,
g_return_val_if_fail (cell != NULL, NULL);
g_return_val_if_fail (!FTT_CELL_IS_LEAF (cell), NULL);
+
g_return_val_if_fail (d[0] < FTT_NEIGHBORS, NULL);
g_return_val_if_fail (d[1] < FTT_NEIGHBORS, NULL);
+
# if FTT_2D3
- if (d[0] >= FTT_NEIGHBORS_2D|| d[1] >= FTT_NEIGHBORS_2D)
- g_assert_not_implemented ();
+ if (d[0] >= FTT_NEIGHBORS_2D)
+ i = index[d[1]][d[2]];
+ else if (d[1] >= FTT_NEIGHBORS_2D)
+ i = index[d[0]][d[2]];
+ else
# endif
-
- i = index[d[0]][d[1]];
+ i = index[d[0]][d[1]];
#else /* FTT_3D */
static gint index[FTT_NEIGHBORS][FTT_NEIGHBORS][FTT_NEIGHBORS] = {
{{-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},
@@ -1313,36 +1317,6 @@ static void cell_traverse_level_non_leafs (FttCell * cell,
}
/**
- * ftt_cell_relative_level:
- * @cell: a #FttCell.
- *
- * Returns: the level of @cell relative to the level of the shallowest of
- * its leaf cells, or zero if @cell is a leaf cell.
- */
-guint ftt_cell_relative_level (FttCell * cell)
-{
- FttOct * children;
- guint n, level = G_MAXINT/2;
-
- g_return_val_if_fail (cell != NULL, 0);
-
- if (FTT_CELL_IS_LEAF (cell))
- return 0;
- children = cell->children;
- for (n = 0; n < FTT_CELLS && level > 0; n++) {
- FttCell * c = &(children->cell[n]);
-
- if (!FTT_CELL_IS_DESTROYED (c)) {
- guint l = ftt_cell_relative_level (c);
-
- if (l < level)
- level = l;
- }
- }
- return level + 1;
-}
-
-/**
* ftt_cell_traverse:
* @root: the root #FttCell of the tree to traverse.
* @order: the order in which the cells are visited - %FTT_PRE_ORDER,
diff --git a/src/ftt.h b/src/ftt.h
index 31c3715..202789e 100644
--- a/src/ftt.h
+++ b/src/ftt.h
@@ -382,17 +382,17 @@ FttCell * ftt_cell_child_corner (const FttCell * cell,
g_return_val_if_fail (cell != NULL, NULL);
g_return_val_if_fail (!FTT_CELL_IS_LEAF (cell), NULL);
- g_assert (d[0] < FTT_NEIGHBORS);
- g_assert (d[1] < FTT_NEIGHBORS);
-
g_return_val_if_fail (d[0] < FTT_NEIGHBORS, NULL);
g_return_val_if_fail (d[1] < FTT_NEIGHBORS, NULL);
+
# if FTT_2D3
- if (d[0] >= FTT_NEIGHBORS_2D || d[1] >= FTT_NEIGHBORS_2D)
- g_assert_not_implemented ();
+ if (d[0] >= FTT_NEIGHBORS_2D)
+ i = index[d[1]][d[2]];
+ else if (d[1] >= FTT_NEIGHBORS_2D)
+ i = index[d[0]][d[2]];
+ else
# endif
-
- i = index[d[0]][d[1]];
+ i = index[d[0]][d[1]];
#else /* FTT_3D */
static gint index[FTT_NEIGHBORS][FTT_NEIGHBORS][FTT_NEIGHBORS] = {
{{-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1},
--
Gerris Flow Solver
More information about the debian-science-commits
mailing list