- base_nameOptional parameter that allows the user to define multiple mechanics material systems on the same block, i.e. for multiple phases
C++ Type:std::string
Description:Optional parameter that allows the user to define multiple mechanics material systems on the same block, i.e. for multiple phases
 - blockThe list of block ids (SubdomainID) that this object will be applied
C++ Type:std::vector<SubdomainName>
Description:The list of block ids (SubdomainID) that this object will be applied
 - boundaryThe list of boundary IDs from the mesh where this boundary condition applies
C++ Type:std::vector<BoundaryName>
Description:The list of boundary IDs from the mesh where this boundary condition applies
 - computeTrueWhen false, MOOSE will not call compute methods on this material. The user must call computeProperties() after retrieving the MaterialBase via MaterialBasePropertyInterface::getMaterialBase(). Non-computed MaterialBases are not sorted for dependencies.
Default:True
C++ Type:bool
Description:When false, MOOSE will not call compute methods on this material. The user must call computeProperties() after retrieving the MaterialBase via MaterialBasePropertyInterface::getMaterialBase(). Non-computed MaterialBases are not sorted for dependencies.
 - constant_onNONEWhen ELEMENT, MOOSE will only call computeQpProperties() for the 0th quadrature point, and then copy that value to the other qps.When SUBDOMAIN, MOOSE will only call computeQpProperties() for the 0th quadrature point, and then copy that value to the other qps. Evaluations on element qps will be skipped
Default:NONE
C++ Type:MooseEnum
Description:When ELEMENT, MOOSE will only call computeQpProperties() for the 0th quadrature point, and then copy that value to the other qps.When SUBDOMAIN, MOOSE will only call computeQpProperties() for the 0th quadrature point, and then copy that value to the other qps. Evaluations on element qps will be skipped
 - extra_stress_namesMaterial property names of rank two tensors to be added to the stress.
C++ Type:std::vector<MaterialPropertyName>
Description:Material property names of rank two tensors to be added to the stress.
 
ADComputeFiniteStrainElasticStress
Compute stress using elasticity for finite strains
Description
This material, ADComputeFiniteStrainElasticStress computes the elastic stress for an incremental formulation, both incremental small (ADComputeIncrementalSmallStrain type) and incremental finite (ADComputeFiniteStrain type) strain formulations. This stress class is compatible with both Cartesian and non-Cartesian strain calculators, including Axisymmetric and RSpherical.
Elastic materials do not experience permanent deformation, and all elastic strain and elastic stress is recoverable. Elastic stress is related to elastic strain through the elasticity tensor
(1)
where is the strain increment; this strain measure is also the sum of the mechanical elastic strain and any eigenstrains in the system.
Input Parameters
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Options:
Description:Adds user-defined labels for accessing object parameters via control logic.
 - enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Options:
Description:Set the enabled status of the MooseObject.
 - implicitTrueDetermines whether this object is calculated using an implicit or explicit form
Default:True
C++ Type:bool
Options:
Description:Determines whether this object is calculated using an implicit or explicit form
 - seed0The seed for the master random number generator
Default:0
C++ Type:unsigned int
Options:
Description:The seed for the master random number generator
 
Advanced Parameters
- output_propertiesList of material properties, from this material, to output (outputs must also be defined to an output type)
C++ Type:std::vector<std::string>
Options:
Description:List of material properties, from this material, to output (outputs must also be defined to an output type)
 - outputsnone Vector of output names were you would like to restrict the output of variables(s) associated with this object
Default:none
C++ Type:std::vector<OutputName>
Options:
Description:Vector of output names were you would like to restrict the output of variables(s) associated with this object
 
Outputs Parameters
Input Files
- (modules/tensor_mechanics/test/tests/finite_strain_elastic_anisotropy/3d_bar_orthotropic_90deg_rotation_ad.i)
 - (modules/contact/test/tests/normal-nodal-lm-tan-tolerance/normal-nodal-lm-tan-tolerance.i)
 - (modules/combined/test/tests/gap_heat_transfer_jac/two_blocks.i)
 - (modules/tensor_mechanics/test/tests/ad_elastic/rspherical_finite_elastic.i)
 - (modules/tensor_mechanics/test/tests/ad_thermal_expansion_function/finite_const.i)
 - (modules/tensor_mechanics/test/tests/action/ad_converter_action_multi_eigenstrain.i)
 - (modules/combined/test/tests/gap_heat_transfer_mortar/finite-2d-rz/finite.i)
 - (modules/tensor_mechanics/test/tests/thermal_expansion/ad_constant_expansion_coeff_old.i)
 - (modules/contact/test/tests/mortar_tm/2d/ad_frictionless_fir/finite.i)
 - (modules/combined/test/tests/exception/ad.i)
 - (modules/contact/test/tests/mortar_tm/2drz/ad_frictionless_second/finite.i)
 - (modules/tensor_mechanics/test/tests/ad_2D_geometries/2D-RZ_centerline_VLC.i)
 - (modules/combined/test/tests/ad_cavity_pressure/3d.i)
 - (tutorials/darcy_thermo_mech/step09_mechanics/problems/step9.i)
 - (modules/tensor_mechanics/test/tests/finite_strain_elastic_anisotropy/3d_bar_orthotropic_full_rotation_ad.i)
 - (modules/tensor_mechanics/test/tests/ad_action/two_block_new.i)
 - (modules/tensor_mechanics/test/tests/plane_stress/ad_weak_plane_stress_finite.i)
 - (modules/combined/test/tests/gap_heat_transfer_mortar/finite-2d/finite.i)
 - (modules/contact/test/tests/mortar_tm/2drz/ad_frictionless_first/finite.i)
 - (modules/combined/test/tests/thermal_elastic/ad-thermal_elastic.i)
 - (modules/combined/test/tests/ad_cavity_pressure/negative_volume.i)
 - (tutorials/darcy_thermo_mech/step11_action/problems/step11.i)
 - (modules/tensor_mechanics/test/tests/ad_finite_strain_jacobian/3d_bar.i)
 - (modules/tensor_mechanics/test/tests/thermal_expansion/ad_constant_expansion_stress_free_temp.i)
 - (modules/tensor_mechanics/test/tests/ad_elastic/rz_finite_elastic.i)
 - (modules/contact/test/tests/mortar_tm/2drz/ad_frictionless_second/finite_rr.i)
 - (modules/combined/test/tests/ad_cavity_pressure/rz.i)
 - (modules/tensor_mechanics/test/tests/ad_elastic/incremental_small_elastic.i)
 - (modules/tensor_mechanics/test/tests/ad_elastic/finite_elastic.i)
 - (modules/contact/test/tests/mortar_tm/2d/ad_frictionless_sec/finite_rr.i)
 - (modules/contact/test/tests/mortar_tm/2drz/ad_frictionless_first/finite_rr.i)
 - (modules/tensor_mechanics/test/tests/ad_finite_strain_jacobian/bending_jacobian.i)
 - (modules/combined/test/tests/ad_cavity_pressure/multiple_postprocessors.i)
 - (modules/tensor_mechanics/test/tests/ad_2D_geometries/2D-RZ_finiteStrain_resid.i)
 - (modules/combined/test/tests/ad_cavity_pressure/initial_temperature.i)
 - (modules/tensor_mechanics/test/tests/ad_action/two_block.i)
 - (modules/tensor_mechanics/test/tests/ad_2D_geometries/3D-RZ_finiteStrain_test.i)
 - (modules/tensor_mechanics/test/tests/ad_2D_geometries/2D-RZ_finiteStrain_test.i)
 - (modules/tensor_mechanics/test/tests/ad_elastic/rz_incremental_small_elastic.i)
 - (modules/combined/test/tests/thermo_mech/ad-youngs_modulus_function_temp.i)
 - (modules/tensor_mechanics/test/tests/thermal_expansion/ad_constant_expansion_coeff.i)
 - (modules/tensor_mechanics/test/tests/ad_action/two_block_no_action.i)
 - (modules/tensor_mechanics/test/tests/ad_thermal_expansion_function/finite_linear.i)
 - (modules/contact/test/tests/mortar_tm/2d/ad_frictionless_sec/finite.i)
 - (modules/combined/test/tests/ad_cavity_pressure/additional_volume.i)
 - (tutorials/darcy_thermo_mech/step10_multiapps/problems/step10.i)
 - (modules/tensor_mechanics/test/tests/czm/czm_patch_test.i)
 - (modules/tensor_mechanics/test/tests/ad_elastic/rspherical_incremental_small_elastic.i)
 - (modules/contact/test/tests/mortar_tm/2d/ad_frictionless_fir/finite_rr.i)
 - (modules/tensor_mechanics/test/tests/ad_anisotropic_plasticity/anis_elasticity_test.i)
 - (modules/tensor_mechanics/test/tests/ad_1D_spherical/finiteStrain_1DSphere_hollow.i)
 
Child Objects
(modules/tensor_mechanics/test/tests/finite_strain_elastic_anisotropy/3d_bar_orthotropic_90deg_rotation_ad.i)
[Mesh]
  [generated_mesh]
    type = GeneratedMeshGenerator
    dim = 3
    xmin = 0
    xmax = 2
    ymin = 0
    ymax = 10
    zmin = 0
    zmax = 2
    nx = 1
    ny = 1
    nz = 1
    elem_type = HEX8
  []
  [corner]
    type = ExtraNodesetGenerator
    new_boundary = 101
    coord = '0 0 0'
    input = generated_mesh
  []
  [side]
    type = ExtraNodesetGenerator
    new_boundary = 102
    coord = '2 0 0'
    input = corner
  []
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Modules/TensorMechanics/Master]
  [all]
    strain = FINITE
    add_variables = true
    use_finite_deform_jacobian = true
    volumetric_locking_correction = false
    use_automatic_differentiation = true
    generate_output = 'stress_xx stress_yy stress_zz stress_xy stress_xz'
  []
[]
[Materials]
  [stress]
    type = ADComputeFiniteStrainElasticStress
  []
  [elasticity_tensor]
    type = ADComputeElasticityTensor
    fill_method = orthotropic
    C_ijkl = '2.0e3 2.0e5 2.0e3 0.71428571e3 0.71428571e3 0.71428571e3 0.4 0.2 0.004 0.004 0.2 0.4'
  []
[]
[BCs]
  [fix_z]
    type = ADDirichletBC
    variable = disp_z
    boundary = bottom
    value = 0
  []
  [rot_y]
    type = DisplacementAboutAxis
    boundary = bottom
    function = t
    angle_units = degrees
    axis_origin = '0. 0. 0.'
    axis_direction = '0. 0. 1.'
    component = 1
    variable = disp_y
  []
  #
  [rot_x]
    type = DisplacementAboutAxis
    boundary = bottom
    function = t
    angle_units = degrees
    axis_origin = '0. 0. 0.'
    axis_direction = '0. 0. 1.'
    component = 0
    variable = disp_x
  []
  [rot_y90]
    type = DisplacementAboutAxis
    boundary = bottom
    function = 90
    angle_units = degrees
    axis_origin = '0. 0. 0.'
    axis_direction = '0. 0. 1.'
    component = 1
    variable = disp_y
  []
  #
  [rot_x90]
    type = DisplacementAboutAxis
    boundary = bottom
    function = 90
    angle_units = degrees
    axis_origin = '0. 0. 0.'
    axis_direction = '0. 0. 1.'
    component = 0
    variable = disp_x
  []
  [press]
    boundary = top
    function = '-1.0*(t-90)*10.0'
    use_displaced_mesh = true
    displacements = 'disp_x disp_y disp_z'
    type = Pressure
    variable = disp_x
    component = 0
  []
[]
[Controls]
  [c1]
    type = TimePeriod
    enable_objects = 'BCs::rot_x BCs::rot_y'
    disable_objects = 'BCs::rot_x90 BCs::rot_y90 BCs::press'
    start_time = '0'
    end_time = '90'
  []
  [c190plus]
    type = TimePeriod
    enable_objects = 'BCs::rot_x90 BCs::rot_y90 BCs::press'
    disable_objects = 'BCs::rot_x BCs::rot_y '
    start_time = '90'
    end_time = '390'
  []
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  petsc_options = '-snes_ksp_ew'
  petsc_options_iname = '-ksp_gmres_restart'
  petsc_options_value = '101'
  line_search = 'none'
  nl_rel_tol = 1e-10
  nl_abs_tol = 1e-08
  nl_max_its = 50
  l_tol = 1e-4
  l_max_its = 50
  start_time = 0.0
  dt = 5
  dtmin = 5
  num_steps = 78
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Outputs]
  exodus = true
[]
(modules/contact/test/tests/normal-nodal-lm-tan-tolerance/normal-nodal-lm-tan-tolerance.i)
[GlobalParams]
  displacements = 'disp_x disp_y'
  preset = false
[]
[Mesh]
  [file]
    type = FileMeshGenerator
    file = 2blk-gap_no1000.e
  []
[]
[Modules/TensorMechanics/Master]
  [./all]
    displacements = 'disp_x disp_y'
    strain = FINITE
    add_variables = true
    block = '1 2'
    use_automatic_differentiation = true
    scaling = 1e-4
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ADComputeIsotropicElasticityTensor
    youngs_modulus = 1e5
    poissons_ratio = 0.345
    block = '1 2'
  [../]
  [./_elastic_strain]
    type = ADComputeFiniteStrainElasticStress
    block = '1 2'
  [../]
[]
[Contact]
  [mortar]
    mesh = file
    secondary = 101
    primary = 100
    model = frictionless
    formulation = mortar
    c_normal = 1e4
    tangential_tolerance = .05
    normal_lm_scaling = 1e-3
  []
[]
[Functions]
  [./disp_bc]
    type = PiecewiseLinear
    x = '0 10.0'
    y = '0 -0.30'
  [../]
