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

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


The following commit has been merged in the upstream branch:
commit d1ca524040e4c95af8d6b0dd13e287fcf08898bd
Author: Sebastien Delaux <s.delaux at niwa.co.nz>
Date:   Wed Jul 22 08:49:22 2009 +1000

    Fix for moving second order bug with merged cells
    
    darcs-hash:20090721224922-118cf-94538d89f0421d201080d7f81c214a2b1f9203c3.gz

diff --git a/src/moving2.c b/src/moving2.c
index 4db2a36..0417fa4 100644
--- a/src/moving2.c
+++ b/src/moving2.c
@@ -632,9 +632,9 @@ static void moving_face_velocity_advection_flux (const FttCellFace * face,
 
 static void swap_fractions (FttCell * cell, GfsVariable * old_solid_v) {
   FttDirection c;
-
+  
   g_assert (cell);
-
+  
   if (FTT_CELL_IS_LEAF(cell)) {
     if (OLD_SOLID (cell)) {
       GfsSolidVector * solid_old = OLD_SOLID (cell);
@@ -642,24 +642,31 @@ static void swap_fractions (FttCell * cell, GfsVariable * old_solid_v) {
       if (GFS_STATE (cell)->solid) {
 	GfsSolidVector * solid = GFS_STATE (cell)->solid;
 	
+	OLD_SOLID (cell)->merged = GFS_STATE (cell)->solid->merged;
+	
 	for (c = 0; c < 2*FTT_DIMENSION; c++) 
 	  if (solid->s[c] == 0.)
 	    solid_old->s[c] = 0;
 	  else
 	    solid_old->s[c] = (solid_old->s[c]+solid->s[c])/2. ;	
       }
-      else
+      else {
+	OLD_SOLID (cell)->merged = NULL;
+	
 	for (c = 0; c < 2*FTT_DIMENSION; c++)
 	  solid_old->s[c] = (solid_old->s[c]+1.)/2. ;
+	
+      }
     }
     else if (GFS_STATE (cell)->solid) {
       GfsSolidVector * solid = GFS_STATE (cell)->solid;
       GfsSolidVector * solid_old = OLD_SOLID (cell) = g_malloc0 (sizeof (GfsSolidVector));
       OLD_SOLID (cell)->a= 1.;
-
+      OLD_SOLID (cell)->merged = GFS_STATE (cell)->solid->merged;
+      
       for (c = 0; c < 2*FTT_DIMENSION; c++) 
 	solid_old->s[c] = 1.;	
-
+      
       for (c = 0; c < 2*FTT_DIMENSION; c++) 
 	if (solid->s[c] == 0.)
 	  solid_old->s[c] = 0;
@@ -671,11 +678,13 @@ static void swap_fractions (FttCell * cell, GfsVariable * old_solid_v) {
   if (OLD_SOLID (cell)) {
     if (GFS_STATE(cell)->solid) {
       GfsSolidVector * tmp = OLD_SOLID (cell);
+      OLD_SOLID (cell)->merged = GFS_STATE (cell)->solid->merged;
       OLD_SOLID (cell) = GFS_STATE(cell)->solid;
       GFS_STATE(cell)->solid = tmp;
       tmp = NULL;
     }
     else {
+      OLD_SOLID (cell)->merged = NULL;
       GFS_STATE(cell)->solid = OLD_SOLID (cell);
       OLD_SOLID (cell) = NULL;
     }
@@ -684,8 +693,8 @@ 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++)
@@ -698,7 +707,7 @@ static void swap_fractions (FttCell * cell, GfsVariable * old_solid_v) {
 	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.){

-- 
Gerris Flow Solver



More information about the debian-science-commits mailing list