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

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


The following commit has been merged in the upstream branch:
commit ce0236c6287620b05651acb21b1e57d096c7dfaa
Author: Stephane Popinet <popinet at users.sf.net>
Date:   Sun Jun 8 18:41:49 2008 +1000

    Checks that density is not negative
    
    darcs-hash:20080608084149-d4795-6578ab556e5d09af373deed6e22d502e6a64d823.gz

diff --git a/src/poisson.c b/src/poisson.c
index 815d2df..18b30bc 100644
--- a/src/poisson.c
+++ b/src/poisson.c
@@ -389,7 +389,14 @@ static void poisson_alpha_coeff (FttCellFace * face,
   gdouble v = lambda2[face->d/2]*alpha;
   GfsStateVector * s = GFS_STATE (face->cell);
 
-  g_assert (v > 0.);
+  if (alpha <= 0.) {
+    FttVector p;
+    ftt_face_pos (face, &p);
+    g_log (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR,
+	   "alpha is negative (%g) at face (%g,%g,%g).\n"
+	   "Please check your definition.",
+	   alpha, p.x, p.y, p.z);
+  }
   if (GFS_IS_MIXED (face->cell))
     v *= s->solid->s[face->d];
   s->f[face->d].v = v;
@@ -511,7 +518,14 @@ static void tension_coeff (FttCellFace * face, gpointer * data)
   }
   g_assert (v <= 1e6);
 
-  g_assert (alpha > 0.);
+  if (alpha <= 0.) {
+    FttVector p;
+    ftt_face_pos (face, &p);
+    g_log (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR,
+	   "alpha is negative (%g) at face (%g,%g,%g).\n"
+	   "Please check your definition.",
+	   alpha, p.x, p.y, p.z);
+  }
   v *= alpha;
   if (GFS_IS_MIXED (face->cell))
     v *= s->solid->s[face->d];
@@ -784,6 +798,14 @@ static void diffusion_mixed_coef (FttCell * cell, DiffusionCoeff * c)
   if (GFS_IS_MIXED (cell))
     GFS_STATE (cell)->solid->v = c->dt*gfs_source_diffusion_cell (c->d, cell);
   GFS_VARIABLE (cell, c->dia->i) = c->alpha ? 1./gfs_function_value (c->alpha, cell) : 1.;
+  if (GFS_VARIABLE (cell, c->dia->i) <= 0.) {
+    FttVector p;
+    ftt_cell_pos (cell, &p);
+    g_log (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR,
+	   "density is negative (%g) at cell (%g,%g,%g).\n"
+	   "Please check your definition of alpha.",
+	   GFS_VARIABLE (cell, c->dia->i), p.x, p.y, p.z);
+  }
 }
 
 /**

-- 
Gerris Flow Solver



More information about the debian-science-commits mailing list