[]
[BCs]
  [./left_x]
    type = DirichletBC
    variable = disp_x
    boundary = 'left'
    value = 0.0
  [../]
  [./left_y]
    type = DirichletBC
    variable = disp_y
    boundary = 'left'
    value = 0.0
  [../]
  [./right_x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'right'
    function = disp_bc # '-30e-3 * t'
  [../]
  [./right_y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'right'
    function = 0
  [../]
[]
[Preconditioning]
  [./fmp]
    type = FDP
    full = true
    finite_difference_type = standard
  [../]
[]
[Executioner]
  solve_type = NEWTON
  type = Transient
  num_steps = 10
  dt = 1
  dtmin = 1
  nl_rel_tol = 1e-12
  nl_abs_tol = 1e-13
  petsc_options = '-ksp_monitor_true_residual -snes_converged_reason -ksp_converged_reason'
  petsc_options_iname = '-pc_type  -snes_linesearch_type -pc_factor_shift_type -snes_max_it  -ksp_max_it'
  petsc_options_value = 'lu        basic                 NONZERO               20            30'
  [Predictor]
    type = SimplePredictor
    scale = 1
  []
[]
[Outputs]
  checkpoint = true
  exodus = true
  print_linear_residuals = false
  [dof]
    type = DOFMap
    execute_on = 'initial'
  []
[]
[Debug]
  show_var_residual_norms = true
[]
(modules/combined/test/tests/gap_heat_transfer_jac/two_blocks.i)
# This problem consists of two beams with different prescribed temperatures on
# the top of the top beam and the bottom of the bottom beam.  The top beam is
# fixed against vertical displacement on the top surface, and the bottom beam
# bends downward due to thermal expansion.
# This is a test of the effectiveness of the Jacobian terms coupling temperature
# and displacement for thermal contact. The Jacobian is not exactly correct,
# but is close enough that this challenging problem converges in a small number
# of nonlinear iterations using NEWTON.
[GlobalParams]
  displacements = 'disp_x disp_y'
[]
[Mesh]
  [./msh]
    type = FileMeshGenerator
    file = two_blocks.e
  []
[]
[Variables]
  [./temp]
  [../]
[]
[Kernels]
  [./heat]
    type = ADHeatConduction
    variable = temp
  [../]
[]
[Modules/TensorMechanics/Master]
  [./all]
    strain = FINITE
    add_variables = true
    eigenstrain_names = thermal_expansion
    generate_output = 'stress_xx stress_yy stress_zz stress_yz stress_xz stress_xy'
    use_automatic_differentiation = true
  [../]
[]
[Contact]
  [./mechanical]
    primary = 4
    secondary = 5
    formulation = kinematic
    tangential_tolerance = 1e-1
    penalty = 1e10
  [../]
[]
[ThermalContact]
  [./thermal]
    type = GapHeatTransfer
    variable = temp
    primary = 4
    secondary = 5
    emissivity_primary = 0
    emissivity_secondary = 0
    gap_conductivity = 1e4
    quadrature = true
  [../]
[]
[BCs]
  [./left_x]
    type = DirichletBC
    variable = disp_x
    boundary = 1
    value = 0.0
  [../]
  [./left_y]
    type = DirichletBC
    variable = disp_y
    boundary = 1
    value = 0.0
  [../]
  [./top_y]
    type = DirichletBC
    variable = disp_y
    boundary = 7
    value = 0
  [../]
  [./top_temp]
    type = DirichletBC
    variable = temp
    boundary = 7
    value = 1000.0
  [../]
  [./bot_temp]
    type = DirichletBC
    variable = temp
    boundary = 6
    value = 500.0
  [../]
[]
[Materials]
  [./density]
    type = Density
    density = 100
  [../]
  [./temp]
    type = ADHeatConductionMaterial
    thermal_conductivity = 1e5
    specific_heat = 620.0
  [../]
  [./Elasticity_tensor]
    type = ADComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '0.3 0.5e8'
  [../]
  [./thermal_eigenstrain]
    type = ADComputeThermalExpansionEigenstrain
    thermal_expansion_coeff = 1e-5
    stress_free_temperature = 500
    temperature = temp
    eigenstrain_name = thermal_expansion
  [../]
  [./stress]
    type = ADComputeFiniteStrainElasticStress
  [../]
[]
[Preconditioning]
  [./SMP]
    type = SMP
    full = true
  [../]
[]
[Outputs]
  exodus = true
[]
[Executioner]
  automatic_scaling = true
  type = Transient
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  solve_type = NEWTON
  nl_max_its = 15
  l_tol = 1e-10
  l_max_its = 50
  start_time = 0.0
  dt = 0.2
  dtmin = 0.2
  num_steps = 1
  line_search = none
[]
(modules/tensor_mechanics/test/tests/ad_elastic/rspherical_finite_elastic.i)
[Mesh]
  type = GeneratedMesh
  dim = 1
  nx = 5
[]
[Problem]
  coord_type = RSPHERICAL
[]
[GlobalParams]
  displacements = 'disp_r'
[]
[Variables]
  # scale with one over Young's modulus
  [./disp_r]
    scaling = 1e-10
  [../]
[]
[Kernels]
  [./stress_r]
    type = ADStressDivergenceRSphericalTensors
    component = 0
    variable = disp_r
    use_displaced_mesh = true
  [../]
[]
[BCs]
  [./center]
    type = DirichletBC
    variable = disp_r
    boundary = left
    value = 0
  [../]
  [./rdisp]
    type = DirichletBC
    variable = disp_r
    boundary = right
    value = 0.1
  [../]
[]
[Materials]
  [./elasticity]
    type = ADComputeIsotropicElasticityTensor
    poissons_ratio = 0.3
    youngs_modulus = 1e10
  [../]
[]
[Materials]
  [./strain]
    type = ADComputeRSphericalFiniteStrain
  [../]
  [./stress]
    type = ADComputeFiniteStrainElasticStress
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  dt = 0.05
  solve_type = 'NEWTON'
  petsc_options_iname = -pc_hypre_type
  petsc_options_value = boomeramg
  dtmin = 0.05
  num_steps = 1
[]
[Outputs]
  exodus = true
[]
(modules/tensor_mechanics/test/tests/ad_thermal_expansion_function/finite_const.i)
# This tests the thermal expansion coefficient function using both
# options to specify that function: mean and instantaneous.  There
# two blocks, each containing a single element, and these use the
# two variants of the function.
# In this test, the instantaneous CTE function has a constant value,
# while the mean CTE function is an analytic function designed to
# give the same response.  If \bar{alpha}(T) is the mean CTE function,
# and \alpha(T) is the instantaneous CTE function,
# \bar{\alpha}(T) = 1/(T-Tref) \intA^{T}_{Tsf} \alpha(T) dT
# where Tref is the reference temperature used to define the mean CTE
# function, and Tsf is the stress-free temperature.
# This version of the test uses finite deformation theory.
# The two models produce very similar results.  There are slight
# differences due to the large deformation treatment.
[Mesh]
  file = 'blocks.e'
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[AuxVariables]
  [./temp]
    order = FIRST
    family = LAGRANGE
  [../]
[]
[Modules/TensorMechanics/Master]
  [./all]
    strain = FINITE
    add_variables = true
    eigenstrain_names = eigenstrain
    generate_output = 'strain_xx strain_yy strain_zz'
    use_automatic_differentiation = true
  [../]
[]
[BCs]
  [./left]
    type = DirichletBC
    variable = disp_x
    boundary = 3
    value = 0.0
  [../]
  [./bottom]
    type = DirichletBC
    variable = disp_y
    boundary = 2
    value = 0.0
  [../]
  [./back]
    type = DirichletBC
    variable = disp_z
    boundary = 1
    value = 0.0
  [../]
[]
[AuxKernels]
  [./temp]
    type = FunctionAux
    variable = temp
    block = '1 2'
    function = temp_func
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ADComputeIsotropicElasticityTensor
    youngs_modulus = 1e6
    poissons_ratio = 0.3
  [../]
  [./small_stress]
    type = ADComputeFiniteStrainElasticStress
  [../]
  [./thermal_expansion_strain1]
    type = ADComputeMeanThermalExpansionFunctionEigenstrain
    block = 1
    thermal_expansion_function = cte_func_mean
    thermal_expansion_function_reference_temperature = 0.5
    stress_free_temperature = 0.0
    temperature = temp
    eigenstrain_name = eigenstrain
  [../]
  [./thermal_expansion_strain2]
    type = ADComputeInstantaneousThermalExpansionFunctionEigenstrain
    block = 2
    thermal_expansion_function = cte_func_inst
    stress_free_temperature = 0.0
    temperature = temp
    eigenstrain_name = eigenstrain
  [../]
[]
[Functions]
  [./cte_func_mean]
    type = ParsedFunction
    vars = 'tsf tref scale' #stress free temp, reference temp, scale factor
    vals = '0.0 0.5  1e-4'
    value = 'scale * (t - tsf) / (t - tref)'
  [../]
  [./cte_func_inst]
    type = PiecewiseLinear
    xy_data = '0 1.0
               2 1.0'
    scale_factor = 1e-4
  [../]
  [./temp_func]
    type = PiecewiseLinear
    xy_data = '0 1
               1 2'
  [../]
[]
[Postprocessors]
  [./disp_1]
    type = NodalMaxValue
    variable = disp_x
    boundary = 101
  [../]
  [./disp_2]
    type = NodalMaxValue
    variable = disp_x
    boundary = 102
  [../]
[]
[Executioner]
  type = Transient
  solve_type = NEWTON
  l_max_its = 100
  l_tol = 1e-4
  nl_abs_tol = 1e-8
  nl_rel_tol = 1e-12
  start_time = 0.0
  end_time = 1.0
  dt = 0.1
[]
[Outputs]
  csv = true
[]
(modules/tensor_mechanics/test/tests/action/ad_converter_action_multi_eigenstrain.i)
# This tests the thermal expansion coefficient function using both
# options to specify that function: mean and instantaneous.  There
# two blocks, each containing a single element, and these use the
# two variants of the function.
# In this test, the instantaneous CTE function has a constant value,
# while the mean CTE function is an analytic function designed to
# give the same response.  If \bar{alpha}(T) is the mean CTE function,
# and \alpha(T) is the instantaneous CTE function,
# \bar{\alpha}(T) = 1/(T-Tref) \intA^{T}_{Tsf} \alpha(T) dT
# where Tref is the reference temperature used to define the mean CTE
# function, and Tsf is the stress-free temperature.
# This version of the test uses finite deformation theory.
# The two models produce very similar results.  There are slight
# differences due to the large deformation treatment.
[Mesh]
  file = 'blocks.e'
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[AuxVariables]
  [./temp]
    order = FIRST
    family = LAGRANGE
  [../]
[]
[Problem]
  solve = false
[]
[Modules/TensorMechanics/Master]
  [./block1]
    block = 1
    strain = FINITE
    add_variables = true
    automatic_eigenstrain_names = true
    generate_output = 'strain_xx strain_yy strain_zz'
    use_automatic_differentiation = true
  [../]
  [./block2]
    block = 2
    strain = FINITE
    add_variables = true
    automatic_eigenstrain_names = true
    generate_output = 'strain_xx strain_yy strain_zz'
    use_automatic_differentiation = true
  [../]
[]
[BCs]
  [./left]
    type = DirichletBC
    variable = disp_x
    boundary = 3
    value = 0.0
  [../]
  [./bottom]
    type = DirichletBC
    variable = disp_y
    boundary = 2
    value = 0.0
  [../]
  [./back]
    type = DirichletBC
    variable = disp_z
    boundary = 1
    value = 0.0
  [../]
[]
[AuxKernels]
  [./temp]
    type = FunctionAux
    variable = temp
    block = '1 2'
    function = temp_func
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ADComputeIsotropicElasticityTensor
    youngs_modulus = 1e6
    poissons_ratio = 0.3
  [../]
  [./small_stress]
    type = ADComputeFiniteStrainElasticStress
  [../]
  [./thermal_expansion_strain1]
    type = ComputeMeanThermalExpansionFunctionEigenstrain
    block = 1
    thermal_expansion_function = cte_func_mean
    thermal_expansion_function_reference_temperature = 0.5
    stress_free_temperature = 0.0
    temperature = temp
    eigenstrain_name = reg_eigenstrain1
  [../]
  [./converter1]
    type = RankTwoTensorMaterialConverter
    block = 1
    reg_props_in = 'reg_eigenstrain1'
    ad_props_out = 'eigenstrain1'
  [../]
  [./thermal_expansion_strain2]
    type = ADComputeInstantaneousThermalExpansionFunctionEigenstrain
    block = 2
    thermal_expansion_function = cte_func_inst
    stress_free_temperature = 0.0
    temperature = temp
    eigenstrain_name = eigenstrain2
  [../]
[]
[Functions]
  [./cte_func_mean]
    type = ParsedFunction
    vars = 'tsf tref scale' #stress free temp, reference temp, scale factor
    vals = '0.0 0.5  1e-4'
    value = 'scale * (t - tsf) / (t - tref)'
  [../]
  [./cte_func_inst]
    type = PiecewiseLinear
    xy_data = '0 1.0
               2 1.0'
    scale_factor = 1e-4
  [../]
  [./temp_func]
    type = PiecewiseLinear
    xy_data = '0 1
               1 2'
  [../]
[]
[Postprocessors]
  [./disp_1]
    type = NodalMaxValue
    variable = disp_x
    boundary = 101
  [../]
  [./disp_2]
    type = NodalMaxValue
    variable = disp_x
    boundary = 102
  [../]
[]
[Executioner]
  type = Transient
  solve_type = PJFNK
  l_max_its = 100
  l_tol = 1e-4
  nl_abs_tol = 1e-8
  nl_rel_tol = 1e-12
  start_time = 0.0
  end_time = 1.0
  dt = 0.1
[]
[Outputs]
  csv = true
[]
(modules/combined/test/tests/gap_heat_transfer_mortar/finite-2d-rz/finite.i)
E_block = 1e7
E_plank = 1e7
elem = QUAD4
order = FIRST
name = 'finite'
[Mesh]
  patch_size = 80
  patch_update_strategy = auto
  [plank]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = 0.6
    ymin = -10
    ymax = 10
    nx = 2
    ny = 67
    elem_type = ${elem}
    boundary_name_prefix = plank
  []
  [plank_id]
    type = SubdomainIDGenerator
    input = plank
    subdomain_id = 1
  []
  [block]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0.61
    xmax = 1.21
    ymin = 7.7
    ymax = 8.5
    nx = 3
    ny = 4
    elem_type = ${elem}
    boundary_name_prefix = block
    boundary_id_offset = 10
  []
  [block_id]
    type = SubdomainIDGenerator
    input = block
    subdomain_id = 2
  []
  [combined]
    type = MeshCollectionGenerator
    inputs = 'plank_id block_id'
  []
  [block_rename]
    type = RenameBlockGenerator
    input = combined
    old_block_id = '1 2'
    new_block_name = 'plank block'
  []
  [secondary]
    input = block_rename
    type = LowerDBlockFromSidesetGenerator
    sidesets = 'block_left'
    new_block_id = '30'
    new_block_name = 'frictionless_secondary_subdomain'
  []
  [primary]
    input = secondary
    type = LowerDBlockFromSidesetGenerator
    sidesets = 'plank_right'
    new_block_id = '20'
    new_block_name = 'frictionless_primary_subdomain'
  []
[]
[Problem]
  coord_type = RZ
[]
[GlobalParams]
  displacements = 'disp_x disp_y'
[]
[Variables]
  [disp_x]
    order = ${order}
    block = 'plank block'
    scaling = ${fparse 2.0 / (E_plank + E_block)}
  []
  [disp_y]
    order = ${order}
    block = 'plank block'
    scaling = ${fparse 2.0 / (E_plank + E_block)}
  []
  [temp]
    order = ${order}
    block = 'plank block'
    scaling = 1e-1
  []
  [thermal_lm]
    order = ${order}
    block = 'frictionless_secondary_subdomain'
    scaling = 1e-7
  []
  [frictionless_normal_lm]
    order = FIRST
    block = 'frictionless_secondary_subdomain'
    scaling = 1e3
    use_dual = true
  []
[]
[Modules/TensorMechanics/Master]
  [action]
    generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx strain_yy strain_zz'
    block = 'plank block'
    use_automatic_differentiation = true
    strain = FINITE
  []
[]
[Kernels]
  [hc]
    type = ADHeatConduction
    variable = temp
    use_displaced_mesh = true
    block = 'plank block'
  []
[]
[Constraints]
  [weighted_gap_lm]
    type = ComputeWeightedGapLMMechanicalContact
    primary_boundary = plank_right
    secondary_boundary = block_left
    primary_subdomain = frictionless_primary_subdomain
    secondary_subdomain = frictionless_secondary_subdomain
    variable = frictionless_normal_lm
    disp_x = disp_x
    disp_y = disp_y
    use_displaced_mesh = true
  []
  [ncp_lm]
    type = ApplyPenetrationConstraintLMMechanicalContact
    secondary = block_left
    primary = plank_right
    variable = frictionless_normal_lm
    primary_variable = disp_x
  []
  [normal_x]
    type = NormalMortarMechanicalContact
    primary_boundary = plank_right
    secondary_boundary = block_left
    primary_subdomain = frictionless_primary_subdomain
    secondary_subdomain = frictionless_secondary_subdomain
    variable = frictionless_normal_lm
    secondary_variable = disp_x
    component = x
    use_displaced_mesh = true
    compute_lm_residuals = false
  []
  [normal_y]
    type = NormalMortarMechanicalContact
    primary_boundary = plank_right
    secondary_boundary = block_left
    primary_subdomain = frictionless_primary_subdomain
    secondary_subdomain = frictionless_secondary_subdomain
    variable = frictionless_normal_lm
    secondary_variable = disp_y
    component = y
    use_displaced_mesh = true
    compute_lm_residuals = false
  []
  [thermal_contact]
    type = GapConductanceConstraint
    variable = thermal_lm
    secondary_variable = temp
    k = 1
    use_displaced_mesh = true
    primary_boundary = plank_right
    primary_subdomain = frictionless_primary_subdomain
    secondary_boundary = block_left
    secondary_subdomain = frictionless_secondary_subdomain
    displacements = 'disp_x disp_y'
  []
[]
[BCs]
  [left_temp]
    type = DirichletBC
    variable = temp
    boundary = 'plank_left'
    value = 400
  []
  [right_temp]
    type = DirichletBC
    variable = temp
    boundary = 'block_right'
    value = 300
  []
  [left_x]
    type = DirichletBC
    variable = disp_x
    boundary = plank_left
    value = 0.0
  []
  [left_y]
    type = DirichletBC
    variable = disp_y
    boundary = plank_bottom
    value = 0.0
  []
  [right_x]
    type = ADFunctionDirichletBC
    variable = disp_x
    boundary = block_right
    function = '-0.04*sin(4*(t+1.5))+0.02'
    preset = false
  []
  [right_y]
    type = ADFunctionDirichletBC
    variable = disp_y
    boundary = block_right
    function = '-t'
    preset = false
  []
[]
[Materials]
  [plank]
    type = ADComputeIsotropicElasticityTensor
    block = 'plank'
    poissons_ratio = 0.3
    youngs_modulus = ${E_plank}
  []
  [block]
    type = ADComputeIsotropicElasticityTensor
    block = 'block'
    poissons_ratio = 0.3
    youngs_modulus = ${E_block}
  []
  [stress]
    type = ADComputeFiniteStrainElasticStress
    block = 'plank block'
  []
  [heat_plank]
    type = ADHeatConductionMaterial
    block = plank
    thermal_conductivity = 2
    specific_heat = 1
  []
  [heat_block]
    type = ADHeatConductionMaterial
    block = block
    thermal_conductivity = 1
    specific_heat = 1
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  petsc_options = '-snes_converged_reason -ksp_converged_reason'
  petsc_options_iname = '-pc_type -mat_mffd_err -pc_factor_shift_type -pc_factor_shift_amount -snes_max_it'
  petsc_options_value = 'lu       1e-5          NONZERO               1e-15                   20'
  end_time = 13.5
  dt = 0.1
  dtmin = 0.1
  timestep_tolerance = 1e-6
  line_search = 'none'
[]
[Postprocessors]
  [nl_its]
    type = NumNonlinearIterations
  []
  [total_nl_its]
    type = CumulativeValuePostprocessor
    postprocessor = nl_its
  []
  [l_its]
    type = NumLinearIterations
  []
  [total_l_its]
    type = CumulativeValuePostprocessor
    postprocessor = l_its
  []
  [contact]
    type = ContactDOFSetSize
    variable = frictionless_normal_lm
    subdomain = frictionless_secondary_subdomain
  []
  [avg_hydro]
    type = ElementAverageValue
    variable = hydrostatic_stress
    block = 'block'
  []
  [avg_temp]
    type = ElementAverageValue
    variable = temp
    block = 'block'
  []
  [max_hydro]
    type = ElementExtremeValue
    variable = hydrostatic_stress
    block = 'block'
  []
  [min_hydro]
    type = ElementExtremeValue
    variable = hydrostatic_stress
    block = 'block'
    value_type = min
  []
  [avg_vonmises]
    type = ElementAverageValue
    variable = vonmises_stress
    block = 'block'
  []
  [max_vonmises]
    type = ElementExtremeValue
    variable = vonmises_stress
    block = 'block'
  []
  [min_vonmises]
    type = ElementExtremeValue
    variable = vonmises_stress
    block = 'block'
    value_type = min
  []
[]
[Outputs]
  exodus = true
  file_base = ${name}
  checkpoint = true
  [comp]
    type = CSV
    show = 'contact avg_temp'
  []
  [out]
    type = CSV
    file_base = '${name}_out'
  []
[]
[Debug]
  show_var_residual_norms = true
[]
(modules/tensor_mechanics/test/tests/thermal_expansion/ad_constant_expansion_coeff_old.i)
# This test involves only thermal expansion strains on a 2x2x2 cube of approximate
# steel material.  An initial temperature of 25 degrees C is given for the material,
# and an auxkernel is used to calculate the temperature in the entire cube to
# raise the temperature each time step.  After the first timestep,in which the
# temperature jumps, the temperature increases by 6.25C each timestep.
# The thermal strain increment should therefore be
#     6.25 C * 1.3e-5 1/C = 8.125e-5 m/m.
# This test is also designed to be used to identify problems with restart files
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 2
  ny = 2
  nz = 2
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Variables]
  [./temp]
  [../]
[]
[Functions]
  [./temperature_load]
    type = ParsedFunction
    value = t*(500.0)+300.0
  [../]
[]
[Modules]
  [./TensorMechanics]
    [./Master]
      [./all]
        strain = SMALL
        incremental = true
        add_variables = true
        eigenstrain_names = eigenstrain
        generate_output = 'strain_xx strain_yy strain_zz'
        use_automatic_differentiation = true
      [../]
    [../]
  [../]
[]
[Kernels]
  [./tempfuncaux]
    type = Diffusion
    variable = temp
  [../]
[]
[BCs]
  [./x_bot]
    type = DirichletBC
    variable = disp_x
    boundary = left
    value = 0.0
  [../]
  [./y_bot]
    type = DirichletBC
    variable = disp_y
    boundary = bottom
    value = 0.0
  [../]
  [./z_bot]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0.0
  [../]
  [./temp]
    type = FunctionDirichletBC
    variable = temp
    function = temperature_load
    boundary = 'left right'
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ADComputeIsotropicElasticityTensor
    youngs_modulus = 2.1e5
    poissons_ratio = 0.3
  [../]
  [./small_stress]
    type = ADComputeFiniteStrainElasticStress
  [../]
  [./thermal_expansion_strain]
    type = ADComputeThermalExpansionEigenstrain
    stress_free_temperature = 298
    thermal_expansion_coeff = 1.3e-5
    temperature = temp
    eigenstrain_name = eigenstrain
    use_old_temperature = true
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  solve_type = 'NEWTON'
  l_max_its = 50
  nl_max_its = 50
  nl_rel_tol = 1e-12
  nl_abs_tol = 1e-10
  l_tol = 1e-9
  start_time = 0.0
  end_time = 0.075
  dt = 0.0125
  dtmin = 0.0001
[]
[Outputs]
  csv = true
  exodus = true
[]
[Postprocessors]
  [./strain_xx]
    type = ElementAverageValue
    variable = strain_xx
  [../]
  [./strain_yy]
    type = ElementAverageValue
    variable = strain_yy
  [../]
  [./strain_zz]
    type = ElementAverageValue
    variable = strain_zz
  [../]
  [./temperature]
    type = AverageNodalVariableValue
    variable = temp
  [../]
[]
(modules/contact/test/tests/mortar_tm/2d/ad_frictionless_fir/finite.i)
E_block = 1e7
E_plank = 1e7
elem = QUAD4
order = FIRST
name = 'finite'
[Mesh]
  patch_size = 80
  patch_update_strategy = auto
  [./plank]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = -0.3
    xmax = 0.3
    ymin = -10
    ymax = 10
    nx = 2
    ny = 67
    elem_type = ${elem}
    boundary_name_prefix = plank
  [../]
  [./plank_id]
    type = SubdomainIDGenerator
    input = plank
    subdomain_id = 1
  [../]
  [./block]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0.31
    xmax = 0.91
    ymin = 7.7
    ymax = 8.5
    nx = 3
    ny = 4
    elem_type = ${elem}
    boundary_name_prefix = block
    boundary_id_offset = 10
  [../]
  [./block_id]
    type = SubdomainIDGenerator
    input = block
    subdomain_id = 2
  [../]
  [./combined]
    type = MeshCollectionGenerator
    inputs = 'plank_id block_id'
  [../]
  [./block_rename]
    type = RenameBlockGenerator
    input = combined
    old_block_id = '1 2'
    new_block_name = 'plank block'
  [../]
[]
[GlobalParams]
  displacements = 'disp_x disp_y'
[]
[Variables]
  [./disp_x]
    order = ${order}
    block = 'plank block'
    scaling = ${fparse 2.0 / (E_plank + E_block)}
  [../]
  [./disp_y]
    order = ${order}
    block = 'plank block'
    scaling = ${fparse 2.0 / (E_plank + E_block)}
  [../]
[]
[Modules/TensorMechanics/Master]
  [./action]
    strain = FINITE
    generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx strain_yy strain_zz'
    block = 'plank block'
    use_automatic_differentiation = true
  [../]
[]
[Contact]
  [./frictionless]
    mesh = block_rename
    primary = plank_right
    secondary = block_left
    formulation = mortar
  [../]
[]
[BCs]
  [./left_x]
    type = DirichletBC
    variable = disp_x
    boundary = plank_left
    value = 0.0
  [../]
  [./left_y]
    type = DirichletBC
    variable = disp_y
    boundary = plank_bottom
    value = 0.0
  [../]
  [./right_x]
    type = ADFunctionDirichletBC
    variable = disp_x
    boundary = block_right
    function = '-0.04*sin(4*(t+1.5))+0.02'
  [../]
  [./right_y]
    type = ADFunctionDirichletBC
    variable = disp_y
    boundary = block_right
    function = '-t'
  [../]
[]
[Materials]
  [./plank]
    type = ADComputeIsotropicElasticityTensor
    block = 'plank'
    poissons_ratio = 0.3
    youngs_modulus = ${E_plank}
  [../]
  [./block]
    type = ADComputeIsotropicElasticityTensor
    block = 'block'
    poissons_ratio = 0.3
    youngs_modulus = ${E_block}
  [../]
  [./stress]
    type = ADComputeFiniteStrainElasticStress
    block = 'plank block'
  [../]
[]
[Executioner]
  type = Transient
  solve_type = 'NEWTON'
  petsc_options = '-snes_converged_reason -ksp_converged_reason'
  petsc_options_iname = '-pc_type -mat_mffd_err -pc_factor_shift_type -pc_factor_shift_amount'
  petsc_options_value = 'lu       1e-5          NONZERO               1e-15'
  end_time = 13.5
  dt = 0.1
  dtmin = 0.1
  timestep_tolerance = 1e-6
  line_search = 'contact'
[]
[Postprocessors]
  [./nl_its]
    type = NumNonlinearIterations
  [../]
  [./total_nl_its]
    type = CumulativeValuePostprocessor
    postprocessor = nl_its
  [../]
  [./l_its]
    type = NumLinearIterations
  [../]
  [./total_l_its]
    type = CumulativeValuePostprocessor
    postprocessor = l_its
  [../]
  [./contact]
    type = ContactDOFSetSize
    variable = frictionless_normal_lm
    subdomain = frictionless_secondary_subdomain
  [../]
  [./avg_hydro]
    type = ElementAverageValue
    variable = hydrostatic_stress
    block = 'block'
  [../]
  [./max_hydro]
    type = ElementExtremeValue
    variable = hydrostatic_stress
    block = 'block'
  [../]
  [./min_hydro]
    type = ElementExtremeValue
    variable = hydrostatic_stress
    block = 'block'
    value_type = min
  [../]
  [./avg_vonmises]
    type = ElementAverageValue
    variable = vonmises_stress
    block = 'block'
  [../]
  [./max_vonmises]
    type = ElementExtremeValue
    variable = vonmises_stress
    block = 'block'
  [../]
  [./min_vonmises]
    type = ElementExtremeValue
    variable = vonmises_stress
    block = 'block'
    value_type = min
  [../]
[]
[Outputs]
  exodus = true
  file_base = ${name}
  [./comp]
    type = CSV
    show = 'contact'
  [../]
  [./out]
    type = CSV
    file_base = '${name}_out'
  [../]
[]
[Debug]
  show_var_residual_norms = true
[]
(modules/combined/test/tests/exception/ad.i)
[GlobalParams]
  order = SECOND
  displacements = 'disp_x disp_y'
[]
[Problem]
  coord_type = RZ
[]
[Mesh]
  patch_update_strategy = iteration
  [./gen]
    type = FileMeshGenerator
    file = mesh.e
  [../]
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./temp]
    initial_condition = 501
  [../]
[]
[AuxVariables]
  [./density_aux]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[Modules/TensorMechanics/Master]
  [./finite]
    strain = FINITE
    use_automatic_differentiation = true
  [../]
[]
[Kernels]
  [./gravity]
    type = ADGravity
    variable = disp_y
    value = -9.81
  [../]
  [./heat]
    type = ADMatDiffusion
    variable = temp
    diffusivity = 1
  [../]
  [./heat_ie]
    type = ADTimeDerivative
    variable = temp
  [../]
[]
[AuxKernels]
  [./conductance]
    type = ADMaterialRealAux
    property = density
    variable = density_aux
    boundary = inner_surface
  [../]
[]
[ThermalContact]
  [./thermal_contact]
    type = GapHeatTransfer
    variable = temp
    primary = outer_interior
    secondary = inner_surface
    emissivity_primary = 0
    emissivity_secondary = 0
    quadrature = true
  [../]
[]
[BCs]
  [./no_x]
    type = ADDirichletBC
    variable = disp_x
    boundary = 'centerline'
    value = 0.0
  [../]
  [./no_y]
    type = ADDirichletBC
    variable = disp_y
    boundary = 'centerline outer_exterior'
    value = 0.0
  [../]
  [./temp]
    type = FunctionDirichletBC
    boundary = outer_exterior
    variable = temp
    function = '500 + t'
  [../]
[]
[Materials]
  [./density]
    type = ADGenericConstantMaterial
    prop_names = 'density'
    prop_values = '1'
  [../]
  [./elasticity_tensor]
    type = ADComputeIsotropicElasticityTensor
    youngs_modulus = 1e11
    poissons_ratio = 0.3
  [../]
  [./inner_elastic_stress]
    type = ADComputeMultipleInelasticStress
    inelastic_models = 'inner_creep'
    block = inner
    outputs = all
  [../]
  [./inner_creep]
    type = ADPowerLawCreepExceptionTest
    coefficient = 10e-22
    n_exponent = 2
    activation_energy = 0
    block = inner
  [../]
  [./outer_stressstress]
    type = ADComputeFiniteStrainElasticStress
    block = outer
  [../]
[]
[Executioner]
  type = Transient
  petsc_options = ' -snes_converged_reason -ksp_converged_reason'
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  line_search = none
  nl_abs_tol = 1e-7
  l_max_its = 20
  num_steps = 1
  dt = 1
  dtmin = .1
[]
[Outputs]
  exodus = true
[]
(modules/contact/test/tests/mortar_tm/2drz/ad_frictionless_second/finite.i)
E_block = 1e7
E_plank = 1e7
elem = QUAD9
order = SECOND
name = 'finite'
[Problem]
  coord_type = RZ
[]
[Mesh]
  patch_size = 80
  patch_update_strategy = auto
  [./plank]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = 0.6
    ymin = 0
    ymax = 10
    nx = 2
    ny = 33
    elem_type = ${elem}
    boundary_name_prefix = plank
  [../]
  [./plank_id]
    type = SubdomainIDGenerator
    input = plank
    subdomain_id = 1
  [../]
  [./block]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0.61
    xmax = 1.21
    ymin = 9.2
    ymax = 10.0
    nx = 3
    ny = 4
    elem_type = ${elem}
    boundary_name_prefix = block
    boundary_id_offset = 10
  [../]
  [./block_id]
    type = SubdomainIDGenerator
    input = block
    subdomain_id = 2
  [../]
  [./combined]
    type = MeshCollectionGenerator
    inputs = 'plank_id block_id'
  [../]
  [./block_rename]
    type = RenameBlockGenerator
    input = combined
    old_block_id = '1 2'
    new_block_name = 'plank block'
  [../]
[]
[GlobalParams]
  displacements = 'disp_x disp_y'
[]
[Variables]
  [./disp_x]
    order = ${order}
    block = 'plank block'
    scaling = ${fparse 2.0 / (E_plank + E_block)}
  [../]
  [./disp_y]
    order = ${order}
    block = 'plank block'
    scaling = ${fparse 2.0 / (E_plank + E_block)}
  [../]
[]
[Modules/TensorMechanics/Master]
  [./block]
    use_automatic_differentiation = true
    strain = FINITE
    generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx strain_yy strain_zz'
    block = 'block'
  [../]
  [./plank]
    use_automatic_differentiation = true
    strain = FINITE
    generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx strain_yy strain_zz'
    block = 'plank'
    eigenstrain_names = 'swell'
  [../]
[]
[Contact]
  [./frictionless]
    mesh = block_rename
    primary = plank_right
    secondary = block_left
    formulation = mortar
  [../]
[]
[BCs]
  [./left_x]
    type = DirichletBC
    variable = disp_x
    preset = false
    boundary = plank_left
    value = 0.0
  [../]
  [./left_y]
    type = DirichletBC
    variable = disp_y
    preset = false
    boundary = plank_bottom
    value = 0.0
  [../]
  [./right_x]
    type = DirichletBC
    variable = disp_x
    preset = false
    boundary = block_right
    value = 0
  [../]
  [./right_y]
    type = ADFunctionDirichletBC
    variable = disp_y
    preset = false
    boundary = block_right
    function = '-t'
  [../]
[]
[Materials]
  [./plank]
    type = ADComputeIsotropicElasticityTensor
    block = 'plank'
    poissons_ratio = 0.3
    youngs_modulus = ${E_plank}
  [../]
  [./block]
    type = ADComputeIsotropicElasticityTensor
    block = 'block'
    poissons_ratio = 0.3
    youngs_modulus = ${E_block}
  [../]
  [./stress]
    type = ADComputeFiniteStrainElasticStress
    block = 'plank block'
  [../]
  [./swell]
    type = ADComputeEigenstrain
    block = 'plank'
    eigenstrain_name = swell
    eigen_base = '1 0 0 0 0 0 0 0 0'
    prefactor = swell_mat
  [../]
  [./swell_mat]
    type = ADGenericFunctionMaterial
    prop_names = 'swell_mat'
    prop_values = '7e-2*(1-cos(4*t))'
    block = 'plank'
  [../]
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  petsc_options = '-snes_converged_reason -ksp_converged_reason'
  petsc_options_iname = '-pc_type -mat_mffd_err -pc_factor_shift_type -pc_factor_shift_amount'
  petsc_options_value = 'lu       1e-5          NONZERO               1e-15'
  end_time = 5
  dt = 0.1
  dtmin = 0.1
  timestep_tolerance = 1e-6
  line_search = 'contact'
[]
[Postprocessors]
  [./nl_its]
    type = NumNonlinearIterations
  [../]
  [./total_nl_its]
    type = CumulativeValuePostprocessor
    postprocessor = nl_its
  [../]
  [./l_its]
    type = NumLinearIterations
  [../]
  [./total_l_its]
    type = CumulativeValuePostprocessor
    postprocessor = l_its
  [../]
  [./contact]
    type = ContactDOFSetSize
    variable = frictionless_normal_lm
    subdomain = frictionless_secondary_subdomain
  [../]
  [./avg_hydro]
    type = ElementAverageValue
    variable = hydrostatic_stress
    block = 'block'
  [../]
  [./max_hydro]
    type = ElementExtremeValue
    variable = hydrostatic_stress
    block = 'block'
  [../]
  [./min_hydro]
    type = ElementExtremeValue
    variable = hydrostatic_stress
    block = 'block'
    value_type = min
  [../]
  [./avg_vonmises]
    type = ElementAverageValue
    variable = vonmises_stress
    block = 'block'
  [../]
  [./max_vonmises]
    type = ElementExtremeValue
    variable = vonmises_stress
    block = 'block'
  [../]
  [./min_vonmises]
    type = ElementExtremeValue
    variable = vonmises_stress
    block = 'block'
    value_type = min
  [../]
[]
[Outputs]
  exodus = true
  file_base = ${name}
  [./comp]
    type = CSV
    show = 'contact'
  [../]
  [./out]
    type = CSV
    file_base = '${name}_out'
  [../]
[]
[Debug]
  show_var_residual_norms = true
[]
(modules/tensor_mechanics/test/tests/ad_2D_geometries/2D-RZ_centerline_VLC.i)
# Simple test to check for use of AxisymmetricCenterlineAverageValue with
# volumetric_locking_correction activated in a tensor mechanics simulation
[Mesh]
  type = GeneratedMesh
  dim = 2
[]
[GlobalParams]
  displacements = 'disp_r disp_z'
  volumetric_locking_correction = true
[]
[Problem]
  coord_type = RZ
[]
[Modules/TensorMechanics/Master]
  [./all]
    strain = FINITE
    add_variables = true
    use_automatic_differentiation = true
  [../]
[]
[AuxVariables]
  [./temperature]
    initial_condition = 298.0
  [../]
[]
[BCs]
  [./symmetry_x]
    type = ADDirichletBC
    variable = disp_r
    value = 0
    boundary = left
  [../]
  [./roller_z]
    type = ADDirichletBC
    variable = disp_z
    value = 0
    boundary = bottom
  [../]
  [./top_load]
    type = ADFunctionDirichletBC
    variable = disp_z
    function = -0.01*t
    boundary = top
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ADComputeIsotropicElasticityTensor
    youngs_modulus = 1e10
    poissons_ratio = 0.3
  [../]
  [./_elastic_strain]
    type = ADComputeFiniteStrainElasticStress
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  line_search = 'none'
  nl_rel_tol = 1e-8
  nl_abs_tol = 1e-10
  nl_max_its = 15
  l_tol = 1e-6
  l_max_its = 50
  start_time = 0.0
  end_time = 0.3
  dt = 0.1
[]
[Postprocessors]
  [./center_temperature]
    type = AxisymmetricCenterlineAverageValue
    variable = temperature
    boundary = left
  [../]
[]
[Outputs]
  csv = true
  perf_graph = true
[]
(modules/combined/test/tests/ad_cavity_pressure/3d.i)
#
# Cavity Pressure Test
#
# This test is designed to compute an internal pressure based on
#   p = n * R * T / V
# where
#   p is the pressure
#   n is the amount of material in the volume (moles)
#   R is the universal gas constant
#   T is the temperature
#   V is the volume
#
# The mesh is composed of one block (1) with an interior cavity of volume 8.
#   Block 2 sits in the cavity and has a volume of 1.  Thus, the total
#   initial volume is 7.
# The test adjusts n, T, and V in the following way:
#   n => n0 + alpha * t
#   T => T0 + beta * t
#   V => V0 + gamma * t
# with
#   alpha = n0
#   beta = T0 / 2
#   gamma = - (0.003322259...) * V0
#   T0 = 240.54443866068704
#   V0 = 7
#   n0 = f(p0)
#   p0 = 100
#   R = 8.314472 J * K^(-1) * mol^(-1)
#
# So, n0 = p0 * V0 / R / T0 = 100 * 7 / 8.314472 / 240.544439
#        = 0.35
#
# The parameters combined at t = 1 gives p = 301.
#
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
  volumetric_locking_correction = true
[]
[Mesh]
  file = 3d.e
[]
[Functions]
  [./displ_positive]
    type = PiecewiseLinear
    x = '0 1'
    y = '0 0.0029069767441859684'
  [../]
  [./displ_negative]
    type = PiecewiseLinear
    x = '0 1'
    y = '0 -0.0029069767441859684'
  [../]
  [./temp1]
    type = PiecewiseLinear
    x = '0 1'
    y = '1 1.5'
    scale_factor = 240.54443866068704
  [../]
  [./material_input_function]
    type = PiecewiseLinear
    x = '0    1'
    y = '0 0.35'
  [../]
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
  [./temp]
    initial_condition = 240.54443866068704
  [../]
  [./material_input]
  [../]
[]
[AuxVariables]
  [./pressure_residual_x]
  [../]
  [./pressure_residual_y]
  [../]
  [./pressure_residual_z]
  [../]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zx]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[Kernels]
  [./TensorMechanics]
    use_displaced_mesh = true
    use_automatic_differentiation = true
  [../]
  [./heat]
    type = ADDiffusion
    variable = temp
    use_displaced_mesh = true
  [../]
  [./material_input_dummy]
    type = ADDiffusion
    variable = material_input
    use_displaced_mesh = true
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = ADRankTwoAux
    rank_two_tensor = stress
    index_i = 0
    index_j = 0
    variable = stress_xx
  [../]
  [./stress_yy]
    type = ADRankTwoAux
    rank_two_tensor = stress
    index_i = 1
    index_j = 1
    variable = stress_yy
  [../]
  [./stress_zz]
    type = ADRankTwoAux
    rank_two_tensor = stress
    index_i = 2
    index_j = 2
    variable = stress_zz
  [../]
  [./stress_xy]
    type = ADRankTwoAux
    rank_two_tensor = stress
    index_i = 0
    index_j = 1
    variable = stress_xy
  [../]
  [./stress_yz]
    type = ADRankTwoAux
    rank_two_tensor = stress
    index_i = 1
    index_j = 2
    variable = stress_yz
  [../]
  [./stress_zx]
    type = ADRankTwoAux
    rank_two_tensor = stress
    index_i = 2
    index_j = 0
    variable = stress_zx
  [../]
