Skip to content

Commit

Permalink
Merge pull request #6080 from gassmoeller/fix_cookbook_check
Browse files Browse the repository at this point in the history
Fix cookbooks and benchmarks
  • Loading branch information
tjhei authored Oct 14, 2024
2 parents 8d7f5cf + 81ca89a commit 03b739e
Show file tree
Hide file tree
Showing 10 changed files with 118 additions and 144 deletions.
3 changes: 2 additions & 1 deletion cookbooks/crustal_deformation/crustal_model_3D.prm
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ end

subsection Material model
set Model name = drucker prager
set Material averaging = harmonic average only viscosity

subsection Drucker Prager
set Reference density = 2800
Expand Down Expand Up @@ -123,6 +124,6 @@ end
subsection Solver parameters
subsection Stokes solver parameters
set Linear solver tolerance = 1e-9
set Number of cheap Stokes solver steps = 0
set Maximum number of expensive Stokes solver steps = 0
end
end
1 change: 1 addition & 0 deletions cookbooks/future/mantle_setup_restart.prm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ end

subsection Solver parameters
subsection Operator splitting parameters
set Reaction solver type = fixed step
set Reaction time step = 2e2
set Reaction time steps per advection step = 20
end
Expand Down
3 changes: 2 additions & 1 deletion cookbooks/future/mantle_setup_start.prm
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ subsection Solver parameters
end

subsection Operator splitting parameters
set Reaction time step = 4e3 #2e2 for the restart
set Reaction solver type = fixed step
set Reaction time step = 4e3 #2e2 for the restart
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# 100 MPI processes are required.

# We include a shared library for the trench location postprocessor.
set Additional shared libraries = $ASPECT_SOURCE_DIR/cookbooks/kinematically_driven_subduction_2d/libsubduction_plate_cooling.so
set Additional shared libraries = ./libsubduction_plate_cooling.so

# 2D
set Dimension = 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# between the subducting and overriding plate, and consequently
# 100 MPI processes are required.
# We include a shared library for the initial temperature plugin and the isotherm depth, composition RMS temperature, and trench location postprocessors.
set Additional shared libraries = $ASPECT_SOURCE_DIR/cookbooks/kinematically_driven_subduction_2d/libsubduction_plate_cooling.so
set Additional shared libraries = ./libsubduction_plate_cooling.so

# 2D
set Dimension = 2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This setup is a modification of the file
# kinematically_driven_subduction_2d_case2a.prm
# to include temperature-dependent density.
set Additional shared libraries = $ASPECT_SOURCE_DIR/cookbooks/kinematically_driven_subduction_2d/libsubduction_plate_cooling.so
set Additional shared libraries = ./libsubduction_plate_cooling.so

# 2D
set Dimension = 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# of the mantle.
# We define plate boundaries and cratons using WorldBuilder.

set Additional shared libraries = $ASPECT_SOURCE_DIR/cookbooks/tomography_based_plate_motions/plugins/libtomography_based_plate_motions.release.so
set Additional shared libraries = ./plugins/libtomography_based_plate_motions.so
set Dimension = 2
set Use years in output instead of seconds = true
set Output directory = 2D-slice-with-faults-cratons
Expand Down
121 changes: 8 additions & 113 deletions tests/crustal_model_3D.prm
Original file line number Diff line number Diff line change
@@ -1,124 +1,19 @@
############### Global parameters
# This test makes sure the cookbook crustal_model_3D runs
# as expected.

set Dimension = 3
set Start time = 0
set End time = 0
set Use years in output instead of seconds = true
set CFL number = .5
set Nonlinear solver scheme = single Advection, iterated Stokes
set Nonlinear solver tolerance = 1e-9
set Max nonlinear iterations = 2
set Pressure normalization = no

############### Parameters describing the model

subsection Geometry model
set Model name = box

subsection Box
set X extent = 128e3
set Y extent = 96e3
set Z extent = 16e3
set X repetitions = 8
set Y repetitions = 3
end
end

# We prescribe a diverging velocity field on the left, right and bottom boundary
# such that two crustal faults form with an offset between them.
subsection Boundary velocity model
set Tangential velocity boundary indicators = front, back
set Prescribed velocity boundary indicators = left: function, right:function, bottom:function

subsection Function
set Variable names = x,y,z
set Function constants = cm=0.01, year=1
set Function expression = if (x<56e3 && y<=48e3 | x<72e3 && y>48e3, -1*cm/year, 1*cm/year) ; 0 ; 0
end
end

subsection Mesh deformation
set Mesh deformation boundary indicators = top: free surface

# Advecting the free surface vertically rather than
# in the surface normal direction can result in a
# more stable mesh when the deformation is large
subsection Free surface
set Surface velocity projection = vertical
end
end

subsection Material model
set Model name = drucker prager

subsection Drucker Prager
set Reference density = 2800

subsection Viscosity
set Minimum viscosity = 1e19
set Maximum viscosity = 1e25
set Reference strain rate = 1e-20
set Angle of internal friction = 30
set Cohesion = 20e6
end
end
end

subsection Gravity model
set Model name = vertical

subsection Vertical
set Magnitude = 9.81
end
end
include $ASPECT_SOURCE_DIR/cookbooks/crustal_deformation/crustal_model_3D.prm

############### Parameters describing the temperature field
# As above, there is no need to set anything for the
# temperature boundary conditions.

subsection Initial temperature model
set Model name = function

subsection Function
set Function expression = 0
end
end

############### Parameters describing the discretization
# The following parameters describe how often we want to refine
# the mesh globally and adaptively, what fraction of cells should
# be refined in each adaptive refinement step, and what refinement
# indicator to use when refining the mesh adaptively.
set End time = 0
set Max nonlinear iterations = 100

