Warning: Undefined array key 1 in /home/np29546/public_html/elmerice/wiki/inc/auth.php on line 78

Warning: Cannot modify header information - headers already sent by (output started at /home/np29546/public_html/elmerice/wiki/inc/auth.php:78) in /home/np29546/public_html/elmerice/wiki/inc/auth.php on line 431

Warning: Cannot modify header information - headers already sent by (output started at /home/np29546/public_html/elmerice/wiki/inc/auth.php:78) in /home/np29546/public_html/elmerice/wiki/inc/actions.php on line 38
problems:parstokes [Elmer/Ice Wiki]

Warning: Undefined array key -1 in /home/np29546/public_html/elmerice/wiki/inc/html.php on line 1458

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
problems:parstokes [2013/03/01 07:13]
tzwinger [Introduction]
problems:parstokes [2019/04/13 13:12] (current)
tzwinger [Introduction]
Line 1: Line 1:
 ====== ParStokes: Iterative Solver for Large-Scale Glaciological Applications ====== ====== ParStokes: Iterative Solver for Large-Scale Glaciological Applications ======
 +
 +==== Alternatives ====
 +Since March 2019, a new [[problems:vectstokes|vectorized Stokes solver]] which further is capable of utilizing the library version of the block preconditioning is available. We recommend using this one.
  
 ==== Introduction ==== ==== Introduction ====
  
-The linear systems that need to be solved in Elmer/Ice are of the form+The linear system that needs to be solved for ice dynamics in Elmer/Ice are of the form
  
  
Line 11: Line 14:
  
 where the v-component of the solution vector represents the velocities, where the v-component of the solution vector represents the velocities,
-and the p-component the pressure. The matrix A is an elasticity-like operator, +and the p-component the pressure. The matrix ''A'' is an elasticity-like operator, 
-C a stabilization term, with B the discrete version of the operator -div.+''C'' a stabilization term, with ''B'' the discrete version of the operator -div.
  
 While direct solvers are a robust way of solving (1), their computational cost in 3D While direct solvers are a robust way of solving (1), their computational cost in 3D
 grows with the square of the number of unknowns, and their memory usage becomes excessive grows with the square of the number of unknowns, and their memory usage becomes excessive
 for large 3D applications. Iterative methods are therefore needed. A new module called for large 3D applications. Iterative methods are therefore needed. A new module called