[]
[BCs]
  [./no_x_exterior]
    type = DirichletBC
    variable = disp_x
    boundary = '7 8'
    value = 0.0
  [../]
  [./no_y_exterior]
    type = DirichletBC
    variable = disp_y
    boundary = '9 10'
    value = 0.0
  [../]
  [./no_z_exterior]
    type = DirichletBC
    variable = disp_z
    boundary = '11 12'
    value = 0.0
  [../]
  [./prescribed_left]
    type = ADFunctionDirichletBC
    variable = disp_x
    boundary = 13
    function = displ_positive
  [../]
  [./prescribed_right]
    type = ADFunctionDirichletBC
    variable = disp_x
    boundary = 14
    function = displ_negative
  [../]
  [./no_y]
    type = DirichletBC
    variable = disp_y
    boundary = '15 16'
    value = 0.0
  [../]
  [./no_z]
    type = DirichletBC
    variable = disp_z
    boundary = '17 18'
    value = 0.0
  [../]
  [./no_x_interior]
    type = DirichletBC
    variable = disp_x
    boundary = '1 2'
    value = 0.0
  [../]
  [./no_y_interior]
    type = DirichletBC
    variable = disp_y
    boundary = '3 4'
    value = 0.0
  [../]
  [./no_z_interior]
    type = DirichletBC
    variable = disp_z
    boundary = '5 6'
    value = 0.0
  [../]
  [./temperatureInterior]
    type = ADFunctionDirichletBC
    boundary = 100
    function = temp1
    variable = temp
  [../]
  [./MaterialInput]
    type = ADFunctionDirichletBC
    boundary = '100 13 14 15 16'
    function = material_input_function
    variable = material_input
  [../]
  [./CavityPressure]
    [./1]
      boundary = 100
      initial_pressure = 100
      material_input = materialInput
      R = 8.314472
      temperature = aveTempInterior
      volume = internalVolume
      startup_time = 0.5
      output = ppress
      save_in = 'pressure_residual_x pressure_residual_y pressure_residual_z'
      use_automatic_differentiation = true
    [../]
  [../]
[]
[Materials]
  [./elast_tensor1]
    type = ADComputeIsotropicElasticityTensor
    youngs_modulus = 1e1
    poissons_ratio = 0
    block = 1
  [../]
  [./strain1]
    type = ADComputeFiniteStrain
    block = 1
  [../]
  [./stress1]
    type = ADComputeFiniteStrainElasticStress
    block = 1
  [../]
  [./elast_tensor2]
    type = ADComputeIsotropicElasticityTensor
    youngs_modulus = 1e6
    poissons_ratio = 0
    block = 2
  [../]
  [./strain2]
    type = ADComputeFiniteStrain
    block = 2
  [../]
  [./stress2]
    type = ADComputeFiniteStrainElasticStress
    block = 2
  [../]
[]
[Executioner]
  type = Transient
  solve_type = 'NEWTON'
  petsc_options_iname = '-pc_type -sub_pc_type'
  petsc_options_value = 'asm       lu'
  nl_rel_tol = 1e-12
  l_tol = 1e-12
  l_max_its = 20
  dt = 0.5
  end_time = 1.0
[]
[Postprocessors]
  [./internalVolume]
    type = InternalVolume
    boundary = 100
    execute_on = 'initial linear'
  [../]
  [./aveTempInterior]
    type = SideAverageValue
    boundary = 100
    variable = temp
    execute_on = 'initial linear'
  [../]
  [./materialInput]
    type = SideAverageValue
    boundary = '7 8 9 10 11 12'
    variable = material_input
    execute_on = linear
  [../]
[]
[Outputs]
  exodus = true
[]
(tutorials/darcy_thermo_mech/step09_mechanics/problems/step9.i)
[GlobalParams]
  displacements = 'disp_r disp_z'
[]
[Mesh]
  [generate]
    type = GeneratedMeshGenerator
    dim = 2
    ny = 200
    nx = 10
    ymax = 0.304 # Length of test chamber
    xmax = 0.0257 # Test chamber radius
  []
  [bottom]
    type = SubdomainBoundingBoxGenerator
    input = generate
    location = inside
    bottom_left = '0 0 0'
    top_right = '0.01285 0.304 0'
    block_id = 1
  []
[]
[Variables]
  [pressure]
  []
  [temperature]
    initial_condition = 300 # Start at room temperature
  []
[]
[AuxVariables]
  [velocity]
    order = CONSTANT
    family = MONOMIAL_VEC
  []
[]
[Modules/TensorMechanics/Master]
  [all]
    # This block adds all of the proper Kernels, strain calculators, and Variables
    # for TensorMechanics in the correct coordinate system (autodetected)
    add_variables = true
    strain = FINITE
    eigenstrain_names = eigenstrain
    use_automatic_differentiation = true
    generate_output = 'vonmises_stress elastic_strain_xx elastic_strain_yy strain_xx strain_yy'
  []
[]
[Kernels]
  [darcy_pressure]
    type = DarcyPressure
    variable = pressure
  []
  [heat_conduction]
    type = ADHeatConduction
    variable = temperature
  []
  [heat_conduction_time_derivative]
    type = ADHeatConductionTimeDerivative
    variable = temperature
  []
  [heat_convection]
    type = DarcyAdvection
    variable = temperature
    pressure = pressure
  []
[]
[AuxKernels]
  [velocity]
    type = DarcyVelocity
    variable = velocity
    execute_on = timestep_end
    pressure = pressure
  []
[]
[BCs]
  [inlet]
    type = DirichletBC
    variable = pressure
    boundary = bottom
    value = 4000 # (Pa) From Figure 2 from paper.  First data point for 1mm spheres.
  []
  [outlet]
    type = DirichletBC
    variable = pressure
    boundary = top
    value = 0 # (Pa) Gives the correct pressure drop from Figure 2 for 1mm spheres
  []
  [inlet_temperature]
    type = FunctionDirichletBC
    variable = temperature
    boundary = bottom
    function = 'if(t<0,350+50*t,350)'
  []
  [outlet_temperature]
    type = HeatConductionOutflow
    variable = temperature
    boundary = top
  []
  [hold_inlet]
    type = DirichletBC
    variable = disp_z
    boundary = bottom
    value = 0
  []
  [hold_center]
    type = DirichletBC
    variable = disp_r
    boundary = left
    value = 0
  []
  [hold_outside]
    type = DirichletBC
    variable = disp_r
    boundary = right
    value = 0
  []
[]
[Materials]
  viscosity_file = data/water_viscosity.csv
  density_file = data/water_density.csv
  thermal_conductivity_file = data/water_thermal_conductivity.csv
  specific_heat_file = data/water_specific_heat.csv
  thermal_expansion_file = data/water_thermal_expansion.csv
  [column_top]
    type = PackedColumn
    block = 0
    temperature = temperature
    radius = 1.15
    fluid_viscosity_file = ${viscosity_file}
    fluid_density_file = ${density_file}
    fluid_thermal_conductivity_file = ${thermal_conductivity_file}
    fluid_specific_heat_file = ${specific_heat_file}
    fluid_thermal_expansion_file = ${thermal_expansion_file}
  []
  [column_bottom]
    type = PackedColumn
    block = 1
    temperature = temperature
    radius = 1
    fluid_viscosity_file = ${viscosity_file}
    fluid_density_file = ${density_file}
    fluid_thermal_conductivity_file = ${thermal_conductivity_file}
    fluid_specific_heat_file = ${specific_heat_file}
    fluid_thermal_expansion_file = ${thermal_expansion_file}
  []
  [elasticity_tensor]
    type = ADComputeIsotropicElasticityTensor
    youngs_modulus = 200e9 # (Pa) from wikipedia
    poissons_ratio = .3 # from wikipedia
  []
  [elastic_stress]
    type = ADComputeFiniteStrainElasticStress
  []
  [thermal_strain]
    type = ADComputeThermalExpansionEigenstrain
    stress_free_temperature = 300
    eigenstrain_name = eigenstrain
    temperature = temperature
    thermal_expansion_coeff = 1e-5 # TM modules doesn't support material property, but it will
  []
[]
[Postprocessors]
  [average_temperature]
    type = ElementAverageValue
    variable = temperature
  []
[]
[Problem]
  type = FEProblem
  coord_type = RZ
[]
[Executioner]
  type = Transient
  start_time = -1
  end_time = 200
  steady_state_tolerance = 1e-7
  steady_state_detection = true
  dt = 0.25
  solve_type = PJFNK
  automatic_scaling = true
  compute_scaling_once = false
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  #petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart'
  #petsc_options_value = 'hypre boomeramg 500'
  line_search = none
  [TimeStepper]
    type = FunctionDT
    function = 'if(t<0,0.1,0.25)'
  []
[]
[Outputs]
  [out]
    type = Exodus
    elemental_as_nodal = true
  []
[]
(modules/tensor_mechanics/test/tests/finite_strain_elastic_anisotropy/3d_bar_orthotropic_full_rotation_ad.i)
[Mesh]
  [generated_mesh]
    type = GeneratedMeshGenerator
    dim = 3
    xmin = 0
    xmax = 2
    ymin = 0
    ymax = 10
    zmin = 0
    zmax = 2
    nx = 1
    ny = 1
    nz = 1
    elem_type = HEX8
  []
  [corner]
    type = ExtraNodesetGenerator
    new_boundary = 101
    coord = '0 0 0'
    input = generated_mesh
  []
  [side]
    type = ExtraNodesetGenerator
    new_boundary = 102
    coord = '2 0 0'
    input = corner
  []
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Modules/TensorMechanics/Master]
  [all]
    strain = FINITE
    add_variables = true
    use_finite_deform_jacobian = true
    volumetric_locking_correction = false
    generate_output = 'stress_xx stress_yy stress_zz stress_xy stress_xz'
    use_automatic_differentiation = true
  []
[]
[Materials]
  [stress]
    type = ADComputeFiniteStrainElasticStress
  []
  [elasticity_tensor]
    type = ADComputeElasticityTensor
    fill_method = orthotropic
    C_ijkl = '2.0e3 2.0e5 2.0e3 0.71428571e3 0.71428571e3 0.71428571e3 0.4 0.2 0.004 0.004 0.2 0.4'
  []
[]
[BCs]
  [fix_z]
    type = ADDirichletBC
    variable = disp_z
    boundary = bottom
    value = 0
  []
  [rot_y]
    type = DisplacementAboutAxis
    boundary = bottom
    function = t
    angle_units = degrees
    axis_origin = '0. 0. 0.'
    axis_direction = '0. 0. 1.'
    component = 1
    variable = disp_y
  []
  #
  [rot_x]
    type = DisplacementAboutAxis
    boundary = bottom
    function = t
    angle_units = degrees
    axis_origin = '0. 0. 0.'
    axis_direction = '0. 0. 1.'
    component = 0
    variable = disp_x
  []
  [rot_y90]
    type = DisplacementAboutAxis
    boundary = bottom
    function = 360
    angle_units = degrees
    axis_origin = '0. 0. 0.'
    axis_direction = '0. 0. 1.'
    component = 1
    variable = disp_y
  []
  #
  [rot_x90]
    type = DisplacementAboutAxis
    boundary = bottom
    function = 360
    angle_units = degrees
    axis_origin = '0. 0. 0.'
    axis_direction = '0. 0. 1.'
    component = 0
    variable = disp_x
  []
  [press]
    boundary = top
    function = '-1.0*(t-360)*10.0'
    use_displaced_mesh = true
    displacements = 'disp_x disp_y disp_z'
    type = Pressure
    variable = disp_y
    component = 1
  []
[]
[Controls]
  [c1]
    type = TimePeriod
    enable_objects = 'BCs::rot_x BCs::rot_y'
    disable_objects = 'BCs::rot_x90 BCs::rot_y90 BCs::press'
    start_time = '0'
    end_time = '360'
  []
  [c190plus]
    type = TimePeriod
    enable_objects = 'BCs::rot_x90 BCs::rot_y90 BCs::press'
    disable_objects = 'BCs::rot_x BCs::rot_y '
    start_time = '360'
    end_time = '660'
  []
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  petsc_options = '-snes_ksp_ew'
  petsc_options_iname = '-ksp_gmres_restart'
  petsc_options_value = '101'
  line_search = 'none'
  nl_rel_tol = 1e-10
  nl_abs_tol = 1e-08
  nl_max_its = 50
  l_tol = 1e-4
  l_max_its = 50
  start_time = 0.0
  dt = 5
  dtmin = 5
  num_steps = 132
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Outputs]
  exodus = true
[]
(modules/tensor_mechanics/test/tests/ad_action/two_block_new.i)
[Mesh]
  [generated_mesh]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 4
    ny = 4
  []
  [block1]
    type = SubdomainBoundingBoxGenerator
    block_id = 1
    bottom_left = '0 0 0'
    top_right = '0.5 1 0'
    input = generated_mesh
  []
  [block2]
    type = SubdomainBoundingBoxGenerator
    block_id = 2
    bottom_left = '0.5 0 0'
    top_right = '1 1 0'
    input = block1
  []
[]
[GlobalParams]
  displacements = 'disp_x disp_y'
[]
[Modules/TensorMechanics/Master]
  # parameters that apply to all subblocks are specified at this level. They
  # can be overwritten in the subblocks.
  add_variables = true
  strain = FINITE
  generate_output = 'stress_xx'
  [./block1]
    # the `block` parameter is only valid insde a subblock.
    block = 1
    use_automatic_differentiation = true
  [../]
  [./block2]
    block = 2
    # the `additional_generate_output` parameter is also only valid inside a
    # subblock. Values specified here are appended to the `generate_output`
    # parameter values.
    additional_generate_output = 'strain_yy'
    use_automatic_differentiation = true
  [../]
[]
[AuxVariables]
  [./stress_theta]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strain_theta]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_theta]
    type = ADRankTwoAux
    rank_two_tensor = stress
    index_i = 2
    index_j = 2
    variable = stress_theta
    execute_on = timestep_end
  [../]
  [./strain_theta]
    type = ADRankTwoAux
    rank_two_tensor = total_strain
    index_i = 2
    index_j = 2
    variable = strain_theta
    execute_on = timestep_end
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ADComputeIsotropicElasticityTensor
    youngs_modulus = 1e10
    poissons_ratio = 0.345
  [../]
  [./_elastic_stress1]
    type = ADComputeFiniteStrainElasticStress
    block = 1
  [../]
  [./_elastic_stress2]
    type = ADComputeFiniteStrainElasticStress
    block = 2
  [../]
[]
[BCs]
  [./left]
    type = DirichletBC
    boundary = 'left'
    variable = disp_x
    value = 0.0
  [../]
  [./top]
    type = DirichletBC
    boundary = 'top'
    variable = disp_y
    value = 0.0
  [../]
  [./right]
    type = DirichletBC
    boundary = 'right'
    variable = disp_x
    value = 0.01
  [../]
  [./bottom]
    type = DirichletBC
    boundary = 'bottom'
    variable = disp_y
    value = 0.01
  [../]
[]
[Debug]
  show_var_residual_norms = true
[]
[Preconditioning]
  [./full]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Steady
  petsc_options_iname = '-ksp_gmres_restart -pc_type -pc_hypre_type -pc_hypre_boomeramg_max_iter'
  petsc_options_value = '  201               hypre    boomeramg      10'
  line_search = 'none'
  nl_rel_tol = 5e-9
  nl_abs_tol = 1e-10
  nl_max_its = 15
  l_tol = 1e-3
  l_max_its = 50
[]
[Outputs]
  exodus = true
[]
(modules/tensor_mechanics/test/tests/plane_stress/ad_weak_plane_stress_finite.i)
[GlobalParams]
  displacements = 'disp_x disp_y'
  temperature = temp
  out_of_plane_strain = strain_zz
[]
[Mesh]
  [./square]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 2
    ny = 2
  [../]
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./strain_zz]
  [../]