subsection Mesh refinement
set Initial adaptive refinement = 0
set Initial global refinement = 1
set Refinement fraction = 0.9
set Strategy = strain rate
set Coarsening fraction = 0.05
set Minimum refinement level = 1
set Initial global refinement = 0
set Minimum refinement level = 0
end

############### Parameters describing what to do with the solution
# The final section allows us to choose which postprocessors to
# run at the end of each time step. We select to generate graphical
# output that will consist of the primary variables (velocity, pressure,
# temperature and the compositional fields) as well as the density and
# viscosity. We also select to compute some statistics about the
# velocity field.

subsection Postprocess
set List of postprocessors = visualization, velocity statistics, topography, pressure statistics

subsection Visualization
set Interpolate output = false
set List of output variables = density, viscosity, strain rate, error indicator
end
end

subsection Solver parameters
subsection Stokes solver parameters
set Linear solver tolerance = 1e-9
set Number of cheap Stokes solver steps = 0
end
set List of postprocessors = velocity statistics, topography, pressure statistics
end
109 changes: 93 additions & 16 deletions tests/crustal_model_3D/screen-output
Original file line number Diff line number Diff line change
@@ -1,31 +1,108 @@

Number of active cells: 192 (on 2 levels)
Number of degrees of freedom: 8,937 (6,435+357+2,145)
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: 1,071
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)... 0+19 iterations.
Relative nonlinear residual (Stokes system) after nonlinear iteration 1: 1
Solving Stokes system (GMG)... 22+0 iterations.
Relative nonlinear residual (Stokes system) after nonlinear iteration 1: 0.999999

Solving Stokes system (GMG)... 0+180 iterations.
Relative nonlinear residual (Stokes system) after nonlinear iteration 2: 0.146052
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

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

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

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

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

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

Solving Stokes system (GMG)... 10+0 iterations.
Relative nonlinear residual (Stokes system) after nonlinear iteration 19: 8.22713e-08

Solving Stokes system (GMG)... 10+0 iterations.
Relative nonlinear residual (Stokes system) after nonlinear iteration 20: 6.31244e-08

Solving Stokes system (GMG)... 9+0 iterations.
Relative nonlinear residual (Stokes system) after nonlinear iteration 21: 4.86369e-08

Solving Stokes system (GMG)... 9+0 iterations.
Relative nonlinear residual (Stokes system) after nonlinear iteration 22: 3.74679e-08

Solving Stokes system (GMG)... 9+0 iterations.
Relative nonlinear residual (Stokes system) after nonlinear iteration 23: 2.89298e-08

Solving Stokes system (GMG)... 8+0 iterations.
Relative nonlinear residual (Stokes system) after nonlinear iteration 24: 2.23418e-08

Solving Stokes system (GMG)... 8+0 iterations.
Relative nonlinear residual (Stokes system) after nonlinear iteration 25: 1.72726e-08

Solving Stokes system (GMG)... 7+0 iterations.
Relative nonlinear residual (Stokes system) after nonlinear iteration 26: 1.33585e-08

Solving Stokes system (GMG)... 7+0 iterations.
Relative nonlinear residual (Stokes system) after nonlinear iteration 27: 1.03318e-08

Solving Stokes system (GMG)... 7+0 iterations.
Relative nonlinear residual (Stokes system) after nonlinear iteration 28: 7.99386e-09


WARNING: The nonlinear solver in the current timestep failed to converge.
Acting according to the parameter 'Nonlinear solver failure strategy'...
Continuing to the next timestep even though solution is not fully converged.
Postprocessing:
Writing graphical output: output-crustal_model_3D/solution/solution-00000
RMS, max velocity: 0.0098 m/year, 0.0264 m/year
Topography min/max: 0 m, 0 m
Pressure min/avg/max: -4.725e+09 Pa, 1.682e+08 Pa, 2.528e+09 Pa
RMS, max velocity: 0.00904 m/year, 0.0111 m/year
Topography min/max: 0 m, 0 m
Pressure min/avg/max: -1.005e+08 Pa, 1.869e+08 Pa, 5.418e+08 Pa

Skipping mesh refinement, because the mesh did not change.

Termination requested by criterion: end time



Termination requested by criterion: end time



WARNING: During this computation 1 nonlinear solver failures occurred!
17 changes: 8 additions & 9 deletions tests/crustal_model_3D/statistics
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@
# 9: Iterations for Stokes solver
# 10: Velocity iterations in Stokes preconditioner
# 11: Schur complement iterations in Stokes preconditioner
# 12: Visualization file name
# 13: RMS velocity (m/year)
# 14: Max. velocity (m/year)
# 15: Minimum topography (m)
# 16: Maximum topography (m)
# 17: Minimal pressure (Pa)
# 18: Average pressure (Pa)
# 19: Maximal pressure (Pa)
0 0.000000000000e+00 0.000000000000e+00 192 6792 2145 2 0 197 377 2095 output-crustal_model_3D/solution/solution-00000 9.79706034e-03 2.64062996e-02 0.00000000e+00 0.00000000e+00 -4.72541266e+09 1.68159158e+08 2.52794342e+09
# 12: RMS velocity (m/year)
# 13: Max. velocity (m/year)
# 14: Minimum topography (m)
# 15: Maximum topography (m)
# 16: Minimal pressure (Pa)
# 17: Average pressure (Pa)
# 18: Maximal pressure (Pa)
0 0.000000000000e+00 0.000000000000e+00 24 1143 357 28 0 336 392 392 9.03571254e-03 1.11375393e-02 0.00000000e+00 0.00000000e+00 -1.00459124e+08 1.86915989e+08 5.41826854e+08

0 comments on commit 03b739e

Please sign in to comment.