forked from idaholab/moose
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enables libmesh preconditioner reuse capability
closes idaholab#21868
- Loading branch information
1 parent
c2579d5
commit 7cdf54f
Showing
6 changed files
with
294 additions
and
27 deletions.
There are no files selected for viewing
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
164 changes: 164 additions & 0 deletions
164
modules/tensor_mechanics/test/tests/preconditioner_reuse/convergence.i
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,164 @@ | ||
# Simple 3D test | ||
|
||
[GlobalParams] | ||
displacements = 'disp_x disp_y disp_z' | ||
large_kinematics = true | ||
[] | ||
|
||
[Variables] | ||
[disp_x] | ||
[] | ||
[disp_y] | ||
[] | ||
[disp_z] | ||
[] | ||
[] | ||
|
||
[Mesh] | ||
[msh] | ||
type = GeneratedMeshGenerator | ||
dim = 3 | ||
nx = 4 | ||
ny = 4 | ||
nz = 4 | ||
[] | ||
[] | ||
|
||
[Kernels] | ||
[sdx] | ||
type = TotalLagrangianStressDivergence | ||
variable = disp_x | ||
component = 0 | ||
[] | ||
[sdy] | ||
type = TotalLagrangianStressDivergence | ||
variable = disp_y | ||
component = 1 | ||
[] | ||
[sdz] | ||
type = TotalLagrangianStressDivergence | ||
variable = disp_z | ||
component = 2 | ||
[] | ||
[] | ||
|
||
[Functions] | ||
[pullx] | ||
type = ParsedFunction | ||
value = '4000 * t' | ||
[] | ||
[pully] | ||
type = ParsedFunction | ||
value = '-2000 * t' | ||
[] | ||
[pullz] | ||
type = ParsedFunction | ||
value = '3000 * t' | ||
[] | ||
[lambda_function] | ||
type = ParsedFunction | ||
value = '1000.0*(t+1.0)' | ||
[] | ||
[] | ||
|
||
[BCs] | ||
[leftx] | ||
type = DirichletBC | ||
preset = true | ||
boundary = left | ||
variable = disp_x | ||
value = 0.0 | ||
[] | ||
[lefty] | ||
type = DirichletBC | ||
preset = true | ||
boundary = left | ||
variable = disp_y | ||
value = 0.0 | ||
[] | ||
[leftz] | ||
type = DirichletBC | ||
preset = true | ||
boundary = left | ||
variable = disp_z | ||
value = 0.0 | ||
[] | ||
[pull_x] | ||
type = FunctionNeumannBC | ||
boundary = right | ||
variable = disp_x | ||
function = pullx | ||
[] | ||
[pull_y] | ||
type = FunctionNeumannBC | ||
boundary = top | ||
variable = disp_y | ||
function = pully | ||
[] | ||
[pull_z] | ||
type = FunctionNeumannBC | ||
boundary = right | ||
variable = disp_z | ||
function = pullz | ||
[] | ||
[] | ||
|
||
[Materials] | ||
[compute_stress] | ||
type = ComputeNeoHookeanStress | ||
lambda = lambda | ||
mu = 67000.0 | ||
[] | ||
[lambda] | ||
type = GenericFunctionMaterial | ||
prop_names = lambda | ||
prop_values = lambda_function | ||
[] | ||
[compute_strain] | ||
type = ComputeLagrangianStrain | ||
[] | ||
[] | ||
|
||
[Preconditioning] | ||
[smp] | ||
type = SMP | ||
full = true | ||
[] | ||
[] | ||
|
||
[Executioner] | ||
type = Transient | ||
|
||
solve_type = 'newton' | ||
line_search = none | ||
|
||
petsc_options = '' | ||
petsc_options_iname = '-pc_type -ksp_type' | ||
petsc_options_value = 'lu gmres' | ||
l_tol = 1e-8 | ||
l_max_its = 100 | ||
|
||
reuse_preconditioner = false | ||
reuse_preconditioner_max_its = 20 | ||
|
||
nl_max_its = 10 | ||
nl_rel_tol = 1e-8 | ||
nl_abs_tol = 1e-10 | ||
|
||
start_time = 0.0 | ||
dt = 1.0 | ||
dtmin = 1.0 | ||
end_time = 10.0 | ||
[] | ||
|
||
[Reporters/iteration_info] | ||
type = IterationInfo | ||
[] | ||
|
||
[Outputs] | ||
exodus = false | ||
[./csv] | ||
type = CSV | ||
file_base = base_case | ||
[../] | ||
[] |
12 changes: 12 additions & 0 deletions
12
modules/tensor_mechanics/test/tests/preconditioner_reuse/gold/base_case.csv
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,12 @@ | ||
time,iteration_info/num_fixed_point_iterations,iteration_info/num_linear_iterations,iteration_info/num_nonlinear_iterations,iteration_info/time,iteration_info/timestep | ||
0,0,0,0,0,0 | ||
1,1,4,4,1,1 | ||
2,1,4,4,2,2 | ||
3,1,4,4,3,3 | ||
4,1,4,4,4,4 | ||
5,1,3,3,5,5 | ||
6,1,3,3,6,6 | ||
7,1,3,3,7,7 | ||
8,1,3,3,8,8 | ||
9,1,3,3,9,9 | ||
10,1,3,3,10,10 |
12 changes: 12 additions & 0 deletions
12
modules/tensor_mechanics/test/tests/preconditioner_reuse/gold/reuse_case.csv
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,12 @@ | ||
time,iteration_info/num_fixed_point_iterations,iteration_info/num_linear_iterations,iteration_info/num_nonlinear_iterations,iteration_info/time,iteration_info/timestep | ||
0,0,0,0,0,0 | ||
1,1,29,4,1,1 | ||
2,1,47,4,2,2 | ||
3,1,56,4,3,3 | ||
4,1,64,4,4,4 | ||
5,1,52,3,5,5 | ||
6,1,55,3,6,6 | ||
7,1,58,3,7,7 | ||
8,1,42,3,8,8 | ||
9,1,16,3,9,9 | ||
10,1,20,3,10,10 |
19 changes: 19 additions & 0 deletions
19
modules/tensor_mechanics/test/tests/preconditioner_reuse/tests
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,19 @@ | ||
[Tests] | ||
issues = '#21868' | ||
[without_reuse] | ||
type = CSVDiff | ||
input = convergence.i | ||
csvdiff = base_case.csv | ||
requirement = 'Convergence matches previous version of MOOSE without the ' | ||
'preconditioner reuse system' | ||
[] | ||
[with_reuse] | ||
type = CSVDiff | ||
input = convergence.i | ||
cli_args = "Executioner/reuse_preconditioner=true Outputs/csv/file_base=reuse_case" | ||
csvdiff = reuse_case.csv | ||
requirement = 'Preconditioner is reused until the linear iterations exceed ' | ||
'the value of reuse_preconditioner_max_its upon which the ' | ||
'system recalculates the preconditioner' | ||
[] | ||
[] |