[]
[AuxVariables]
  [./temp]
  [../]
  [./nl_strain_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[Postprocessors]
  [./react_z]
    type = ADMaterialTensorIntegral
    rank_two_tensor = stress
    index_i = 2
    index_j = 2
  [../]
  [./min_strain_zz]
    type = NodalExtremeValue
    variable = strain_zz
    value_type = min
  [../]
  [./max_strain_zz]
    type = NodalExtremeValue
    variable = strain_zz
    value_type = max
  [../]
[]
[Modules/TensorMechanics/Master]
  [./plane_stress]
    planar_formulation = WEAK_PLANE_STRESS
    strain = FINITE
    generate_output = 'stress_xx stress_xy stress_yy stress_zz strain_xx strain_xy strain_yy'
    eigenstrain_names = eigenstrain
    use_automatic_differentiation = true
  [../]
[]
[AuxKernels]
  [./tempfuncaux]
    type = FunctionAux
    variable = temp
    function = tempfunc
    use_displaced_mesh = false
  [../]
  [./strain_zz]
    type = ADRankTwoAux
    rank_two_tensor = total_strain
    variable = nl_strain_zz
    index_i = 2
    index_j = 2
  [../]
[]
[Functions]
  [./pull]
    type = PiecewiseLinear
    x='0     1   100'
    y='0  0.00  0.00'
  [../]
  [./tempfunc]
    type = ParsedFunction
    value = '(1 - x) * t'
  [../]
[]
[BCs]
  [./bottomx]
    type = DirichletBC
    boundary = 0
    variable = disp_x
    value = 0.0
  [../]
  [./bottomy]
    type = DirichletBC
    boundary = 0
    variable = disp_y
    value = 0.0
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ADComputeIsotropicElasticityTensor
    poissons_ratio = 0.3
    youngs_modulus = 1e6
  [../]
  [./thermal_strain]
    type = ADComputeThermalExpansionEigenstrain
    thermal_expansion_coeff = 0.02
    stress_free_temperature = 0.5
    eigenstrain_name = eigenstrain
  [../]
  [./stress]
    type = ADComputeFiniteStrainElasticStress
  [../]
[]
[Executioner]
  type = Transient
  solve_type = 'NEWTON'
  # controls for nonlinear iterations
  nl_max_its = 15
  nl_rel_tol = 1e-14
  nl_abs_tol = 1e-12
  # time control
  start_time = 0.0
  dt = 1.0
  dtmin = 1.0
  end_time = 2.0
[]
[Outputs]
  file_base = 'weak_plane_stress_finite_out'
  exodus = true
[]
(modules/combined/test/tests/gap_heat_transfer_mortar/finite-2d/finite.i)
E_block = 1e7
E_plank = 1e7
elem = QUAD4
order = FIRST
name = 'finite'
[Mesh]
  patch_size = 80
  patch_update_strategy = auto
  [plank]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = -0.3
    xmax = 0.3
    ymin = -10
    ymax = 10
    nx = 2
    ny = 67
    elem_type = ${elem}
    boundary_name_prefix = plank
  []
  [plank_id]
    type = SubdomainIDGenerator
    input = plank
    subdomain_id = 1
  []
  [block]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0.31
    xmax = 0.91
    ymin = 7.7
    ymax = 8.5
    nx = 3
    ny = 4
    elem_type = ${elem}
    boundary_name_prefix = block
    boundary_id_offset = 10
  []
  [block_id]
    type = SubdomainIDGenerator
    input = block
    subdomain_id = 2
  []
  [combined]
    type = MeshCollectionGenerator
    inputs = 'plank_id block_id'
  []
  [block_rename]
    type = RenameBlockGenerator
    input = combined
    old_block_id = '1 2'
    new_block_name = 'plank block'
  []
  [secondary]
    input = block_rename
    type = LowerDBlockFromSidesetGenerator
    sidesets = 'block_left'
    new_block_id = '30'
    new_block_name = 'frictionless_secondary_subdomain'
  []
  [primary]
    input = secondary
    type = LowerDBlockFromSidesetGenerator
    sidesets = 'plank_right'
    new_block_id = '20'
    new_block_name = 'frictionless_primary_subdomain'
  []
[]
[GlobalParams]
  displacements = 'disp_x disp_y'
[]
[Variables]
  [disp_x]
    order = ${order}
    block = 'plank block'
    scaling = ${fparse 2.0 / (E_plank + E_block)}
  []
  [disp_y]
    order = ${order}
    block = 'plank block'
    scaling = ${fparse 2.0 / (E_plank + E_block)}
  []
  [temp]
    order = ${order}
    block = 'plank block'
    scaling = 1e-1
  []
  [thermal_lm]
    order = ${order}
    block = 'frictionless_secondary_subdomain'
    scaling = 1e-7
  []
  [frictionless_normal_lm]
    order = FIRST
    block = 'frictionless_secondary_subdomain'
    scaling = 1e3
    use_dual = true
  []
[]
[Modules/TensorMechanics/Master]
  [action]
    generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx strain_yy strain_zz'
    block = 'plank block'
    use_automatic_differentiation = true
    strain = FINITE
  []
[]
[Kernels]
  [hc]
    type = ADHeatConduction
    variable = temp
    use_displaced_mesh = true
    block = 'plank block'
  []
[]
[Constraints]
  [weighted_gap_lm]
    type = ComputeWeightedGapLMMechanicalContact
    primary_boundary = plank_right
    secondary_boundary = block_left
    primary_subdomain = frictionless_primary_subdomain
    secondary_subdomain = frictionless_secondary_subdomain
    variable = frictionless_normal_lm
    disp_x = disp_x
    disp_y = disp_y
    use_displaced_mesh = true
  []
  [ncp_lm]
    type = ApplyPenetrationConstraintLMMechanicalContact
    secondary = block_left
    primary = plank_right
    variable = frictionless_normal_lm
    primary_variable = disp_x
  []
  [normal_x]
    type = NormalMortarMechanicalContact
    primary_boundary = plank_right
    secondary_boundary = block_left
    primary_subdomain = frictionless_primary_subdomain
    secondary_subdomain = frictionless_secondary_subdomain
    variable = frictionless_normal_lm
    secondary_variable = disp_x
    component = x
    use_displaced_mesh = true
    compute_lm_residuals = false
  []
  [normal_y]
    type = NormalMortarMechanicalContact
    primary_boundary = plank_right
    secondary_boundary = block_left
    primary_subdomain = frictionless_primary_subdomain
    secondary_subdomain = frictionless_secondary_subdomain
    variable = frictionless_normal_lm
    secondary_variable = disp_y
    component = y
    use_displaced_mesh = true
    compute_lm_residuals = false
  []
  [thermal_contact]
    type = GapConductanceConstraint
    variable = thermal_lm
    secondary_variable = temp
    k = 1
    use_displaced_mesh = true
    primary_boundary = plank_right
    primary_subdomain = frictionless_primary_subdomain
    secondary_boundary = block_left
    secondary_subdomain = frictionless_secondary_subdomain
    displacements = 'disp_x disp_y'
  []
[]
[BCs]
  [left_temp]
    type = DirichletBC
    variable = temp
    boundary = 'plank_left'
    value = 400
  []
  [right_temp]
    type = DirichletBC
    variable = temp
    boundary = 'block_right'
    value = 300
  []
  [left_x]
    type = DirichletBC
    variable = disp_x
    boundary = plank_left
    value = 0.0
  []
  [left_y]
    type = DirichletBC
    variable = disp_y
    boundary = plank_bottom
    value = 0.0
  []
  [right_x]
    type = ADFunctionDirichletBC
    variable = disp_x
    boundary = block_right
    function = '-0.04*sin(4*(t+1.5))+0.02'
    preset = false
  []
  [right_y]
    type = ADFunctionDirichletBC
    variable = disp_y
    boundary = block_right
    function = '-t'
    preset = false
  []
[]
[Materials]
  [plank]
    type = ADComputeIsotropicElasticityTensor
    block = 'plank'
    poissons_ratio = 0.3
    youngs_modulus = ${E_plank}
  []
  [block]
    type = ADComputeIsotropicElasticityTensor
    block = 'block'
    poissons_ratio = 0.3
    youngs_modulus = ${E_block}
  []
  [stress]
    type = ADComputeFiniteStrainElasticStress
    block = 'plank block'
  []
  [heat_plank]
    type = ADHeatConductionMaterial
    block = plank
    thermal_conductivity = 2
    specific_heat = 1
  []
  [heat_block]
    type = ADHeatConductionMaterial
    block = block
    thermal_conductivity = 1
    specific_heat = 1
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  petsc_options = '-snes_converged_reason -ksp_converged_reason'
  petsc_options_iname = '-pc_type -mat_mffd_err -pc_factor_shift_type -pc_factor_shift_amount -snes_max_it'
  petsc_options_value = 'lu       1e-5          NONZERO               1e-15                   20'
  end_time = 13.5
  dt = 0.1
  dtmin = 0.1
  timestep_tolerance = 1e-6
  line_search = 'none'
[]
[Postprocessors]
  [nl_its]
    type = NumNonlinearIterations
  []
  [total_nl_its]
    type = CumulativeValuePostprocessor
    postprocessor = nl_its
  []
  [l_its]
    type = NumLinearIterations
  []
  [total_l_its]
    type = CumulativeValuePostprocessor
    postprocessor = l_its
  []
  [contact]
    type = ContactDOFSetSize
    variable = frictionless_normal_lm
    subdomain = frictionless_secondary_subdomain
  []
  [avg_hydro]
    type = ElementAverageValue
    variable = hydrostatic_stress
    block = 'block'
  []
  [avg_temp]
    type = ElementAverageValue
    variable = temp
    block = 'block'
  []
  [max_hydro]
    type = ElementExtremeValue
    variable = hydrostatic_stress
    block = 'block'
  []
  [min_hydro]
    type = ElementExtremeValue
    variable = hydrostatic_stress
    block = 'block'
    value_type = min
  []
  [avg_vonmises]
    type = ElementAverageValue
    variable = vonmises_stress
    block = 'block'
  []
  [max_vonmises]
    type = ElementExtremeValue
    variable = vonmises_stress
    block = 'block'
  []
  [min_vonmises]
    type = ElementExtremeValue
    variable = vonmises_stress
    block = 'block'
    value_type = min
  []
[]
[Outputs]
  exodus = true
  file_base = ${name}
  checkpoint = true
  [comp]
    type = CSV
    show = 'contact avg_temp'
  []
  [out]
    type = CSV
    file_base = '${name}_out'
  []
  [dof]
    type = DOFMap
    execute_on = 'initial'
  []
[]
[Debug]
  show_var_residual_norms = true
[]
(modules/contact/test/tests/mortar_tm/2drz/ad_frictionless_first/finite.i)
E_block = 1e7
E_plank = 1e7
elem = QUAD4
order = FIRST
name = 'finite'
[Problem]
  coord_type = RZ
[]
[Mesh]
  patch_size = 80
  patch_update_strategy = auto
  [./plank]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = 0.6
    ymin = -10
    ymax = 10
    nx = 2
    ny = 67
    elem_type = ${elem}
    boundary_name_prefix = plank
  [../]
  [./plank_id]
    type = SubdomainIDGenerator
    input = plank
    subdomain_id = 1
  [../]
  [./block]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0.61
    xmax = 1.21
    ymin = 9.2
    ymax = 10.0
    nx = 3
    ny = 4
    elem_type = ${elem}
    boundary_name_prefix = block
    boundary_id_offset = 10
  [../]
  [./block_id]
    type = SubdomainIDGenerator
    input = block
    subdomain_id = 2
  [../]
  [./combined]
    type = MeshCollectionGenerator
    inputs = 'plank_id block_id'
  [../]
  [./block_rename]
    type = RenameBlockGenerator
    input = combined
    old_block_id = '1 2'
    new_block_name = 'plank block'
  [../]
[]
[GlobalParams]
  displacements = 'disp_x disp_y'
[]
[Variables]
  [./disp_x]
    order = ${order}
    block = 'plank block'
    scaling = ${fparse 2.0 / (E_plank + E_block)}
  [../]
  [./disp_y]
    order = ${order}
    block = 'plank block'
    scaling = ${fparse 2.0 / (E_plank + E_block)}
  [../]
[]
[Modules/TensorMechanics/Master]
  [./block]
    use_automatic_differentiation = true
    strain = FINITE
    generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx strain_yy strain_zz'
    block = 'block'
  [../]
  [./plank]
    use_automatic_differentiation = true
    strain = FINITE
    generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx strain_yy strain_zz'
    block = 'plank'
    eigenstrain_names = 'swell'
  [../]
[]
[Contact]
  [./frictionless]
    mesh = block_rename
    primary = plank_right
    secondary = block_left
    formulation = mortar
  [../]
[]
[BCs]
  [./left_x]
    type = DirichletBC
    variable = disp_x
    boundary = plank_left
    value = 0.0
  [../]
  [./left_y]
    type = DirichletBC
    variable = disp_y
    boundary = plank_bottom
    value = 0.0
  [../]
  [./right_x]
    type = DirichletBC
    variable = disp_x
    boundary = block_right
    value = 0
  [../]
  [./right_y]
    type = ADFunctionDirichletBC
    variable = disp_y
    preset = false
    boundary = block_right
    function = '-t'
  [../]
[]
[Materials]
  [./plank]
    type = ADComputeIsotropicElasticityTensor
    block = 'plank'
    poissons_ratio = 0.3
    youngs_modulus = ${E_plank}
  [../]
  [./block]
    type = ADComputeIsotropicElasticityTensor
    block = 'block'
    poissons_ratio = 0.3
    youngs_modulus = ${E_block}
  [../]
  [./stress]
    type = ADComputeFiniteStrainElasticStress
    block = 'plank block'
  [../]
  [./swell]
    type = ADComputeEigenstrain
    block = 'plank'
    eigenstrain_name = swell
    eigen_base = '1 0 0 0 0 0 0 0 0'
    prefactor = swell_mat
  [../]
  [./swell_mat]
    type = ADGenericFunctionMaterial
    prop_names = 'swell_mat'
    prop_values = '7e-2*(1-cos(4*t))'
    block = 'plank'
  [../]
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  petsc_options = '-snes_converged_reason -ksp_converged_reason'
  petsc_options_iname = '-pc_type -mat_mffd_err -pc_factor_shift_type -pc_factor_shift_amount'
  petsc_options_value = 'lu       1e-5          NONZERO               1e-15'
  end_time = 10
  dt = 0.1
  dtmin = 0.1
  timestep_tolerance = 1e-6
  line_search = 'contact'
[]
[Postprocessors]
  [./nl_its]
    type = NumNonlinearIterations
  [../]
  [./total_nl_its]
    type = CumulativeValuePostprocessor
    postprocessor = nl_its
  [../]
  [./l_its]
    type = NumLinearIterations
  [../]
  [./total_l_its]
    type = CumulativeValuePostprocessor
    postprocessor = l_its
  [../]
  [./contact]
    type = ContactDOFSetSize
    variable = frictionless_normal_lm
    subdomain = frictionless_secondary_subdomain
  [../]
  [./avg_hydro]
    type = ElementAverageValue
    variable = hydrostatic_stress
    block = 'block'
  [../]
  [./max_hydro]
    type = ElementExtremeValue
    variable = hydrostatic_stress
    block = 'block'
  [../]
  [./min_hydro]
    type = ElementExtremeValue
    variable = hydrostatic_stress
    block = 'block'
    value_type = min
  [../]
  [./avg_vonmises]
    type = ElementAverageValue
    variable = vonmises_stress
    block = 'block'
  [../]
  [./max_vonmises]
    type = ElementExtremeValue
    variable = vonmises_stress
    block = 'block'
  [../]
  [./min_vonmises]
    type = ElementExtremeValue
    variable = vonmises_stress
    block = 'block'
    value_type = min
  [../]
[]
[Outputs]
  exodus = true
  file_base = ${name}
  [./comp]
    type = CSV
    show = 'contact'
  [../]
  [./out]
    type = CSV
    file_base = '${name}_out'
  [../]
[]
[Debug]
  show_var_residual_norms = true
[]
(modules/combined/test/tests/thermal_elastic/ad-thermal_elastic.i)
# Patch Test
# This test is designed to compute constant xx, yy, zz, xy, yz, and xz
#  stress on a set of irregular hexes.  The mesh is composed of one
#  block with seven elements.  The elements form a unit cube with one
#  internal element.  There is a nodeset for each exterior node.
# The cube is displaced by 1e-6 units in x, 2e-6 in y, and 3e-6 in z.
#  The faces are sheared as well (1e-6, 2e-6, and 3e-6 for xy, yz, and
#  zx).  This gives a uniform strain/stress state for all six unique
#  tensor components.  This displacement is again applied in the second
#  step.
# With Young's modulus at 1e6 and Poisson's ratio at 0, the shear
#  modulus is 5e5 (G=E/2/(1+nu)).  Therefore, for the mechanical strain,
#
#  stress xx = 1e6 * 1e-6 = 1
#  stress yy = 1e6 * 2e-6 = 2
#  stress zz = 1e6 * 3e-6 = 3
#  stress xy = 2 * 5e5 * 1e-6 / 2 = 0.5
#             (2 * G   * gamma_xy / 2 = 2 * G * epsilon_xy)
#  stress yz = 2 * 5e5 * 2e-6 / 2 = 1
#  stress zx = 2 * 5e5 * 3e-6 / 2 = 1.5
# Young's modulus is a function of temperature for this test.  The
#  temperature changes from 100 to 500.  The Young's modulus drops
#  due to that temperature change from 1e6 to 6e5.
# Poisson's ratio also is a function of temperature and changes from
#  0 to 0.25.
# At the end of the temperature ramp, E=6e5 and nu=0.25.  This gives
#  G=2.4e=5.  lambda=E*nu/(1+nu)/(1-2*nu)=2.4E5.  The final stress
#  is therefore
#  stress xx = 2.4e5 * 12e-6 + 2*2.4e5*2e-6 = 3.84
#  stress yy = 2.4e5 * 12e-6 + 2*2.4e5*4e-6 = 4.80
#  stress zz = 2.4e5 * 12e-6 + 2*2.4e5*6e-6 = 5.76
#  stress xy = 2 * 2.4e5 * 2e-6 / 2 = 0.48
#             (2 * G   * gamma_xy / 2 = 2 * G * epsilon_xy)
#  stress yz = 2 * 2.4e5 * 4e-6 / 2 = 0.96
#  stress xz = 2 * 2.4e5 * 6e-6 / 2 = 1.44
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
  file = thermal_elastic.e
[]
[Functions]
  [./ramp1]
    type = PiecewiseLinear
    x = '0. 1. 2.'
    y = '0. 1. 2.'
    scale_factor = 1e-6
  [../]
  [./ramp2]
    type = PiecewiseLinear
    x = '0. 1. 2.'
    y = '0. 1. 2.'
    scale_factor = 2e-6
  [../]
  [./ramp3]
    type = PiecewiseLinear
    x = '0. 1. 2.'
    y = '0. 1. 2.'
    scale_factor = 3e-6
  [../]
  [./ramp4]
    type = PiecewiseLinear
    x = '0. 1. 2.'
    y = '0. 1. 2.'
    scale_factor = 4e-6
  [../]
  [./ramp6]
    type = PiecewiseLinear
    x = '0. 1. 2.'
    y = '0. 1. 2.'
    scale_factor = 6e-6
  [../]
  [./tempFunc]
    type = PiecewiseLinear
    x = '0     1     2'
    y = '100.0 100.0 500.0'
  [../]
[]
[Variables]
  [./temp]
    initial_condition = 100.0
  [../]
[]
[Modules/TensorMechanics/Master]
  [./all]
    add_variables = true
    generate_output = 'stress_xx stress_yy stress_zz stress_xy stress_xz stress_yz'
    strain = FINITE
    use_automatic_differentiation = true
  [../]
[]
[Kernels]
  [./heat]
    type = ADDiffusion
    variable = temp
  [../]
[]
[BCs]
  [./node1_x]
    type = DirichletBC
    variable = disp_x
    boundary = 1
    value = 0.0
  [../]
  [./node1_y]
    type = ADFunctionDirichletBC
    variable = disp_y
    boundary = 1
    function = ramp2
  [../]
  [./node1_z]
    type = ADFunctionDirichletBC
    variable = disp_z
    boundary = 1
    function = ramp3
  [../]
  [./node2_x]
    type = ADFunctionDirichletBC
    variable = disp_x
    boundary = 2
    function = ramp1
  [../]
  [./node2_y]
    type = ADFunctionDirichletBC
    variable = disp_y
    boundary = 2
    function = ramp2
  [../]
  [./node2_z]
    type = ADFunctionDirichletBC
    variable = disp_z
    boundary = 2
    function = ramp6
  [../]
  [./node3_x]
    type = ADFunctionDirichletBC
    variable = disp_x
    boundary = 3
    function = ramp1
  [../]
  [./node3_y]
    type = DirichletBC
    variable = disp_y
    boundary = 3
    value = 0.0
  [../]
  [./node3_z]
    type = ADFunctionDirichletBC
    variable = disp_z
    boundary = 3
    function = ramp3
  [../]
  [./node4_x]
    type = DirichletBC
    variable = disp_x
    boundary = 4
    value = 0.0
  [../]
  [./node4_y]
    type = DirichletBC
    variable = disp_y
    boundary = 4
    value = 0.0
  [../]
  [./node4_z]
    type = DirichletBC
    variable = disp_z
    boundary = 4
    value = 0.0
  [../]
  [./node5_x]
    type = ADFunctionDirichletBC
    variable = disp_x
    boundary = 5
    function = ramp1
  [../]
  [./node5_y]
    type = ADFunctionDirichletBC
    variable = disp_y
    boundary = 5
    function = ramp4
  [../]
  [./node5_z]
    type = ADFunctionDirichletBC
    variable = disp_z
    boundary = 5
    function = ramp3
  [../]
  [./node6_x]
    type = ADFunctionDirichletBC
    variable = disp_x
    boundary = 6
    function = ramp2
  [../]
  [./node6_y]
    type = ADFunctionDirichletBC
    variable = disp_y
    boundary = 6
    function = ramp4
  [../]
  [./node6_z]
    type = ADFunctionDirichletBC
    variable = disp_z
    boundary = 6
    function = ramp6
  [../]
  [./node7_x]
    type = ADFunctionDirichletBC
    variable = disp_x
    boundary = 7
    function = ramp2
  [../]
  [./node7_y]
    type = ADFunctionDirichletBC
    variable = disp_y
    boundary = 7
    function = ramp2
  [../]
  [./node7_z]
    type = ADFunctionDirichletBC
    variable = disp_z
    boundary = 7
    function = ramp3
  [../]
  [./node8_x]
    type = ADFunctionDirichletBC
    variable = disp_x
    boundary = 8
    function = ramp1
  [../]
  [./node8_y]
    type = ADFunctionDirichletBC
    variable = disp_y
    boundary = 8
    function = ramp2
  [../]
  [./node8_z]
    type = DirichletBC
    variable = disp_z
    boundary = 8
    value = 0.0
  [../]
  [./temp]
    type = ADFunctionDirichletBC
    variable = temp
    boundary = '10 12'
    function = tempFunc
  [../]
[]
[Materials]
  [./youngs_modulus]
    type = ADPiecewiseLinearInterpolationMaterial
    x = '100 500'
    y = '1e6 6e5'
    property = youngs_modulus
    variable = temp
  [../]
  [./poissons_ratio]
    type = ADPiecewiseLinearInterpolationMaterial
    x = '100 500'
    y = '0   0.25'
    property = poissons_ratio
    variable = temp
  [../]
  [./elasticity_tensor]
    type = ADComputeVariableIsotropicElasticityTensor
    youngs_modulus = youngs_modulus
    poissons_ratio = poissons_ratio
  [../]
  [./stress]
    type = ADComputeFiniteStrainElasticStress
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  nl_rel_tol = 1e-9
  nl_abs_tol = 1e-9
  l_max_its = 20
  start_time = 0.0
  dt = 1.0
  end_time = 2.0
[]
[Outputs]
  exodus = true
[]
(modules/combined/test/tests/ad_cavity_pressure/negative_volume.i)
#
# Cavity Pressure Test
#
# This test is designed to compute a negative number of moles
# to trigger an error check in the CavityPressureUserObject.
# The negative number of moles is achieved by supplying an
# open volume to the InternalVolume postprocessor, which
# calculates a negative volume.
[Problem]
  coord_type = RZ
[]
[GlobalParams]
  displacements = 'disp_r disp_z'
[]
[Mesh]
  type = GeneratedMesh
  dim = 2
  nx = 1
  ny = 2
[]
[Functions]
  [./temperature]
    type = PiecewiseLinear
    x = '0 1'
    y = '1 2'
    scale_factor = 100
  [../]
[]
[Variables]
  [./temperature]
    initial_condition = 100
  [../]
[]
[Modules/TensorMechanics/Master]
  [./block]
    strain = FINITE
    add_variables = true
    use_automatic_differentiation = true
  [../]
[]
[Kernels]
  [./heat]
    type = Diffusion
    variable = temperature
    use_displaced_mesh = true
  [../]
[]
[BCs]
  [./no_x]
    type = ADDirichletBC
    variable = disp_r
    boundary = left
    value = 0.0
  [../]
  [./no_y]
    type = ADDirichletBC
    variable = disp_z
    boundary = bottom
    value = 0.0
  [../]
  [./temperatureInterior]
    type = ADFunctionDirichletBC
    boundary = 2
    function = temperature
    variable = temperature
  [../]
  [./CavityPressure]
    [./pressure]
      boundary = 'top bottom right'
      initial_pressure = 10e5
      R = 8.3143
      output_initial_moles = initial_moles
      temperature = aveTempInterior
      volume = internalVolume
      startup_time = 0.5
      output = ppress
      use_automatic_differentiation = true
    [../]
  [../]
[]
[Materials]
  [./elastic_tensor]
    type = ADComputeIsotropicElasticityTensor
    youngs_modulus = 1e6
    poissons_ratio = 0.3
  [../]
  [./stress1]
    type = ADComputeFiniteStrainElasticStress
  [../]
[]
[Executioner]
  type = Transient
  solve_type = 'NEWTON'
  petsc_options_iname = '-pc_type -sub_pc_type'
  petsc_options_value = 'asm       lu'
  nl_abs_tol = 1e-10
  l_max_its = 20
  dt = 0.5
  end_time = 1.0
[]
[Postprocessors]
  [./internalVolume]
    type = InternalVolume
    boundary = 'top bottom right'
    execute_on = 'initial linear'
  [../]
  [./aveTempInterior]
    type = AxisymmetricCenterlineAverageValue
    boundary = left
    variable = temperature
    execute_on = 'initial linear'
  [../]
[]
[Outputs]
  exodus = false
[]
(tutorials/darcy_thermo_mech/step11_action/problems/step11.i)
[GlobalParams]
  displacements = 'disp_r disp_z'
[]
[Mesh]
  type = GeneratedMesh
  dim = 2
  ny = 200
  nx = 10
  ymax = 0.304 # Length of test chamber
  xmax = 0.0257 # Test chamber radius
[]
[Variables]
  [pressure]
  []
  [temperature]
    initial_condition = 300 # Start at room temperature
  []
[]
[DarcyThermoMech]
[]
[Modules/TensorMechanics/Master]
  [all]
    # This block adds all of the proper Kernels, strain calculators, and Variables
    # for TensorMechanics in the correct coordinate system (autodetected)
    add_variables = true
    strain = FINITE
    eigenstrain_names = eigenstrain
    use_automatic_differentiation = true
    generate_output = 'vonmises_stress elastic_strain_xx elastic_strain_yy strain_xx strain_yy'
  []
[]
[BCs]
  [inlet]
    type = DirichletBC
    variable = pressure
    boundary = bottom
    value = 4000 # (Pa) From Figure 2 from paper.  First data point for 1mm spheres.
  []
  [outlet]
    type = DirichletBC
    variable = pressure
    boundary = top
    value = 0 # (Pa) Gives the correct pressure drop from Figure 2 for 1mm spheres
  []
  [inlet_temperature]
    type = FunctionDirichletBC
    variable = temperature
    boundary = bottom
    function = 'if(t<0,350+50*t,350)'
  []
  [outlet_temperature]
    type = HeatConductionOutflow
    variable = temperature
    boundary = top
  []
  [hold_inlet]
    type = DirichletBC
    variable = disp_z
    boundary = bottom
    value = 0
  []
  [hold_center]
    type = DirichletBC
    variable = disp_r
    boundary = left
    value = 0
  []
  [hold_outside]
    type = DirichletBC
    variable = disp_r
    boundary = right
    value = 0
  []
[]
[Materials]
  viscosity_file = data/water_viscosity.csv
  density_file = data/water_density.csv
  thermal_conductivity_file = data/water_thermal_conductivity.csv
  specific_heat_file = data/water_specific_heat.csv
  thermal_expansion_file = data/water_thermal_expansion.csv
  [column]
    type = PackedColumn
    block = 0
    temperature = temperature
    radius = 1.15
    fluid_viscosity_file = ${viscosity_file}
    fluid_density_file = ${density_file}
    fluid_thermal_conductivity_file = ${thermal_conductivity_file}
    fluid_specific_heat_file = ${specific_heat_file}
    fluid_thermal_expansion_file = ${thermal_expansion_file}
  []
  [elasticity_tensor]
    type = ADComputeIsotropicElasticityTensor
    youngs_modulus = 200e9 # (Pa) from wikipedia
    poissons_ratio = .3 # from wikipedia
  []
  [elastic_stress]
    type = ADComputeFiniteStrainElasticStress
  []
  [thermal_strain]
    type = ADComputeThermalExpansionEigenstrain
    stress_free_temperature = 300
    eigenstrain_name = eigenstrain
    temperature = temperature
    thermal_expansion_coeff = 1e-5
  []
[]
[Postprocessors]
  [average_temperature]
    type = ElementAverageValue
    variable = temperature
  []
[]
[Problem]
  type = FEProblem
  coord_type = RZ
[]
[Executioner]
  type = Transient
  start_time = -1
  end_time = 200
  steady_state_tolerance = 1e-7
  steady_state_detection = true
  dt = 0.25
  solve_type = PJFNK
  automatic_scaling = true
  compute_scaling_once = false
  petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart'
  petsc_options_value = 'hypre boomeramg 500'
  line_search = none
  [TimeStepper]
    type = FunctionDT
    function = 'if(t<0,0.1,0.25)'
  []
[]
[Outputs]
  [out]
    type = Exodus
    elemental_as_nodal = true
  []
[]
(modules/tensor_mechanics/test/tests/ad_finite_strain_jacobian/3d_bar.i)
[Mesh]
  [generated_mesh]
    type = GeneratedMeshGenerator
    dim = 3
    xmin = 0
    xmax = 2
    ymin = 0
    ymax = 2
    zmin = 0
    zmax = 10
    nx = 10
    ny = 2
    nz = 2
    elem_type = HEX8
  []
  [corner]
    type = ExtraNodesetGenerator
    new_boundary = 101
    coord = '0 0 0'
    input = generated_mesh
  []
  [side]
    type = ExtraNodesetGenerator
    new_boundary = 102
    coord = '2 0 0'
    input = corner
  []
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Modules/TensorMechanics/Master]
  [./all]
    strain = FINITE
    add_variables = true
    use_finite_deform_jacobian = true
    volumetric_locking_correction = false
    use_automatic_differentiation = true
  [../]
[]
[Materials]
  [./stress]
    type = ADComputeFiniteStrainElasticStress
  [../]
  [./elasticity_tensor]
    type = ADComputeElasticityTensor
    fill_method = symmetric9
    C_ijkl = '1.684e5 0.176e5 0.176e5 1.684e5 0.176e5 1.684e5 0.754e5 0.754e5 0.754e5'
  [../]
[]
[BCs]
 [./fix_corner_x]
   type = ADDirichletBC
   variable = disp_x
   boundary = 101
   value = 0
 [../]
 [./fix_corner_y]
   type = ADDirichletBC
   variable = disp_y
   boundary = 101
   value = 0
 [../]
 [./fix_side_y]
   type = ADDirichletBC
   variable = disp_y
   boundary = 102
   value = 0
 [../]
 [./fix_z]
   type = ADDirichletBC
   variable = disp_z
   boundary = back
   value = 0
 [../]
 [./move_z]
   type = ADFunctionDirichletBC
   variable = disp_z
   boundary = front
   function = 't'
 [../]
[]
[Executioner]
  type = Transient
  solve_type = NEWTON
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  nl_rel_tol = 1e-10
  nl_max_its = 10
  l_tol  = 1e-4
  l_max_its = 50
  dt = 0.2
  dtmin = 0.2
  num_steps = 2
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Outputs]
  exodus = true
[]
(modules/tensor_mechanics/test/tests/thermal_expansion/ad_constant_expansion_stress_free_temp.i)
# This test involves only thermal expansion strains on a 2x2x2 cube of approximate
# steel material; however, in this case the stress free temperature of the material
# has been set to 200K so that there is an initial delta temperature of 100K.
# An initial temperature of 300K is given for the material,
# and an auxkernel is used to calculate the temperature in the entire cube to
# raise the temperature each time step.  The final temperature is 675K
# The thermal strain increment should therefore be
#     (675K - 300K) * 1.3e-5 1/K + 100K * 1.3e-5 1/K = 6.175e-3 m/m.
# This test uses a start up step to identify problems in the calculation of
# eigenstrains with a stress free temperature that is different from the initial
# value of the temperature in the problem
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 2
  ny = 2
  nz = 2
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Variables]
  [./temp]
    initial_condition = 300.0
  [../]