-`ParStokesis therefore available in Elmer now, which is dedicated to this purpose.+**ParStokes** is therefore available in Elmer now, which is dedicated to this purpose
 +Detailed description of its functionality can be found in chapter 24 of the [[http://www.nic.funet.fi/pub/sci/physics/elmer/doc/ElmerModelsManual.pdf|Elmer Models Manual]]
  
  
Line 45: Line 49:
  
 A sif-file for the ParStokes module should have (at least) three Solver sections, one  A sif-file for the ParStokes module should have (at least) three Solver sections, one 
-for the coupled problem, one for the velocity system with A, and one for the pressure  +for the coupled problem, one for the velocity system with ''A'', and one for the pressure  
-system with M. An example could look like this:+system with ''M''. An example could look like this:
  
   Solver 1   Solver 1
     Equation = "Velocity Preconditioning"     Equation = "Velocity Preconditioning"
-    Procedure = "DummyRoutine" "DummyRoutine+    Exec Solver = "Before Simulation" 
-    Variable = -dofs 3 "V" +    Procedure = "VelocityPrecond" "VelocityPrecond
-    Variable Output = False +    Variable = -dofs 3 "V" ! that would be default
-    Exec Solver = "before simulation" +
-     +
-    Element = "p:1 b:4" +
-    Bubbles in Global System = False +
-   +
-    Linear System Symmetric = True +
-    Linear System Scaling = True +
-    Linear System Row Equilibration = Logical True +
-    Linear System Solver = Iterative +
-    Linear System Max Iterations = 250 +
-    Linear System Preconditioning = ILU0 +
-    Linear System Convergence Tolerance = 1.0e-6 +
-    Linear System Abort Not Converged = False +
-    Skip Compute Nonlinear Change = Logical True +
-    Back Rotate N-T Solution = Logical False +
-    Linear System Timing = True+
   End   End
  
   Solver 2   Solver 2
     Equation = "Pressure Preconditioning"     Equation = "Pressure Preconditioning"
-    Procedure = "DummyRoutine" "DummyRoutine+    Exec Solver = "Before Simulation" 
-    Variable = -dofs 1 "P" +    Procedure = "PressurePrecond" "PressurePrecond
-    Variable Output = False +    Variable = -dofs 1 "p" ! that would be default
-    Exec Solver = "before simulation" +
-     +
-    Element = "p:1 b:4" +
-    Bubbles in Global System = False +
-     +
-    Linear System Symmetric = True +
-    Linear System Scaling = True +
-    Linear System Solver = iterative +
-    Linear System Iterative Method = CG +
-    Linear System Max Iterations = 1000 +
-    Linear System Convergence Tolerance = 1.0e-6 +
-    Linear System Preconditioning = Diagonal +
-    Linear System Residual Output = 10 +
-    Skip Compute Nonlinear Change = Logical True +
-    Back Rotate N-T Solution = Logical False +
-    Linear System Timing = True+
   End   End
  
Line 98: Line 70:
     Procedure = "ParStokes" "StokesSolver"     Procedure = "ParStokes" "StokesSolver"
     Element = "p:1 b:4"       Element = "p:1 b:4"  
-    Bubbles in Global System = False 
     Variable = FlowVar     Variable = FlowVar
     Variable Dofs = 4     Variable Dofs = 4
Line 108: Line 79:
     !-----------------------------------------------     !-----------------------------------------------
     Block Preconditioning = Logical True     Block Preconditioning = Logical True
-    Linear System Scaling = Logical True 
-    Linear System Row Equilibration = Logical True 
-    Linear System Solver = "Iterative" 
     Linear System GCR Restart = Integer 200     Linear System GCR Restart = Integer 200
     Linear System Max Iterations = 200     Linear System Max Iterations = 200
Line 118: Line 86:
     Nonlinear System Newton After Tolerance = 1.0e-3     Nonlinear System Newton After Tolerance = 1.0e-3
   End   End
 +  
 +== Boundary Conditions ==
  
-== Remarks == +The variables in the solver sections for the preconditioner (Solver 1 and 2) are not  
-a) The ParStokes module is not compiled automatically. The source code is in trunk/fem/src/modules/ParStokes.src. You should copy the code to your directory (possibly rename the suffix to .f90, as some Fortran compilers are picky about thisand then simply compile it: <code>elmerf90 ParStokes.f90 -o ParStokes.so</code> +identified as being the same as in the coupled system (Solver 3 in example above)so boundary conditions 
-Place the resulting shared object into directory that is either under the $LD_LIBRARY_PATH or if you can access it - into $ELMER_HOME/share/elmersolver/lib+have to be assigned to all the components twice. For instance, to specify no-slip 
 +condition at the bedrock the according section in the sif-file might look like this:
  
-b) The entry 'Equation' in the first two solvers must have the names given above so that the ParStokes module finds them. The function DummyRoutine is an empty subroutine that you have to supply, it may look like this: +  ! bedrock
-<code> +  Boundary Condition 2 
-  SUBROUTINE DummyRoutineModel,Solver,dt,TransientSimulation )+    Name = "bedrock" 
 +    Target Boundaries(1= 5 
 +    FlowVar 1 = Real 0.0 
 +    FlowVar 2 = Real 0.0 
 +    FlowVar 3 = Real 0.0 
 +    V 1 = Real 0.0 
 +    V 2 = Real 0.0 
 +    V 3 = Real 0.0 
 +  End
      
-  USE DefUtils +In the case of sliding conditions, the keyword "Slip Coefficient" will be recognised by the preconditioner as well as the solver. Stress conditions are imposed using the keywords       
-  USE SolverUtils +     Surface Traction {1,2,3} = Real      
-  USE ElementUtils +(the same as the keyword ''Pressure {1,2,3}'' in Navier-Stokesfor component-wise setting, or  
-  IMPLICIT NONE +     Normal Surface Traction = Real  
-  TYPE(Solver_t:: Solver +(same as ''External Pressure'' in Navier-Stokesfor imposing a normal force (e.g., sea pressure).
-  TYPE(Model_t:: Model +
-  REAL(KIND=dp:: dt +
-  LOGICAL :: TransientSimulation +
-   +
-  END SUBROUTINE DummyRoutine +
-</code>+
  
-and is compiled as usual, by  +== Remarks == 
-<code> +a) All solver routines presented above are included in the basic Elmer(/Ice) distribution
-  elmerf90 -o DummyRoutine.so DummyRoutine.f90 +
-</code> +
-   +
-Same here: Place the resulting shared object into directory that is either under the $LD_LIBRARY_PATH or - if you can access it - into $ELMER_HOME/share/elmersolver/lib +
  
-c) We propose to use linear elements for all variables here, augmented +b) We propose to use linear elements for all variables here, augmented 
-with fourth order bubble functions to achieve stability. While the high+with four bubble functions per velocity component to achieve stability. While the high
 order stabilization makes the assembly somewhat costly, it is important for order stabilization makes the assembly somewhat costly, it is important for
-achieving a stable solution. The corresponding lines in all three solver sections are+achieving a stable solution. The corresponding line in all three solver sections are
  
   Element = "p:1 b:4"     Element = "p:1 b:4"  
-  Bubbles in Global System = False+   
 +The setting (see item f of this list) 
 +    Bubbles in Global System = False 
 +is not needed, as it is the default in any of the solvers.
  
-d) The scaling of the linear systems is essential in order to get+P2-P1/Q2-Q1 approximation offers an alternative for using p-bubbles (see section 24.4 of [[http://www.nic.funet.fi/pub/sci/physics/elmer/doc/ElmerModelsManual.pdf|Elmer Models manual]]). 
 + 
 +c) The scaling of the linear systems is essential in order to get
 appropriate stopping criteria for the nested iterations. For the appropriate stopping criteria for the nested iterations. For the
 outer iteration (Solver 3 above), one should generally use outer iteration (Solver 3 above), one should generally use
Line 161: Line 135:
   Linear System Row Equilibration = Logical True   Linear System Row Equilibration = Logical True
  
-For the systems with A and M it is possible to preserve symmetry by setting+d) For the systems with ''A'' and ''M'' it is possible to preserve symmetry by setting (both are default settings)
  
-  Linear System Scaling = Logical True +  Linear System Scaling = Logical True  
-  Linear System Row Equilibration = Logical False+  Linear System Row Equilibration = Logical False 
  
 In that case CG can be used instead of BiCGStab. In that case CG can be used instead of BiCGStab.
Line 197: Line 171:
 outer iteration decreases. outer iteration decreases.
  
-f) The variables in the solver sections for the preconditioner (Solver 1 and 2) are not  +f) ParStokes by default does only solve the Stokes (and not Navier-Stokesequation. If one wishes to include acceleration termssetting the keyword "Convective = Logical True" will do so. Also2 Picard iterations are always performed, independently from what is specified in the sif-file. The line "Reset Newton..." is not necessary. In this case, it would be good to include
-identified as being the same as in the coupled system (Solver 3), so boundary conditions +
-have to be assigned to all the components twiceFor instanceto specify a no-slip +
-condition at the bedrock the according section in the sif-file might look like this:+
  
-  ! bedrock: +    Bubbles in Global System True 
- +     
-  Boundary Condition 2 +to avoid the by default implemented elimination of bubbles from the global systemIn that case one also should take care that the ''Element'' keyword contains the same bubble degree for all three solvers.    
-    Name "bedrock" +
-    Target Boundaries(1) = 5 +
-    FlowVar 1 = Real 0.+
-    FlowVar 2 = Real 0.+
-    FlowVar 3 = Real 0.0 +
-    V 1 = Real 0.0 +
-    V 2 = Real 0.0 +
-    V 3 = Real 0.0 +
-  End+
  
 +g) It should be possible to restart a ParStokes simulation
  
 ==== Approximate solution of systems with A and M ==== ==== Approximate solution of systems with A and M ====
 +
 +In the example above, no numerical setting for the solution of the blocks M and A are given. The defualt settings (see source code) should suffice in most cases. Here, we just present some tweaks for these parts:
  
 The solution of systems with M is relatively easy in practice, we recommend using a CG The solution of systems with M is relatively easy in practice, we recommend using a CG
Line 228: Line 193:
     Variable Output = False     Variable Output = False
     Exec Solver = "before simulation"     Exec Solver = "before simulation"
-    Element = "p:1 b:4" 
-    Bubbles in Global System = False 
     Linear System Symmetric = True     Linear System Symmetric = True
     Linear System Scaling = True     Linear System Scaling = True
Line 238: Line 201:
     Linear System Preconditioning = Diagonal     Linear System Preconditioning = Diagonal
     Linear System Residual Output = 10     Linear System Residual Output = 10
-    Skip Compute Nonlinear Change = Logical True 
-    Back Rotate N-T Solution = Logical False 
     Linear System Timing = True     Linear System Timing = True
   End   End
Line 259: Line 220:
 this variant, set in the according solver section this variant, set in the according solver section
  
-Linear System Use HYPRE = Logical True+   Linear System Use HYPRE = Logical True
  
 The parameters  The parameters 
problems/parstokes.1362122006.txt.gz · Last modified: 2013/03/01 07:13 by tzwinger
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0