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

Sebastien Delaux s.delaux at niwa.co.nz
Tue Nov 24 12:24:39 UTC 2009


The following commit has been merged in the upstream branch:
commit 35de45e9d09e9e6160138e86df16940a0aa62d67
Author: Sebastien Delaux <s.delaux at niwa.co.nz>
Date:   Thu Jun 25 08:30:25 2009 +1000

    Fix for problem with small cells and moving solid interface in second
    
    order method
    
    darcs-hash:20090624223025-118cf-a6d2dd6215b86fff154b822d3f5422ca46222cdb.gz

diff --git a/src/moving2.c b/src/moving2.c
index f2190c2..7bee4c4 100644
--- a/src/moving2.c
+++ b/src/moving2.c
@@ -683,6 +683,32 @@ static void swap_fractions (FttCell * cell, GfsVariable * old_solid_v) {
     OLD_SOLID (cell) = GFS_STATE(cell)->solid;
     GFS_STATE(cell)->solid = NULL;
   }
+
+
+  /* Check for negative fractions and fix*/
+  if (GFS_STATE(cell)->solid)
+    for (c = 0; c < 2*FTT_DIMENSION; c++)
+      if (GFS_STATE(cell)->solid->s[c] < 0.) {
+	if (OLD_SOLID (cell)) 
+	  if (OLD_SOLID (cell)->s[c] >= 0.)
+	    GFS_STATE(cell)->solid->s[c] = OLD_SOLID (cell)->s[c];
+	  else
+	    GFS_STATE(cell)->solid->s[c] = 1.;
+	else
+	  GFS_STATE(cell)->solid->s[c] = 0.;
+      }
+
+  if (OLD_SOLID (cell)) 
+    for (c = 0; c < 2*FTT_DIMENSION; c++)
+      if (OLD_SOLID (cell)->s[c] < 0.){
+	if (GFS_STATE(cell)->solid)
+	  if (GFS_STATE(cell)->solid->s[c] >= 0.)
+	    OLD_SOLID (cell)->s[c] = GFS_STATE(cell)->solid->s[c];
+	  else
+	    OLD_SOLID (cell)->s[c] = 1.;
+	else
+	  OLD_SOLID (cell)->s[c] = 0.;
+      }
 }
 
 static void old_solid_fractions_from_children (FttCell * cell)

-- 
Gerris Flow Solver



More information about the debian-science-commits mailing list