[]
[AuxVariables]
  [./eigenstrain_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./eigenstrain_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./eigenstrain_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./total_strain_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./total_strain_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./total_strain_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[Functions]
  [./temperature_load]
    type = ParsedFunction
    value = t*(5000.0)+300.0
  [../]
[]
[Modules]
  [./TensorMechanics]
    [./Master]
      [./all]
        strain = SMALL
        incremental = true
        add_variables = true
        eigenstrain_names = eigenstrain
        use_automatic_differentiation = true
      [../]
    [../]
  [../]
[]
[Kernels]
  [./temp]
    type = Diffusion
    variable = temp
  [../]
[]
[AuxKernels]
  [./eigenstrain_yy]
    type = ADRankTwoAux
    rank_two_tensor = eigenstrain
    variable = eigenstrain_yy
    index_i = 1
    index_j = 1
    execute_on = 'initial timestep_end'
  [../]
  [./eigenstrain_xx]
    type = ADRankTwoAux
    rank_two_tensor = eigenstrain
    variable = eigenstrain_xx
    index_i = 0
    index_j = 0
    execute_on = 'initial timestep_end'
  [../]
  [./eigenstrain_zz]
    type = ADRankTwoAux
    rank_two_tensor = eigenstrain
    variable = eigenstrain_zz
    index_i = 2
    index_j = 2
    execute_on = 'initial timestep_end'
  [../]
  [./total_strain_yy]
    type = ADRankTwoAux
    rank_two_tensor = total_strain
    variable = total_strain_yy
    index_i = 1
    index_j = 1
    execute_on = 'initial timestep_end'
  [../]
  [./total_strain_xx]
    type = ADRankTwoAux
    rank_two_tensor = total_strain
    variable = total_strain_xx
    index_i = 0
    index_j = 0
    execute_on = 'initial timestep_end'
  [../]
  [./total_strain_zz]
    type = ADRankTwoAux
    rank_two_tensor = total_strain
    variable = total_strain_zz
    index_i = 2
    index_j = 2
    execute_on = 'initial timestep_end'
  [../]
[]
[BCs]
  [./x_bot]
    type = DirichletBC
    variable = disp_x
    boundary = left
    value = 0.0
  [../]
  [./y_bot]
    type = DirichletBC
    variable = disp_y
    boundary = bottom
    value = 0.0
  [../]
  [./z_bot]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0.0
  [../]
  [./temp]
    type = FunctionDirichletBC
    variable = temp
    function = temperature_load
    boundary = 'left right'
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ADComputeIsotropicElasticityTensor
    youngs_modulus = 2.1e5
    poissons_ratio = 0.3
  [../]
  [./small_stress]
    type = ADComputeFiniteStrainElasticStress
  [../]
  [./thermal_expansion_strain]
    type = ADComputeThermalExpansionEigenstrain
    stress_free_temperature = 200
    thermal_expansion_coeff = 1.3e-5
    temperature = temp
    eigenstrain_name = eigenstrain
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  solve_type = 'NEWTON'
  l_max_its = 50
  nl_max_its = 50
  nl_rel_tol = 1e-12
  nl_abs_tol = 1e-10
  l_tol = 1e-9
  start_time = -0.0125
  n_startup_steps = 1
  end_time = 0.075
  dt = 0.0125
  dtmin = 0.0001
[]
[Outputs]
  exodus = true
[]
[Postprocessors]
  [./eigenstrain_xx]
    type = ElementAverageValue
    variable = eigenstrain_xx
    execute_on = 'initial timestep_end'
  [../]
  [./eigenstrain_yy]
    type = ElementAverageValue
    variable = eigenstrain_yy
    execute_on = 'initial timestep_end'
  [../]
  [./eigenstrain_zz]
    type = ElementAverageValue
    variable = eigenstrain_zz
    execute_on = 'initial timestep_end'
  [../]
  [./total_strain_xx]
    type = ElementAverageValue
    variable = total_strain_xx
    execute_on = 'initial timestep_end'
  [../]
  [./total_strain_yy]
    type = ElementAverageValue
    variable = total_strain_yy
    execute_on = 'initial timestep_end'
  [../]
  [./total_strain_zz]
    type = ElementAverageValue
    variable = total_strain_zz
    execute_on = 'initial timestep_end'
  [../]
  [./temperature]
    type = AverageNodalVariableValue
    variable = temp
    execute_on = 'initial timestep_end'
  [../]
[]
(modules/tensor_mechanics/test/tests/ad_elastic/rz_finite_elastic.i)
[Mesh]
  type = GeneratedMesh
  dim = 2
  nx = 3
  ny = 3
[]
[Problem]
  coord_type = RZ
[]
[GlobalParams]
  displacements = 'disp_r disp_z'
[]
[Variables]
  # scale with one over Young's modulus
  [./disp_r]
    scaling = 1e-10
  [../]
  [./disp_z]
    scaling = 1e-10
  [../]
[]
[Kernels]
  [./stress_r]
    type = ADStressDivergenceRZTensors
    component = 0
    variable = disp_r
    use_displaced_mesh = true
  [../]
  [./stress_z]
    type = ADStressDivergenceRZTensors
    component = 1
    variable = disp_z
    use_displaced_mesh = true
  [../]
[]
[BCs]
  [./bottom]
    type = DirichletBC
    variable = disp_z
    boundary = bottom
    value = 0
  [../]
  [./axial]
    type = DirichletBC
    variable = disp_r
    boundary = left
    value = 0
  [../]
  [./rdisp]
    type = DirichletBC
    variable = disp_r
    boundary = right
    value = 0.1
  [../]
[]
[Materials]
  [./elasticity]
    type = ADComputeIsotropicElasticityTensor
    poissons_ratio = 0.3
    youngs_modulus = 1e10
  [../]
[]
[Materials]
  [./strain]
    type = ADComputeAxisymmetricRZFiniteStrain
  [../]
  [./stress]
    type = ADComputeFiniteStrainElasticStress
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  dt = 0.05
  solve_type = 'NEWTON'
  petsc_options_iname = -pc_hypre_type
  petsc_options_value = boomeramg
  dtmin = 0.05
  num_steps = 1
[]
[Outputs]
  exodus = true
[]
(modules/contact/test/tests/mortar_tm/2drz/ad_frictionless_second/finite_rr.i)
E_block = 1e7
E_plank = 1e7
elem = QUAD9
order = SECOND
name = 'finite_rr'
[Problem]
  coord_type = RZ
[]
[Mesh]
  patch_size = 80
  patch_update_strategy = auto
  [./plank]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = 0.6
    ymin = 0
    ymax = 10
    nx = 2
    ny = 33
    elem_type = ${elem}
    boundary_name_prefix = plank
  [../]
  [./plank_id]
    type = SubdomainIDGenerator
    input = plank
    subdomain_id = 1
  [../]
  [./block]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0.61
    xmax = 1.21
    ymin = 9.2
    ymax = 10.0
    nx = 3
    ny = 4
    elem_type = ${elem}
    boundary_name_prefix = block
    boundary_id_offset = 10
  [../]
  [./block_id]
    type = SubdomainIDGenerator
    input = block
    subdomain_id = 2
  [../]
  [./combined]
    type = MeshCollectionGenerator
    inputs = 'plank_id block_id'
  [../]
  [./block_rename]
    type = RenameBlockGenerator
    input = combined
    old_block_id = '1 2'
    new_block_name = 'plank block'
  [../]
[]
[GlobalParams]
  displacements = 'disp_x disp_y'
[]
[Problem]
  type = ReferenceResidualProblem
  extra_tag_vectors = 'ref'
  reference_vector = 'ref'
[]
[Variables]
  [./disp_x]
    order = ${order}
    block = 'plank block'
    scaling = ${fparse 2.0 / (E_plank + E_block)}
  [../]
  [./disp_y]
    order = ${order}
    block = 'plank block'
    scaling = ${fparse 2.0 / (E_plank + E_block)}
  [../]
[]
[Modules/TensorMechanics/Master]
  [./block]
    use_automatic_differentiation = true
    strain = FINITE
    generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx strain_yy strain_zz'
    block = 'block'
    extra_vector_tags = 'ref'
  [../]
  [./plank]
    use_automatic_differentiation = true
    strain = FINITE
    generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx strain_yy strain_zz'
    block = 'plank'
    eigenstrain_names = 'swell'
    extra_vector_tags = 'ref'
  [../]
[]
[Contact]
  [./frictionless]
    mesh = block_rename
    primary = plank_right
    secondary = block_left
    formulation = mortar
  [../]
[]
[BCs]
  [./left_x]
    type = DirichletBC
    variable = disp_x
    preset = false
    boundary = plank_left
    value = 0.0
  [../]
  [./left_y]
    type = DirichletBC
    variable = disp_y
    preset = false
    boundary = plank_bottom
    value = 0.0
  [../]
  [./right_x]
    type = DirichletBC
    variable = disp_x
    preset = false
    boundary = block_right
    value = 0
  [../]
  [./right_y]
    type = ADFunctionDirichletBC
    variable = disp_y
    preset = false
    boundary = block_right
    function = '-t'
  [../]
[]
[Materials]
  [./plank]
    type = ADComputeIsotropicElasticityTensor
    block = 'plank'
    poissons_ratio = 0.3
    youngs_modulus = ${E_plank}
  [../]
  [./block]
    type = ADComputeIsotropicElasticityTensor
    block = 'block'
    poissons_ratio = 0.3
    youngs_modulus = ${E_block}
  [../]
  [./stress]
    type = ADComputeFiniteStrainElasticStress
    block = 'plank block'
  [../]
  [./swell]
    type = ADComputeEigenstrain
    block = 'plank'
    eigenstrain_name = swell
    eigen_base = '1 0 0 0 0 0 0 0 0'
    prefactor = swell_mat
  [../]
  [./swell_mat]
    type = ADGenericFunctionMaterial
    prop_names = 'swell_mat'
    prop_values = '7e-2*(1-cos(4*t))'
    block = 'plank'
  [../]
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  petsc_options = '-snes_converged_reason -ksp_converged_reason'
  petsc_options_iname = '-pc_type -mat_mffd_err -pc_factor_shift_type -pc_factor_shift_amount'
  petsc_options_value = 'lu       1e-5          NONZERO               1e-15'
  end_time = 5
  dt = 0.1
  dtmin = 0.1
  timestep_tolerance = 1e-6
  line_search = 'contact'
  nl_abs_tol = 1e-12
[]
[Postprocessors]
  [./nl_its]
    type = NumNonlinearIterations
  [../]
  [./total_nl_its]
    type = CumulativeValuePostprocessor
    postprocessor = nl_its
  [../]
  [./l_its]
    type = NumLinearIterations
  [../]
  [./total_l_its]
    type = CumulativeValuePostprocessor
    postprocessor = l_its
  [../]
  [./contact]
    type = ContactDOFSetSize
    variable = frictionless_normal_lm
    subdomain = frictionless_secondary_subdomain
  [../]
  [./avg_hydro]
    type = ElementAverageValue
    variable = hydrostatic_stress
    block = 'block'
  [../]
  [./max_hydro]
    type = ElementExtremeValue
    variable = hydrostatic_stress
    block = 'block'
  [../]
  [./min_hydro]
    type = ElementExtremeValue
    variable = hydrostatic_stress
    block = 'block'
    value_type = min
  [../]
  [./avg_vonmises]
    type = ElementAverageValue
    variable = vonmises_stress
    block = 'block'
  [../]
  [./max_vonmises]
    type = ElementExtremeValue
    variable = vonmises_stress
    block = 'block'
  [../]
  [./min_vonmises]
    type = ElementExtremeValue
    variable = vonmises_stress
    block = 'block'
    value_type = min
  [../]
[]
[Outputs]
  exodus = true
  file_base = ${name}
  [./comp]
    type = CSV
    show = 'contact'
  [../]
  [./out]
    type = CSV
    file_base = '${name}_out'
  [../]
[]
[Debug]
  show_var_residual_norms = true
[]
(modules/combined/test/tests/ad_cavity_pressure/rz.i)
#
# Cavity Pressure Test
#
# This test is designed to compute an internal pressure based on
#   p = n * R * T / V
# where
#   p is the pressure
#   n is the amount of material in the volume (moles)
#   R is the universal gas constant
#   T is the temperature
#   V is the volume
#
# The mesh is composed of one block (2) with an interior cavity of volume 8.
#   Block 1 sits in the cavity and has a volume of 1.  Thus, the total
#   initial volume is 7.
# The test adjusts T in the following way:
#   T => T0 + beta * t
# with
#   beta = T0
#   T0 = 240.54443866068704
#   V0 = 7
#   n0 = f(p0)
#   p0 = 100
#   R = 8.314472 J * K^(-1) * mol^(-1)
#
# So, n0 = p0 * V0 / R / T0 = 100 * 7 / 8.314472 / 240.544439
#        = 0.35
#
# At t = 1, p = 200.
[Problem]
  coord_type = RZ
[]
[GlobalParams]
  displacements = 'disp_r disp_z'
[]
[Mesh]
  file = rz.e
[]
[Functions]
  [./temperature]
    type = PiecewiseLinear
    x = '0 1'
    y = '1 2'
    scale_factor = 240.54443866068704
  [../]
[]
[Variables]
  [./disp_r]
  [../]
  [./disp_z]
  [../]
  [./temp]
    initial_condition = 240.54443866068704
  [../]
[]
[Kernels]
  [./TensorMechanics]
    use_displaced_mesh = true
    use_automatic_differentiation = true
  [../]
  [./heat]
    type = ADDiffusion
    variable = temp
    use_displaced_mesh = true
  [../]
[]
[BCs]
  [./no_x]
    type = DirichletBC
    variable = disp_r
    boundary = '1 2'
    value = 0.0
  [../]
  [./no_y]
    type = DirichletBC
    variable = disp_z
    boundary = '1 2'
    value = 0.0
  [../]
  [./temperatureInterior]
    type = ADFunctionDirichletBC
    preset = false
    boundary = 2
    function = temperature
    variable = temp
  [../]
  [./CavityPressure]
    [./1]
      boundary = 2
      initial_pressure = 100
      R = 8.314472
      temperature = aveTempInterior
      volume = internalVolume
      startup_time = 0.5
      output = ppress
      use_automatic_differentiation = true
    [../]
  [../]
[]
[Materials]
  [./elastic_tensor1]
    type = ADComputeIsotropicElasticityTensor
    youngs_modulus = 1e6
    poissons_ratio = 0.3
    block = 1
  [../]
  [./strain1]
    type = ADComputeAxisymmetricRZFiniteStrain
    block = 1
  [../]
  [./stress1]
    type = ADComputeFiniteStrainElasticStress
    block = 1
  [../]
  [./elastic_tensor2]
    type = ADComputeIsotropicElasticityTensor
    youngs_modulus = 1e6
    poissons_ratio = 0.3
    block = 2
  [../]
  [./strain2]
    type = ADComputeAxisymmetricRZFiniteStrain
    block = 2
  [../]
  [./stress2]
    type = ADComputeFiniteStrainElasticStress
    block = 2
  [../]
[]
[Executioner]
  type = Transient
  solve_type = 'NEWTON'
  petsc_options_iname = '-pc_type -sub_pc_type'
  petsc_options_value = 'asm       lu'
  nl_abs_tol = 1e-10
  l_max_its = 20
  dt = 0.5
  end_time = 1.0
[]
[Postprocessors]
  [./internalVolume]
    type = InternalVolume
    boundary = 2
    execute_on = 'initial linear'
  [../]
  [./aveTempInterior]
    type = SideAverageValue
    boundary = 2
    variable = temp
    execute_on = 'initial linear'
  [../]
[]
[Outputs]
  exodus = true
  [./checkpoint]
    type = Checkpoint
    num_files = 1
  [../]
[]
(modules/tensor_mechanics/test/tests/ad_elastic/incremental_small_elastic.i)
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 3
  ny = 3
  nz = 3
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Variables]
  # scale with one over Young's modulus
  [./disp_x]
    scaling = 1e-10
  [../]
  [./disp_y]
    scaling = 1e-10
  [../]
  [./disp_z]
    scaling = 1e-10
  [../]
[]
[Kernels]
  [./stress_x]
    type = ADStressDivergenceTensors
    component = 0
    variable = disp_x
  [../]
  [./stress_y]
    type = ADStressDivergenceTensors
    component = 1
    variable = disp_y
  [../]
  [./stress_z]
    type = ADStressDivergenceTensors
    component = 2
    variable = disp_z
  [../]
[]
[BCs]
  [./symmy]
    type = DirichletBC
    variable = disp_y
    boundary = bottom
    value = 0
  [../]
  [./symmx]
    type = DirichletBC
    variable = disp_x
    boundary = left
    value = 0
  [../]
  [./symmz]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0
  [../]
  [./tdisp]
    type = DirichletBC
    variable = disp_z
    boundary = front
    value = 0.1
  [../]
[]
[Materials]
  [./elasticity]
    type = ADComputeIsotropicElasticityTensor
    poissons_ratio = 0.3
    youngs_modulus = 1e10
  [../]
[]
[Materials]
  [./strain]
    type = ADComputeIncrementalSmallStrain
  [../]
  [./stress]
    type = ADComputeFiniteStrainElasticStress
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  dt = 0.05
  solve_type = 'NEWTON'
  petsc_options_iname = -pc_hypre_type
  petsc_options_value = boomeramg
  dtmin = 0.05
  num_steps = 1
[]
[Outputs]
  exodus = true
[]
(modules/tensor_mechanics/test/tests/ad_elastic/finite_elastic.i)
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 3
  ny = 3
  nz = 3
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Variables]
  # scale with one over Young's modulus
  [./disp_x]
    scaling = 1e-10
  [../]
  [./disp_y]
    scaling = 1e-10
  [../]
  [./disp_z]
    scaling = 1e-10
  [../]
[]
[Kernels]
  [./stress_x]
    type = ADStressDivergenceTensors
    component = 0
    variable = disp_x
    use_displaced_mesh = true
  [../]
  [./stress_y]
    type = ADStressDivergenceTensors
    component = 1
    variable = disp_y
    use_displaced_mesh = true
  [../]
  [./stress_z]
    type = ADStressDivergenceTensors
    component = 2
    variable = disp_z
    use_displaced_mesh = true
  [../]
[]
[BCs]
  [./symmy]
    type = DirichletBC
    variable = disp_y
    boundary = bottom
    value = 0
  [../]
  [./symmx]
    type = DirichletBC
    variable = disp_x
    boundary = left
    value = 0
  [../]
  [./symmz]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0
  [../]
  [./tdisp]
    type = DirichletBC
    variable = disp_z
    boundary = front
    value = 0.1
  [../]
[]
[Materials]
  [./elasticity]
    type = ADComputeIsotropicElasticityTensor
    poissons_ratio = 0.3
    youngs_modulus = 1e10
  [../]
[]
[Materials]
  [./strain]
    type = ADComputeFiniteStrain
  [../]
  [./stress]
    type = ADComputeFiniteStrainElasticStress
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  dt = 0.05
  solve_type = 'NEWTON'
  petsc_options_iname = -pc_hypre_type
  petsc_options_value = boomeramg
  dtmin = 0.05
  num_steps = 1
[]
[Outputs]
  exodus = true
[]
(modules/contact/test/tests/mortar_tm/2d/ad_frictionless_sec/finite_rr.i)
E_block = 1e7
E_plank = 1e7
elem = QUAD9
order = SECOND
name = 'finite_rr'
[Mesh]
  patch_size = 80
  patch_update_strategy = auto
  [./plank]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = -0.3
    xmax = 0.3
    ymin = -10
    ymax = 10
    nx = 2
    ny = 67
    elem_type = ${elem}
    boundary_name_prefix = plank
  [../]
  [./plank_id]
    type = SubdomainIDGenerator
    input = plank
    subdomain_id = 1
  [../]
  [./block]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0.31
    xmax = 0.91
    ymin = 7.7
    ymax = 8.5
    nx = 3
    ny = 4
    elem_type = ${elem}
    boundary_name_prefix = block
    boundary_id_offset = 10
  [../]
  [./block_id]
    type = SubdomainIDGenerator
    input = block
    subdomain_id = 2
  [../]
  [./combined]
    type = MeshCollectionGenerator
    inputs = 'plank_id block_id'
  [../]
  [./block_rename]
    type = RenameBlockGenerator
    input = combined
    old_block_id = '1 2'
    new_block_name = 'plank block'
  [../]
[]
[GlobalParams]
  displacements = 'disp_x disp_y'
[]
[Problem]
  type = ReferenceResidualProblem
  extra_tag_vectors = 'ref'
  reference_vector = 'ref'
[]
[Variables]
  [./disp_x]
    order = ${order}
    block = 'plank block'
    scaling = ${fparse 2.0 / (E_plank + E_block)}
  [../]
  [./disp_y]
    order = ${order}
    block = 'plank block'
    scaling = ${fparse 2.0 / (E_plank + E_block)}
  [../]
[]
[Modules/TensorMechanics/Master]
  [./action]
    strain = FINITE
    generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx strain_yy strain_zz'
    block = 'plank block'
    extra_vector_tags = 'ref'
    use_automatic_differentiation = true
  [../]
[]
[Contact]
  [./frictionless]
    mesh = block_rename
    primary = plank_right
    secondary = block_left
    formulation = mortar
  [../]
[]
[BCs]
  [./left_x]
    type = DirichletBC
    variable = disp_x
    preset = false
    boundary = plank_left
    value = 0.0
  [../]
  [./left_y]
    type = DirichletBC
    variable = disp_y
    preset = false
    boundary = plank_bottom
    value = 0.0
  [../]
  [./right_x]
    type = ADFunctionDirichletBC
    variable = disp_x
    preset = false
    boundary = block_right
    function = '-0.04*sin(4*(t+1.5))+0.02'
  [../]
  [./right_y]
    type = ADFunctionDirichletBC
    variable = disp_y
    preset = false
    boundary = block_right
    function = '-t'
  [../]
[]
[Materials]
  [./plank]
    type = ADComputeIsotropicElasticityTensor
    block = 'plank'
    poissons_ratio = 0.3
    youngs_modulus = ${E_plank}
  [../]
  [./block]
    type = ADComputeIsotropicElasticityTensor
    block = 'block'
    poissons_ratio = 0.3
    youngs_modulus = ${E_block}
  [../]
  [./stress]
    type = ADComputeFiniteStrainElasticStress
    block = 'plank block'
  [../]
[]
[Executioner]
  type = Transient
  solve_type = 'NEWTON'
  petsc_options = '-snes_converged_reason -ksp_converged_reason'
  petsc_options_iname = '-pc_type -mat_mffd_err -pc_factor_shift_type -pc_factor_shift_amount'
  petsc_options_value = 'lu       1e-5          NONZERO               1e-15'
  end_time = 13.5
  dt = 0.1
  dtmin = 0.1
  timestep_tolerance = 1e-6
  line_search = 'contact'
  nl_abs_tol = 1e-7
[]
[Postprocessors]
  [./nl_its]
    type = NumNonlinearIterations
  [../]
  [./total_nl_its]
    type = CumulativeValuePostprocessor
    postprocessor = nl_its
  [../]
  [./l_its]
    type = NumLinearIterations
  [../]
  [./total_l_its]
    type = CumulativeValuePostprocessor
    postprocessor = l_its
  [../]
  [./contact]
    type = ContactDOFSetSize
    variable = frictionless_normal_lm
    subdomain = frictionless_secondary_subdomain
  [../]
  [./avg_hydro]
    type = ElementAverageValue
    variable = hydrostatic_stress
    block = 'block'
  [../]
  [./max_hydro]
    type = ElementExtremeValue
    variable = hydrostatic_stress
    block = 'block'
  [../]
  [./min_hydro]
    type = ElementExtremeValue
    variable = hydrostatic_stress
    block = 'block'
    value_type = min
  [../]
  [./avg_vonmises]
    type = ElementAverageValue
    variable = vonmises_stress
    block = 'block'
  [../]
  [./max_vonmises]
    type = ElementExtremeValue
    variable = vonmises_stress
    block = 'block'
  [../]
  [./min_vonmises]
    type = ElementExtremeValue
    variable = vonmises_stress
    block = 'block'
    value_type = min
  [../]
[]
[Outputs]
  exodus = true
  file_base = ${name}
  [./comp]
    type = CSV
    show = 'contact'
  [../]
  [./out]
    type = CSV
    file_base = '${name}_out'
  [../]
[]
[Debug]
  show_var_residual_norms = true
[]
(modules/contact/test/tests/mortar_tm/2drz/ad_frictionless_first/finite_rr.i)
E_block = 1e7
E_plank = 1e7
elem = QUAD4
order = FIRST
name = 'finite_rr'
[Problem]
  coord_type = RZ
[]
[Mesh]
  patch_size = 80
  patch_update_strategy = auto
  [./plank]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = 0.6
    ymin = -10
    ymax = 10
    nx = 2
    ny = 67
    elem_type = ${elem}
    boundary_name_prefix = plank
  [../]
  [./plank_id]
    type = SubdomainIDGenerator
    input = plank
    subdomain_id = 1
  [../]
  [./block]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0.61
    xmax = 1.21
    ymin = 9.2
    ymax = 10.0
    nx = 3
    ny = 4
    elem_type = ${elem}
    boundary_name_prefix = block
    boundary_id_offset = 10
  [../]
  [./block_id]
    type = SubdomainIDGenerator
    input = block
    subdomain_id = 2
  [../]
  [./combined]
    type = MeshCollectionGenerator
    inputs = 'plank_id block_id'
  [../]
  [./block_rename]
    type = RenameBlockGenerator
    input = combined
    old_block_id = '1 2'
    new_block_name = 'plank block'
  [../]
[]
[GlobalParams]
  displacements = 'disp_x disp_y'
[]
[Problem]
  type = ReferenceResidualProblem
  extra_tag_vectors = 'ref'
  reference_vector = 'ref'
[]
[Variables]
  [./disp_x]
    order = ${order}
    block = 'plank block'
    scaling = ${fparse 2.0 / (E_plank + E_block)}
  [../]
  [./disp_y]
    order = ${order}
    block = 'plank block'
    scaling = ${fparse 2.0 / (E_plank + E_block)}
  [../]
[]
[Modules/TensorMechanics/Master]
  [./block]
    use_automatic_differentiation = true
    strain = FINITE
    generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx strain_yy strain_zz'
    block = 'block'
    extra_vector_tags = 'ref'
  [../]
  [./plank]
    use_automatic_differentiation = true
    strain = FINITE
    generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx strain_yy strain_zz'
    block = 'plank'
    eigenstrain_names = 'swell'
    extra_vector_tags = 'ref'
  [../]
[]
[Contact]
  [./frictionless]
    mesh = block_rename
    primary = plank_right
    secondary = block_left
    formulation = mortar
  [../]
[]
[BCs]
  [./left_x]
    type = DirichletBC
    variable = disp_x
    boundary = plank_left
    value = 0.0
  [../]
  [./left_y]
    type = DirichletBC
    variable = disp_y
    boundary = plank_bottom
    value = 0.0
  [../]
  [./right_x]
    type = DirichletBC
    variable = disp_x
    boundary = block_right
    value = 0
  [../]
  [./right_y]
    type = ADFunctionDirichletBC
    variable = disp_y
    boundary = block_right
    function = '-t'
  [../]
[]
[Materials]
  [./plank]
    type = ADComputeIsotropicElasticityTensor
    block = 'plank'
    poissons_ratio = 0.3
    youngs_modulus = ${E_plank}
  [../]
  [./block]
    type = ADComputeIsotropicElasticityTensor
    block = 'block'
    poissons_ratio = 0.3
    youngs_modulus = ${E_block}
  [../]
  [./stress]
    type = ADComputeFiniteStrainElasticStress
    block = 'plank block'
  [../]
  [./swell]
    type = ADComputeEigenstrain
    block = 'plank'
    eigenstrain_name = swell
    eigen_base = '1 0 0 0 0 0 0 0 0'
    prefactor = swell_mat
  [../]
  [./swell_mat]
    type = ADGenericFunctionMaterial
    prop_names = 'swell_mat'
    prop_values = '7e-2*(1-cos(4*t))'
    block = 'plank'
  [../]
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  petsc_options = '-snes_converged_reason -ksp_converged_reason'
  petsc_options_iname = '-pc_type -mat_mffd_err -pc_factor_shift_type -pc_factor_shift_amount'
  petsc_options_value = 'lu       1e-5          NONZERO               1e-15'
  end_time = 10
  dt = 0.1
  dtmin = 0.1
  timestep_tolerance = 1e-6
  line_search = 'contact'
  nl_abs_tol = 1e-12
[]
[Postprocessors]
  [./nl_its]
    type = NumNonlinearIterations
  [../]
  [./total_nl_its]
    type = CumulativeValuePostprocessor
    postprocessor = nl_its
  [../]
  [./l_its]
    type = NumLinearIterations
  [../]
  [./total_l_its]
    type = CumulativeValuePostprocessor
    postprocessor = l_its
  [../]
  [./contact]
    type = ContactDOFSetSize
    variable = frictionless_normal_lm
    subdomain = frictionless_secondary_subdomain
  [../]
  [./avg_hydro]
    type = ElementAverageValue
    variable = hydrostatic_stress
    block = 'block'
  [../]
  [./max_hydro]
    type = ElementExtremeValue
    variable = hydrostatic_stress
    block = 'block'
  [../]
  [./min_hydro]
    type = ElementExtremeValue
    variable = hydrostatic_stress
    block = 'block'
    value_type = min
  [../]
  [./avg_vonmises]
    type = ElementAverageValue
    variable = vonmises_stress
    block = 'block'
  [../]
  [./max_vonmises]
    type = ElementExtremeValue
    variable = vonmises_stress
    block = 'block'
  [../]
  [./min_vonmises]
    type = ElementExtremeValue
    variable = vonmises_stress
    block = 'block'
    value_type = min
  [../]
[]
[Outputs]
  exodus = true
  file_base = ${name}
  [./comp]
    type = CSV
    show = 'contact'
  [../]
  [./out]
    type = CSV
    file_base = '${name}_out'
  [../]
[]
[Debug]
  show_var_residual_norms = true
[]
(modules/tensor_mechanics/test/tests/ad_finite_strain_jacobian/bending_jacobian.i)
[Mesh]
  [generated_mesh]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = 10
    ymin = 0
    ymax = 2
    nx = 10
    ny = 2
    elem_type = QUAD4
  []
  [corner]
    type = ExtraNodesetGenerator
    new_boundary = 101
    coord = '0 0'
    input = generated_mesh
  []
  [side]
    type = ExtraNodesetGenerator
    new_boundary = 102
    coord = '10 0'
    input = corner
  []
  [mid]
    type = ExtraNodesetGenerator
    new_boundary = 103
    coord = '5 2'
    input = side
  []
[]
[GlobalParams]
  displacements = 'disp_x disp_y'
[]
[Modules/TensorMechanics/Master]
  [./all]
    strain = FINITE
    add_variables = true
    use_finite_deform_jacobian = true
    volumetric_locking_correction = false
    use_automatic_differentiation = true
  [../]
[]
[Materials]
  [./stress]
    type = ADComputeFiniteStrainElasticStress
  [../]
  [./elasticity_tensor]
    type = ADComputeElasticityTensor
    fill_method = symmetric9
    C_ijkl = '1.684e5 0.176e5 0.176e5 1.684e5 0.176e5 1.684e5 0.754e5 0.754e5 0.754e5'
  [../]
[]
[BCs]
 [./fix_corner_x]
   type = ADDirichletBC
   variable = disp_x
   boundary = 101
   value = 0
 [../]
 [./fix_corner_y]
   type = ADDirichletBC
   variable = disp_y
   boundary = 101
   value = 0
 [../]
 [./fix_y]
   type = ADDirichletBC
   variable = disp_y
   boundary = 102
   value = 0
 [../]
 [./move_y]
   type = ADFunctionDirichletBC
   variable = disp_y
   boundary = 103
   function = '-t'
 [../]
[]
[Executioner]
  type = Transient
  solve_type = NEWTON
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  nl_rel_tol = 1e-10
  nl_max_its = 10
  l_tol  = 1e-4
  l_max_its = 50
  dt = 0.1
  dtmin = 0.1
  num_steps = 2
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Outputs]
  exodus = true
[]
(modules/combined/test/tests/ad_cavity_pressure/multiple_postprocessors.i)
#
# Cavity Pressure Test (Volume input as a vector of postprocessors)
#
# This test is designed to compute an internal pressure based on
#   p = n * R * T / V
# where
#   p is the pressure
#   n is the amount of material in the volume (moles)
#   R is the universal gas constant
#   T is the temperature
#   V is the volume
#
# The mesh is composed of one block (1) with an interior cavity of volume 8.
#   Block 2 sits in the cavity and has a volume of 1.  Thus, the total
#   initial volume is 7.
# The test adjusts n, T, and V in the following way:
#   n => n0 + alpha * t
#   T => T0 + beta * t
#   V => V0 + gamma * t
# with
#   alpha = n0
#   beta = T0 / 2
#   gamma = - (0.003322259...) * V0
#   T0 = 240.54443866068704
#   V0 = 7
#   n0 = f(p0)
#   p0 = 100
#   R = 8.314472 J * K^(-1) * mol^(-1)
#
# So, n0 = p0 * V0 / R / T0 = 100 * 7 / 8.314472 / 240.544439
#        = 0.35
#
# In this test the internal volume is calculated as the sum of two Postprocessors
# internalVolumeInterior and internalVolumeExterior.  This sum equals the value
# reported by the internalVolume postprocessor.
#
# The parameters combined at t = 1 gives p = 301.
#
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
  volumetric_locking_correction = true
[]
[Mesh]
  file = 3d.e
[]
[Functions]
  [./displ_positive]
    type = PiecewiseLinear
    x = '0 1'
    y = '0 0.0029069767441859684'
  [../]
  [./displ_negative]
    type = PiecewiseLinear
    x = '0 1'
    y = '0 -0.0029069767441859684'
  [../]
  [./temp1]
    type = PiecewiseLinear
    x = '0 1'
    y = '1 1.5'
    scale_factor = 240.54443866068704
  [../]
  [./material_input_function]
    type = PiecewiseLinear
    x = '0    1'
    y = '0 0.35'
  [../]
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
  [./temp]
    initial_condition = 240.54443866068704
  [../]
  [./material_input]
  [../]
