[cig-commits] r14408 - in mc/3D/CitcomS/trunk: CitcomS/Components/Stokes_solver lib module

tan2 at geodynamics.org tan2 at geodynamics.org
Fri Mar 20 16:36:57 PDT 2009


Author: tan2
Date: 2009-03-20 16:36:56 -0700 (Fri, 20 Mar 2009)
New Revision: 14408

Modified:
   mc/3D/CitcomS/trunk/CitcomS/Components/Stokes_solver/Incompressible.py
   mc/3D/CitcomS/trunk/lib/General_matrix_functions.c
   mc/3D/CitcomS/trunk/lib/Instructions.c
   mc/3D/CitcomS/trunk/lib/global_defs.h
   mc/3D/CitcomS/trunk/module/setProperties.c
Log:
limiting the number of multigrid cycles in solve_del2_u().

A new input parameter solver.vsolver.max_mg_cycles (default to 50) controls the max. number of multigrid cycles when solving the velocity. Without this parameter, when the stiffness matrix is near singular, the the multigrid solver may become an infinite loop.



Modified: mc/3D/CitcomS/trunk/CitcomS/Components/Stokes_solver/Incompressible.py
===================================================================
--- mc/3D/CitcomS/trunk/CitcomS/Components/Stokes_solver/Incompressible.py	2009-03-20 21:00:53 UTC (rev 14407)
+++ mc/3D/CitcomS/trunk/CitcomS/Components/Stokes_solver/Incompressible.py	2009-03-20 23:36:56 UTC (rev 14408)
@@ -96,6 +96,7 @@
 
         vlowstep = prop.int("vlowstep", default=1000)
         vhighstep = prop.int("vhighstep", default=3)
+        max_mg_cycles = prop.int("max_mg_cycles", default=50)
         piterations = prop.int("piterations", default=1000)
 
         aug_lagr = prop.bool("aug_lagr", default=True)

Modified: mc/3D/CitcomS/trunk/lib/General_matrix_functions.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/General_matrix_functions.c	2009-03-20 21:00:53 UTC (rev 14407)
+++ mc/3D/CitcomS/trunk/lib/General_matrix_functions.c	2009-03-20 23:36:56 UTC (rev 14408)
@@ -112,7 +112,7 @@
 	record(E,message);
 	report(E,message);
       }
-    }  while (!valid);
+    }  while (!valid && counts < E->control.max_mg_cycles);
 
     cycles = counts;
   }

Modified: mc/3D/CitcomS/trunk/lib/Instructions.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Instructions.c	2009-03-20 21:00:53 UTC (rev 14407)
+++ mc/3D/CitcomS/trunk/lib/Instructions.c	2009-03-20 23:36:56 UTC (rev 14408)
@@ -660,6 +660,7 @@
 
   input_int("vhighstep",&(E->control.v_steps_high),"1,0,nomax",m);
   input_int("vlowstep",&(E->control.v_steps_low),"250,0,nomax",m);
+  input_int("max_mg_cycles",&(E->control.max_mg_cycles),"50,0,nomax",m);
   input_int("piterations",&(E->control.p_iterations),"100,0,nomax",m);
 
   input_float("rayleigh",&(E->control.Atemp),"essential",m);

Modified: mc/3D/CitcomS/trunk/lib/global_defs.h
===================================================================
--- mc/3D/CitcomS/trunk/lib/global_defs.h	2009-03-20 21:00:53 UTC (rev 14407)
+++ mc/3D/CitcomS/trunk/lib/global_defs.h	2009-03-20 23:36:56 UTC (rev 14408)
@@ -509,6 +509,7 @@
     int v_steps_upper;
     int p_iterations;
     int mg_cycle;
+    int max_mg_cycles;
     int down_heavy;
     int up_heavy;
     int verbose;

Modified: mc/3D/CitcomS/trunk/module/setProperties.c
===================================================================
--- mc/3D/CitcomS/trunk/module/setProperties.c	2009-03-20 21:00:53 UTC (rev 14407)
+++ mc/3D/CitcomS/trunk/module/setProperties.c	2009-03-20 23:36:56 UTC (rev 14408)
@@ -869,6 +869,7 @@
 
     getIntProperty(properties, "vlowstep", E->control.v_steps_low, fp);
     getIntProperty(properties, "vhighstep", E->control.v_steps_high, fp);
+    getIntProperty(properties, "max_mg_cycles", E->control.max_mg_cycles, fp);
     getIntProperty(properties, "piterations", E->control.p_iterations, fp);
 
     getIntProperty(properties, "aug_lagr", E->control.augmented_Lagr, fp);



More information about the CIG-COMMITS mailing list