geodynamics / aspect

A parallel, extensible finite element code to simulate convection in both 2D and 3D models.
https://aspect.geodynamics.org/
Other
228 stars 237 forks source link

Fix cookbooks and benchmarks #6080

Closed gassmoeller closed 1 month ago

gassmoeller commented 1 month ago

Some small fixes that were necessary to make the following succeed:

  cd benchmarks && make -f check.mk BUILD=$BUILDDIR -j4
  cd cookbooks && make -f check.mk BUILD=$BUILDDIR -j4

Part of the release checklist for 3.0.

One item of note is that for the crustal_model_3D cookbook the default material averaging (project to Q1 viscosity only) struggles with the GMG solver. More precisely with every subsequent nonlinear iteration the linear solver requires more iterations until it finally does not converge anymore. The problems go away if I switch to harmonic averaging instead. AMG with project to Q1 viscosity only also has some issues (namely that the nonlinear solver doesnt converge to better than 1e-5), but at least the iteration number for the linear solver stays almost constant between nonlinear iterations. I need to take a closer look at this, but for now this PR at least fixes the cookbook so that it converges.

log.txt (GMG, Q1):

-----------------------------------------------------------------------------
--                             This is ASPECT                              --
-- The Advanced Solver for Planetary Evolution, Convection, and Tectonics. --
-----------------------------------------------------------------------------
--     . version 2.6.0-pre (main, 69b3924b3)
--     . using deal.II 9.5.2
--     .       with 32 bit indices
--     .       with vectorization level 3 (AVX512, 8 doubles, 512 bits)
--     . using Trilinos 14.4.0
--     . using p4est 2.3.2
--     . using Geodynamic World Builder 1.0.0
--     . running in OPTIMIZED mode
--     . running with 1 MPI process
-----------------------------------------------------------------------------

-----------------------------------------------------------------------------
-- For information on how to cite ASPECT, see:
--   https://aspect.geodynamics.org/citing.html?ver=2.6.0-pre&mf=1&sha=69b3924b3&src=code
-----------------------------------------------------------------------------
Number of active cells: 24 (on 1 levels)
Number of degrees of freedom: 1,500 (1,071+72+357)

Number of mesh deformation degrees of freedom: 216
   Solving mesh displacement system... 0 iterations.
*** Timestep 0:  t=0 years, dt=0 years
   Solving mesh displacement system... 0 iterations.
   Skipping temperature solve because RHS is zero.
   Solving Stokes system (GMG)... 22+0 iterations.
      Relative nonlinear residual (Stokes system) after nonlinear iteration 1: 0.999999

   Solving Stokes system (GMG)... 242+0 iterations.
      Relative nonlinear residual (Stokes system) after nonlinear iteration 2: 0.157404

   Solving Stokes system (GMG)... 482+0 iterations.
      Relative nonlinear residual (Stokes system) after nonlinear iteration 3: 0.00076655

   Solving Stokes system (GMG)... 396+0 iterations.
      Relative nonlinear residual (Stokes system) after nonlinear iteration 4: 0.000184047

   Solving Stokes system (GMG)... 372+0 iterations.
      Relative nonlinear residual (Stokes system) after nonlinear iteration 5: 9.37592e-05

   Solving Stokes system (GMG)... 454+0 iterations.
      Relative nonlinear residual (Stokes system) after nonlinear iteration 6: 8.53391e-05

   Solving Stokes system (GMG)... 582+0 iterations.
      Relative nonlinear residual (Stokes system) after nonlinear iteration 7: 6.40057e-05

   Solving Stokes system (GMG)... 549+0 iterations.
      Relative nonlinear residual (Stokes system) after nonlinear iteration 8: 9.60702e-05

   Solving Stokes system (GMG)... 893+0 iterations.
      Relative nonlinear residual (Stokes system) after nonlinear iteration 9: 7.81497e-05

   Solving Stokes system (GMG)... 669+0 iterations.
      Relative nonlinear residual (Stokes system) after nonlinear iteration 10: 0.000142374

   Solving Stokes system (GMG)... 717+0 iterations.
      Relative nonlinear residual (Stokes system) after nonlinear iteration 11: 7.76505e-05

   Solving Stokes system (GMG)... 794+0 iterations.
      Relative nonlinear residual (Stokes system) after nonlinear iteration 12: 0.000164783

   Solving Stokes system (GMG)... 1000+0 iterations.

