[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203
Stephane Popinet
popinet at users.sf.net
Fri May 15 02:53:02 UTC 2009
The following commit has been merged in the upstream branch:
commit c595fdb92cdef8b8e38f56e95a2585c2a7b7789f
Author: Stephane Popinet <popinet at users.sf.net>
Date: Fri Jan 27 21:08:33 2006 +1100
Bug fix for special case of solid boundary
When children mixed cells are all empty, a divide-by-zero would occur when
computing the center of "mass" of the parent cell.
darcs-hash:20060127100833-d4795-65ae6fdad24e0793423388ef0a17a5c7445fb782.gz
diff --git a/src/solid.c b/src/solid.c
index 8c18228..e2ebde7 100644
--- a/src/solid.c
+++ b/src/solid.c
@@ -566,13 +566,19 @@ void gfs_cell_init_solid_fractions_from_children (FttCell * cell)
if (solid == NULL)
GFS_STATE (cell)->solid = solid = g_malloc0 (sizeof (GfsSolidVector));
- solid->a = w/FTT_CELLS;
- solid->cm.x = cm.x/w;
- solid->cm.y = cm.y/w;
- solid->cm.z = cm.z/w;
+ solid->a = w/FTT_CELLS;
+ g_assert (wa > 0.);
solid->ca.x = ca.x/wa;
solid->ca.y = ca.y/wa;
solid->ca.z = ca.z/wa;
+ if (w > 0.) {
+ solid->cm.x = cm.x/w;
+ solid->cm.y = cm.y/w;
+ solid->cm.z = cm.z/w;
+ }
+ else
+ ftt_cell_pos (cell, &solid->cm);
+
for (i = 0; i < FTT_NEIGHBORS; i++) {
guint n = ftt_cell_children_direction (cell, i, &child);
--
Gerris Flow Solver
More information about the debian-science-commits
mailing list