[cig-commits] commit 2026 by bangerth to /var/svn/dealii/aspect

dealii.demon at gmail.com dealii.demon at gmail.com
Thu Nov 21 06:52:59 PST 2013


Revision 2026

Make progress with nonlinear solvers.

U   trunk/aspect/doc/modules/changes.h
U   trunk/aspect/source/simulator/assembly.cc
U   trunk/aspect/source/simulator/core.cc


http://www.dealii.org/websvn/revision.php?repname=Aspect+Repository&path=%2F&rev=2026&peg=2026

Diff:
Modified: trunk/aspect/doc/modules/changes.h
===================================================================
--- trunk/aspect/doc/modules/changes.h	2013-11-21 14:52:01 UTC (rev 2025)
+++ trunk/aspect/doc/modules/changes.h	2013-11-21 14:52:29 UTC (rev 2026)
@@ -8,6 +8,12 @@
 </p>
 
 <ol>
+  <li>Fixed: When using compressible models with nonlinear iterations
+  such as "Stokes", "iterated IMPES" or "iterated Stokes" and prescribed
+  boundary values, there were numerous bugs that should now be fixed.
+  <br>
+  (Wolfgang Bangerth 2013/11/21)
+
   <li>Changed: When the user selects to terminate by end time, the
   final time step is adjusted to hit the final time exactly.
   <br>

Modified: trunk/aspect/source/simulator/assembly.cc
===================================================================
--- trunk/aspect/source/simulator/assembly.cc	2013-11-21 14:52:01 UTC (rev 2025)
+++ trunk/aspect/source/simulator/assembly.cc	2013-11-21 14:52:29 UTC (rev 2026)
@@ -1223,14 +1223,6 @@
       pressure_shape_function_integrals.compress(VectorOperation::add);
 
 
-    // if we got here and have rebuilt the matrix, make sure that
-    // the flag for the preconditioner had previously also been
-    // set
-    if (rebuild_stokes_matrix == true)
-      Assert (rebuild_stokes_preconditioner == true,
-              ExcInternalError());
-
-
     // record that we have just rebuilt the matrix
     rebuild_stokes_matrix = false;
 

Modified: trunk/aspect/source/simulator/core.cc
===================================================================
--- trunk/aspect/source/simulator/core.cc	2013-11-21 14:52:01 UTC (rev 2025)
+++ trunk/aspect/source/simulator/core.cc	2013-11-21 14:52:29 UTC (rev 2026)
@@ -1020,22 +1020,30 @@
         }
         case NonlinearSolver::Stokes_only:
         {
-          // the Stokes matrix depends on the viscosity. if the viscosity
-          // depends on other solution variables, then we need to
-          // update the Stokes matrix in every time step and so need to set
-          // the rebuild_stokes_matrix flag. if we change the Stokes matrix we also
-          // need to update the Stokes preconditioner.
-          //
-          // there is a similar case where this solver can be used, namely for
-          // compressible models. in that case, the matrix does not depend on
-          // the previous solution, but we still need to iterate since the right
-          // hand side depends on it
           unsigned int iteration = 0;
 
           do
             {
+              // the Stokes matrix depends on the viscosity. if the viscosity
+              // depends on other solution variables, then we need to
+              // update the Stokes matrix in every iteration and so need to set
+              // the rebuild_stokes_matrix flag. if we change the Stokes matrix we also
+              // need to update the Stokes preconditioner.
+              //
+              // there is a similar case where this nonlinear solver can be used, namely for
+              // compressible models. in that case, the matrix does not depend on
+              // the previous solution, but we still need to iterate since the right
+              // hand side depends on it. in those cases, the matrix does not change,
+              // but if we have to repeat computing the right hand side, we need to
+              // also rebuild the matrix if we end up with inhomogenous velocity
+              // boundary conditions (i.e., if there are prescribed velocity boundary
+              // indicators)
+              if ((stokes_matrix_depends_on_solution() == true)
+                  ||
+                  (parameters.prescribed_velocity_boundary_indicators.size() > 0))
+                rebuild_stokes_matrix = true;
               if (stokes_matrix_depends_on_solution() == true)
-                rebuild_stokes_matrix = rebuild_stokes_preconditioner = true;
+                rebuild_stokes_preconditioner = true;
 
               assemble_stokes_system();
               build_stokes_preconditioner();


More information about the CIG-COMMITS mailing list