log.txt (GMG, harmonic average):

-----------------------------------------------------------------------------
--                             This is ASPECT                              --
-- The Advanced Solver for Planetary Evolution, Convection, and Tectonics. --
-----------------------------------------------------------------------------
--     . version 2.6.0-pre (main, 69b3924b3)
--     . using deal.II 9.5.2
--     .       with 32 bit indices
--     .       with vectorization level 3 (AVX512, 8 doubles, 512 bits)
--     . using Trilinos 14.4.0
--     . using p4est 2.3.2
--     . using Geodynamic World Builder 1.0.0
--     . running in OPTIMIZED mode
--     . running with 1 MPI process
-----------------------------------------------------------------------------

-----------------------------------------------------------------------------
-- For information on how to cite ASPECT, see:
--   https://aspect.geodynamics.org/citing.html?ver=2.6.0-pre&mf=1&sha=69b3924b3&src=code
-----------------------------------------------------------------------------
Number of active cells: 24 (on 1 levels)
Number of degrees of freedom: 1,500 (1,071+72+357)

Number of mesh deformation degrees of freedom: 216
   Solving mesh displacement system... 0 iterations.
*** Timestep 0:  t=0 years, dt=0 years
   Solving mesh displacement system... 0 iterations.
   Skipping temperature solve because RHS is zero.
   Solving Stokes system (GMG)... 22+0 iterations.
      Relative nonlinear residual (Stokes system) after nonlinear iteration 1: 0.999999

   Solving Stokes system (GMG)... 25+0 iterations.
      Relative nonlinear residual (Stokes system) after nonlinear iteration 2: 0.159695

   Solving Stokes system (GMG)... 21+0 iterations.
      Relative nonlinear residual (Stokes system) after nonlinear iteration 3: 6.70296e-05

   Solving Stokes system (GMG)... 20+0 iterations.
      Relative nonlinear residual (Stokes system) after nonlinear iteration 4: 2.60333e-05

   Solving Stokes system (GMG)... 18+0 iterations.
      Relative nonlinear residual (Stokes system) after nonlinear iteration 5: 1.98817e-05

   Solving Stokes system (GMG)... 17+0 iterations.
      Relative nonlinear residual (Stokes system) after nonlinear iteration 6: 6.69786e-06

   Solving Stokes system (GMG)... 16+0 iterations.
      Relative nonlinear residual (Stokes system) after nonlinear iteration 7: 5.74977e-06

   Solving Stokes system (GMG)... 15+0 iterations.
      Relative nonlinear residual (Stokes system) after nonlinear iteration 8: 2.55677e-06

   Solving Stokes system (GMG)... 15+0 iterations.
      Relative nonlinear residual (Stokes system) after nonlinear iteration 9: 1.88832e-06

   Solving Stokes system (GMG)... 14+0 iterations.
      Relative nonlinear residual (Stokes system) after nonlinear iteration 10: 1.14181e-06

   Solving Stokes system (GMG)... 14+0 iterations.
      Relative nonlinear residual (Stokes system) after nonlinear iteration 11: 8.44013e-07

   Solving Stokes system (GMG)... 13+0 iterations.
      Relative nonlinear residual (Stokes system) after nonlinear iteration 12: 5.81288e-07

   Solving Stokes system (GMG)... 13+0 iterations.
      Relative nonlinear residual (Stokes system) after nonlinear iteration 13: 4.37762e-07
... until it converges
tjhei commented 1 month ago

Part of the release checklist for 3.0.

With this they all pass? Then I don't have to run this check, thank you.