[]
[AuxVariables]
  [./pressure_residual_x]
  [../]
  [./pressure_residual_y]
  [../]
  [./pressure_residual_z]
  [../]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zx]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[Kernels]
  [./TensorMechanics]
    use_displaced_mesh = true
    use_automatic_differentiation = true
  [../]
  [./heat]
    type = ADDiffusion
    variable = temp
    use_displaced_mesh = true
  [../]
  [./material_input_dummy]
    type = ADDiffusion
    variable = material_input
    use_displaced_mesh = true
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = ADRankTwoAux
    rank_two_tensor = stress
    index_i = 0
    index_j = 0
    variable = stress_xx
  [../]
  [./stress_yy]
    type = ADRankTwoAux
    rank_two_tensor = stress
    index_i = 1
    index_j = 1
    variable = stress_yy
  [../]
  [./stress_zz]
    type = ADRankTwoAux
    rank_two_tensor = stress
    index_i = 2
    index_j = 2
    variable = stress_zz
  [../]
  [./stress_xy]
    type = ADRankTwoAux
    rank_two_tensor = stress
    index_i = 0
    index_j = 1
    variable = stress_xy
  [../]
  [./stress_yz]
    type = ADRankTwoAux
    rank_two_tensor = stress
    index_i = 1
    index_j = 2
    variable = stress_yz
  [../]
  [./stress_zx]
    type = ADRankTwoAux
    rank_two_tensor = stress
    index_i = 2
    index_j = 0
    variable = stress_zx
  [../]
[]
[BCs]
  [./no_x_exterior]
    type = DirichletBC
    variable = disp_x
    boundary = '7 8'
    value = 0.0
  [../]
  [./no_y_exterior]
    type = DirichletBC
    variable = disp_y
    boundary = '9 10'
    value = 0.0
  [../]
  [./no_z_exterior]
    type = DirichletBC
    variable = disp_z
    boundary = '11 12'
    value = 0.0
  [../]
  [./prescribed_left]
    type = ADFunctionDirichletBC
    variable = disp_x
    boundary = 13
    function = displ_positive
  [../]
  [./prescribed_right]
    type = ADFunctionDirichletBC
    variable = disp_x
    boundary = 14
    function = displ_negative
  [../]
  [./no_y]
    type = DirichletBC
    variable = disp_y
    boundary = '15 16'
    value = 0.0
  [../]
  [./no_z]
    type = DirichletBC
    variable = disp_z
    boundary = '17 18'
    value = 0.0
  [../]
  [./no_x_interior]
    type = DirichletBC
    variable = disp_x
    boundary = '1 2'
    value = 0.0
  [../]
  [./no_y_interior]
    type = DirichletBC
    variable = disp_y
    boundary = '3 4'
    value = 0.0
  [../]
  [./no_z_interior]
    type = DirichletBC
    variable = disp_z
    boundary = '5 6'
    value = 0.0
  [../]
  [./temperatureInterior]
    type = ADFunctionDirichletBC
    boundary = 100
    function = temp1
    variable = temp
  [../]
  [./MaterialInput]
    type = ADFunctionDirichletBC
    boundary = '100 13 14 15 16'
    function = material_input_function
    variable = material_input
  [../]
  [./CavityPressure]
    [./1]
      boundary = 100
      initial_pressure = 100
      material_input = materialInput
      R = 8.314472
      temperature = aveTempInterior
      volume = 'internalVolumeInterior internalVolumeExterior'
      startup_time = 0.5
      output = ppress
      save_in = 'pressure_residual_x pressure_residual_y pressure_residual_z'
      use_automatic_differentiation = true
    [../]
  [../]
[]
[Materials]
  [./elast_tensor1]
    type = ADComputeIsotropicElasticityTensor
    youngs_modulus = 1e1
    poissons_ratio = 0
    block = 1
  [../]
  [./strain1]
    type = ADComputeFiniteStrain
    block = 1
  [../]
  [./stress1]
    type = ADComputeFiniteStrainElasticStress
    block = 1
  [../]
  [./elast_tensor2]
    type = ADComputeIsotropicElasticityTensor
    youngs_modulus = 1e6
    poissons_ratio = 0
    block = 2
  [../]
  [./strain2]
    type = ADComputeFiniteStrain
    block = 2
  [../]
  [./stress2]
    type = ADComputeFiniteStrainElasticStress
    block = 2
  [../]
[]
[Executioner]
  type = Transient
  solve_type = 'NEWTON'
  petsc_options_iname = '-pc_type -sub_pc_type'
  petsc_options_value = 'asm       lu'
  nl_rel_tol = 1e-12
  l_tol = 1e-12
  l_max_its = 20
  dt = 0.5
  end_time = 1.0
[]
[Postprocessors]
  [./internalVolume]
    type = InternalVolume
    boundary = 100
    execute_on = 'initial linear'
  [../]
  [./aveTempInterior]
    type = SideAverageValue
    boundary = 100
    variable = temp
    execute_on = 'initial linear'
  [../]
  [./internalVolumeInterior]
    type = InternalVolume
    boundary = '1 2 3 4 5 6'
    execute_on = 'initial linear'
  [../]
  [./internalVolumeExterior]
    type = InternalVolume
    boundary = '13 14 15 16 17 18'
    execute_on = 'initial linear'
  [../]
  [./materialInput]
    type = SideAverageValue
    boundary = '7 8 9 10 11 12'
    variable = material_input
    execute_on = linear
  [../]
[]
[Outputs]
  exodus = true
[]
(modules/tensor_mechanics/test/tests/ad_2D_geometries/2D-RZ_finiteStrain_resid.i)
# This tests the save_in_disp residual aux-variables for
# ComputeAxisymmetricRZFiniteStrain, which is generated through the use of the
# TensorMechanics MasterAction. The GeneratedMesh is 1x1, rotated via axisym to
# create a cylinder of height 1, radius 1.
#
# PostProcessor force_z plots the force on the top surface of the cylinder.
#
# Displacement of 0.1 is applied to top of cylinder while other surfaces are
# constrained. Plotting force_z vs stress_z will show a slope of 3.14159 (pi),
# consistent with formula for normal stress:
#
# Stress = force / area
#
# where area is A = pi * r^2 for a circle.
[Mesh]
  type = GeneratedMesh
  dim = 2
  nx = 5
  ny = 5
  xmin = 0.0
  xmax = 1.0
  ymin = 0.0
  ymax = 1.0
[]
[GlobalParams]
  displacements = 'disp_r disp_z'
[]
[Problem]
  coord_type = RZ
[]
[Modules/TensorMechanics/Master]
  [./all]
    strain = FINITE
    add_variables = true
    save_in = 'force_r force_z'
    use_automatic_differentiation = true
  [../]
[]
[AuxVariables]
  [./stress_r]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strain_r]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_z]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strain_z]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./force_r]
    order = FIRST
    family = LAGRANGE
  [../]
  [./force_z]
    order = FIRST
    family = LAGRANGE
  [../]
[]
[AuxKernels]
  [./stress_r]
    type = ADRankTwoAux
    rank_two_tensor = stress
    index_i = 0
    index_j = 0
    variable = stress_r
    execute_on = timestep_end
  [../]
  [./strain_r]
    type = ADRankTwoAux
    rank_two_tensor = total_strain
    index_i = 0
    index_j = 0
    variable = strain_r
    execute_on = timestep_end
  [../]
  [./stress_z]
    type = ADRankTwoAux
    rank_two_tensor = stress
    index_i = 1
    index_j = 1
    variable = stress_z
    execute_on = timestep_end
  [../]
  [./strain_z]
    type = ADRankTwoAux
    rank_two_tensor = total_strain
    index_i = 1
    index_j = 1
    variable = strain_z
    execute_on = timestep_end
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ADComputeIsotropicElasticityTensor
    youngs_modulus = 1e6
    poissons_ratio = 0.3
  [../]
  [./_elastic_strain]
    type = ADComputeFiniteStrainElasticStress
  [../]
[]
[BCs]
  [./no_disp_r_left]
    type = ADDirichletBC
    variable = disp_r
    boundary = left
    value = 0.0
  [../]
  [./no_disp_r_right]
    type = ADDirichletBC
    variable = disp_r
    boundary = right
    value = 0.0
  [../]
  [./no_disp_z_bottom]
    type = ADDirichletBC
    variable = disp_z
    boundary = bottom
    value = 0.0
  [../]
  [./top]
    type = ADFunctionDirichletBC
    variable = disp_z
    boundary = top
    function = 't'
  [../]
[]
[Debug]
  show_var_residual_norms = true
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  petsc_options_iname = '-ksp_gmres_restart -pc_type -pc_hypre_type -pc_hypre_boomeramg_max_iter'
  petsc_options_value = '  201               hypre    boomeramg      10'
  line_search = 'none'
  #Preconditioned JFNK (default)
  solve_type = 'PJFNK'
  nl_rel_tol = 5e-9
  nl_abs_tol = 1e-10
  nl_max_its = 15
  l_tol = 1e-3
  l_max_its = 50
  start_time = 0.0
  end_time = 0.1
  dt = 0.01
[]
[Postprocessors]
  [./strainR]
    type = ElementAverageValue
    variable = strain_r
  [../]
  [./stressR]
    type = ElementAverageValue
    variable = stress_r
  [../]
  [./strainZ]
    type = ElementAverageValue
    variable = strain_z
  [../]
  [./stressZ]
    type = ElementAverageValue
    variable = stress_z
  [../]
  [./force_r]
    type = NodalSum
    variable = force_r
    boundary = top
  [../]
  [./force_z]
    type = NodalSum
    variable = force_z
    boundary = top
  [../]
[]
[Outputs]
  exodus = true
  print_linear_residuals = false
  perf_graph = true
[]
(modules/combined/test/tests/ad_cavity_pressure/initial_temperature.i)
#
# Cavity Pressure Test
#
# This test is designed to compute an internal pressure based on
#   p = n * R * T / V
# where
#   p is the pressure
#   n is the amount of material in the volume (moles)
#   R is the universal gas constant
#   T is the temperature
#   V is the volume
#
# The mesh is composed of one block (1) with an interior cavity of volume 8.
#   Block 2 sits in the cavity and has a volume of 1.  Thus, the total
#   initial volume is 7.
# The test adjusts n, T, and V in the following way:
#   n => n0 + alpha * t
#   T => T0 + beta * t
#   V => V0 + gamma * t
# with
#   alpha = n0
#   beta = T0 / 2
#   gamma = -(0.003322259...) * V0
#   T0 = 240.54443866068704
#   V0 = 7
#   n0 = f(p0)
#   p0 = 100
#   R = 8.314472 J * K^(-1) * mol^(-1)
#
# So, n0 = p0 * V0 / R / T0 = 100 * 7 / 8.314472 / 240.544439
#        = 0.35
#
# The parameters combined at t = 1 gives p = 301.
#
# This test sets the initial temperature to 500, but the CavityPressure
#   is told that that initial temperature is T0.  Thus, the final solution
#   is unchanged.
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
  file = 3d.e
[]
[GlobalParams]
  volumetric_locking_correction = true
[]
[Functions]
  [./displ_positive]
    type = PiecewiseLinear
    x = '0 1'
    y = '0 0.0029069767441859684'
  [../]
  [./displ_negative]
    type = PiecewiseLinear
    x = '0 1'
    y = '0 -0.0029069767441859684'
  [../]
  [./temp1]
    type = PiecewiseLinear
    x = '0 1'
    y = '1 1.5'
    scale_factor = 240.54443866068704
  [../]
  [./material_input_function]
    type = PiecewiseLinear
    x = '0    1'
    y = '0 0.35'
  [../]
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
  [./temp]
    initial_condition = 500
  [../]
  [./material_input]
  [../]
[]
[AuxVariables]
  [./pressure_residual_x]
  [../]
  [./pressure_residual_y]
  [../]
  [./pressure_residual_z]
  [../]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zx]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[Kernels]
  [./TensorMechanics]
    use_displaced_mesh = true
    use_automatic_differentiation = true
  [../]
  [./heat]
    type = ADDiffusion
    variable = temp
    use_displaced_mesh = true
  [../]
  [./material_input_dummy]
    type = ADDiffusion
    variable = material_input
    use_displaced_mesh = true
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = ADRankTwoAux
    rank_two_tensor = stress
    index_i = 0
    index_j = 0
    variable = stress_xx
  [../]
  [./stress_yy]
    type = ADRankTwoAux
    rank_two_tensor = stress
    index_i = 1
    index_j = 1
    variable = stress_yy
  [../]
  [./stress_zz]
    type = ADRankTwoAux
    rank_two_tensor = stress
    index_i = 2
    index_j = 2
    variable = stress_zz
  [../]
  [./stress_xy]
    type = ADRankTwoAux
    rank_two_tensor = stress
    index_i = 0
    index_j = 1
    variable = stress_xy
  [../]
  [./stress_yz]
    type = ADRankTwoAux
    rank_two_tensor = stress
    index_i = 1
    index_j = 2
    variable = stress_yz
  [../]
  [./stress_zx]
    type = ADRankTwoAux
    rank_two_tensor = stress
    index_i = 2
    index_j = 0
    variable = stress_zx
  [../]
[]
[BCs]
  [./no_x_exterior]
    type = DirichletBC
    variable = disp_x
    boundary = '7 8'
    value = 0.0
  [../]
  [./no_y_exterior]
    type = DirichletBC
    variable = disp_y
    boundary = '9 10'
    value = 0.0
  [../]
  [./no_z_exterior]
    type = DirichletBC
    variable = disp_z
    boundary = '11 12'
    value = 0.0
  [../]
  [./prescribed_left]
    type = ADFunctionDirichletBC
    variable = disp_x
    boundary = 13
    function = displ_positive
  [../]
  [./prescribed_right]
    type = ADFunctionDirichletBC
    variable = disp_x
    boundary = 14
    function = displ_negative
  [../]
  [./no_y]
    type = DirichletBC
    variable = disp_y
    boundary = '15 16'
    value = 0.0
  [../]
  [./no_z]
    type = DirichletBC
    variable = disp_z
    boundary = '17 18'
    value = 0.0
  [../]
  [./no_x_interior]
    type = DirichletBC
    variable = disp_x
    boundary = '1 2'
    value = 0.0
  [../]
  [./no_y_interior]
    type = DirichletBC
    variable = disp_y
    boundary = '3 4'
    value = 0.0
  [../]
  [./no_z_interior]
    type = DirichletBC
    variable = disp_z
    boundary = '5 6'
    value = 0.0
  [../]
  [./temperatureInterior]
    type = ADFunctionDirichletBC
    boundary = 100
    function = temp1
    variable = temp
  [../]
  [./MaterialInput]
    type = ADFunctionDirichletBC
    boundary = '100 13 14 15 16'
    function = material_input_function
    variable = material_input
  [../]
  [./CavityPressure]
    [./1]
      boundary = 100
      initial_pressure = 100
      material_input = materialInput
      R = 8.314472
      temperature = aveTempInterior
      initial_temperature = 240.54443866068704
      volume = internalVolume
      startup_time = 0.5
      output = ppress
      save_in = 'pressure_residual_x pressure_residual_y pressure_residual_z'
      use_automatic_differentiation = true
    [../]
  [../]
[]
[Materials]
  [./elast_tensor1]
    type = ADComputeElasticityTensor
    C_ijkl = '0 5'
    fill_method = symmetric_isotropic
    block = 1
  [../]
  [./strain1]
    type = ADComputeFiniteStrain
    block = 1
  [../]
  [./stress1]
    type = ADComputeFiniteStrainElasticStress
    block = 1
  [../]
  [./elast_tensor2]
    type = ADComputeElasticityTensor
    C_ijkl = '0 5'
    fill_method = symmetric_isotropic
    block = 2
  [../]
  [./strain2]
    type = ADComputeFiniteStrain
    block = 2
  [../]
  [./stress2]
    type = ADComputeFiniteStrainElasticStress
    block = 2
  [../]
[]
[Executioner]
  type = Transient
  solve_type = 'NEWTON'
  petsc_options_iname = '-pc_type -sub_pc_type'
  petsc_options_value = 'asm       lu'
  nl_rel_tol = 1e-12
  l_tol = 1e-12
  l_max_its = 20
  dt = 0.5
  end_time = 1.0
[]
[Postprocessors]
  [./internalVolume]
    type = InternalVolume
    boundary = 100
    execute_on = 'initial linear'
  [../]
  [./aveTempInterior]
    type = SideAverageValue
    boundary = 100
    variable = temp
    execute_on = 'initial linear'
  [../]
  [./materialInput]
    type = SideAverageValue
    boundary = '7 8 9 10 11 12'
    variable = material_input
    execute_on = linear
  [../]
[]
[Outputs]
  exodus = true
[]
(modules/tensor_mechanics/test/tests/ad_action/two_block.i)
[Mesh]
  [generated_mesh]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 4
    ny = 4
  []
  [block1]
    type = SubdomainBoundingBoxGenerator
    block_id = 1
    bottom_left = '0 0 0'
    top_right = '0.5 1 0'
    input = generated_mesh
  []
  [block2]
    type = SubdomainBoundingBoxGenerator
    block_id = 2
    bottom_left = '0.5 0 0'
    top_right = '1 1 0'
    input = block1
  []
[]
[GlobalParams]
  displacements = 'disp_x disp_y'
[]
[Modules/TensorMechanics/Master]
  [./block1]
    strain = FINITE
    add_variables = true
    #block = 1
    use_automatic_differentiation = true
  [../]
  [./block2]
    strain = SMALL
    add_variables = true
    block = 2
    use_automatic_differentiation = true
  [../]
[]
[AuxVariables]
  [./stress_theta]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strain_theta]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_theta]
    type = ADRankTwoAux
    rank_two_tensor = stress
    index_i = 2
    index_j = 2
    variable = stress_theta
    execute_on = timestep_end
  [../]
  [./strain_theta]
    type = ADRankTwoAux
    rank_two_tensor = total_strain
    index_i = 2
    index_j = 2
    variable = strain_theta
    execute_on = timestep_end
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ADComputeIsotropicElasticityTensor
    youngs_modulus = 1e10
    poissons_ratio = 0.345
  [../]
  [./_elastic_stress1]
    type = ADComputeFiniteStrainElasticStress
    block = 1
  [../]
  [./_elastic_stress2]
    type = ADComputeLinearElasticStress
    block = 2
  [../]
[]
[BCs]
  [./left]
    type = DirichletBC
    boundary = 'left'
    variable = disp_x
    value = 0.0
  [../]
  [./top]
    type = DirichletBC
    boundary = 'top'
    variable = disp_y
    value = 0.0
  [../]
  [./right]
    type = DirichletBC
    boundary = 'right'
    variable = disp_x
    value = 0.01
  [../]
  [./bottom]
    type = DirichletBC
    boundary = 'bottom'
    variable = disp_y
    value = 0.01
  [../]
[]
[Debug]
  show_var_residual_norms = true
[]
[Preconditioning]
  [./full]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Steady
  petsc_options_iname = '-ksp_gmres_restart -pc_type -pc_hypre_type -pc_hypre_boomeramg_max_iter'
  petsc_options_value = '  201               hypre    boomeramg      10'
  line_search = 'none'
  nl_rel_tol = 5e-9
  nl_abs_tol = 1e-10
  nl_max_its = 15
  l_tol = 1e-3
  l_max_its = 50
[]
[Outputs]
  exodus = true
[]
(modules/tensor_mechanics/test/tests/ad_2D_geometries/3D-RZ_finiteStrain_test.i)
# Considers the mechanics solution for a thick spherical shell that is uniformly
# pressurized on the inner and outer surfaces, using 3D geometry.
#
# From Roark (Formulas for Stress and Strain, McGraw-Hill, 1975), the radially-dependent
# circumferential stress in a uniformly pressurized thick spherical shell is given by:
#
# S(r) = [ Pi[ri^3(2r^3+ro^3)] - Po[ro^3(2r^3+ri^3)] ] / [2r^3(ro^3-ri^3)]
#
#   where:
#          Pi = inner pressure
#          Po = outer pressure
#          ri = inner radius
#          ro = outer radius
#
# The tests assume an inner and outer radii of 5 and 10, with internal and external
# pressures of 100000 and 200000 at t = 1.0, respectively. The resulting compressive
# tangential stress is largest at the inner wall and, from the above equation, has a
# value of -271429.
#
# RESULTS are below. Since stresses are average element values, values for the
# edge element and one-element-in are used to extrapolate the stress to the
# inner surface. The vesrion of the tests that are checked use the coarsest meshes.
#
#  Mesh    Radial elem   S(edge elem)  S(one elem in)  S(extrap to surf)
# 1D-SPH
# 2D-RZ        12 (x10)    -265004      -254665        -270174
#  3D          12 (6x6)    -261880      -252811        -266415
#
# 1D-SPH
# 2D-RZ        48 (x10)    -269853      -266710        -271425
#  3D          48 (10x10)  -268522      -265653        -269957
#
# The numerical solution converges to the analytical solution as the mesh is
# refined.
[Mesh]
  file = 3D_mesh.e
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Modules/TensorMechanics/Master]
  [./all]
    strain = FINITE
    add_variables = true
    block = 1
    use_displaced_mesh = true
    use_automatic_differentiation = true
  [../]
[]
[AuxVariables]
  [./stress_theta]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strain_theta]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_theta]
    type = RankTwoAux
    rank_two_tensor = stress
    index_i = 2
    index_j = 2
    variable = stress_theta
    execute_on = timestep_end
  [../]
  [./strain_theta]
    type = RankTwoAux
    rank_two_tensor = total_strain
    index_i = 2
    index_j = 2
    variable = strain_theta
    execute_on = timestep_end
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ADComputeIsotropicElasticityTensor
    youngs_modulus = 1e10
    poissons_ratio = 0.345
    block = 1
  [../]
  [./elastic_strain]
    type = ADComputeFiniteStrainElasticStress
    block = 1
  [../]
[]
[BCs]
# pin particle along symmetry planes
  [./no_disp_x]
    type = ADDirichletBC
    variable = disp_x
    boundary = xzero
    value = 0.0
  [../]
  [./no_disp_y]
    type = ADDirichletBC
    variable = disp_y
    boundary = yzero
    value = 0.0
  [../]
  [./no_disp_z]
    type = ADDirichletBC
    variable = disp_z
    boundary = zzero
    value = 0.0
  [../]
# exterior and internal pressures
  [./exterior_pressure_x]
    type = ADPressure
    variable = disp_x
    boundary = outer
    component = 0
    function = '200000*t'
  [../]
 [./exterior_pressure_y]
    type = ADPressure
    variable = disp_y
    boundary = outer
    component = 1
    function = '200000*t'
  [../]
[./exterior_pressure_z]
    type = ADPressure
    variable = disp_z
    boundary = outer
    component = 2
    function = '200000*t'
  [../]
  [./interior_pressure_x]
    type = ADPressure
    variable = disp_x
    boundary = inner
    component = 0
    function = '100000*t'
  [../]
  [./interior_pressure_y]
    type = ADPressure
    variable = disp_y
    boundary = inner
    component = 1
    function = '100000*t'
  [../]
  [./interior_pressure_z]
    type = ADPressure
    variable = disp_z
    boundary = inner
    component = 2
    function = '100000*t'
  [../]
[]
[Debug]
  show_var_residual_norms = true
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  petsc_options_iname = '-ksp_gmres_restart -pc_type -pc_hypre_type -pc_hypre_boomeramg_max_iter'
  petsc_options_value = '  201               hypre    boomeramg      10'
  line_search = 'none'
  #Preconditioned JFNK (default)
  solve_type = 'PJFNK'
  nl_rel_tol = 5e-9
  nl_abs_tol = 1e-10
  nl_max_its = 15
  l_tol = 1e-3
  l_max_its = 50
  start_time = 0.0
  end_time = 0.2
  dt = 0.1
[]
[Postprocessors]
  [./strainTheta]
    type = ElementAverageValue
    variable = strain_theta
  [../]
  [./stressTheta]
    type = ElementAverageValue
    variable = stress_theta
  [../]
  [./stressTheta_pt]
    type = PointValue
    point = '5.0 0.0 0.0'
    #bottom inside edge for comparison to theory; use csv = true
    variable = stress_theta
  [../]
[]
[Outputs]
  exodus = true
[]
(modules/tensor_mechanics/test/tests/ad_2D_geometries/2D-RZ_finiteStrain_test.i)
# Considers the mechanics solution for a thick spherical shell that is uniformly
# pressurized on the inner and outer surfaces, using 2D axisymmetric geometry.
# This test uses the strain calculator ComputeAxisymmetricRZFiniteStrain,
# which is generated through the use of the TensorMechanics MasterAction.
#
# From Roark (Formulas for Stress and Strain, McGraw-Hill, 1975), the radially-dependent
# circumferential stress in a uniformly pressurized thick spherical shell is given by:
#
# S(r) = [ Pi[ri^3(2r^3+ro^3)] - Po[ro^3(2r^3+ri^3)] ] / [2r^3(ro^3-ri^3)]
#
#   where:
#          Pi = inner pressure
#          Po = outer pressure
#          ri = inner radius
#          ro = outer radius
#
# The tests assume an inner and outer radii of 5 and 10, with internal and external
# pressures of 100000 and 200000 at t = 1.0, respectively. The resulting compressive
# tangential stress is largest at the inner wall and, from the above equation, has a
# value of -271429.
#
# RESULTS are below. Since stresses are average element values, values for the
# edge element and one-element-in are used to extrapolate the stress to the
# inner surface. The vesrion of the tests that are checked use the coarsest meshes.
#
#  Mesh    Radial elem   S(edge elem)  S(one elem in)  S(extrap to surf)
# 1D-SPH
# 2D-RZ        12 (x10)    -265004      -254665        -270174
#  3D          12 (6x6)    -261880      -252811        -266415
#
# 1D-SPH
# 2D-RZ        48 (x10)    -269853      -266710        -271425
#  3D          48 (10x10)  -268522      -265653        -269957
#
# The numerical solution converges to the analytical solution as the mesh is
# refined.
[Mesh]
  file = 2D-RZ_mesh.e
[]
[GlobalParams]
  displacements = 'disp_r disp_z'
[]
[Problem]
  coord_type = RZ
[]
[Modules/TensorMechanics/Master]
  [./all]
    strain = FINITE
    add_variables = true
    block = 1
    use_automatic_differentiation = true
  [../]
[]
[AuxVariables]
  [./stress_theta]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strain_theta]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_theta]
    type = ADRankTwoAux
    rank_two_tensor = stress
    index_i = 2
    index_j = 2
    variable = stress_theta
    execute_on = timestep_end
  [../]
  [./strain_theta]
    type = ADRankTwoAux
    rank_two_tensor = total_strain
    index_i = 2
    index_j = 2
    variable = strain_theta
    execute_on = timestep_end
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ADComputeIsotropicElasticityTensor
    youngs_modulus = 1e10
    poissons_ratio = 0.345
    block = 1
  [../]
  [./_elastic_strain]
    type = ADComputeFiniteStrainElasticStress
    block = 1
  [../]
[]
[BCs]
# pin particle along symmetry planes
  [./no_disp_r]
    type = ADDirichletBC
    variable = disp_r
    boundary = xzero
    value = 0.0
  [../]
  [./no_disp_z]
    type = ADDirichletBC
    variable = disp_z
    boundary = yzero
    value = 0.0
  [../]
# exterior and internal pressures
  [./exterior_pressure_r]
    type = ADPressure
    variable = disp_r
    boundary = outer
    component = 0
    function = '200000*t'
  [../]
 [./exterior_pressure_z]
    type = ADPressure
    variable = disp_z
    boundary = outer
    component = 1
    function = '200000*t'
  [../]
  [./interior_pressure_r]
    type = ADPressure
    variable = disp_r
    boundary = inner
    component = 0
    function = '100000*t'
  [../]
  [./interior_pressure_z]
    type = ADPressure
    variable = disp_z
    boundary = inner
    component = 1
    function = '100000*t'
  [../]
