Skip to content
Permalink
Browse files

Merge pull request #13501 from sapitts/investigate_perfgraph_rrp

New test for reference residual and perf graph to demonstrate usage
  • Loading branch information...
permcody committed Jun 4, 2019
2 parents 737f971 + 480d7fd commit 0f54368e6547a557efab845de1673383436c9272
@@ -0,0 +1,4 @@
time,elapsed,res_calls
0,0,0
1,0.508920117,45
2,0.579691763,58
@@ -0,0 +1,199 @@
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]

[Mesh]
type = GeneratedMesh
dim = 3
nx = 4
ny = 4
nz = 4
[]

[Problem]
type = ReferenceResidualProblem
solution_variables = 'disp_x disp_y disp_z temp'
reference_residual_variables = 'saved_x saved_y saved_z saved_t'
[]

[Variables]
[./disp_x]
order = FIRST
family = LAGRANGE
[../]

[./disp_y]
order = FIRST
family = LAGRANGE
[../]

[./disp_z]
order = FIRST
family = LAGRANGE
[../]

[./temp]
order = FIRST
family = LAGRANGE
[../]
[]

[AuxVariables]
[./saved_x]
[../]
[./saved_y]
[../]
[./saved_z]
[../]
[./saved_t]
[../]
[]

[Modules/TensorMechanics/Master]
[./all]
volumetric_locking_correction = true
incremental = true
save_in = 'saved_x saved_y saved_z'
eigenstrain_names = thermal_expansion
strain = FINITE
decomposition_method = EigenSolution
[../]
[]

[Kernels]
[./heat]
type = HeatConduction
variable = temp
save_in = saved_t
[../]
[]

[Functions]
[./pull]
type = PiecewiseLinear
x = '0 1 2'
y = '0 1 1'
scale_factor = 0.1
[../]
[]

[BCs]
[./bottom_x]
type = DirichletBC
variable = disp_x
boundary = bottom
value = 0.0
[../]

[./bottom_y]
type = DirichletBC
variable = disp_y
boundary = bottom
value = 0.0
[../]

[./bottom_z]
type = DirichletBC
variable = disp_z
boundary = bottom
value = 0.0
[../]

[./top_x]
type = DirichletBC
variable = disp_x
boundary = top
value = 0.0
[../]

[./top_y]
type = FunctionDirichletBC
variable = disp_y
boundary = top
function = pull
[../]

[./top_z]
type = DirichletBC
variable = disp_z
boundary = top
value = 0.0
[../]

[./bottom_temp]
type = DirichletBC
variable = temp
boundary = bottom
value = 10.0
[../]

[./top_temp]
type = DirichletBC
variable = temp
boundary = top
value = 20.0
[../]
[]

[Materials]
[./elasticity_tensor]
type = ComputeIsotropicElasticityTensor
block = 0
youngs_modulus = 1.0
poissons_ratio = 0.3
[../]
[./stress]
type = ComputeFiniteStrainElasticStress
block = 0
[../]

[./thermal_expansion]
type = ComputeThermalExpansionEigenstrain
block = 0
eigenstrain_name = thermal_expansion
temperature = temp
thermal_expansion_coeff = 1e-5
stress_free_temperature = 0.0
[../]

[./heat1]
type = HeatConductionMaterial
block = 0
specific_heat = 1.0
thermal_conductivity = 1e-3 #Tuned to give temperature reference resid close to that of solidmech
[../]

[./density]
type = Density
block = 0
density = 1.0
[../]
[]

[Executioner]
type = Transient
solve_type = 'PJFNK'

nl_rel_tol = 1e-10
l_tol = 1e-3
l_max_its = 100
dt = 1.0
end_time = 2.0
[]

[Postprocessors]
[./res_calls]
type = PerfGraphData
section_name = "ReferenceResidualProblem::computeResidualInternal"
data_type = calls
[../]
[./elapsed]
type = PerfGraphData
section_name = "Root"
data_type = total
[../]
[]

