-
Notifications
You must be signed in to change notification settings - Fork 239
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6175 from gassmoeller/recursive_include
Allow recursive includes in parameter files
- Loading branch information
Showing
16 changed files
with
419 additions
and
124 deletions.
There are no files selected for viewing
120 changes: 3 additions & 117 deletions
120
benchmarks/newton_solver_benchmark_set/nonlinear_channel_flow/input_t.prm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,131 +1,17 @@ | ||
# Like the poiseuille_2d.prm test and based on the nonlinear channel | ||
# Like input_v.prm and based on the nonlinear channel | ||
# flow benchmark. This is used to test the traction boundary conditions | ||
# of the Newton Stokes solver. | ||
|
||
set Output directory = output_t | ||
set Dimension = 2 | ||
set CFL number = 1.0 | ||
set Maximum time step = 1 | ||
set End time = 0 | ||
set Start time = 0 | ||
set Adiabatic surface temperature = 0 | ||
set Surface pressure = 0 | ||
set Use years in output instead of seconds = false | ||
set Nonlinear solver scheme = single Advection, iterated Newton Stokes | ||
set Max nonlinear iterations = 150 | ||
set Nonlinear solver tolerance = 1e-14 | ||
set Additional shared libraries = libsimple_nonlinear.so | ||
|
||
subsection Solver parameters | ||
subsection Stokes solver parameters | ||
set Linear solver tolerance = 1e-7 | ||
set Stokes solver type = block AMG | ||
end | ||
|
||
subsection Newton solver parameters | ||
set Max pre-Newton nonlinear iterations = 3 | ||
set Nonlinear Newton solver switch tolerance = 1e-20 | ||
set Max Newton line search iterations = 5 | ||
set Maximum linear Stokes solver tolerance = 1e-2 | ||
set Use Newton residual scaling method = false | ||
set Use Newton failsafe = false | ||
set Stabilization preconditioner = SPD | ||
set Stabilization velocity block = SPD | ||
end | ||
end | ||
|
||
subsection Boundary temperature model | ||
set List of model names = box | ||
set Fixed temperature boundary indicators = bottom, top | ||
|
||
subsection Box | ||
set Left temperature = 0 | ||
end | ||
end | ||
|
||
subsection Initial temperature model | ||
set Model name = function | ||
|
||
subsection Function | ||
set Function expression = 0 | ||
end | ||
end | ||
|
||
subsection Gravity model | ||
set Model name = vertical | ||
|
||
subsection Vertical | ||
set Magnitude = 0 | ||
end | ||
end | ||
|
||
subsection Geometry model | ||
set Model name = box | ||
include $ASPECT_SOURCE_DIR/benchmarks/newton_solver_benchmark_set/nonlinear_channel_flow/input_v.prm | ||
|
||
subsection Box | ||
set X extent = 10e3 | ||
set Y extent = 8e3 | ||
set Y repetitions = 1 | ||
end | ||
end | ||
|
||
subsection Material model | ||
set Model name = simple nonlinear | ||
|
||
subsection Simple nonlinear | ||
set Minimum viscosity = 1e19 | ||
set Maximum viscosity = 1e24 | ||
set Stress exponent = 3 | ||
set Viscosity averaging p = -1 | ||
set Viscosity prefactor = 1e-37 | ||
set Use deviator of strain-rate = false | ||
end | ||
end | ||
|
||
subsection Mesh refinement | ||
set Initial adaptive refinement = 0 | ||
set Initial global refinement = 4 | ||
end | ||
set Output directory = output_t | ||
|
||
subsection Boundary velocity model | ||
set Zero velocity boundary indicators = left, right | ||
# pressure bc: Prescribe a zero vertical velocity component on the vertical boundaries | ||
set Prescribed velocity boundary indicators = bottom x: function, top x: function | ||
|
||
subsection Function | ||
set Function constants = n = 3 | ||
set Variable names = x,y | ||
|
||
# For velocity boundary conditions both are used, for pressure boundary conditions only the first (x) component | ||
set Function expression = 0;(1e-37/(n+1))*((1e9/8e3)^n)*(((5e3)^(n+1))-(abs(x-(5e3))^(n+1))); | ||
end | ||
end | ||
|
||
subsection Boundary traction model | ||
# pressure bc: Prescribe a horizontal traction on the vertical boundaries | ||
set Prescribed traction boundary indicators = bottom y: function, top y: function | ||
subsection Function | ||
set Variable names = x,y | ||
|
||
# We want to prescribe a pressure of 1e9 at the bottom boundary | ||
# and 0 at the top boundary. | ||
# The traction in this case is defined as: | ||
# tau = - pressure * normal_vector. | ||
# On the bottom boundary, the outward pointing normal vector is | ||
# (0;-1). On the top (0;1). | ||
# Therefore: | ||
# Top boundary: tau = - pressure(top) (0;1) = - (0) (0;1) = (0;0). | ||
# Bottom boundary: tau = - pressure(bottom) (0;-1) = - (1e9) (0;-1) = (0;1e9). | ||
# Conveniently, the traction is the same on both boundaries. | ||
set Function expression = 0; y>4e3 ? 0 : 1e9 | ||
end | ||
end | ||
|
||
subsection Postprocess | ||
set List of postprocessors = velocity statistics, pressure statistics, mass flux statistics, visualization | ||
|
||
subsection Visualization | ||
set List of output variables = material properties, strain rate | ||
set Time between graphical output = 2 | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Added: ASPECT can now use the 'include' keyword in parameter | ||
files to include other parameter files, even if those other | ||
parameter files include parameter files themselves. ASPECT now | ||
also respects the parameters 'Dimension' and 'Additional shared | ||
libraries' in the included parameter files, which was not the | ||
case before. | ||
<br> | ||
(Rene Gassmoeller, 2024/12/04) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Test for including prm files. This is simply including the simpler_box.prm test. | ||
|
||
include $ASPECT_SOURCE_DIR/tests/simpler_box.prm # This is an include, and this comments tests if this line is correctly replaced. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# Test for including prm files. This is simply including the simpler_box.prm test. | ||
|
||
# Included content from $ASPECT_SOURCE_DIR/tests/simpler_box.prm: | ||
|
||
set Dimension = 2 | ||
set CFL number = 1.0 | ||
set End time = 0 | ||
set Start time = 0 | ||
set Adiabatic surface temperature = 0 | ||
set Surface pressure = 0 | ||
set Use years in output instead of seconds = false | ||
set Nonlinear solver scheme = single Advection, single Stokes | ||
|
||
subsection Boundary temperature model | ||
set List of model names = box | ||
set Fixed temperature boundary indicators = 0, 1 | ||
end | ||
|
||
subsection Gravity model | ||
set Model name = vertical | ||
end | ||
|
||
subsection Geometry model | ||
set Model name = box | ||
|
||
subsection Box | ||
set X extent = 1.2 | ||
set Y extent = 1 | ||
set Z extent = 1 | ||
end | ||
end | ||
|
||
subsection Initial temperature model | ||
set Model name = perturbed box | ||
end | ||
|
||
subsection Material model | ||
set Model name = simpler | ||
|
||
subsection Simpler model | ||
set Reference density = 1 | ||
set Reference specific heat = 1250 | ||
set Reference temperature = 1 | ||
set Thermal conductivity = 1e-6 | ||
set Thermal expansion coefficient = 2e-5 | ||
set Viscosity = 1 | ||
end | ||
end | ||
|
||
subsection Mesh refinement | ||
set Initial adaptive refinement = 0 | ||
set Initial global refinement = 5 | ||
end | ||
|
||
subsection Boundary velocity model | ||
set Tangential velocity boundary indicators = 1 | ||
set Zero velocity boundary indicators = 0, 2, 3 | ||
end | ||
|
||
subsection Postprocess | ||
set List of postprocessors = visualization, velocity statistics, basic statistics, temperature statistics, heat flux statistics | ||
|
||
subsection Visualization | ||
set Interpolate output = false | ||
set List of output variables = material properties | ||
|
||
subsection Material properties | ||
set List of material properties = density, viscosity | ||
end | ||
end | ||
end | ||
|
||
|
||
set Output directory = output-include_prm_file | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
Number of active cells: 1,024 (on 6 levels) | ||
Number of degrees of freedom: 13,764 (8,450+1,089+4,225) | ||
|
||
*** Timestep 0: t=0 seconds, dt=0 seconds | ||
Solving temperature system... 0 iterations. | ||
Solving Stokes system (GMG)... 17+0 iterations. | ||
|
||
Postprocessing: | ||
Writing graphical output: output-include_prm_file/solution/solution-00000 | ||
RMS, max velocity: 9e-09 m/s, 3.23e-08 m/s | ||
Temperature min/avg/max: 0 K, 1.035 K, 1.1 K | ||
Heat fluxes through boundary parts: 1.667e-07 W, 6.239e-05 W, 0 W, 0 W | ||
|
||
Termination requested by criterion: end time | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# 1: Time step number | ||
# 2: Time (seconds) | ||
# 3: Time step size (seconds) | ||
# 4: Number of mesh cells | ||
# 5: Number of Stokes degrees of freedom | ||
# 6: Number of temperature degrees of freedom | ||
# 7: Iterations for temperature solver | ||
# 8: Iterations for Stokes solver | ||
# 9: Velocity iterations in Stokes preconditioner | ||
# 10: Schur complement iterations in Stokes preconditioner | ||
# 11: Visualization file name | ||
# 12: RMS velocity (m/s) | ||
# 13: Max. velocity (m/s) | ||
# 14: Minimal temperature (K) | ||
# 15: Average temperature (K) | ||
# 16: Maximal temperature (K) | ||
# 17: Average nondimensional temperature (K) | ||
# 18: Outward heat flux through boundary with indicator 0 ("left") (W) | ||
# 19: Outward heat flux through boundary with indicator 1 ("right") (W) | ||
# 20: Outward heat flux through boundary with indicator 2 ("bottom") (W) | ||
# 21: Outward heat flux through boundary with indicator 3 ("top") (W) | ||
0 0.000000000000e+00 0.000000000000e+00 1024 9539 4225 0 16 18 18 output-include_prm_file/solution/solution-00000 9.00076535e-09 3.23376836e-08 0.00000000e+00 1.03532014e+00 1.10000000e+00 1.03532014e+00 1.66666640e-07 6.23888889e-05 0.00000000e+00 0.00000000e+00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Test for recursively including prm files. | ||
# This is including the include_prm_file.prm test, which | ||
# itself is including simpler_box.prm. | ||
|
||
include $ASPECT_SOURCE_DIR/tests/include_prm_file.prm |
Oops, something went wrong.