[]
[Debug]
  show_var_residual_norms = true
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  petsc_options_iname = '-ksp_gmres_restart -pc_type -pc_hypre_type -pc_hypre_boomeramg_max_iter'
  petsc_options_value = '  201               hypre    boomeramg      10'
  line_search = 'none'
  #Preconditioned JFNK (default)
  solve_type = 'PJFNK'
  nl_rel_tol = 5e-9
  nl_abs_tol = 1e-10
  nl_max_its = 15
  l_tol = 1e-3
  l_max_its = 50
  start_time = 0.0
  end_time = 0.2
  dt = 0.1
[]
[Postprocessors]
  [./strainTheta]
    type = ElementAverageValue
    variable = strain_theta
  [../]
  [./stressTheta]
    type = ElementAverageValue
    variable = stress_theta
  [../]
  [./stressTheta_pt]
    type = PointValue
    point = '5.0 0.0 0.0'
    #bottom inside edge for comparison to theory; use csv = true
    variable = stress_theta
  [../]
[]
[Outputs]
  exodus = true
[]
(modules/tensor_mechanics/test/tests/ad_elastic/rz_incremental_small_elastic.i)
[Mesh]
  type = GeneratedMesh
  dim = 2
  nx = 3
  ny = 3
[]
[Problem]
  coord_type = RZ
[]
[GlobalParams]
  displacements = 'disp_r disp_z'
[]
[Variables]
  # scale with one over Young's modulus
  [./disp_r]
    scaling = 1e-10
  [../]
  [./disp_z]
    scaling = 1e-10
  [../]
[]
[Kernels]
  [./stress_r]
    type = ADStressDivergenceRZTensors
    component = 0
    variable = disp_r
  [../]
  [./stress_z]
    type = ADStressDivergenceRZTensors
    component = 1
    variable = disp_z
  [../]
[]
[BCs]
  [./bottom]
    type = DirichletBC
    variable = disp_z
    boundary = bottom
    value = 0
  [../]
  [./axial]
    type = DirichletBC
    variable = disp_r
    boundary = left
    value = 0
  [../]
  [./rdisp]
    type = DirichletBC
    variable = disp_r
    boundary = right
    value = 0.1
  [../]
[]
[Materials]
  [./elasticity]
    type = ADComputeIsotropicElasticityTensor
    poissons_ratio = 0.3
    youngs_modulus = 1e10
  [../]
[]
[Materials]
  [./strain]
    type = ADComputeAxisymmetricRZIncrementalStrain
  [../]
  [./stress]
    type = ADComputeFiniteStrainElasticStress
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  dt = 0.05
  solve_type = 'NEWTON'
  petsc_options_iname = -pc_hypre_type
  petsc_options_value = boomeramg
  dtmin = 0.05
  num_steps = 1
[]
[Outputs]
  exodus = true
[]
(modules/combined/test/tests/thermo_mech/ad-youngs_modulus_function_temp.i)
# ---------------------------------------------------------------------------
# This test is designed to verify the variable elasticity tensor functionality in the
# ADComputeFiniteStrainElasticStress class with the elasticity_tensor_has_changed flag
# by varying the young's modulus with temperature. A constant strain is applied
# to the mesh in this case, and the stress varies with the changing elastic constants.
#
# Geometry: A single element cube in symmetry boundary conditions and pulled
#           at a constant displacement to create a constant strain in the x-direction.
#
# Temperature:  The temperature varies from 400K to 700K in this simulation by
#           100K each time step. The temperature is held constant in the last
#           timestep to ensure that the elasticity tensor components are constant
#           under constant temperature.
#
# Results: Because Poisson's ratio is set to zero, only the stress along the x
#          axis is non-zero.  The stress changes with temperature.
#
#    Temperature(K)   strain_{xx}(m/m)     Young's Modulus(Pa)   stress_{xx}(Pa)
#          400              0.001             10.0e6               1.0e4
#          500              0.001             10.0e6               1.0e4
#          600              0.001              9.94e6              9.94e3
#          700              0.001              9.93e6              9.93e3
#
#    The tensor mechanics results align exactly with the analytical results above
#    when this test is run with ComputeIncrementalSmallStrain.  When the test is
#    run with ComputeFiniteStrain, a 0.05% discrepancy between the analytical
#    strains and the simulation strain results is observed, and this discrepancy
#    is carried over into the calculation of the elastic stress.
#-------------------------------------------------------------------------
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
  [./temp]
    initial_condition = 400
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./elastic_strain_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[Functions]
  [./temperature_function]
    type = PiecewiseLinear
    x = '1       4'
    y = '400   700'
  [../]
[]
[Kernels]
  [./heat]
    type = ADDiffusion
    variable = temp
  [../]
  [./TensorMechanics]
    use_displaced_mesh = true
    use_automatic_differentiation = true
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = ADRankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
 [./elastic_strain_xx]
    type = ADRankTwoAux
    rank_two_tensor = elastic_strain
    variable = elastic_strain_xx
    index_i = 0
    index_j = 0
    execute_on = timestep_end
  [../]
[]
[BCs]
  [./u_left_fix]
    type = DirichletBC
    variable = disp_x
    boundary = left
    value = 0.0
  [../]
  [./u_bottom_fix]
    type = DirichletBC
    variable = disp_y
    boundary = bottom
    value = 0.0
  [../]
  [./u_back_fix]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0.0
  [../]
  [./u_pull_right]
    type = DirichletBC
    variable = disp_x
    boundary = right
    value = 0.001
  [../]
  [./temp_bc_1]
    type = ADFunctionDirichletBC
    variable = temp
    preset = false
    boundary = '1 2 3 4'
    function = temperature_function
  [../]
[]
[Materials]
  [./youngs_modulus]
    type = ADPiecewiseLinearInterpolationMaterial
    xy_data = '0          10e+6
               599.9999   10e+6
               600        9.94e+6
               99900      10e3'
    property = youngs_modulus
    variable = temp
  [../]
  [./elasticity_tensor]
    type = ADComputeVariableIsotropicElasticityTensor
    youngs_modulus = youngs_modulus
    poissons_ratio = 0.0
  [../]
  [./strain]
    type = ADComputeIncrementalSmallStrain
  [../]
  [./stress]
    type = ADComputeFiniteStrainElasticStress
  [../]
[]
[Preconditioning]
  [./full]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  end_time = 5
[]
[Postprocessors]
  [./elastic_strain_xx]
    type = ElementAverageValue
    variable = elastic_strain_xx
  [../]
  [./elastic_stress_xx]
    type = ElementAverageValue
    variable = stress_xx
  [../]
  [./temp]
    type = AverageNodalVariableValue
    variable = temp
  [../]
[]
[Outputs]
  exodus = true
[]
(modules/tensor_mechanics/test/tests/thermal_expansion/ad_constant_expansion_coeff.i)
# This test involves only thermal expansion strains on a 2x2x2 cube of approximate
# steel material.  An initial temperature of 25 degrees C is given for the material,
# and an auxkernel is used to calculate the temperature in the entire cube to
# raise the temperature each time step.  After the first timestep,in which the
# temperature jumps, the temperature increases by 6.25C each timestep.
# The thermal strain increment should therefore be
#     6.25 C * 1.3e-5 1/C = 8.125e-5 m/m.
# This test is also designed to be used to identify problems with restart files
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 2
  ny = 2
  nz = 2
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Variables]
  [./temp]
  [../]
[]
[Functions]
  [./temperature_load]
    type = ParsedFunction
    value = t*(500.0)+300.0
  [../]
[]
[Modules]
  [./TensorMechanics]
    [./Master]
      [./all]
        strain = SMALL
        incremental = true
        add_variables = true
        eigenstrain_names = eigenstrain
        generate_output = 'strain_xx strain_yy strain_zz'
        use_automatic_differentiation = true
      [../]
    [../]
  [../]
[]
[Kernels]
  [./tempfuncaux]
    type = Diffusion
    variable = temp
  [../]
[]
[BCs]
  [./x_bot]
    type = DirichletBC
    variable = disp_x
    boundary = left
    value = 0.0
  [../]
  [./y_bot]
    type = DirichletBC
    variable = disp_y
    boundary = bottom
    value = 0.0
  [../]
  [./z_bot]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0.0
  [../]
  [./temp]
    type = FunctionDirichletBC
    variable = temp
    function = temperature_load
    boundary = 'left right'
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ADComputeIsotropicElasticityTensor
    youngs_modulus = 2.1e5
    poissons_ratio = 0.3
  [../]
  [./small_stress]
    type = ADComputeFiniteStrainElasticStress
  [../]
  [./thermal_expansion_strain]
    type = ADComputeThermalExpansionEigenstrain
    stress_free_temperature = 298
    thermal_expansion_coeff = 1.3e-5
    temperature = temp
    eigenstrain_name = eigenstrain
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  solve_type = 'NEWTON'
  l_max_its = 50
  nl_max_its = 50
  nl_rel_tol = 1e-12
  nl_abs_tol = 1e-10
  l_tol = 1e-9
  start_time = 0.0
  end_time = 0.075
  dt = 0.0125
  dtmin = 0.0001
[]
[Outputs]
  csv = true
  exodus = true
[]
[Postprocessors]
  [./strain_xx]
    type = ElementAverageValue
    variable = strain_xx
  [../]
  [./strain_yy]
    type = ElementAverageValue
    variable = strain_yy
  [../]
  [./strain_zz]
    type = ElementAverageValue
    variable = strain_zz
  [../]
  [./temperature]
    type = AverageNodalVariableValue
    variable = temp
  [../]
[]
(modules/tensor_mechanics/test/tests/ad_action/two_block_no_action.i)
[Mesh]
  [generated_mesh]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 4
    ny = 4
  []
  [block1]
    type = SubdomainBoundingBoxGenerator
    block_id = 1
    bottom_left = '0 0 0'
    top_right = '0.5 1 0'
    input = generated_mesh
  []
  [block2]
    type = SubdomainBoundingBoxGenerator
    block_id = 2
    bottom_left = '0.5 0 0'
    top_right = '1 1 0'
    input = block1
  []
[]
[GlobalParams]
  displacements = 'disp_x disp_y'
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
[]
# [Modules/TensorMechanics/Master]
#   [./block1]
#     strain = FINITE
#     add_variables = true
#     #block = 1
#     use_automatic_differentiation = true
#   [../]
#   [./block2]
#     strain = SMALL
#     add_variables = true
#     block = 2
#     use_automatic_differentiation = true
#   [../]
# []
[Kernels]
  [./disp_x]
    type = ADStressDivergenceTensors
    variable = disp_x
    component = 0
  [../]
  [./disp_y]
    type = ADStressDivergenceTensors
    variable = disp_y
    component = 1
  [../]
[]
[AuxVariables]
  [./stress_theta]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strain_theta]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_theta]
    type = ADRankTwoAux
    rank_two_tensor = stress
    index_i = 2
    index_j = 2
    variable = stress_theta
    execute_on = timestep_end
  [../]
  [./strain_theta]
    type = ADRankTwoAux
    rank_two_tensor = total_strain
    index_i = 2
    index_j = 2
    variable = strain_theta
    execute_on = timestep_end
  [../]
[]
[Materials]
  [./block_1]
    type = ADComputeFiniteStrain
    block = 1
  [../]
  [./block_2]
    type = ADComputeSmallStrain
    block = 2
  [../]
  [./elasticity_tensor]
    type = ADComputeIsotropicElasticityTensor
    youngs_modulus = 1e10
    poissons_ratio = 0.345
  [../]
  [./_elastic_stress1]
    type = ADComputeFiniteStrainElasticStress
    block = 1
  [../]
  [./_elastic_stress2]
    type = ADComputeLinearElasticStress
    block = 2
  [../]
[]
[BCs]
  [./left]
    type = DirichletBC
    boundary = 'left'
    variable = disp_x
    value = 0.0
  [../]
  [./top]
    type = DirichletBC
    boundary = 'top'
    variable = disp_y
    value = 0.0
  [../]
  [./right]
    type = DirichletBC
    boundary = 'right'
    variable = disp_x
    value = 0.01
  [../]
  [./bottom]
    type = DirichletBC
    boundary = 'bottom'
    variable = disp_y
    value = 0.01
  [../]
[]
[Debug]
  show_var_residual_norms = true
[]
[Preconditioning]
  [./full]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Steady
  petsc_options_iname = '-ksp_gmres_restart -pc_type -pc_hypre_type -pc_hypre_boomeramg_max_iter'
  petsc_options_value = '  201               hypre    boomeramg      10'
  line_search = 'none'
  nl_rel_tol = 5e-9
  nl_abs_tol = 1e-10
  nl_max_its = 15
  l_tol = 1e-3
  l_max_its = 50
[]
[Outputs]
  exodus = true
[]
(modules/tensor_mechanics/test/tests/ad_thermal_expansion_function/finite_linear.i)
# This tests the thermal expansion coefficient function using both
# options to specify that function: mean and instantaneous.  There
# two blocks, each containing a single element, and these use the
# two variants of the function.
# In this test, the instantaneous CTE function is a linear function
# while the mean CTE function is an analytic function designed to
# give the same response.  If \bar{alpha}(T) is the mean CTE function,
# and \alpha(T) is the instantaneous CTE function,
# \bar{\alpha}(T) = 1/(T-Tref) \intA^{T}_{Tsf} \alpha(T) dT
# where Tref is the reference temperature used to define the mean CTE
# function, and Tsf is the stress-free temperature.
# This version of the test uses finite deformation theory.
# The two models produce very similar results.  There are slight
# differences due to the large deformation treatment.
[Mesh]
  file = 'blocks.e'
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[AuxVariables]
  [./temp]
    order = FIRST
    family = LAGRANGE
  [../]
[]
[Modules/TensorMechanics/Master]
  [./all]
    strain = FINITE
    add_variables = true
    eigenstrain_names = eigenstrain
    generate_output = 'strain_xx strain_yy strain_zz'
    use_automatic_differentiation = true
  [../]
[]
[BCs]
  [./left]
    type = DirichletBC
    variable = disp_x
    boundary = 3
    value = 0.0
  [../]
  [./bottom]
    type = DirichletBC
    variable = disp_y
    boundary = 2
    value = 0.0
  [../]
  [./back]
    type = DirichletBC
    variable = disp_z
    boundary = 1
    value = 0.0
  [../]
[]
[AuxKernels]
  [./temp]
    type = FunctionAux
    variable = temp
    block = '1 2'
    function = temp_func
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ADComputeIsotropicElasticityTensor
    youngs_modulus = 1e6
    poissons_ratio = 0.3
  [../]
  [./small_stress]
    type = ADComputeFiniteStrainElasticStress
  [../]
  [./thermal_expansion_strain1]
    type = ADComputeMeanThermalExpansionFunctionEigenstrain
    block = 1
    thermal_expansion_function = cte_func_mean
    thermal_expansion_function_reference_temperature = 0.5
    stress_free_temperature = 0.0
    temperature = temp
    eigenstrain_name = eigenstrain
  [../]
  [./thermal_expansion_strain2]
    type = ADComputeInstantaneousThermalExpansionFunctionEigenstrain
    block = 2
    thermal_expansion_function = cte_func_inst
    stress_free_temperature = 0.0
    temperature = temp
    eigenstrain_name = eigenstrain
  [../]
[]
[Functions]
  [./cte_func_mean]
    type = ParsedFunction
    vars = 'tsf tref scale' #stress free temp, reference temp, scale factor
    vals = '0.0 0.5  1e-4'
    value = 'scale * (0.5 * t^2 - 0.5 * tsf^2) / (t - tref)'
  [../]
  [./cte_func_inst]
    type = PiecewiseLinear
    xy_data = '0 0.0
               2 2.0'
    scale_factor = 1e-4
  [../]
  [./temp_func]
    type = PiecewiseLinear
    xy_data = '0 1
               1 2'
  [../]
[]
[Postprocessors]
  [./disp_1]
    type = NodalMaxValue
    variable = disp_x
    boundary = 101
  [../]
  [./disp_2]
    type = NodalMaxValue
    variable = disp_x
    boundary = 102
  [../]
[]
[Executioner]
  type = Transient
  solve_type = NEWTON
  l_max_its = 100
  l_tol = 1e-4
  nl_abs_tol = 1e-8
  nl_rel_tol = 1e-12
  start_time = 0.0
  end_time = 1.0
  dt = 0.1
[]
[Outputs]
  csv = true
[]
(modules/contact/test/tests/mortar_tm/2d/ad_frictionless_sec/finite.i)
E_block = 1e7
E_plank = 1e7
elem = QUAD9
order = SECOND
name = 'finite'
[Mesh]
  patch_size = 80
  patch_update_strategy = auto
  [./plank]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = -0.3
    xmax = 0.3
    ymin = -10
    ymax = 10
    nx = 2
    ny = 67
    elem_type = ${elem}
    boundary_name_prefix = plank
  [../]
  [./plank_id]
    type = SubdomainIDGenerator
    input = plank
    subdomain_id = 1
  [../]
  [./block]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0.31
    xmax = 0.91
    ymin = 7.7
    ymax = 8.5
    nx = 3
    ny = 4
    elem_type = ${elem}
    boundary_name_prefix = block
    boundary_id_offset = 10
  [../]
  [./block_id]
    type = SubdomainIDGenerator
    input = block
    subdomain_id = 2
  [../]
  [./combined]
    type = MeshCollectionGenerator
    inputs = 'plank_id block_id'
  [../]
  [./block_rename]
    type = RenameBlockGenerator
    input = combined
    old_block_id = '1 2'
    new_block_name = 'plank block'
  [../]
[]
[GlobalParams]
  displacements = 'disp_x disp_y'
[]
[Variables]
  [./disp_x]
    order = ${order}
    block = 'plank block'
    scaling = ${fparse 2.0 / (E_plank + E_block)}
  [../]
  [./disp_y]
    order = ${order}
    block = 'plank block'
    scaling = ${fparse 2.0 / (E_plank + E_block)}
  [../]
[]
[Modules/TensorMechanics/Master]
  [./action]
    strain = FINITE
    generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx strain_yy strain_zz'
    block = 'plank block'
    use_automatic_differentiation = true
  [../]
[]
[Contact]
  [./frictionless]
    mesh = block_rename
    primary = plank_right
    secondary = block_left
    formulation = mortar
  [../]
[]
[BCs]
  [./left_x]
    type = DirichletBC
    variable = disp_x
    preset = false
    boundary = plank_left
    value = 0.0
  [../]
  [./left_y]
    type = DirichletBC
    variable = disp_y
    preset = false
    boundary = plank_bottom
    value = 0.0
  [../]
  [./right_x]
    type = ADFunctionDirichletBC
    variable = disp_x
    preset = false
    boundary = block_right
    function = '-0.04*sin(4*(t+1.5))+0.02'
  [../]
  [./right_y]
    type = ADFunctionDirichletBC
    variable = disp_y
    preset = false
    boundary = block_right
    function = '-t'
  [../]
[]
[Materials]
  [./plank]
    type = ADComputeIsotropicElasticityTensor
    block = 'plank'
    poissons_ratio = 0.3
    youngs_modulus = ${E_plank}
  [../]
  [./block]
    type = ADComputeIsotropicElasticityTensor
    block = 'block'
    poissons_ratio = 0.3
    youngs_modulus = ${E_block}
  [../]
  [./stress]
    type = ADComputeFiniteStrainElasticStress
    block = 'plank block'
  [../]
[]
[Executioner]
  type = Transient
  solve_type = 'NEWTON'
  petsc_options = '-snes_converged_reason -ksp_converged_reason'
  petsc_options_iname = '-pc_type -mat_mffd_err -pc_factor_shift_type -pc_factor_shift_amount'
  petsc_options_value = 'lu       1e-5          NONZERO               1e-15'
  end_time = 13.5
  dt = 0.1
  dtmin = 0.1
  timestep_tolerance = 1e-6
  line_search = 'contact'
[]
[Postprocessors]
  [./nl_its]
    type = NumNonlinearIterations
  [../]
  [./total_nl_its]
    type = CumulativeValuePostprocessor
    postprocessor = nl_its
  [../]
  [./l_its]
    type = NumLinearIterations
  [../]
  [./total_l_its]
    type = CumulativeValuePostprocessor
    postprocessor = l_its
  [../]
  [./contact]
    type = ContactDOFSetSize
    variable = frictionless_normal_lm
    subdomain = frictionless_secondary_subdomain
  [../]
  [./avg_hydro]
    type = ElementAverageValue
    variable = hydrostatic_stress
    block = 'block'
  [../]
  [./max_hydro]
    type = ElementExtremeValue
    variable = hydrostatic_stress
    block = 'block'
  [../]
  [./min_hydro]
    type = ElementExtremeValue
    variable = hydrostatic_stress
    block = 'block'
    value_type = min
  [../]
  [./avg_vonmises]
    type = ElementAverageValue
    variable = vonmises_stress
    block = 'block'
  [../]
  [./max_vonmises]
    type = ElementExtremeValue
    variable = vonmises_stress
    block = 'block'
  [../]
  [./min_vonmises]
    type = ElementExtremeValue
    variable = vonmises_stress
    block = 'block'
    value_type = min
  [../]
[]
[Outputs]
  exodus = true
  file_base = ${name}
  [./comp]
    type = CSV
    show = 'contact'
  [../]
  [./out]
    type = CSV
    file_base = '${name}_out'
  [../]
[]
[Debug]
  show_var_residual_norms = true
[]
(modules/combined/test/tests/ad_cavity_pressure/additional_volume.i)
#
# Cavity Pressure Test using using automatic differentiation
#
# This test is designed to compute an internal pressure based on
# p = n * R * / (V_cavity / T_cavity + V_add / T_add)
# where
#  p is the pressure
#  n is the amount of material in the volume (moles)
#  R is the universal gas constant
#  T_cavity is the temperature in the cavity
#  T_add is the temperature of the additional volume
#
# The mesh is composed of one block (1) with an interior cavity of volume 8.
#   Block 2 sits in the cavity and has a volume of 1.  Thus, the total
#   initial volume is 7. An additional volume of 2 is added.
#
# The test adjusts n, T, and V in the following way:
#   n => n0 + alpha * t
#   T => T0 + beta * t
#   V => V_cavity0 + gamma * t + V_add
# with
#   alpha = n0
#   beta = T0 / 2
#   gamma = -(0.003322259...) * V0
#   T0 = 240.54443866068704
#   V_cavity0 = 7
#   V_add = 2
#   T_add = 100
#   n0 = f(p0)
#   p0 = 100
#   R = 8.314472 J * K^(-1) * mol^(-1)
#
#  An additional volume of 2 with a temperature of 100.0 is included.
#
# So, n0 = p0 * (V_cavity / T_cavity + V_add / T_add) / R
#        = 100 * (7 / 240.544439 + 2 / 100) / 8.314472
#        = 0.59054
#
# The parameters combined at t = 1 gives p = 249.647.
#
# This test sets the initial temperature to 500, but the CavityPressure
#   is told that that initial temperature is T0.  Thus, the final solution
#   is unchanged.
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
  file = 3d.e
[]
[GlobalParams]
  volumetric_locking_correction = true
[]
[Functions]
  [./displ_positive]
    type = PiecewiseLinear
    x = '0 1'
    y = '0 0.0029069767441859684'
  [../]
  [./displ_negative]
    type = PiecewiseLinear
    x = '0 1'
    y = '0 -0.0029069767441859684'
  [../]
  [./temp1]
    type = PiecewiseLinear
    x = '0 1'
    y = '1 1.5'
    scale_factor = 240.54443866068704
  [../]
  [./material_input_function]
    type = PiecewiseLinear
    x = '0    1'
    y = '0 0.59054'
  [../]
  [./additional_volume]
    type = ConstantFunction
    value = 2
  [../]
  [./temperature_of_additional_volume]
    type = ConstantFunction
    value = 100
  [../]
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
  [./temp]
    initial_condition = 500
  [../]
  [./material_input]
  [../]
[]
[AuxVariables]
  [./pressure_residual_x]
  [../]
  [./pressure_residual_y]
  [../]
  [./pressure_residual_z]
  [../]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zx]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[Kernels]
  [./TensorMechanics]
    use_displaced_mesh = true
    use_automatic_differentiation = true
  [../]
  [./heat]
    type = ADDiffusion
    variable = temp
    use_displaced_mesh = true
  [../]
  [./material_input_dummy]
    type = ADDiffusion
    variable = material_input
    use_displaced_mesh = true
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = ADRankTwoAux
    rank_two_tensor = stress
    index_i = 0
    index_j = 0
    variable = stress_xx
  [../]
  [./stress_yy]
    type = ADRankTwoAux
    rank_two_tensor = stress
    index_i = 1
    index_j = 1
    variable = stress_yy
  [../]
  [./stress_zz]
    type = ADRankTwoAux
    rank_two_tensor = stress
    index_i = 2
    index_j = 2
    variable = stress_zz
  [../]
  [./stress_xy]
    type = ADRankTwoAux
    rank_two_tensor = stress
    index_i = 0
    index_j = 1
    variable = stress_xy
  [../]
  [./stress_yz]
    type = ADRankTwoAux
    rank_two_tensor = stress
    index_i = 1
    index_j = 2
    variable = stress_yz
  [../]
  [./stress_zx]
    type = ADRankTwoAux
    rank_two_tensor = stress
    index_i = 2
    index_j = 0
    variable = stress_zx
  [../]
[]
[BCs]
  [./no_x_exterior]
    type = DirichletBC
    variable = disp_x
    boundary = '7 8'
    value = 0.0
  [../]
  [./no_y_exterior]
    type = DirichletBC
    variable = disp_y
    boundary = '9 10'
    value = 0.0
  [../]
  [./no_z_exterior]
    type = DirichletBC
    variable = disp_z
    boundary = '11 12'
    value = 0.0
  [../]
  [./prescribed_left]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 13
    function = displ_positive
  [../]
  [./prescribed_right]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 14
    function = displ_negative
  [../]
  [./no_y]
    type = DirichletBC
    variable = disp_y
    boundary = '15 16'
    value = 0.0
  [../]
  [./no_z]
    type = DirichletBC
    variable = disp_z
    boundary = '17 18'
    value = 0.0
  [../]
  [./no_x_interior]
    type = DirichletBC
    variable = disp_x
    boundary = '1 2'
    value = 0.0
  [../]
  [./no_y_interior]
    type = DirichletBC
    variable = disp_y
    boundary = '3 4'
    value = 0.0
  [../]
  [./no_z_interior]
    type = DirichletBC
    variable = disp_z
    boundary = '5 6'
    value = 0.0
  [../]
  [./temperatureInterior]
    type = ADFunctionDirichletBC
    boundary = 100
    function = temp1
    variable = temp
  [../]
  [./MaterialInput]
    type = ADFunctionDirichletBC
    boundary = '100 13 14 15 16'
    function = material_input_function
    variable = material_input
  [../]
  [./CavityPressure]
    [./1]
      boundary = 100
      initial_pressure = 100
      material_input = materialInput
      R = 8.314472
      temperature = aveTempInterior
      initial_temperature = 240.54443866068704
      volume = internalVolume
      startup_time = 0.5
      output = ppress
      save_in = 'pressure_residual_x pressure_residual_y pressure_residual_z'
      additional_volumes = volume1
      temperature_of_additional_volumes = temperature1
      use_automatic_differentiation = true
    [../]
  [../]
[]
[Materials]
  [./elast_tensor1]
    type = ADComputeElasticityTensor
    C_ijkl = '0 5'
    fill_method = symmetric_isotropic
    block = 1
  [../]
  [./strain1]
    type = ADComputeFiniteStrain
    block = 1
  [../]
  [./stress1]
    type = ADComputeFiniteStrainElasticStress
    block = 1
  [../]
  [./elast_tensor2]
    type = ADComputeElasticityTensor
    C_ijkl = '0 5'
    fill_method = symmetric_isotropic
    block = 2
  [../]
  [./strain2]
    type = ADComputeFiniteStrain
    block = 2
  [../]
  [./stress2]
    type = ADComputeFiniteStrainElasticStress
    block = 2
  [../]