[Outputs]
csv = true
[]
@@ -5,6 +5,9 @@
exodiff = 'reference_residual_out.e'
custom_cmp = 'reference_residual.cmp'
scale_refine = 2
design = 'ReferenceResidualProblem.md'
issues = '#12053'
requirement = 'The reference residual based convergence checking system shall determine if convergence is achieved by comparing the residual to a set of physical displacement quantities.'
[../]
[./test_sm]
type = 'Exodiff'
@@ -13,43 +16,59 @@
exodiff = 'reference_residual_out.e'
custom_cmp = 'reference_residual.cmp'
scale_refine = 2
design = 'ReferenceResidualProblem.md'
issues = '#12053'
requirement = 'The reference residual based convergence checking system shall determine if convergence is achieved by comparing the residual to physical displacement quantities in a solid mechanics module input file.'
prereq = test
[../]
[./test_scaling]
type = 'Exodiff'
input = 'reference_residual.i'
exodiff = 'reference_residual_out.e'
cli_args = 'Variables/disp_x/scaling=2
Variables/disp_y/scaling=0.1
Variables/disp_z/scaling=30
Variables/temp/scaling=0.001'
prereq = test_sm
[../]
[./group_variables]
type = 'Exodiff'
input = 'group_variables.i'
exodiff = 'group_variables_out.e'
abs_zero = 1e-9
requirement = 'The reference residual based convergence checking system shall permit the norm of independent groups of either scalar and standard solution variables to be compared against reference quantities provided through the norms of groups of auxiliary variables.'
design = 'ReferenceResidualProblem.md'
issues = '#12053'
[../]
[./group_variables_duplicate_error_check]
type = 'RunException'
input = 'group_variables.i'
expect_err = "A variable cannot be included in multiple groups in the 'group_variables' parameter."
cli_args = 'Problem/group_variables="disp_x disp_y; disp_x scalar_strain_zz1"'
requirement = 'The reference residual based convergence checking system shall generate an error if a variable is added to multiple groups.'
design = 'ReferenceResidualProblem.md'
issues = '#12053'
[../]
[./group_variables_ungroup_error_check]
type = 'RunException'
input = 'group_variables.i'
expect_err = "In the 'group_variables' parameter, variable disp_x is not grouped with other variables."
cli_args = 'Problem/group_variables="disp_x; scalar_strain_zz1 scalar_strain_zz2"'
requirement = 'The reference residual based convergence checking system shall generate an error if a group containing a single variable is defined.'
design = 'ReferenceResidualProblem.md'
issues = '#12053'
[../]
[./test_scaling]
type = 'Exodiff'
input = 'reference_residual.i'
exodiff = 'reference_residual_out.e'
cli_args = 'Variables/disp_x/scaling=2
Variables/disp_y/scaling=0.1
Variables/disp_z/scaling=30
Variables/temp/scaling=0.001'
design = 'ReferenceResidualProblem.md'
issues = '#10403'
requirement = 'The reference residual based convergence checking system shall apply the variable scaling factor to the reference residual calculation if a scaling factor is applied to a variable.'
prereq = test_sm
[../]
[./group_variables]
type = 'Exodiff'
input = 'group_variables.i'
exodiff = 'group_variables_out.e'
abs_zero = 1e-9
requirement = 'The reference residual based convergence checking system shall permit the norm of independent groups of either scalar and standard solution variables to be compared against reference quantities provided through the norms of groups of auxiliary variables.'
design = 'ReferenceResidualProblem.md'
issues = '#12053'
[../]
[./test_with_perfgraph]
type = 'CSVDiff'
input = 'reference_residual_perfgraph.i'
csvdiff = 'reference_residual_perfgraph_out.csv'
rel_err = 1000 # checking only for the presence of the prefgraph postprocessor quantities in the CSV file, not the values
abs_zero = 1
requirement = 'The reference residual based convergence checking system shall run when used in conjunction with the functionality to output residual and jacobian calculation timing information.'
design = 'ReferenceResidualProblem.md'
issues = '#13495'
[../]
[./group_variables_duplicate_error_check]
type = 'RunException'
input = 'group_variables.i'
expect_err = "A variable cannot be included in multiple groups in the 'group_variables' parameter."
cli_args = 'Problem/group_variables="disp_x disp_y; disp_x scalar_strain_zz1"'
requirement = 'The reference residual based convergence checking system shall generate an error if a variable is added to multiple groups.'
design = 'ReferenceResidualProblem.md'
issues = '#12053'
[../]
[./group_variables_ungroup_error_check]
type = 'RunException'
input = 'group_variables.i'
expect_err = "In the 'group_variables' parameter, variable disp_x is not grouped with other variables."
cli_args = 'Problem/group_variables="disp_x; scalar_strain_zz1 scalar_strain_zz2"'
requirement = 'The reference residual based convergence checking system shall generate an error if a group containing a single variable is defined.'
design = 'ReferenceResidualProblem.md'
issues = '#12053'
[../]
[]

0 comments on commit 0f54368

Please sign in to comment.
You can’t perform that action at this time.