[]
[Executioner]
  type = Transient
  solve_type = 'NEWTON'
  petsc_options_iname = '-pc_type -sub_pc_type'
  petsc_options_value = 'asm       lu'
  nl_rel_tol = 1e-12
  l_tol = 1e-12
  l_max_its = 20
  dt = 0.5
  end_time = 1.0
[]
[Postprocessors]
  [./internalVolume]
    type = InternalVolume
    boundary = 100
    execute_on = 'initial linear'
  [../]
  [./aveTempInterior]
    type = SideAverageValue
    boundary = 100
    variable = temp
    execute_on = 'initial linear'
  [../]
  [./materialInput]
    type = SideAverageValue
    boundary = '7 8 9 10 11 12'
    variable = material_input
    execute_on = linear
  [../]
  [./volume1]
    type = FunctionValuePostprocessor
    function = additional_volume
    execute_on = 'initial linear'
  [../]
  [./temperature1]
    type = FunctionValuePostprocessor
    function = temperature_of_additional_volume
    execute_on = 'initial linear'
  [../]
[]
[Outputs]
  exodus = true
[]
(tutorials/darcy_thermo_mech/step10_multiapps/problems/step10.i)
[GlobalParams]
  displacements = 'disp_r disp_z'
[]
[Mesh]
  type = GeneratedMesh
  dim = 2
  nx = 10
  ny = 100
  ymax = 0.304 # Length of test chamber
  xmax = 0.0257 # Test chamber radius
[]
[Variables]
  [pressure]
  []
  [temperature]
    initial_condition = 300 # Start at room temperature
  []
[]
[AuxVariables]
  [k_eff]
    initial_condition = 15.0 # water at 20C
  []
  [velocity]
    order = CONSTANT
    family = MONOMIAL_VEC
  []
[]
[Modules/TensorMechanics/Master]
  [all]
    # This block adds all of the proper Kernels, strain calculators, and Variables
    # for TensorMechanics in the correct coordinate system (autodetected)
    add_variables = true
    strain = FINITE
    eigenstrain_names = eigenstrain
    use_automatic_differentiation = true
    generate_output = 'vonmises_stress elastic_strain_xx elastic_strain_yy strain_xx strain_yy'
  []
[]
[Kernels]
  [darcy_pressure]
    type = DarcyPressure
    variable = pressure
  []
  [heat_conduction]
    type = ADHeatConduction
    variable = temperature
  []
  [heat_conduction_time_derivative]
    type = ADHeatConductionTimeDerivative
    variable = temperature
  []
  [heat_convection]
    type = DarcyAdvection
    variable = temperature
    pressure = pressure
  []
[]
[AuxKernels]
  [velocity]
    type = DarcyVelocity
    variable = velocity
    execute_on = timestep_end
    pressure = pressure
  []
[]
[BCs]
  [inlet]
    type = DirichletBC
    variable = pressure
    boundary = bottom
    value = 4000 # (Pa) From Figure 2 from paper.  First data point for 1mm spheres.
  []
  [outlet]
    type = DirichletBC
    variable = pressure
    boundary = top
    value = 0 # (Pa) Gives the correct pressure drop from Figure 2 for 1mm spheres
  []
  [inlet_temperature]
    type = FunctionDirichletBC
    variable = temperature
    boundary = bottom
    function = 'if(t<0,350+50*t,350)'
  []
  [outlet_temperature]
    type = HeatConductionOutflow
    variable = temperature
    boundary = top
  []
  [hold_inlet]
    type = DirichletBC
    variable = disp_z
    boundary = bottom
    value = 0
  []
  [hold_center]
    type = DirichletBC
    variable = disp_r
    boundary = left
    value = 0
  []
  [hold_outside]
    type = DirichletBC
    variable = disp_r
    boundary = right
    value = 0
  []
[]
[Materials]
  viscosity_file = data/water_viscosity.csv
  density_file = data/water_density.csv
  specific_heat_file = data/water_specific_heat.csv
  thermal_expansion_file = data/water_thermal_expansion.csv
  [column]
    type = PackedColumn
    temperature = temperature
    radius = 1
    thermal_conductivity = k_eff # Use the AuxVariable instead of calculating
    fluid_viscosity_file = ${viscosity_file}
    fluid_density_file = ${density_file}
    fluid_specific_heat_file = ${specific_heat_file}
    fluid_thermal_expansion_file = ${thermal_expansion_file}
  []
  [elasticity_tensor]
    type = ADComputeIsotropicElasticityTensor
    youngs_modulus = 200e9 # (Pa) from wikipedia
    poissons_ratio = .3 # from wikipedia
  []
  [elastic_stress]
    type = ADComputeFiniteStrainElasticStress
  []
  [thermal_strain]
    type = ADComputeThermalExpansionEigenstrain
    stress_free_temperature = 300
    thermal_expansion_coeff = 1e-6
    eigenstrain_name = eigenstrain
    temperature = temperature
  []
[]
[Postprocessors]
  [average_temperature]
    type = ElementAverageValue
    variable = temperature
  []
[]
[Executioner]
  type = Transient
  start_time = -1
  end_time = 200
  steady_state_tolerance = 1e-7
  steady_state_detection = true
  dt = 0.25
  solve_type = PJFNK
  automatic_scaling = true
  compute_scaling_once = false
  petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart'
  petsc_options_value = 'hypre boomeramg 500'
  line_search = none
  [TimeStepper]
    type = FunctionDT
    function = 'if(t<0,0.1,0.25)'
  []
[]
[MultiApps]
  [micro]
    type = TransientMultiApp
    app_type = DarcyThermoMechApp
    positions = '0.01285 0.0    0
                 0.01285 0.0608 0
                 0.01285 0.1216 0
                 0.01285 0.1824 0
                 0.01285 0.2432 0
                 0.01285 0.304  0'
    input_files = step10_micro.i
    execute_on = 'timestep_end'
  []
[]
[Transfers]
  [keff_from_sub]
    type = MultiAppPostprocessorInterpolationTransfer
    direction = from_multiapp
    multi_app = micro
    variable = k_eff
    power = 1
    postprocessor = k_eff
    execute_on = 'timestep_end'
  []
  [temperature_to_sub]
    type = MultiAppVariableValueSamplePostprocessorTransfer
    direction = to_multiapp
    multi_app = micro
    source_variable = temperature
    postprocessor = temperature_in
    execute_on = 'timestep_end'
  []
[]
[Controls]
  [multiapp]
    type = TimePeriod
    disable_objects = 'MultiApps::micro Transfers::keff_from_sub Transfers::temperature_to_sub'
    start_time = '0'
    execute_on = 'initial'
  []
[]
[Outputs]
  [out]
    type = Exodus
    elemental_as_nodal = true
  []
[]
(modules/tensor_mechanics/test/tests/czm/czm_patch_test.i)
# Patch test for cohesive zone modeling to check convergence
[Mesh]
  [./msh]
  type = FileMeshGenerator
  file = patch_mesh.e
  []
  [./transform]
  type = TransformGenerator
  input = msh
  transform = TRANSLATE
  vector_value = '-0.5 -0.5 -0.5'
  []
  [./split]
    type = BreakMeshByBlockGenerator
    input = transform
  []
  [./add_surfaces]
    type = SideSetsFromNormalsGenerator
    input = split
    normals = '0  0  1
               0  1  0
               1  0  0
               0  0 -1
               0 -1  0
              -1  0  0'
    fixed_normal = true
    new_boundary = 'front top right back bottom left'
  []
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Modules]
  [./TensorMechanics]
    [./Master]
      [./all]
        strain = FINITE
        add_variables = true
        use_finite_deform_jacobian = true
        use_automatic_differentiation = true
      [../]
    [../]
  [../]
[]
[Functions]
  [./angles]
    type = PiecewiseLinear
    x = '0 1'
    y = '0 0'
  [../]
  [./stretch]
    type = PiecewiseLinear
    x = '0 1'
    y = '0 0.01'
  [../]
  [./move_y]
    type = ParsedFunction
    value = 'y*cos(theta) - z * (1 + a)*sin(theta) - y'
    vars = 'a theta'
    vals = 'stretch angles'
  [../]
  [./move_z]
    type = ParsedFunction
    value = 'y*sin(theta) + z*(1+a)*cos(theta) - z'
    vars = 'a theta'
    vals = 'stretch angles'
  [../]
  [./dt_fun]
    type = PiecewiseConstant
    x = '0 1'
    y = '0.25 0.25'
  []
[]
[BCs]
  [./fix]
    type = DirichletBC
    preset = true
    value = 0.0
    boundary = left
    variable = disp_x
  [../]
  [./front_y]
    type = FunctionDirichletBC
    boundary = front
    variable = disp_y
    function = move_y
    preset = true
  [../]
  [./back_y]
    type = FunctionDirichletBC
    boundary = back
    variable = disp_y
    function = move_y
    preset = true
  [../]
  [./front_z]
    type = FunctionDirichletBC
    boundary = front
    variable = disp_z
    function = move_z
    preset = true
  [../]
  [./back_z]
    type = FunctionDirichletBC
    boundary = back
    variable = disp_z
    function = move_z
    preset = true
  [../]
[]
[Modules/TensorMechanics/CohesiveZoneMaster]
  [./czm_ik]
    boundary = 'interface'
  [../]
[]
[Materials]
  [./stress]
    type = ADComputeFiniteStrainElasticStress
  [../]
  [./elasticity_tensor]
    type = ADComputeElasticityTensor
    fill_method = symmetric9
    C_ijkl = '1.684e5 0.176e5 0.176e5 1.684e5 0.176e5 1.684e5 0.754e5 0.754e5 0.754e5'
  [../]
  [./czm_mat]
    boundary = 'interface'
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  solve_type = 'newton'
  line_search = none
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  l_max_its = 2
  l_tol = 1e-14
  nl_max_its = 15
  nl_rel_tol = 1e-10
  nl_abs_tol = 1e-10
  start_time = 0.0
  dt = 0.25
  end_time = 1
[]
[Postprocessors]
  [./nonlin]
    type = NumNonlinearIterations
  [../]
[]
[Outputs]
  csv = true
[]
(modules/tensor_mechanics/test/tests/ad_elastic/rspherical_incremental_small_elastic.i)
[Mesh]
  type = GeneratedMesh
  dim = 1
  nx = 5
[]
[Problem]
  coord_type = RSPHERICAL
[]
[GlobalParams]
  displacements = 'disp_r'
[]
[Variables]
  # scale with one over Young's modulus
  [./disp_r]
    scaling = 1e-10
  [../]
[]
[Kernels]
  [./stress_r]
    type = ADStressDivergenceRSphericalTensors
    component = 0
    variable = disp_r
  [../]
[]
[BCs]
  [./center]
    type = DirichletBC
    variable = disp_r
    boundary = left
    value = 0
  [../]
  [./rdisp]
    type = DirichletBC
    variable = disp_r
    boundary = right
    value = 0.1
  [../]
[]
[Materials]
  [./elasticity]
    type = ADComputeIsotropicElasticityTensor
    poissons_ratio = 0.3
    youngs_modulus = 1e10
  [../]
[]
[Materials]
  [./strain]
    type = ADComputeRSphericalIncrementalStrain
  [../]
  [./stress]
    type = ADComputeFiniteStrainElasticStress
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  dt = 0.05
  solve_type = 'NEWTON'
  petsc_options_iname = -pc_hypre_type
  petsc_options_value = boomeramg
  dtmin = 0.05
  num_steps = 1
[]
[Outputs]
  exodus = true
[]
(modules/contact/test/tests/mortar_tm/2d/ad_frictionless_fir/finite_rr.i)
E_block = 1e7
E_plank = 1e7
elem = QUAD4
order = FIRST
name = 'finite_rr'
[Mesh]
  patch_size = 80
  patch_update_strategy = auto
  [./plank]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = -0.3
    xmax = 0.3
    ymin = -10
    ymax = 10
    nx = 2
    ny = 67
    elem_type = ${elem}
    boundary_name_prefix = plank
  [../]
  [./plank_id]
    type = SubdomainIDGenerator
    input = plank
    subdomain_id = 1
  [../]
  [./block]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0.31
    xmax = 0.91
    ymin = 7.7
    ymax = 8.5
    nx = 3
    ny = 4
    elem_type = ${elem}
    boundary_name_prefix = block
    boundary_id_offset = 10
  [../]
  [./block_id]
    type = SubdomainIDGenerator
    input = block
    subdomain_id = 2
  [../]
  [./combined]
    type = MeshCollectionGenerator
    inputs = 'plank_id block_id'
  [../]
  [./block_rename]
    type = RenameBlockGenerator
    input = combined
    old_block_id = '1 2'
    new_block_name = 'plank block'
  [../]
[]
[GlobalParams]
  displacements = 'disp_x disp_y'
[]
[Problem]
  type = ReferenceResidualProblem
  extra_tag_vectors = 'ref'
  reference_vector = 'ref'
[]
[Variables]
  [./disp_x]
    order = ${order}
    block = 'plank block'
    scaling = ${fparse 2.0 / (E_plank + E_block)}
  [../]
  [./disp_y]
    order = ${order}
    block = 'plank block'
    scaling = ${fparse 2.0 / (E_plank + E_block)}
  [../]
[]
[Modules/TensorMechanics/Master]
  [./action]
    strain = FINITE
    generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx strain_yy strain_zz'
    block = 'plank block'
    extra_vector_tags = 'ref'
    use_automatic_differentiation = true
  [../]
[]
[Contact]
  [./frictionless]
    mesh = block_rename
    primary = plank_right
    secondary = block_left
    formulation = mortar
  [../]
[]
[BCs]
  [./left_x]
    type = DirichletBC
    variable = disp_x
    boundary = plank_left
    value = 0.0
  [../]
  [./left_y]
    type = DirichletBC
    variable = disp_y
    boundary = plank_bottom
    value = 0.0
  [../]
  [./right_x]
    type = ADFunctionDirichletBC
    variable = disp_x
    boundary = block_right
    function = '-0.04*sin(4*(t+1.5))+0.02'
  [../]
  [./right_y]
    type = ADFunctionDirichletBC
    variable = disp_y
    boundary = block_right
    function = '-t'
  [../]
[]
[Materials]
  [./plank]
    type = ADComputeIsotropicElasticityTensor
    block = 'plank'
    poissons_ratio = 0.3
    youngs_modulus = ${E_plank}
  [../]
  [./block]
    type = ADComputeIsotropicElasticityTensor
    block = 'block'
    poissons_ratio = 0.3
    youngs_modulus = ${E_block}
  [../]
  [./stress]
    type = ADComputeFiniteStrainElasticStress
    block = 'plank block'
  [../]
[]
[Executioner]
  type = Transient
  solve_type = 'NEWTON'
  petsc_options = '-snes_converged_reason -ksp_converged_reason'
  petsc_options_iname = '-pc_type -mat_mffd_err -pc_factor_shift_type -pc_factor_shift_amount'
  petsc_options_value = 'lu       1e-5          NONZERO               1e-15'
  end_time = 13.5
  dt = 0.1
  dtmin = 0.1
  timestep_tolerance = 1e-6
  line_search = 'contact'
  nl_abs_tol = 1e-7
[]
[Postprocessors]
  [./nl_its]
    type = NumNonlinearIterations
  [../]
  [./total_nl_its]
    type = CumulativeValuePostprocessor
    postprocessor = nl_its
  [../]
  [./l_its]
    type = NumLinearIterations
  [../]
  [./total_l_its]
    type = CumulativeValuePostprocessor
    postprocessor = l_its
  [../]
  [./contact]
    type = ContactDOFSetSize
    variable = frictionless_normal_lm
    subdomain = frictionless_secondary_subdomain
  [../]
  [./avg_hydro]
    type = ElementAverageValue
    variable = hydrostatic_stress
    block = 'block'
  [../]
  [./max_hydro]
    type = ElementExtremeValue
    variable = hydrostatic_stress
    block = 'block'
  [../]
  [./min_hydro]
    type = ElementExtremeValue
    variable = hydrostatic_stress
    block = 'block'
    value_type = min
  [../]
  [./avg_vonmises]
    type = ElementAverageValue
    variable = vonmises_stress
    block = 'block'
  [../]
  [./max_vonmises]
    type = ElementExtremeValue
    variable = vonmises_stress
    block = 'block'
  [../]
  [./min_vonmises]
    type = ElementExtremeValue
    variable = vonmises_stress
    block = 'block'
    value_type = min
  [../]
[]
[Outputs]
  exodus = true
  file_base = ${name}
  [./comp]
    type = CSV
    show = 'contact'
  [../]
  [./out]
    type = CSV
    file_base = '${name}_out'
  [../]
[]
[Debug]
  show_var_residual_norms = true
[]
(modules/tensor_mechanics/test/tests/ad_anisotropic_plasticity/anis_elasticity_test.i)
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
  volumetric_locking_correction = true
[]
[AuxVariables]
  [hydrostatic_stress]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[Variables]
  [disp_x]
    scaling = 1e-10
  []
  [disp_y]
    scaling = 1e-10
  []
  [disp_z]
    scaling = 1e-10
  []
[]
[AuxKernels]
  [hydrostatic_stress]
    type = ADRankTwoScalarAux
    variable = hydrostatic_stress
    rank_two_tensor = stress
    scalar_type = Hydrostatic
  []
[]
[Functions]
  [pull]
    type = PiecewiseLinear
    x = '0 1e3 1e8'
    y = '0 1e2 1e2'
  []
[]
[Modules/TensorMechanics/Master]
  [all]
    strain = FINITE
    add_variables = true
    incremental = true
    generate_output = 'elastic_strain_xx elastic_strain_yy elastic_strain_xy stress_xx stress_xy stress_yy'
    use_automatic_differentiation = true
  []
[]
[Materials]
  [elasticity_tensor]
    type = ADComputeIsotropicElasticityTensor
    youngs_modulus = 206800
    poissons_ratio = 0.0
  []
   [stress_]
      type = ADComputeFiniteStrainElasticStress
   []
[]
[BCs]
  [no_disp_x]
    type = ADDirichletBC
    variable = disp_x
    boundary = bottom
    value = 0.0
  []
  [no_disp_y]
    type = ADDirichletBC
    variable = disp_y
    boundary = bottom
    value = 0.0
  []
  [no_disp_z]
    type = ADDirichletBC
    variable = disp_z
    boundary = bottom
    value = 0.0
  []
  [Pressure]
    [Side1]
      boundary = top
      function = pull
    []
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  solve_type = NEWTON
  petsc_options_iname = '-ksp_gmres_restart -pc_type -sub_pc_type'
  petsc_options_value = '101                asm      lu'
  line_search = 'none'
  nl_rel_tol = 1e-07
  nl_abs_tol = 1.0e-15
  l_max_its = 90
  num_steps = 40
  dt = 5.0e1
  start_time = 0
  automatic_scaling = true
[]
[Postprocessors]
  [max_disp_x]
    type = ElementExtremeValue
    variable = disp_x
  []
  [max_disp_y]
    type = ElementExtremeValue
    variable = disp_y
  []
  [max_hydro]
    type = ElementAverageValue
    variable = hydrostatic_stress
  []
  [dt]
    type = TimestepSize
  []
  [num_lin]
    type = NumLinearIterations
    outputs = console
  []
  [num_nonlin]
    type = NumNonlinearIterations
    outputs = console
  []
[]
[Outputs]
  csv = true
  exodus = true
  perf_graph = true
[]
(modules/tensor_mechanics/test/tests/ad_1D_spherical/finiteStrain_1DSphere_hollow.i)
# This simulation models the mechanics solution for a hollow sphere under
# pressure, applied on the outer surfaces, using 1D spherical symmetry
# assumpitions.  The inner radius of the sphere, r = 4mm, is pinned to prevent
# rigid body movement of the sphere.
#
# From Bower (Applied Mechanics of Solids, 2008, available online at
# solidmechanics.org/text/Chapter4_1/Chapter4_1.htm), and applying the outer
# pressure and pinned displacement boundary conditions set in this simulation,
# the radial displacement is given by:
#
# u(r) = \frac{P(1 + v)(1 - 2v)b^3}{E(b^3(1 + v) + 2a^3(1-2v))} * (\frac{a^3}{r^2} - r)
#
# where P is the applied pressure, b is the outer radius, a is the inner radius,
# v is Poisson's ration, E is Young's Modulus, and r is the radial position.
#
# The radial stress is given by:
#
# S(r) = \frac{Pb^3}{b^3(1 + v) + 2a^3(1 - 2v)} * (\frac{2a^3}{r^3}(2v - 1) - (1 + v))
#
# The test assumes an inner radius of 4mm, and outer radius of 9 mm,
# zero displacement at r = 4mm, and an applied outer pressure of 2MPa.
# The radial stress is largest in the inner most element and, at an assumed
# mid element coordinate of 4.5mm, is equal to -2.545MPa.
[Mesh]
  type = GeneratedMesh
  dim = 1
  xmin = 4
  xmax = 9
  nx = 5
[]
[GlobalParams]
  displacements = 'disp_r'
[]
[Problem]
  coord_type = RSPHERICAL
[]
[Modules/TensorMechanics/Master]
  [./all]
    strain = FINITE
    add_variables = true
    use_automatic_differentiation = true
  [../]
[]
[AuxVariables]
  [./stress_rr]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[Postprocessors]
  [./stress_rr]
    type = ElementAverageValue
    variable = stress_rr
  [../]
[]
[AuxKernels]
  [./stress_rr]
    type = ADRankTwoAux
    rank_two_tensor = stress
    index_i = 0
    index_j = 0
    variable = stress_rr
    execute_on = timestep_end
  [../]
[]
[BCs]
  [./innerDisp]
    type = ADDirichletBC
    boundary = left
    variable = disp_r
    value = 0.0
  [../]
  [./outerPressure]
    type = ADPressure
    boundary = right
    variable = disp_r
    component = 0
    constant = 2
  [../]
[]
[Materials]
  [./Elasticity_tensor]
    type = ADComputeIsotropicElasticityTensor
    poissons_ratio = 0.345
    youngs_modulus = 1e4
  [../]
  [./stress]
    type = ADComputeFiniteStrainElasticStress
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  solve_type = PJFNK
  line_search = none
# controls for linear iterations
  l_max_its = 100
  l_tol = 1e-8
# controls for nonlinear iterations
  nl_max_its = 15
  nl_rel_tol = 1e-10
  nl_abs_tol = 1e-5
# time control
  start_time = 0.0
  dt = 0.25
  dtmin = 0.0001
  end_time = 1.0
[]
[Outputs]
  exodus = true
[]
(modules/tensor_mechanics/include/materials/ADComputeMultipleInelasticStress.h)
// This file is part of the MOOSE framework
// https://www.mooseframework.org
//
// All rights reserved, see COPYRIGHT for full restrictions
// https://github.com/idaholab/moose/blob/master/COPYRIGHT
//
// Licensed under LGPL 2.1, please see LICENSE for details
// https://www.gnu.org/licenses/lgpl-2.1.html
#pragma once
#include "ADComputeFiniteStrainElasticStress.h"
#include "ADRankTwoTensorForward.h"
#include "ADRankFourTensorForward.h"
#include "StressUpdateBase.h"
/**
 * ADComputeMultipleInelasticStress computes the stress and a decomposition of the strain
 * into elastic and inelastic parts.  By default finite strains are assumed.
 *
 * The elastic strain is calculated by subtracting the computed inelastic strain
 * increment tensor from the mechanical strain tensor.  Mechanical strain is
 * considered as the sum of the elastic and inelastic (plastic, creep, ect) strains.
 *
 * This material is used to call the recompute iterative materials of a number
 * of specified inelastic models that inherit from ADStressUpdateBase.  It iterates
 * over the specified inelastic models until the change in stress is within
 * a user-specified tolerance, in order to produce the stress and the elastic and inelastic strains
 * for the time increment.
 */
class ADComputeMultipleInelasticStress : public ADComputeFiniteStrainElasticStress
{
public:
  static InputParameters validParams();
  ADComputeMultipleInelasticStress(const InputParameters & parameters);
  virtual void initialSetup() override;
protected:
  virtual void initQpStatefulProperties() override;
  virtual void computeQpStress() override;
  /**
    Compute the stress for the current QP, but do not rotate tensors from the
    intermediate configuration to the new configuration
   */
  virtual void computeQpStressIntermediateConfiguration();
  /**
   * Rotate _elastic_strain, _stress, and _inelastic_strain to the
   * new configuration.
   */
  virtual void finiteStrainRotation();
  /**
   * Given the _strain_increment[_qp], iterate over all of the user-specified
   * recompute materials in order to find an admissible stress (which is placed
   * into _stress[_qp]) and set of inelastic strains.
   * @param elastic_strain_increment The elastic part of _strain_increment[_qp] after the iterative
   * process has converged
   * @param combined_inelastic_strain_increment The inelastic part of _strain_increment[_qp] after
   * the iterative process has converged.  This is a weighted sum of all the inelastic strains
   * computed by all the plastic models during the Picard iterative scheme.  The weights are
   * dictated by the user using _inelastic_weights
   */
  virtual void updateQpState(ADRankTwoTensor & elastic_strain_increment,
                             ADRankTwoTensor & combined_inelastic_strain_increment);
  /**
   * An optimised version of updateQpState that gets used when the number
   * of plastic models is unity, or when we're cycling through models
   * Given the _strain_increment[_qp], find an admissible stress (which is
   * put into _stress[_qp]) and inelastic strain.
   * @param model_number Use this model number
   * @param elastic_strain_increment The elastic part of _strain_increment[_qp]
   * @param combined_inelastic_strain_increment The inelastic part of _strain_increment[_qp]
   */
  virtual void updateQpStateSingleModel(unsigned model_number,
                                        ADRankTwoTensor & elastic_strain_increment,
                                        ADRankTwoTensor & combined_inelastic_strain_increment);
  /**
   * Given a trial stress (_stress[_qp]) and a strain increment (elastic_strain_increment)
   * let the model_number model produce an admissible stress (gets placed back
   * in _stress[_qp]), and decompose the strain increment into an elastic part
   * (gets placed back into elastic_strain_increment) and an
   * inelastic part (inelastic_strain_increment).
   * @param model_number The inelastic model to use
   * @param elastic_strain_increment Upon input, this is the strain increment.
   * Upon output, it is the elastic part of the strain increment
   * @param inelastic_strain_increment The inelastic strain increment
   * corresponding to the supplied strain increment
   */
  virtual void computeAdmissibleState(unsigned model_number,
                                      ADRankTwoTensor & elastic_strain_increment,
                                      ADRankTwoTensor & inelastic_strain_increment);
  ///@{Input parameters associated with the recompute iteration to return the stress state to the yield surface
  const unsigned int _max_iterations;
  const Real _relative_tolerance;
  const Real _absolute_tolerance;
  const bool _internal_solve_full_iteration_history;
  ///@}
  /// after updateQpState, rotate the stress, elastic_strain, and inelastic_strain using _rotation_increment
  const bool _perform_finite_strain_rotations;
  /// The sum of the inelastic strains that come from the plastic models
  ADMaterialProperty<RankTwoTensor> & _inelastic_strain;
  /// old value of inelastic strain
  const MaterialProperty<RankTwoTensor> & _inelastic_strain_old;
  /// number of plastic models
  const unsigned _num_models;
  /// _inelastic_strain = sum_i (_inelastic_weights_i * inelastic_strain_from_model_i)
  const std::vector<Real> _inelastic_weights;
  /// whether to cycle through the models, using only one model per timestep
  const bool _cycle_models;
  MaterialProperty<Real> & _material_timestep_limit;
  /**
   * The user supplied list of inelastic models to use in the simulation
   *
   * Users should take care to list creep models first and plasticity
   * models last to allow for the case when a creep model relaxes the stress state
   * inside of the yield surface in an iteration.
   */
  std::vector<ADStressUpdateBase *> _models;
  /// is the elasticity tensor guaranteed to be isotropic?
  bool _is_elasticity_tensor_guaranteed_isotropic;
};