- inputThe mesh we want to modify
C++ Type:MeshGeneratorName
Description:The mesh we want to modify
 - sidesetsThe sidesets from which to create the new block
C++ Type:std::vector<BoundaryName>
Description:The sidesets from which to create the new block
 
LowerDBlockFromSidesetGenerator
Adds lower dimensional elements on the specified sidesets.
Overview
This mesh generator accepts a list of sidesets and creates a lower dimensional block of elements along those sides. The order of the newly create lower dimensional element block will match the order of the parent elements (e.g. first order for first order parents, second order for second order parents).
Input Parameters
- new_block_idThe lower dimensional block id to create
C++ Type:unsigned short
Options:
Description:The lower dimensional block id to create
 - new_block_nameThe lower dimensional block name to create (optional)
C++ Type:SubdomainName
Options:
Description:The lower dimensional block name to create (optional)
 - show_infoFalseWhether or not to show mesh info after generating the mesh (bounding box, element types, sidesets, nodesets, subdomains, etc)
Default:False
C++ Type:bool
Options:
Description:Whether or not to show mesh info after generating the mesh (bounding box, element types, sidesets, nodesets, subdomains, etc)
 
Optional 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.
 
Advanced Parameters
Input Files
- (test/tests/mortar/convergence-studies/gap-conductance/gap-conductance.i)
 - (test/tests/mortar/mortar-q-points/test.i)
 - (modules/combined/test/tests/gap_heat_transfer_mortar/small-2d/small.i)
 - (modules/contact/examples/2d_indenter/indenter_rz_fine.i)
 - (modules/heat_conduction/test/tests/gap_heat_transfer_mortar/gap_heat_transfer_mortar_displaced.i)
 - (modules/contact/test/tests/mortar_tm/2d/frictionless_second/finite_noaction.i)
 - (modules/heat_conduction/test/tests/gap_heat_transfer_mortar/gap_heat_transfer_mortar.i)
 - (modules/combined/test/tests/gap_heat_transfer_mortar/finite-2d-rz/finite.i)
 - (test/tests/mortar/displaced-gap-conductance-2d-bnd-coupling/gap-conductance-bnd-material.i)
 - (test/tests/mortar/displaced-gap-conductance-2d-non-conforming/gap-conductance.i)
 - (test/tests/mortar/continuity-2d-conforming/conforming.i)
 - (modules/combined/test/tests/gap_heat_transfer_mortar/small-2d-rz/small.i)
 - (modules/contact/test/tests/mechanical-small-problem/frictionless-nodal-lm-mortar-disp.i)
 - (test/tests/meshgenerators/lower_d_block_generator/ids.i)
 - (test/tests/mesh_modifiers/lower_d_block/lower_d.i)
 - (test/tests/mortar/gap-conductance-2d-non-conforming/gap-conductance.i)
 - (modules/contact/test/tests/sliding_block/in_and_out/frictionless_lm.i)
 - (modules/combined/examples/mortar/eigenstrain.i)
 - (modules/combined/test/tests/gap_heat_transfer_mortar/finite-2d/finite.i)
 - (test/tests/mortar/periodic-value/periodic.i)
 - (test/tests/mortar/displaced-gap-conductance-2d-bnd-coupling/gap-conductance.i)
 - (test/tests/mortar/convergence-studies/solution-continuity/continuity.i)
 - (test/tests/mortar/displaced-gap-conductance-2d-bnd-coupling/gap-conductance-bnd-aux-kernel.i)
 - (modules/contact/test/tests/mechanical-small-problem/mortar-mech.i)
 - (modules/contact/test/tests/sliding_block/in_and_out/frictional_lm.i)
 - (test/tests/mortar/cant-do-3d/periodic.i)
 - (test/tests/mortar/continuity-2d-non-conforming/soln-continuity.i)
 - (modules/combined/examples/mortar/mortar_gradient.i)
 - (test/tests/mortar/continuity-2d-conforming/conforming_two_var.i)
 - (test/tests/mortar/continuity-2d-non-conforming/dual-soln-continuity.i)
 - (modules/contact/test/tests/mortar_tm/2drz/frictionless_first/finite_noaction.i)
 - (modules/contact/test/tests/mortar_tm/2drz/frictionless_second/finite_noaction.i)
 - (test/tests/bcs/ad_coupled_lower_value/test.i)
 - (modules/contact/test/tests/mortar_tm/2d/frictionless_first/finite_noaction.i)
 - (test/tests/mortar/continuity-2d-conforming/conforming-2nd-order.i)
 - (test/tests/mortar/continuity-2d-non-conforming/sequencing-stateful-soln-continuity.i)
 - (test/tests/meshgenerators/lower_d_block_generator/names.i)
 - (test/tests/mortar/continuity-2d-conforming/equalgradient.i)
 
(test/tests/mortar/convergence-studies/gap-conductance/gap-conductance.i)
[Problem]
  error_on_jacobian_nonzero_reallocation = true
[]
[Mesh]
  second_order = true
  [./left_block]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = 1
    ymin = 0
    ymax = 1
    nx = 2
    ny = 2
    elem_type = QUAD4
  [../]
  [./left_block_sidesets]
    type = RenameBoundaryGenerator
    input = left_block
    old_boundary_id = '0 1 2 3'
    new_boundary_name = 'lb_bottom lb_right lb_top lb_left'
  [../]
  [./left_block_id]
    type = SubdomainIDGenerator
    input = left_block_sidesets
    subdomain_id = 1
  [../]
  [./right_block]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 2
    xmax = 3
    ymin = 0
    ymax = 1
    nx = 2
    ny = 2
    elem_type = QUAD4
  [../]
  [./right_block_id]
    type = SubdomainIDGenerator
    input = right_block
    subdomain_id = 2
  [../]
  [right_block_change_boundary_id]
    type = RenameBoundaryGenerator
    input = right_block_id
    old_boundary_id = '0 1 2 3'
    new_boundary_id = '100 101 102 103'
  []
  [./combined]
    type = MeshCollectionGenerator
    inputs = 'left_block_id right_block_change_boundary_id'
  [../]
  [./block_rename]
    type = RenameBlockGenerator
    input = combined
    old_block_id = '1 2'
    new_block_name = 'left_block right_block'
  [../]
  [right_right_sideset]
    type = SideSetsAroundSubdomainGenerator
    input = block_rename
    new_boundary = rb_right
    block = right_block
    normal = '1 0 0'
  []
  [right_left_sideset]
    type = SideSetsAroundSubdomainGenerator
    input = right_right_sideset
    new_boundary = rb_left
    block = right_block
    normal = '-1 0 0'
  []
  [right_top_sideset]
    type = SideSetsAroundSubdomainGenerator
    input = right_left_sideset
    new_boundary = rb_top
    block = right_block
    normal = '0 1 0'
  []
  [right_bottom_sideset]
    type = SideSetsAroundSubdomainGenerator
    input = right_top_sideset
    new_boundary = rb_bottom
    block = right_block
    normal = '0 -1 0'
  []
  [secondary]
    input = right_bottom_sideset
    type = LowerDBlockFromSidesetGenerator
    sidesets = 'lb_right'
    new_block_id = '10001'
    new_block_name = 'secondary_lower'
  []
  [primary]
    input = secondary
    type = LowerDBlockFromSidesetGenerator
    sidesets = 'rb_left'
    new_block_id = '10000'
    new_block_name = 'primary_lower'
  []
[]
[Variables]
  [./T]
    block = 'left_block right_block'
    order = SECOND
  [../]
  [./lambda]
    block = 'secondary_lower'
    family = MONOMIAL
    order = CONSTANT
  [../]
[]
[BCs]
  [./neumann]
    type = FunctionGradientNeumannBC
    exact_solution = exact_soln_primal
    variable = T
    boundary = 'lb_bottom lb_top lb_left rb_bottom rb_right rb_top'
  [../]
[]
[Kernels]
  [./conduction]
    type = Diffusion
    variable = T
    block = 'left_block right_block'
  [../]
  [./sink]
    type = Reaction
    variable = T
    block = 'left_block right_block'
  [../]
  [./forcing_function]
    type = BodyForce
    variable = T
    function = forcing_function
    block = 'left_block right_block'
  [../]
[]
[Functions]
  [./forcing_function]
    type = ParsedFunction
    value = ''
  [../]
  [./exact_soln_primal]
    type = ParsedFunction
    value = ''
  [../]
  [exact_soln_lambda]
    type = ParsedFunction
    value = ''
  []
  [mms_secondary]
    type = ParsedFunction
    value = ''
  []
  [mms_primary]
    type = ParsedFunction
    value = ''
  []
[]
[Debug]
  show_var_residual_norms = 1
[]
[Constraints]
  [./mortar]
    type = GapHeatConductanceTest
    primary_boundary = rb_left
    secondary_boundary = lb_right
    primary_subdomain = primary_lower
    secondary_subdomain = secondary_lower
    secondary_variable = T
    variable = lambda
    secondary_gap_conductance = 1
    primary_gap_conductance = 1
    secondary_mms_function = mms_secondary
    primary_mms_function = mms_primary
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  solve_type = NEWTON
  type = Steady
  petsc_options = '-snes_converged_reason'
  # petsc_options_iname = '-pc_type -pc_factor_mat_solver_type'
  # petsc_options_value = 'lu       superlu_dist'
  petsc_options_iname = '-pc_type -pc_hypre_type'
  petsc_options_value = 'hypre    boomeramg'
[]
[Outputs]
  exodus = true
  csv = true
  [dofmap]
    type = DOFMap
    execute_on = 'initial'
  []
[]
[Postprocessors]
  [L2lambda]
    type = ElementL2Error
    variable = lambda
    function = exact_soln_lambda
    execute_on = 'timestep_end'
    block = 'secondary_lower'
  []
  [L2u]
    type = ElementL2Error
    variable = T
    function = exact_soln_primal
    execute_on = 'timestep_end'
    block = 'left_block right_block'
  []
  [h]
    type = AverageElementSize
    block = 'left_block right_block'
  []
[]
(test/tests/mortar/mortar-q-points/test.i)
[Mesh]
  [file]
    type = FileMeshGenerator
    file = nodal_normals_test_offset_nonmatching_gap.e
  []
  [./primary]
    input = file
    type = LowerDBlockFromSidesetGenerator
    sidesets = '2'
    new_block_id = '20'
  [../]
  [./secondary]
    input = primary
    type = LowerDBlockFromSidesetGenerator
    sidesets = '1'
    new_block_id = '10'
  [../]
  uniform_refine = 2
[]
[Problem]
  kernel_coverage_check = false
[]
[Variables]
  [./T]
    block = '1 2'
  [../]
[]
[Kernels]
  [./conduction]
    type = Diffusion
    variable = T
    block = '1 2'
  [../]
  [./reaction]
    type = Reaction
    variable = T
    block = '1 2'
  [../]
[]
[Constraints]
  [./mortar]
    type = SpatiallyVaryingSource
    primary_boundary = 2
    secondary_boundary = 1
    primary_subdomain = 20
    secondary_subdomain = 10
    secondary_variable = T
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  solve_type = NEWTON
  type = Steady
[]
[Outputs]
  exodus = true
[]
(modules/combined/test/tests/gap_heat_transfer_mortar/small-2d/small.i)
E_block = 1e7
E_plank = 1e7
elem = QUAD4
order = FIRST
name = 'small'
[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
  []
[]
[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'
  []
  [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 = ADComputeLinearElasticStress
    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/contact/examples/2d_indenter/indenter_rz_fine.i)
[GlobalParams]
  volumetric_locking_correction = true
  displacements = 'disp_x disp_y'
[]
[Problem]
  coord_type = RZ
  type = ReferenceResidualProblem
  reference_vector = 'ref'
  extra_tag_vectors = 'ref'
[]
[Mesh]
  patch_update_strategy = auto
  patch_size = 2
  partitioner = centroid
  centroid_partitioner_direction = y
  [simple_mesh]
    type = FileMeshGenerator
    file = indenter_rz_fine_bigsideset.e
  []
  [secondary]
    type = LowerDBlockFromSidesetGenerator
    sidesets = '4'
    new_block_id = '10001'
    new_block_name = 'secondary_lower'
    input = simple_mesh
  []
  [primary]
    type = LowerDBlockFromSidesetGenerator
    sidesets = '6'
    new_block_id = '10000'
    new_block_name = 'primary_lower'
    input = secondary
  []
  # For NodalVariableValue to work with distributed mesh
  allow_renumbering = false
[../]
[Functions]
  [disp_y]
    type = PiecewiseLinear
    x = '0.  1.0     2.0    2.6   3.0'
    y = '0.  -4.5   -5.7   -5.7  -4.0'
  []
[]
[Variables]
  [disp_x]
    order = FIRST
    family = LAGRANGE
    block = '1 2'
  []
  [disp_y]
    order = FIRST
    family = LAGRANGE
    block = '1 2'
  []
  [frictionless_normal_lm]
    block = 'secondary_lower'
  []
[]
[AuxVariables]
  [saved_x]
  []
  [saved_y]
  []
[]
[Modules/TensorMechanics/Master]
  [all]
    add_variables = true
    strain = FINITE
    block = '1 2'
    use_automatic_differentiation = false
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_zz'
    save_in = 'saved_x saved_y'
  []
[]
[BCs]
  # Symmetries of the Problem
  [symm_x_indenter]
    type = DirichletBC
    variable = disp_x
    boundary = 5
    value = 0.0
  []
  [symm_x_material]
    type = DirichletBC
    variable = disp_x
    boundary = 9
    value = 0.0
  []
  # Material should not fly away
  [material_base_y]
    type = DirichletBC
    variable = disp_y
    boundary = 8
    value = 0.0
  []
  # Drive indenter motion
  [disp_y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 1
    function = disp_y
  []
[]
[Constraints]
  # All constraints below for mechanical contact (Mortar)
  [lm]
    type = NormalNodalLMMechanicalContact
    secondary = '4'
    primary = 6
    variable = frictionless_normal_lm
    primary_variable = disp_x
    disp_y = disp_y
    use_displaced_mesh = true
    tangential_tolerance = 0.01
  []
  [x]
    type = NormalMortarMechanicalContact
    primary_boundary = '6'
    secondary_boundary = '4'
    primary_subdomain = '10000'
    secondary_subdomain = '10001'
    variable = frictionless_normal_lm
    secondary_variable = disp_x
    component = x
    use_displaced_mesh = true
    compute_lm_residuals = true
  []
  [y]
    type = NormalMortarMechanicalContact
    primary_boundary = '6'
    secondary_boundary = '4'
    primary_subdomain = '10000'
    secondary_subdomain = '10001'
    variable = frictionless_normal_lm
    secondary_variable = disp_y
    component = y
    use_displaced_mesh = true
    compute_lm_residuals = true
  []
[../]
[UserObjects]
  [slip_rate_gss]
    type = CrystalPlasticitySlipRateGSS
    variable_size = 48
    slip_sys_file_name = input_slip_sys_bcc48.txt
    num_slip_sys_flowrate_props = 2
    flowprops = '1 48 0.0001 0.01'
    uo_state_var_name = state_var_gss
    slip_incr_tol = 10.0
    block = 2
  []
  [slip_resistance_gss]
    type = CrystalPlasticitySlipResistanceGSS
    variable_size = 48
    uo_state_var_name = state_var_gss
    block = 2
  []
  [state_var_gss]
    type = CrystalPlasticityStateVariable
    variable_size = 48
    groups = '0 24 48'
    group_values = '900 1000' #120
    uo_state_var_evol_rate_comp_name = state_var_evol_rate_comp_gss
    scale_factor = 1.0
    block = 2
  []
  [state_var_evol_rate_comp_gss]
    type = CrystalPlasticityStateVarRateComponentGSS
    variable_size = 48
    hprops = '1.4 1000 1200 2.5'
    uo_slip_rate_name = slip_rate_gss
    uo_state_var_name = state_var_gss
    block = 2
  []
[]
[Materials]
  [tensor]
    type = ComputeIsotropicElasticityTensor
    block = '1'
    youngs_modulus = 1.0e7
    poissons_ratio = 0.25
  []
  [stress]
    type = ComputeFiniteStrainElasticStress
    block = '1'
  []
  [crysp]
    type = FiniteStrainUObasedCP
    block = 2
    stol = 1e-2
    tan_mod_type = exact
    uo_slip_rates = 'slip_rate_gss'
    uo_slip_resistances = 'slip_resistance_gss'
    uo_state_vars = 'state_var_gss'
    uo_state_var_evol_rate_comps = 'state_var_evol_rate_comp_gss'
    maximum_substep_iteration = 20
  []
  [elasticity_tensor]
    type = ComputeElasticityTensorCP
    block = 2
    C_ijkl = '265190 113650 113650 265190 113650 265190 75769 75769 75760'
    fill_method = symmetric9
  []
[]
[Preconditioning]
  [SMP]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  petsc_options = '-snes_ksp_ew'
  petsc_options_iname = '-pc_type -snes_linesearch_type -pc_factor_shift_type '
                        '-pc_factor_shift_amount'
  petsc_options_value = 'lu       basic                 NONZERO               1e-15'
  line_search = 'none'
  automatic_scaling = true
  nl_abs_tol = 1.5e-07
  nl_rel_tol = 1.5e-07
  l_max_its = 40
  l_abs_tol = 1e-08
  l_tol = 1e-08
  start_time = 0.0
  dt = 0.01
  end_time = 3.0 # Executioner
[]
[Postprocessors]
  [maxdisp]
    type = NodalVariableValue
    nodeid = 39
    variable = disp_y
  []
  [resid_y]
    type = NodalSum
    variable = saved_y
    boundary = 1
  []
[]
[Outputs]
  [out]
    type = Exodus
    elemental_as_nodal = true
  []
  perf_graph = true
  csv = true
[]
(modules/heat_conduction/test/tests/gap_heat_transfer_mortar/gap_heat_transfer_mortar_displaced.i)
[Mesh]
  displacements = 'disp_x disp_y'
  [file]
    type = FileMeshGenerator
    file = 2blk-gap.e
  []
  [secondary]
    type = LowerDBlockFromSidesetGenerator
    sidesets = '101'
    new_block_id = 10001
    new_block_name = 'secondary_lower'
    input = file
  []
  [primary]
    type = LowerDBlockFromSidesetGenerator
    sidesets = '100'
    new_block_id = 10000
    new_block_name = 'primary_lower'
    input = secondary
  []
[]
[Problem]
  kernel_coverage_check = false
  material_coverage_check = false
[]
[Variables]
  [./temp]
    order = FIRST
    family = LAGRANGE
    block = '1 2'
  [../]
  [./disp_x]
    order = FIRST
    family = LAGRANGE
    block = '1 2'
  [../]
  [./disp_y]
    order = FIRST
    family = LAGRANGE
    block = '1 2'
  [../]
  [./lm]
    order = FIRST
    family = LAGRANGE
    block = 'secondary_lower'
  [../]
[]
[Materials]
  [./left]
    type = ADHeatConductionMaterial
    block = 1
    thermal_conductivity = 1000
    specific_heat = 1
  [../]
  [./right]
    type = ADHeatConductionMaterial
    block = 2
    thermal_conductivity = 500
    specific_heat = 1
  [../]
[]
[Kernels]
  [./hc_displaced_block]
    type = ADHeatConduction
    variable = temp
    use_displaced_mesh = true
    block = '1'
  [../]
  [./hc_undisplaced_block]
    type = ADHeatConduction
    variable = temp
    use_displaced_mesh = false
    block = '2'
  [../]
  [disp_x]
    type = Diffusion
    variable = disp_x
    block = '1 2'
  []
  [disp_y]
    type = Diffusion
    variable = disp_y
    block = '1 2'
  []
[]
[Constraints]
  [./ced]
    type = GapConductanceConstraint
    variable = lm
    secondary_variable = temp
    k = 100
    use_displaced_mesh = true
    primary_boundary = 100
    primary_subdomain = 10000
    secondary_boundary = 101
    secondary_subdomain = 10001
    displacements = 'disp_x disp_y'
  [../]
[]
[BCs]
  [./left]
    type = DirichletBC
    variable = temp
    boundary = 'left'
    value = 1
  [../]
  [./right]
    type = DirichletBC
    variable = temp
    boundary = 'right'
    value = 0
  [../]
  [left_disp_x]
    type = DirichletBC
    preset = false
    variable = disp_x
    boundary = 'left'
    value = .1
  []
  [right_disp_x]
    type = DirichletBC
    preset = false
    variable = disp_x
    boundary = 'right'
    value = 0
  []
  [bottom_disp_y]
    type = DirichletBC
    preset = false
    variable = disp_y
    boundary = 'bottom'
    value = 0
  []
[]
[Preconditioning]
  [./fmp]
    type = SMP
    full = true
    solve_type = 'NEWTON'
  [../]
[]
[Executioner]
  type = Steady
  nl_rel_tol = 1e-11
[]
[Outputs]
  exodus = true
  show = 'temp disp_x disp_y'
  [dof]
    type = DOFMap
    execute_on = 'initial'
  []
[]
(modules/contact/test/tests/mortar_tm/2d/frictionless_second/finite_noaction.i)
E_block = 1e7
E_plank = 1e7
elem = QUAD9
order = SECOND
name = 'finite_noaction'
[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)}
  [../]
  [./frictionless_normal_lm]
    order = ${order}
    block = 'frictionless_secondary_subdomain'
  [../]
[]
[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'
  [../]
[]
[Constraints]
  [./lm]
    type = NormalNodalLMMechanicalContact
    secondary = block_left
    primary = plank_right
    variable = frictionless_normal_lm
    primary_variable = disp_x
    disp_y = disp_y
    ncp_function_type = min
    use_displaced_mesh = true
  [../]
  [./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
  [../]
[]
[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 = FunctionDirichletBC
    variable = disp_x
    preset = false
    boundary = block_right
    function = '-0.04*sin(4*(t+1.5))+0.02'
  [../]
  [./right_y]
    type = FunctionDirichletBC
    variable = disp_y
    preset = false
    boundary = block_right
    function = '-t'
  [../]
[]
[Materials]
  [./plank]
    type = ComputeIsotropicElasticityTensor
    block = 'plank'
    poissons_ratio = 0.3
    youngs_modulus = ${E_plank}
  [../]
  [./block]
    type = ComputeIsotropicElasticityTensor
    block = 'block'
    poissons_ratio = 0.3
    youngs_modulus = ${E_block}
  [../]
  [./stress]
    type = ComputeFiniteStrainElasticStress
    block = 'plank block'
  [../]
[]
[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 = 13.5
  dt = 0.1
  dtmin = 0.1
  timestep_tolerance = 1e-6
  line_search = 'contact'
  snesmf_reuse_base = false
[]
[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/heat_conduction/test/tests/gap_heat_transfer_mortar/gap_heat_transfer_mortar.i)
[Mesh]
  [file]
    type = FileMeshGenerator
    file = 2blk-gap.e
  []
  [secondary]
    type = LowerDBlockFromSidesetGenerator
    sidesets = '101'
    new_block_id = '10001'
    new_block_name = 'secondary_lower'
    input = file
  []
  [primary]
    type = LowerDBlockFromSidesetGenerator
    sidesets = '100'
    new_block_id = '10000'
    new_block_name = 'primary_lower'
    input = secondary
  []
[]
[Problem]
  kernel_coverage_check = false
  material_coverage_check = false
[]
[Variables]
  [./temp]
    order = FIRST
    family = LAGRANGE
    block = '1 2'
  [../]
  [./lm]
    order = FIRST
    family = LAGRANGE
    block = 'secondary_lower'
  [../]
[]
[Materials]
  [./left]
    type = HeatConductionMaterial
    block = 1
    thermal_conductivity = 1000
    specific_heat = 1
  [../]
  [./right]
    type = HeatConductionMaterial
    block = 2
    thermal_conductivity = 500
    specific_heat = 1
  [../]
[]
[Kernels]
  [./hc]
    type = HeatConduction
    variable = temp
    use_displaced_mesh = false
    block = '1 2'
  [../]
[]
[Constraints]
  [./ced]
    type = GapConductanceConstraint
    variable = lm
    secondary_variable = temp
    k = 100
    primary_boundary = 100
    primary_subdomain = 10000
    secondary_boundary = 101
    secondary_subdomain = 10001
  [../]
[]
[BCs]
  [./left]
    type = DirichletBC
    variable = temp
    boundary = 'left'
    value = 1
  [../]
  [./right]
    type = DirichletBC
    variable = temp
    boundary = 'right'
    value = 0
  [../]
[]
[Preconditioning]
  [./fmp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Steady
  solve_type = 'PJFNK'
  nl_rel_tol = 1e-11
[]
[Outputs]
  exodus = 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
[]
(test/tests/mortar/displaced-gap-conductance-2d-bnd-coupling/gap-conductance-bnd-material.i)
[Mesh]
  displacements = 'disp_x disp_y'
  [file]
    type = FileMeshGenerator
    file = nodal_normals_test_offset_nonmatching_gap.e
    # block 1: left
    # block 2: right
  []
  [./primary]
    input = file
    type = LowerDBlockFromSidesetGenerator
    sidesets = '2'
    new_block_id = '20'
  [../]
  [./secondary]
    input = primary
    type = LowerDBlockFromSidesetGenerator
    sidesets = '1'
    new_block_id = '10'
  [../]
[]
[AuxVariables]
  [disp_x]
    block = '1 2'
  []
  [disp_y]
    block = '1 2'
  []
[]
[AuxKernels]
  [function_x]
    type = FunctionAux
    function = '.05 * t'
    variable = 'disp_x'
    block = '2'
  []
  [function_y]
    type = FunctionAux
    function = '.05 * t'
    variable = 'disp_y'
    block = '2'
  []
[]
[Problem]
  kernel_coverage_check = false
[]
[Variables]
  [./T]
    block = '1 2'
  [../]
  [./lambda]
    block = '10'
    family = LAGRANGE
    order = FIRST
  [../]
[]
[BCs]
  [./left]
    type = DirichletBC
    variable = T
    boundary = '5'
    value = 0
  [../]
  [./right]
    type = DirichletBC
    variable = T
    boundary = '8'
    value = 1
  [../]
[]
[Kernels]
  [./conduction]
    type = Diffusion
    variable = T
    block = '1 2'
  [../]
[]
[Debug]
  show_var_residual_norms = 1
[]
[Constraints]
  [./mortar]
    type = GapHeatConductanceMaterial
    primary_boundary = 2
    secondary_boundary = 1
    primary_subdomain = 20
    secondary_subdomain = 10
    variable = lambda
    secondary_variable = T
    use_displaced_mesh = true
    material_property = 'layer_modifier'
  [../]
[]
[Materials]
  [constant]
    type = ADGenericConstantMaterial
    prop_names = 'gap_conductance'
    prop_values = '.03'
    block = '1 2'
    use_displaced_mesh = true
  []
  [bnd_material_modifier]
    type = ADGenericConstantMaterial
    prop_names = 'layer_modifier'
    prop_values = '5.0'
    boundary = '1 2'
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  solve_type = NEWTON
  type = Transient
  num_steps = 5
  petsc_options_iname = '-pc_type -snes_linesearch_type'
  petsc_options_value = 'lu       basic'
[]
[Outputs]
  exodus = true
  [dofmap]
    type = DOFMap
    execute_on = 'initial'
  []
[]
(test/tests/mortar/displaced-gap-conductance-2d-non-conforming/gap-conductance.i)
[Mesh]
  displacements = 'disp_x disp_y'
  [file]
    type = FileMeshGenerator
    file = nodal_normals_test_offset_nonmatching_gap.e
    # block 1: left
    # block 2: right
  []
  [./primary]
    input = file
    type = LowerDBlockFromSidesetGenerator
    sidesets = '2'
    new_block_id = '20'
  [../]
  [./secondary]
    input = primary
    type = LowerDBlockFromSidesetGenerator
    sidesets = '1'
    new_block_id = '10'
  [../]
[]
[AuxVariables]
  [disp_x]
    block = '1 2'
  []
  [disp_y]
    block = '1 2'
  []
[]
[AuxKernels]
  [function_x]
    type = FunctionAux
    function = '.05 * t'
    variable = 'disp_x'
    block = '2'
  []
  [function_y]
    type = FunctionAux
    function = '.05 * t'
    variable = 'disp_y'
    block = '2'
  []
[]
[Problem]
  kernel_coverage_check = false
[]
[Variables]
  [./T]
    block = '1 2'
  [../]
  [./lambda]
    block = '10'
    family = MONOMIAL
    order = CONSTANT
  [../]
[]
[BCs]
  [./left]
    type = DirichletBC
    variable = T
    boundary = '5'
    value = 0
  [../]
  [./right]
    type = DirichletBC
    variable = T
    boundary = '8'
    value = 1
  [../]
[]
[Kernels]
  [./conduction]
    type = Diffusion
    variable = T
    block = '1 2'
  [../]
[]
[Debug]
  show_var_residual_norms = 1
[]
[Constraints]
  [./mortar]
    type = GapHeatConductanceTest
    primary_boundary = 2
    secondary_boundary = 1
    primary_subdomain = 20
    secondary_subdomain = 10
    variable = lambda
    secondary_variable = T
    use_displaced_mesh = true
  [../]
[]
[Materials]
  [constant]
    type = ADGenericConstantMaterial
    prop_names = 'gap_conductance'
    prop_values = '.03'
    block = '1 2'
    use_displaced_mesh = true
  []
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  solve_type = NEWTON
  type = Transient
  num_steps = 5
  petsc_options_iname = '-pc_type -snes_linesearch_type'
  petsc_options_value = 'lu       basic'
[]
[Outputs]
  exodus = true
  [dofmap]
    type = DOFMap
    execute_on = 'initial'
  []
[]
(test/tests/mortar/continuity-2d-conforming/conforming.i)
[Mesh]
  [file]
    type = FileMeshGenerator
    file = 2blk-conf.e
  []
  [secondary]
    input = file
    type = LowerDBlockFromSidesetGenerator
    sidesets = '101'
    new_block_id = '10001'
    new_block_name = 'secondary_lower'
  []
  [primary]
    input = secondary
    type = LowerDBlockFromSidesetGenerator
    sidesets = '100'
    new_block_id = '10000'
    new_block_name = 'primary_lower'
  []
[]
[Functions]
  [./exact_sln]
    type = ParsedFunction
    value = y
  [../]
  [./ffn]
    type = ParsedFunction
    value = 0
  [../]
[]
[Variables]
  [./u]
    order = FIRST
    family = LAGRANGE
    block = '1 2'
  [../]
  [./lm]
    order = FIRST
    family = LAGRANGE
    block = 'secondary_lower'
  [../]
[]
[Kernels]
  [./diff]
    type = Diffusion
    variable = u
  [../]
  [./ffn]
    type = BodyForce
    variable = u
    function = ffn
  [../]
[]
[Constraints]
  [./ced]
    type = EqualValueConstraint
    variable = lm
    secondary_variable = u
    primary_boundary = 100
    primary_subdomain = 10000
    secondary_boundary = 101
    secondary_subdomain = 10001
  [../]
[]
[BCs]
  [./all]
    type = FunctionDirichletBC
    variable = u
    boundary = '1 2 3 4'
    function = exact_sln
  [../]
[]
[Postprocessors]
  [./l2_error]
    type = ElementL2Error
    variable = u
    function = exact_sln
    block = '1 2'
    execute_on = 'initial timestep_end'
  [../]
[]
[Preconditioning]
  [./fmp]
    type = SMP
    full = true
    solve_type = 'NEWTON'
  [../]
[]
[Executioner]
  type = Steady
  nl_rel_tol = 1e-11
  l_tol = 1e-10
[]
[Outputs]
  exodus = true
[]
(modules/combined/test/tests/gap_heat_transfer_mortar/small-2d-rz/small.i)
E_block = 1e7
E_plank = 1e7
elem = QUAD4
order = FIRST
name = 'small'
[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
  []
[]
[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 = ADComputeLinearElasticStress
    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/contact/test/tests/mechanical-small-problem/frictionless-nodal-lm-mortar-disp.i)
[GlobalParams]
  displacements = 'disp_x disp_y'
[]
[Mesh]
  [./simple_mesh]
    type = FileMeshGenerator
    file = mesh.e
  [../]
  [./primary]
    type = LowerDBlockFromSidesetGenerator
    input = simple_mesh
    sidesets = '2'
    new_block_id = '3'
  [../]
  [./secondary]
    type = LowerDBlockFromSidesetGenerator
    input = primary
    sidesets = '1'
    new_block_id = '4'
  [../]
[]
[Constraints]
  [./lm]
    type = NormalNodalLMMechanicalContact
    secondary = 1
    primary = 2
    variable = frictionless_normal_lm
    primary_variable = disp_x
    disp_y = disp_y
  [../]
  [x]
    type = NormalMortarMechanicalContact
    primary_boundary = '2'
    secondary_boundary = '1'
    primary_subdomain = '3'
    secondary_subdomain = '4'
    variable = frictionless_normal_lm
    secondary_variable = disp_x
    component = x
    use_displaced_mesh = true
    compute_lm_residuals = false
  []
  [y]
    type = NormalMortarMechanicalContact
    primary_boundary = '2'
    secondary_boundary = '1'
    primary_subdomain = '3'
    secondary_subdomain = '4'
    variable = frictionless_normal_lm
    secondary_variable = disp_y
    component = y
    use_displaced_mesh = true
    compute_lm_residuals = false
  []
[]
[Variables]
  [./disp_x]
    block = '1 2'
  [../]
  [./disp_y]
    block = '1 2'
  [../]
  [./frictionless_normal_lm]
    block = 4
  [../]
[]
[BCs]
  [./left_x]
    type = DirichletBC
    variable = disp_x
    boundary = 'outside_left'
    value = 0.0
  [../]
  [./left_y]
    type = DirichletBC
    variable = disp_y
    boundary = 'outside_left'
    value = 0.0
  [../]
  [./right_x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'outside_right'
    function = '-5e-3 * t'
  [../]
  [./right_y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'outside_right'
    function = 0
  [../]
[]
[Kernels]
  [disp_x]
    type = Diffusion
    variable = disp_x
    block = '1 2'
  []
  [disp_y]
    type = Diffusion
    variable = disp_y
    block = '1 2'
  []
[]
[Debug]
  show_var_residual_norms = 1
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  solve_type = PJFNK
  type = Transient
  num_steps = 10
  dt = 1
  dtmin = 1
  petsc_options_iname = '-pc_type -snes_linesearch_type -pc_factor_shift_type -pc_factor_shift_amount'
  petsc_options_value = 'lu       basic                 NONZERO               1e-15'
[]
[Outputs]
  exodus = true
[]
[Postprocessors]
  [contact]
    type = ContactDOFSetSize
    variable = frictionless_normal_lm
    subdomain = '4'
    execute_on = 'nonlinear timestep_end'
  []
[]
(test/tests/meshgenerators/lower_d_block_generator/ids.i)
[Mesh]
  [./gmg]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 10
    ny = 10
  []
  [./lower_d_block]
    type = LowerDBlockFromSidesetGenerator
    input = gmg
    new_block_id = 10
    sidesets = '0 0 1 2 3'
  []
[]
[Variables]
  [./u]
    block = 0
  [../]
  [./v]
    block = 10
  [../]
[]
[Kernels]
  [./diff]
    type = Diffusion
    variable = u
    block = 0
  [../]
  [./srcv]
    type = BodyForce
    block = 10
    variable = v
    function = 1
  [../]
  [./time_v]
    type = TimeDerivative
    block = 10
    variable = v
  [../]
[]
[BCs]
  [./left]
    type = DirichletBC
    variable = u
    boundary = left
    value = 0
  [../]
  [./right]
    type = DirichletBC
    variable = u
    boundary = right
    value = 1
  [../]
[]
[Executioner]
  type = Transient
  num_steps = 2
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type -pc_hypre_type'
  petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
  exodus = true
[]
(test/tests/mesh_modifiers/lower_d_block/lower_d.i)
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 10
    ny = 10
  []
  [lower]
    type = LowerDBlockFromSidesetGenerator
    input = gen
    new_block_id = 10
    sidesets = '0 0 1 2 3'
  []
[]
[Variables]
  [u]
    block = 0
  []
  [v]
    block = 10
  []
[]
[Kernels]
  [diff]
    type = Diffusion
    variable = u
    block = 0
  []
  [srcv]
    type = BodyForce
    block = 10
    variable = v
    function = 1
  []
  [time_v]
    type = TimeDerivative
    block = 10
    variable = v
  []
[]
[BCs]
  [left]
    type = DirichletBC
    variable = u
    boundary = left
    value = 0
  []
  [right]
    type = DirichletBC
    variable = u
    boundary = right
    value = 1
  []
[]
[Executioner]
  type = Transient
  num_steps = 2
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type -pc_hypre_type'
  petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
  exodus = true
[]
(test/tests/mortar/gap-conductance-2d-non-conforming/gap-conductance.i)
[Mesh]
  [file]
    type = FileMeshGenerator
    file = nodal_normals_test_offset_nonmatching_gap.e
  []
  [./primary]
    input = file
    type = LowerDBlockFromSidesetGenerator
    sidesets = '2'
    new_block_id = '20'
  [../]
  [./secondary]
    input = primary
    type = LowerDBlockFromSidesetGenerator
    sidesets = '1'
    new_block_id = '10'
  [../]
[]
[Problem]
  kernel_coverage_check = false
[]
[Variables]
  [./T]
    block = '1 2'
  [../]
  [./lambda]
    block = '10'
  [../]
[]
[BCs]
  [./neumann]
    type = FunctionGradientNeumannBC
    exact_solution = exact_soln
    variable = T
    boundary = '3 4 5 6 7 8'
  [../]
[]
[Kernels]
  [./conduction]
    type = Diffusion
    variable = T
    block = '1 2'
  [../]
  [./sink]
    type = Reaction
    variable = T
    block = '1 2'
  [../]
  [./forcing_function]
    type = BodyForce
    variable = T
    function = forcing_function
    block = '1 2'
  [../]
[]
[Functions]
  [./forcing_function]
    type = ParsedFunction
    value = '-4 + x^2 + y^2'
  [../]
  [./exact_soln]
    type = ParsedFunction
    value = 'x^2 + y^2'
  [../]
[]
[Debug]
  show_var_residual_norms = 1
[]
[Constraints]
  [./mortar]
    type = GapHeatConductanceTest
    primary_boundary = 2
    secondary_boundary = 1
    primary_subdomain = 20
    secondary_subdomain = 10
    variable = lambda
    secondary_variable = T
  [../]
[]
[Materials]
  [constant]
    type = ADGenericConstantMaterial
    prop_names = 'gap_conductance'
    prop_values = '.03'
    block = '1 2'
  []
  [./ssm]
    type = SpatialStatefulMaterial
    block = '1 2'
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  solve_type = NEWTON
  type = Steady
  petsc_options_iname = '-pc_type -snes_linesearch_type'
  petsc_options_value = 'lu       basic'
[]
[Outputs]
  exodus = true
  [dofmap]
    type = DOFMap
    execute_on = 'initial'
  []
[]
(modules/contact/test/tests/sliding_block/in_and_out/frictionless_lm.i)
[Mesh]
  patch_size = 80
  [file]
    type = FileMeshGenerator
    file = sliding_elastic_blocks_2d.e
  []
  [secondary]
    input = file
    type = LowerDBlockFromSidesetGenerator
    sidesets = '3'
    new_block_id = '30'
  []
  [primary]
    input = secondary
    type = LowerDBlockFromSidesetGenerator
    sidesets = '2'
    new_block_id = '20'
  []
[]
[GlobalParams]
  displacements = 'disp_x disp_y'
  volumetric_locking_correction = false
[]
[Modules/TensorMechanics/Master]
  [./all]
    add_variables = true
    strain = FINITE
    block = '1 2'
  [../]
[]
[Variables]
  [normal_lm]
    block = '30'
  []
[]
[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
  [../]
  [./right_x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 4
    function = horizontal_movement
  [../]
  [./right_y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 4
    function = vertical_movement
  [../]
[]
[Materials]
  [./left]
    type = ComputeIsotropicElasticityTensor
    block = '1 2'
    youngs_modulus = 1e6
    poissons_ratio = 0.3
    constant_on = SUBDOMAIN
  [../]
  [./stress]
    type = ComputeFiniteStrainElasticStress
    block = '1 2'
  [../]
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  petsc_options = '-snes_converged_reason -ksp_converged_reason -snes_ksp_ew'
  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 = 15
  dt = 0.1
  dtmin = 0.01
  l_max_its = 30
  nl_max_its = 20
  line_search = 'none'
  timestep_tolerance = 1e-6
  snesmf_reuse_base = false
[]
[Debug]
  show_var_residual_norms = true
[]
[Outputs]
  sync_times = '1 2 3 4 5 6 7 8 9 10 11 12 13 14 15'
  [out]
    type = Exodus
    sync_only = true
  []
  [dof]
    execute_on = 'initial'
    type = DOFMap
  []
  [csv]
    type = CSV
    execute_on = 'nonlinear timestep_end'
  []
[]
[Functions]
  [./vertical_movement]
    type = ParsedFunction
    value = -t
  [../]
  [./horizontal_movement]
    type = ParsedFunction
    value = -0.04*sin(4*t)+0.02
  [../]
[]
[Constraints]
  [./lm]
    type = NormalNodalLMMechanicalContact
    secondary = 3
    primary = 2
    variable = normal_lm
    primary_variable = disp_x
    disp_y = disp_y
    ncp_function_type = min
    use_displaced_mesh = true
  [../]
  [normal_x]
    type = NormalMortarMechanicalContact
    primary_boundary = '2'
    secondary_boundary = '3'
    primary_subdomain = '20'
    secondary_subdomain = '30'
    variable = normal_lm
    secondary_variable = disp_x
    component = x
    use_displaced_mesh = true
    compute_lm_residuals = false
  []
  [normal_y]
    type = NormalMortarMechanicalContact
    primary_boundary = '2'
    secondary_boundary = '3'
    primary_subdomain = '20'
    secondary_subdomain = '30'
    variable = normal_lm
    secondary_variable = disp_y
    component = y
    use_displaced_mesh = true
    compute_lm_residuals = false
  []
[]
[Postprocessors]
  [./num_nl]
    type = NumNonlinearIterations
  [../]
  [lin]
    type = NumLinearIterations
  []
  [contact]
    type = ContactDOFSetSize
    variable = normal_lm
    subdomain = '30'
    execute_on = 'nonlinear timestep_end'
  []
[]
(modules/combined/examples/mortar/eigenstrain.i)
#
# Eigenstrain with Mortar gradient periodicity
#
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 50
    ny = 50
    xmin = -0.5
    xmax = 0.5
    ymin = -0.5
    ymax = 0.5
  []
  [./cnode]
    input = gen
    type = ExtraNodesetGenerator
    coord = '0.0 0.0'
    new_boundary = 100
  [../]
  [./anode]
    input = cnode
    type = ExtraNodesetGenerator
    coord = '0.0 0.5'
    new_boundary = 101
  [../]
  [secondary_x]
    input = anode
    type = LowerDBlockFromSidesetGenerator
    sidesets = '3'
    new_block_id = 10
    new_block_name = "secondary_x"
  []
  [primary_x]
    input = secondary_x
    type = LowerDBlockFromSidesetGenerator
    sidesets = '1'
    new_block_id = 12
    new_block_name = "primary_x"
  []
  [secondary_y]
    input = primary_x
    type = LowerDBlockFromSidesetGenerator
    sidesets = '0'
    new_block_id = 11
    new_block_name = "secondary_y"
  []
  [primary_y]
    input = secondary_y
    type = LowerDBlockFromSidesetGenerator
    sidesets = '2'
    new_block_id = 13
    new_block_name = "primary_y"
  []
[]
[GlobalParams]
  derivative_order = 2
  enable_jit = true
  displacements = 'disp_x disp_y'
[]
# AuxVars to compute the free energy density for outputting
[AuxVariables]
  [./local_energy]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./local_free_energy]
    type = TotalFreeEnergy
    block = 0
    execute_on = 'initial LINEAR'
    variable = local_energy
    interfacial_vars = 'c'
    kappa_names = 'kappa_c'
  [../]
[]
[Variables]
  # Solute concentration variable
  [./c]
    [./InitialCondition]
      type = RandomIC
      min = 0.49
      max = 0.51
    [../]
    block = 0
  [../]
  [./w]
    block = 0
  [../]
  # Mesh displacement
  [./disp_x]
    block = 0
  [../]
  [./disp_y]
    block = 0
  [../]
  # Lagrange multipliers for gradient component periodicity
  [./lm_left_right_xx]
    order = FIRST
    family = LAGRANGE
    block = secondary_x
  [../]
  [./lm_left_right_xy]
    order = FIRST
    family = LAGRANGE
    block = secondary_x
  [../]
  [./lm_left_right_yx]
    order = FIRST
    family = LAGRANGE
    block = secondary_x
  [../]
  [./lm_left_right_yy]
    order = FIRST
    family = LAGRANGE
    block = secondary_x
  [../]
  [./lm_up_down_xx]
    order = FIRST
    family = LAGRANGE
    block = secondary_y
  [../]
  [./lm_up_down_xy]
    order = FIRST
    family = LAGRANGE
    block = secondary_y
  [../]
  [./lm_up_down_yx]
    order = FIRST
    family = LAGRANGE
    block = secondary_y
  [../]
  [./lm_up_down_yy]
    order = FIRST
    family = LAGRANGE
    block = secondary_y
  [../]
[]
[Constraints]
  [./ud_disp_x_grad_x]
    type = EqualGradientConstraint
    variable = lm_up_down_xx
    component = 0
    secondary_variable = disp_x
    secondary_boundary = bottom
    primary_boundary = top
    secondary_subdomain = secondary_y
    primary_subdomain = primary_y
    periodic = true
  [../]
  [./ud_disp_x_grad_y]
    type = EqualGradientConstraint
    variable = lm_up_down_xy
    component = 1
    secondary_variable = disp_x
    secondary_boundary = bottom
    primary_boundary = top
    secondary_subdomain = secondary_y
    primary_subdomain = primary_y
    periodic = true
  [../]
  [./ud_disp_y_grad_x]
    type = EqualGradientConstraint
    variable = lm_up_down_yx
    component = 0
    secondary_variable = disp_y
    secondary_boundary = bottom
    primary_boundary = top
    secondary_subdomain = secondary_y
    primary_subdomain = primary_y
    periodic = true
  [../]
  [./ud_disp_y_grad_y]
    type = EqualGradientConstraint
    variable = lm_up_down_yy
    component = 1
    secondary_variable = disp_y
    secondary_boundary = bottom
    primary_boundary = top
    secondary_subdomain = secondary_y
    primary_subdomain = primary_y
    periodic = true
  [../]
  [./lr_disp_x_grad_x]
    type = EqualGradientConstraint
    variable = lm_left_right_xx
    component = 0
    secondary_variable = disp_x
    secondary_boundary = left
    primary_boundary = right
    secondary_subdomain = secondary_x
    primary_subdomain = primary_x
    periodic = true
  [../]
  [./lr_disp_x_grad_y]
    type = EqualGradientConstraint
    variable = lm_left_right_xy
    component = 1
    secondary_variable = disp_x
    secondary_boundary = left
    primary_boundary = right
    secondary_subdomain = secondary_x
    primary_subdomain = primary_x
    periodic = true
  [../]
  [./lr_disp_y_grad_x]
    type = EqualGradientConstraint
    variable = lm_left_right_yx
    component = 0
    secondary_variable = disp_y
    secondary_boundary = left
    primary_boundary = right
    secondary_subdomain = secondary_x
    primary_subdomain = primary_x
    periodic = true
  [../]
  [./lr_disp_y_grad_y]
    type = EqualGradientConstraint
    variable = lm_left_right_yy
    component = 1
    secondary_variable = disp_y
    secondary_boundary = left
    primary_boundary = right
    secondary_subdomain = secondary_x
    primary_subdomain = primary_x
    periodic = true
  [../]
[]
[Kernels]
  # Set up stress divergence kernels
  [./TensorMechanics]
    block = 0
  [../]
  # Cahn-Hilliard kernels
  [./c_dot]
    type = CoupledTimeDerivative
    variable = w
    v = c
    block = 0
  [../]
  [./c_res]
    type = SplitCHParsed
    variable = c
    f_name = F
    kappa_name = kappa_c
    w = w
    block = 0
  [../]
  [./w_res]
    type = SplitCHWRes
    variable = w
    mob_name = M
    block = 0
  [../]
[]
[Materials]
  # declare a few constants, such as mobilities (L,M) and interface gradient prefactors (kappa*)
  [./consts]
    type = GenericConstantMaterial
    block = '0 10 11'
    prop_names  = 'M   kappa_c'
    prop_values = '0.2 0.01   '
  [../]
  [./shear1]
    type = GenericConstantRankTwoTensor
    block = 0
    tensor_values = '0 0 0 0 0 0.5'
    tensor_name = shear1
  [../]
  [./shear2]
    type = GenericConstantRankTwoTensor
    block = 0
    tensor_values = '0 0 0 0 0 -0.5'
    tensor_name = shear2
  [../]
  [./expand3]
    type = GenericConstantRankTwoTensor
    block = 0
    tensor_values = '1 1 0 0 0 0'
    tensor_name = expand3
  [../]
  [./weight1]
    type = DerivativeParsedMaterial
    block = 0
    function = '0.3*c^2'
    f_name = weight1
    args = c
  [../]
  [./weight2]
    type = DerivativeParsedMaterial
    block = 0
    function = '0.3*(1-c)^2'
    f_name = weight2
    args = c
  [../]
  [./weight3]
    type = DerivativeParsedMaterial
    block = 0
    function = '4*(0.5-c)^2'
    f_name = weight3
    args = c
  [../]
  # matrix phase
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    C_ijkl = '1 1'
    fill_method = symmetric_isotropic
  [../]
  [./strain]
    type = ComputeSmallStrain
    block = 0
    displacements = 'disp_x disp_y'
    eigenstrain_names = eigenstrain
  [../]
  [./eigenstrain]
    type = CompositeEigenstrain
    block = 0
    tensors = 'shear1  shear2  expand3'
    weights = 'weight1 weight2 weight3'
    args = c
    eigenstrain_name = eigenstrain
  [../]
  [./stress]
    type = ComputeLinearElasticStress
    block = 0
  [../]
  # chemical free energies
  [./chemical_free_energy]
    type = DerivativeParsedMaterial
    block = 0
    f_name = Fc
    function = '4*c^2*(1-c)^2'
    args = 'c'
    outputs = exodus
    output_properties = Fc
  [../]
  # elastic free energies
  [./elastic_free_energy]
    type = ElasticEnergyMaterial
    f_name = Fe
    block = 0
    args = 'c'
    outputs = exodus
    output_properties = Fe
  [../]
  # free energy (chemical + elastic)
  [./free_energy]
    type = DerivativeSumMaterial
    block = 0
    f_name = F
    sum_materials = 'Fc Fe'
    args = 'c'
  [../]
[]
[BCs]
  [./Periodic]
    [./up_down]
      primary = top
      secondary = bottom
      translation = '0 -1 0'
      variable = 'c w'
    [../]
    [./left_right]
      primary = left
      secondary = right
      translation = '1 0 0'
      variable = 'c w'
    [../]
  [../]
  # fix center point location
  [./centerfix_x]
    type = DirichletBC
    boundary = 100
    variable = disp_x
    value = 0
  [../]
  [./centerfix_y]
    type = DirichletBC
    boundary = 100
    variable = disp_y
    value = 0
  [../]
  # fix side point x coordinate to inhibit rotation
  [./angularfix]
    type = DirichletBC
    boundary = 101
    variable = disp_x
    value = 0
  [../]
[]
[Preconditioning]
  [./SMP]
    type = SMP
    full = true
  [../]
[]
# We monitor the total free energy and the total solute concentration (should be constant)
[Postprocessors]
  [./total_free_energy]
    type = ElementIntegralVariablePostprocessor
    block = 0
    execute_on = 'initial TIMESTEP_END'
    variable = local_energy
  [../]
  [./total_solute]
    type = ElementIntegralVariablePostprocessor
    block = 0
    execute_on = 'initial TIMESTEP_END'
    variable = c
  [../]
  [./min]
    type = ElementExtremeValue
    block = 0
    execute_on = 'initial TIMESTEP_END'
    value_type = min
    variable = c
  [../]
  [./max]
    type = ElementExtremeValue
    block = 0
    execute_on = 'initial TIMESTEP_END'
    value_type = max
    variable = c
  [../]
[]
[Executioner]
  type = Transient
  scheme = bdf2
  solve_type = 'PJFNK'
  line_search = basic
  # mortar currently does not support MPI parallelization
  petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount'
  petsc_options_value = ' lu       NONZERO               1e-10'
  l_max_its = 30
  nl_max_its = 12
  l_tol = 1.0e-4
  nl_rel_tol = 1.0e-8
  nl_abs_tol = 1.0e-10
  start_time = 0.0
  num_steps = 200
  [./TimeStepper]
    type = SolutionTimeAdaptiveDT
    dt = 0.01
  [../]
[]
[Outputs]
  execute_on = 'timestep_end'
  print_linear_residuals = false
  exodus = true
  [./table]
    type = CSV
    delimiter = ' '
  [../]
[]
(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
[]
(test/tests/mortar/periodic-value/periodic.i)
[Mesh]
  [file]
    type = FileMeshGenerator
    file = square.msh
  []
  [secondary]
    input = file
    type = LowerDBlockFromSidesetGenerator
    new_block_id = 11
    new_block_name = "secondary"
    sidesets = '101'
  []
  [primary]
    input = secondary
    type = LowerDBlockFromSidesetGenerator
    new_block_id = 12
    new_block_name = "primary"
    sidesets = '103'
  []
[]
[Variables]
  [u]
    order = SECOND
    block = 'domain'
  []
  [lm]
    block = 'secondary'
  []
[]
[Kernels]
  [diffusion]
    type = Diffusion
    variable = u
    block = 'domain'
  []
  [force]
    type = BodyForce
    variable = u
    block = 'domain'
  []
[]
[BCs]
  [left]
    type = DirichletBC
    variable = u
    value = 1
    boundary = 'left'
  []
[]
[Constraints]
  [ev]
    type = EqualValueConstraint
    variable = lm
    secondary_variable = u
    primary_boundary = 103
    secondary_boundary = 101
    primary_subdomain = 12
    secondary_subdomain = 11
    periodic = true
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Steady
  solve_type = NEWTON
[]
[Outputs]
  exodus = true
[]
(test/tests/mortar/displaced-gap-conductance-2d-bnd-coupling/gap-conductance.i)
[Mesh]
  displacements = 'disp_x disp_y'
  [file]
    type = FileMeshGenerator
    file = nodal_normals_test_offset_nonmatching_gap.e
    # block 1: left
    # block 2: right
  []
  [./primary]
    input = file
    type = LowerDBlockFromSidesetGenerator
    sidesets = '2'
    new_block_id = '20'
  [../]
  [./secondary]
    input = primary
    type = LowerDBlockFromSidesetGenerator
    sidesets = '1'
    new_block_id = '10'
  [../]
[]
[AuxVariables]
  [disp_x]
    block = '1 2'
  []
  [disp_y]
    block = '1 2'
  []
  [aux_var]
  []
[]
[AuxKernels]
  [function_x]
    type = FunctionAux
    function = '.05 * t'
    variable = 'disp_x'
    block = '2'
  []
  [function_y]
    type = FunctionAux
    function = '.05 * t'
    variable = 'disp_y'
    block = '2'
  []
  [flux_modifier]
    type = StatefulAuxLowerD
    variable = 'aux_var'
    coupled_variable = 'lambda'
    boundary = '1'
  []
[]
[Problem]
  kernel_coverage_check = false
[]
[Variables]
  [./T]
    block = '1 2'
  [../]
  [./lambda]
    block = '10'
    family = LAGRANGE
    order = FIRST
  [../]
[]
[BCs]
  [./left]
    type = DirichletBC
    variable = T
    boundary = '5'
    value = 0
  [../]
  [./right]
    type = DirichletBC
    variable = T
    boundary = '8'
    value = 1
  [../]
[]
[Kernels]
  [./conduction]
    type = Diffusion
    variable = T
    block = '1 2'
  [../]
[]
[Debug]
  show_var_residual_norms = 1
[]
[Constraints]
  [./mortar]
    type = GapHeatConductanceAuxKernel
    primary_boundary = 2
    secondary_boundary = 1
    primary_subdomain = 20
    secondary_subdomain = 10
    variable = lambda
    secondary_variable = T
    use_displaced_mesh = true
    auxkernel_variable = 'aux_var'
  [../]
[]
[Materials]
  [constant]
    type = ADGenericConstantMaterial
    prop_names = 'gap_conductance'
    prop_values = '.03'
    block = '1 2'
    use_displaced_mesh = true
  []
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  solve_type = NEWTON
  type = Transient
  num_steps = 5
  petsc_options_iname = '-pc_type -snes_linesearch_type'
  petsc_options_value = 'lu       basic'
[]
[Outputs]
  exodus = true
  [dofmap]
    type = DOFMap
    execute_on = 'initial'
  []
[]
(test/tests/mortar/convergence-studies/solution-continuity/continuity.i)
[Mesh]
  second_order = true
  [./left_block]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = 1
    ymin = 0
    ymax = 1
    nx = 2
    ny = 2
    elem_type = QUAD4
  [../]
  [./left_block_sidesets]
    type = RenameBoundaryGenerator
    input = left_block
    old_boundary_id = '0 1 2 3'
    new_boundary_name = 'lb_bottom lb_right lb_top lb_left'
  [../]
  [./left_block_id]
    type = SubdomainIDGenerator
    input = left_block_sidesets
    subdomain_id = 1
  [../]
  [./right_block]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 1
    xmax = 2
    ymin = 0
    ymax = 1
    nx = 2
    ny = 2
    elem_type = QUAD4
  [../]
  [./right_block_id]
    type = SubdomainIDGenerator
    input = right_block
    subdomain_id = 2
  [../]
  [right_block_change_boundary_id]
    type = RenameBoundaryGenerator
    input = right_block_id
    old_boundary_id = '0 1 2 3'
    new_boundary_id = '100 101 102 103'
  []
  [./combined]
    type = MeshCollectionGenerator
    inputs = 'left_block_id right_block_change_boundary_id'
  [../]
  [./block_rename]
    type = RenameBlockGenerator
    input = combined
    old_block_id = '1 2'
    new_block_name = 'left_block right_block'
  [../]
  [right_right_sideset]
    type = SideSetsAroundSubdomainGenerator
    input = block_rename
    new_boundary = rb_right
    block = right_block
    normal = '1 0 0'
  []
  [right_left_sideset]
    type = SideSetsAroundSubdomainGenerator
    input = right_right_sideset
    new_boundary = rb_left
    block = right_block
    normal = '-1 0 0'
  []
  [right_top_sideset]
    type = SideSetsAroundSubdomainGenerator
    input = right_left_sideset
    new_boundary = rb_top
    block = right_block
    normal = '0 1 0'
  []
  [right_bottom_sideset]
    type = SideSetsAroundSubdomainGenerator
    input = right_top_sideset
    new_boundary = rb_bottom
    block = right_block
    normal = '0 -1 0'
  []
  [secondary]
    input = right_bottom_sideset
    type = LowerDBlockFromSidesetGenerator
    sidesets = 'lb_right'
    new_block_id = '10001'
    new_block_name = 'secondary_lower'
  []
  [primary]
    input = secondary
    type = LowerDBlockFromSidesetGenerator
    sidesets = 'rb_left'
    new_block_id = '10000'
    new_block_name = 'primary_lower'
  []
[]
[Variables]
  [./T]
    block = 'left_block right_block'
    order = SECOND
  [../]
  [./lambda]
    block = 'secondary_lower'
  [../]
[]
[BCs]
  [./neumann]
    type = FunctionGradientNeumannBC
    exact_solution = exact_soln_primal
    variable = T
    boundary = 'lb_bottom lb_top lb_left rb_bottom rb_right rb_top'
  [../]
[]
[Kernels]
  [./conduction]
    type = Diffusion
    variable = T
    block = 'left_block right_block'
  [../]
  [./sink]
    type = Reaction
    variable = T
    block = 'left_block right_block'
  [../]
  [./forcing_function]
    type = BodyForce
    variable = T
    function = forcing_function
    block = 'left_block right_block'
  [../]
[]
[Functions]
  [./forcing_function]
    type = ParsedFunction
    value = ''
  [../]
  [./exact_soln_primal]
    type = ParsedFunction
    value = ''
  [../]
  [exact_soln_lambda]
    type = ParsedFunction
    value = ''
  []
[]
[Debug]
  show_var_residual_norms = 1
[]
[Constraints]
  [./mortar]
    type = EqualValueConstraint
    primary_boundary = rb_left
    secondary_boundary = lb_right
    primary_subdomain = primary_lower
    secondary_subdomain = secondary_lower
    secondary_variable = T
    variable = lambda
    delta = 0.4
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  solve_type = NEWTON
  type = Steady
  petsc_options = '-snes_converged_reason -ksp_converged_reason'
  petsc_options_iname = '-pc_type -snes_linesearch_type -pc_factor_mat_solver_type'
  petsc_options_value = 'lu       basic                 mumps'
[]
[Outputs]
  exodus = true
  csv = true
  [dofmap]
    type = DOFMap
    execute_on = 'initial'
  []
[]
[Postprocessors]
  [L2lambda]
    type = ElementL2Error
    variable = lambda
    function = exact_soln_lambda
    execute_on = 'timestep_end'
    block = 'secondary_lower'
  []
  [L2u]
    type = ElementL2Error
    variable = T
    function = exact_soln_primal
    execute_on = 'timestep_end'
    block = 'left_block right_block'
  []
  [h]
    type = AverageElementSize
    block = 'left_block right_block'
  []
[]
(test/tests/mortar/displaced-gap-conductance-2d-bnd-coupling/gap-conductance-bnd-aux-kernel.i)
[Mesh]
  displacements = 'disp_x disp_y'
  [file]
    type = FileMeshGenerator
    file = nodal_normals_test_offset_nonmatching_gap.e
    # block 1: left
    # block 2: right
  []
  [./primary]
    input = file
    type = LowerDBlockFromSidesetGenerator
    sidesets = '2'
    new_block_id = '20'
  [../]
  [./secondary]
    input = primary
    type = LowerDBlockFromSidesetGenerator
    sidesets = '1'
    new_block_id = '10'
  [../]
[]
[AuxVariables]
  [disp_x]
    block = '1 2'
  []
  [disp_y]
    block = '1 2'
  []
  [aux_var]
  []
[]
[AuxKernels]
  [function_x]
    type = FunctionAux
    function = '.05 * t'
    variable = 'disp_x'
    block = '2'
  []
  [function_y]
    type = FunctionAux
    function = '.05 * t'
    variable = 'disp_y'
    block = '2'
  []
  [flux_modifier]
    type = StatefulAuxLowerD
    variable = 'aux_var'
    coupled_variable = 'lambda'
    boundary = '1'
  []
[]
[Problem]
  kernel_coverage_check = false
[]
[Variables]
  [./T]
    block = '1 2'
  [../]
  [./lambda]
    block = '10'
    family = LAGRANGE
    order = FIRST
  [../]
[]
[BCs]
  [./left]
    type = DirichletBC
    variable = T
    boundary = '5'
    value = 0
  [../]
  [./right]
    type = DirichletBC
    variable = T
    boundary = '8'
    value = 1
  [../]
[]
[Kernels]
  [./conduction]
    type = Diffusion
    variable = T
    block = '1 2'
  [../]
[]
[Debug]
  show_var_residual_norms = 1
[]
[Constraints]
  [./mortar]
    type = GapHeatConductanceAuxKernel
    primary_boundary = 2
    secondary_boundary = 1
    primary_subdomain = 20
    secondary_subdomain = 10
    variable = lambda
    secondary_variable = T
    use_displaced_mesh = true
    auxkernel_variable = 'aux_var'
  [../]
[]
[Materials]
  [constant]
    type = ADGenericConstantMaterial
    prop_names = 'gap_conductance'
    prop_values = '.03'
    block = '1 2'
    use_displaced_mesh = true
  []
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  solve_type = NEWTON
  type = Transient
  num_steps = 5
  petsc_options_iname = '-pc_type -snes_linesearch_type'
  petsc_options_value = 'lu       basic'
[]
[Outputs]
  exodus = true
  [dofmap]
    type = DOFMap
    execute_on = 'initial'
  []
[]
(modules/contact/test/tests/mechanical-small-problem/mortar-mech.i)
[Mesh]
  displacements = 'disp_x disp_y'
  [file]
    type = FileMeshGenerator
    file = mesh.e
  []
  [./primary]
    type = LowerDBlockFromSidesetGenerator
    sidesets = '2'
    new_block_id = '20'
    input = file
  [../]
  [./secondary]
    type = LowerDBlockFromSidesetGenerator
    sidesets = '1'
    new_block_id = '10'
    input = primary
  [../]
[]
[Problem]
  kernel_coverage_check = false
[]
[Variables]
  [./disp_x]
    block = '1 2'
  [../]
  [./disp_y]
    block = '1 2'
  [../]
  [./lambda]
    block = '10'
    family = MONOMIAL
    order = CONSTANT
  [../]
[]
[BCs]
  [./left_x]
    type = DirichletBC
    variable = disp_x
    boundary = 'outside_left'
    value = 0.0
  [../]
  [./left_y]
    type = DirichletBC
    variable = disp_y
    boundary = 'outside_left'
    value = 0.0
  [../]
  [./right_x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'outside_right'
    function = '-5e-3 * t'
  [../]
  [./right_y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'outside_right'
    function = 0
  [../]
[]
[Kernels]
  [disp_x]
    type = Diffusion
    variable = disp_x
    block = '1 2'
  []
  [disp_y]
    type = Diffusion
    variable = disp_y
    block = '1 2'
  []
[]
[Debug]
  show_var_residual_norms = 1
[]
[Constraints]
  [lm]
    type = NormalMortarLMMechanicalContact
    primary_boundary = '2'
    secondary_boundary = '1'
    primary_subdomain = '20'
    secondary_subdomain = '10'
    variable = lambda
    secondary_variable = disp_x
    secondary_disp_y = disp_y
    use_displaced_mesh = true
    compute_primal_residuals = false
  []
  [x]
    type = NormalMortarMechanicalContact
    primary_boundary = '2'
    secondary_boundary = '1'
    primary_subdomain = '20'
    secondary_subdomain = '10'
    variable = lambda
    secondary_variable = disp_x
    component = x
    use_displaced_mesh = true
    compute_lm_residuals = false
  []
  [y]
    type = NormalMortarMechanicalContact
    primary_boundary = '2'
    secondary_boundary = '1'
    primary_subdomain = '20'
    secondary_subdomain = '10'
    variable = lambda
    secondary_variable = disp_y
    component = y
    use_displaced_mesh = true
    compute_lm_residuals = false
  []
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  solve_type = PJFNK
  type = Transient
  num_steps = 10
  dt = 1
  dtmin = 1
  petsc_options_iname = '-pc_type -snes_linesearch_type -pc_factor_shift_type -pc_factor_shift_amount'
  petsc_options_value = 'lu       basic                 NONZERO               1e-15'
[]
[Outputs]
  exodus = true
  [dofmap]
    type = DOFMap
    execute_on = 'initial'
  []
[]
(modules/contact/test/tests/sliding_block/in_and_out/frictional_lm.i)
[Mesh]
  patch_size = 80
  [file]
    type = FileMeshGenerator
    file = sliding_elastic_blocks_2d.e
  []
  [secondary]
    input = file
    type = LowerDBlockFromSidesetGenerator
    sidesets = '3'
    new_block_id = '30'
  []
  [primary]
    input = secondary
    type = LowerDBlockFromSidesetGenerator
    sidesets = '2'
    new_block_id = '20'
  []
[]
[GlobalParams]
  volumetric_locking_correction = false
  displacements = 'disp_x disp_y'
[]
[Variables]
  [normal_lm]
    block = '30'
  []
  [tangential_lm]
    block = '30'
    family = MONOMIAL
    order = CONSTANT
  []
[]
[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
  [../]
  [./right_x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 4
    function = horizontal_movement
  [../]
  [./right_y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 4
    function = vertical_movement
  [../]
[]
[Modules/TensorMechanics/Master]
  [./all]
    add_variables = true
    strain = FINITE
    block = '1 2'
  [../]
[]
[Materials]
  [./tensor]
    type = ComputeIsotropicElasticityTensor
    block = '1 2'
    youngs_modulus = 1e6
    poissons_ratio = 0.3
    constant_on = SUBDOMAIN
  [../]
  [./stress]
    type = ComputeFiniteStrainElasticStress
    block = '1 2'
  [../]
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  petsc_options = '-snes_converged_reason -ksp_converged_reason -snes_ksp_ew'
  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 = 15
  dt = 0.1
  dtmin = 0.01
  l_max_its = 30
  nl_max_its = 20
  line_search = 'none'
  timestep_tolerance = 1e-6
  snesmf_reuse_base = false
  [./Predictor]
    type = SimplePredictor
    scale = 1.0
  [../]
[]
[Debug]
  show_var_residual_norms = true
[]
[Outputs]
  sync_times = '1 2 3 4 5 6 7 8 9 10 11 12 13 14 15'
  [out]
    type = Exodus
    sync_only = true
  []
  [dof]
    execute_on = 'initial'
    type = DOFMap
  []
  [csv]
    type = CSV
    execute_on = 'nonlinear timestep_end'
  []
[]
[Functions]
  [./vertical_movement]
    type = ParsedFunction
    value = -t
  [../]
  [./horizontal_movement]
    type = ParsedFunction
    value = -0.04*sin(4*t)+0.02
  [../]
[]
[Constraints]
  [./lm]
    type = NormalNodalLMMechanicalContact
    secondary = 3
    primary = 2
    variable = normal_lm
    primary_variable = disp_x
    disp_y = disp_y
    ncp_function_type = min
    use_displaced_mesh = true
    c = 1e6 # relative scale difference between pressure and gap
  [../]
  [normal_x]
    type = NormalMortarMechanicalContact
    primary_boundary = '2'
    secondary_boundary = '3'
    primary_subdomain = '20'
    secondary_subdomain = '30'
    variable = normal_lm
    secondary_variable = disp_x
    component = x
    use_displaced_mesh = true
    compute_lm_residuals = false
  []
  [normal_y]
    type = NormalMortarMechanicalContact
    primary_boundary = '2'
    secondary_boundary = '3'
    primary_subdomain = '20'
    secondary_subdomain = '30'
    variable = normal_lm
    secondary_variable = disp_y
    component = y
    use_displaced_mesh = true
    compute_lm_residuals = false
  []
  [tangential_lm]
    type = TangentialMortarLMMechanicalContact
    primary_boundary = '2'
    secondary_boundary = '3'
    primary_subdomain = '20'
    secondary_subdomain = '30'
    variable = tangential_lm
    secondary_variable = disp_x
    secondary_disp_y = disp_y
    use_displaced_mesh = true
    compute_primal_residuals = false
    contact_pressure = normal_lm
    friction_coefficient = .4
    ncp_function_type = fb
    c = 1000 # relative scale difference between pressure and velocity
  []
  [tangential_x]
    type = TangentialMortarMechanicalContact
    primary_boundary = '2'
    secondary_boundary = '3'
    primary_subdomain = '20'
    secondary_subdomain = '30'
    variable = tangential_lm
    secondary_variable = disp_x
    component = x
    use_displaced_mesh = true
    compute_lm_residuals = false
  []
  [tangential_y]
    type = TangentialMortarMechanicalContact
    primary_boundary = '2'
    secondary_boundary = '3'
    primary_subdomain = '20'
    secondary_subdomain = '30'
    variable = tangential_lm
    secondary_variable = disp_y
    component = y
    use_displaced_mesh = true
    compute_lm_residuals = false
  []
[]
[Postprocessors]
  [./num_nl]
    type = NumNonlinearIterations
  [../]
  [./cumulative]
    type = CumulativeValuePostprocessor
    postprocessor = num_nl
  [../]
  [lin]
    type = NumLinearIterations
  []
  [cum_lin]
    type = CumulativeValuePostprocessor
    postprocessor = lin
  []
  [contact]
    type = ContactDOFSetSize
    variable = normal_lm
    subdomain = '30'
    execute_on = 'nonlinear timestep_end'
  []
[]
(test/tests/mortar/cant-do-3d/periodic.i)
[Mesh]
  [file]
    type = FileMeshGenerator
    file = flow_test.e
  []
  [secondary]
    input = file
    type = LowerDBlockFromSidesetGenerator
    new_block_id = 11
    new_block_name = "secondary"
    sidesets = '1'
  []
  [primary]
    input = secondary
    type = LowerDBlockFromSidesetGenerator
    new_block_id = 12
    new_block_name = "primary"
    sidesets = '2'
  []
[]
[Variables]
  [u]
    block = 'bottom middle top'
  []
  [lm]
    block = 'secondary'
  []
[]
[Kernels]
  [diffusion]
    type = Diffusion
    variable = u
    block = 'bottom middle top'
  []
  [force]
    type = BodyForce
    variable = u
    block = 'bottom middle top'
  []
[]
[BCs]
  [left]
    type = DirichletBC
    variable = u
    value = 1
    boundary = 'around'
  []
[]
[Constraints]
  [ev]
    type = EqualValueConstraint
    variable = lm
    secondary_variable = u
    primary_boundary = top
    secondary_boundary = bottom
    primary_subdomain = 12
    secondary_subdomain = 11
    periodic = true
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Steady
  solve_type = NEWTON
[]
[Outputs]
  exodus = true
[]
(test/tests/mortar/continuity-2d-non-conforming/soln-continuity.i)
[Mesh]
  second_order = true
  [file]
    type = FileMeshGenerator
    file = nodal_normals_test_offset_nonmatching_gap.e
  []
  [./primary]
    input = file
    type = LowerDBlockFromSidesetGenerator
    sidesets = '2'
    new_block_id = '20'
  [../]
  [./secondary]
    input = primary
    type = LowerDBlockFromSidesetGenerator
    sidesets = '1'
    new_block_id = '10'
  [../]
[]
[Problem]
  kernel_coverage_check = false
[]
[Variables]
  [./T]
    block = '1 2'
    order = SECOND
  [../]
  [./lambda]
    block = '10'
  [../]
[]
[BCs]
  [./neumann]
    type = FunctionGradientNeumannBC
    exact_solution = exact_soln
    variable = T
    boundary = '3 4 5 6 7 8'
  [../]
[]
[Kernels]
  [./conduction]
    type = Diffusion
    variable = T
    block = '1 2'
  [../]
  [./sink]
    type = Reaction
    variable = T
    block = '1 2'
  [../]
  [./forcing_function]
    type = BodyForce
    variable = T
    function = forcing_function
    block = '1 2'
  [../]
[]
[Functions]
  [./forcing_function]
    type = ParsedFunction
    value = '-4 + x^2 + y^2'
  [../]
  [./exact_soln]
    type = ParsedFunction
    value = 'x^2 + y^2'
  [../]
[]
[Debug]
  show_var_residual_norms = 1
[]
[Constraints]
  [./mortar]
    type = EqualValueConstraint
    primary_boundary = 2
    secondary_boundary = 1
    primary_subdomain = 20
    secondary_subdomain = 10
    variable = lambda
    secondary_variable = T
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  solve_type = NEWTON
  type = Steady
  petsc_options_iname = '-pc_type -snes_linesearch_type -pc_factor_shift_type -pc_factor_shift_amount'
  petsc_options_value = 'lu       basic                 NONZERO               1e-15'
[]
[Outputs]
  exodus = true
  [dofmap]
    type = DOFMap
    execute_on = 'initial'
  []
[]
(modules/combined/examples/mortar/mortar_gradient.i)
#
# Compare a diffusion equation with (c) and without (v) periodic gradient
# constraints and a ramped sloped initial condition and value-periodic diffusion (p)
# without a slope.
#
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 40
    ny = 40
  []
  [secondary_x]
    input = gen
    type = LowerDBlockFromSidesetGenerator
    sidesets = '3'
    new_block_id = 10
    new_block_name = "secondary_x"
  []
  [primary_x]
    input = secondary_x
    type = LowerDBlockFromSidesetGenerator
    sidesets = '1'
    new_block_id = 12
    new_block_name = "primary_x"
  []
  [secondary_y]
    input = primary_x
    type = LowerDBlockFromSidesetGenerator
    sidesets = '0'
    new_block_id = 11
    new_block_name = "secondary_y"
  []
  [primary_y]
    input = secondary_y
    type = LowerDBlockFromSidesetGenerator
    sidesets = '2'
    new_block_id = 13
    new_block_name = "primary_y"
  []
[]
[Functions]
  [./init_slope]
    # slope with a concentration spike close to the lower interface
    type = ParsedFunction
    value = 'if(x>0.4 & x<0.6 & y>0.1 & y<0.3, 3+y, y)'
  [../]
  [./init_flat]
    # no-slope and the same spike
    type = ParsedFunction
    value = 'if(x>0.4 & x<0.6 & y>0.1 & y<0.3, 3, 0)'
  [../]
[]
[Variables]
  # gradient constrained concentration
  [./c]
    order = FIRST
    family = LAGRANGE
    block = 0
    [./InitialCondition]
      type = FunctionIC
      function = init_slope
    [../]
  [../]
  # unconstrained concentrarion
  [./v]
    order = FIRST
    family = LAGRANGE
    block = 0
    [./InitialCondition]
      type = FunctionIC
      function = init_slope
    [../]
  [../]
  # flat value periodic diffusion
  [./p]
    order = FIRST
    family = LAGRANGE
    block = 0
    [./InitialCondition]
      type = FunctionIC
      function = init_flat
    [../]
  [../]
  # Lagrange multipliers for gradient component in the horizontal directon
  [./lm_left_right_x]
    order = FIRST
    family = LAGRANGE
    block = "secondary_x"
  [../]
  [./lm_left_right_y]
    order = FIRST
    family = LAGRANGE
    block = "secondary_x"
  [../]
  # Lagrange multipliers for gradient component in the vertical directon
  [./lm_up_down_x]
    order = FIRST
    family = LAGRANGE
    block = "secondary_y"
  [../]
  [./lm_up_down_y]
    order = FIRST
    family = LAGRANGE
    block = "secondary_y"
  [../]
[]
[Kernels]
  # the gradient constrained concentration
  [./diff]
    type = Diffusion
    variable = c
    block = 0
  [../]
  [./dt]
    type = TimeDerivative
    variable = c
    block = 0
  [../]
  # the un-constrained concentration
  [./diff2]
    type = Diffusion
    variable = v
    block = 0
  [../]
  [./dt2]
    type = TimeDerivative
    variable = v
    block = 0
  [../]
  # the value periodic concentration
  [./diff3]
    type = Diffusion
    variable = p
    block = 0
  [../]
  [./dt3]
    type = TimeDerivative
    variable = p
    block = 0
  [../]
[]
[Constraints]
  [./equaly_grad_x]
    type = EqualGradientConstraint
    variable = lm_up_down_x
    component = 0
    secondary_variable = c
    secondary_boundary = bottom
    primary_boundary = top
    secondary_subdomain = secondary_y
    primary_subdomain = primary_y
    periodic = true
  [../]
  [./equaly_grad_y]
    type = EqualGradientConstraint
    variable = lm_up_down_y
    component = 1
    secondary_variable = c
    secondary_boundary = bottom
    primary_boundary = top
    secondary_subdomain = secondary_y
    primary_subdomain = primary_y
    periodic = true
  [../]
  [./equalx_grad_x]
    type = EqualGradientConstraint
    variable = lm_left_right_x
    component = 0
    secondary_variable = c
    secondary_boundary = left
    primary_boundary = right
    secondary_subdomain = secondary_x
    primary_subdomain = primary_x
    periodic = true
  [../]
  [./equalx_grad_y]
    type = EqualGradientConstraint
    variable = lm_left_right_y
    component = 1
    secondary_variable = c
    secondary_boundary = left
    primary_boundary = right
    secondary_subdomain = secondary_x
    primary_subdomain = primary_x
    periodic = true
  [../]
[]
[BCs]
  # DiffusionFluxBC is the surface term in the weak form of the Diffusion equation
  [./surface]
    type = DiffusionFluxBC
    boundary = 'top bottom left right'
    variable = c
  [../]
  [./surface2]
    type = DiffusionFluxBC
    boundary = 'top bottom left right'
    variable = v
  [../]
  # for the value periodic diffusion we skip the surface term and apply value PBCs
  [./Periodic]
    [./up_down]
      variable = p
      primary = 0
      secondary = 2
      translation = '0 1 0'
    [../]
    [./left_right]
      variable = p
      primary = 1
      secondary = 3
      translation = '-1 0 0'
    [../]
  [../]
[]
[AuxVariables]
  [./diff_constraint]
    block = 0
  [../]
  [./diff_periodic]
    block = 0
  [../]
  [./diff_slope]
    block = 0
  [../]
  [./slope]
    block = 0
    [./InitialCondition]
      type = FunctionIC
      function = y
    [../]
  [../]
[]
[AuxKernels]
  # difference between the constrained and unconstrained sloped diffusions
  [./diff_constraint]
    type = ParsedAux
    variable = diff_constraint
    function = 'c-v'
    args = 'c v'
    block = 0
  [../]
  # difference between the periodic gradient constrained diffusion and the flat
  # value period diffusien with a constant slope added. This should be the same,
  # but they aren't quite because the gradient constraint affects the gradient in
  # the entire elements (i.e. a larger volume is affected by the gradient constraint
  # compared to the nodal value periodicity)
  [./diff_periodic]
    type = ParsedAux
    variable = diff_periodic
    function = 'c-p-slope'
    args = 'c p slope'
    block = 0
  [../]
  # subtract the constant slope from the gradient periodic simulation (should yield
  # almost p - per the argument above)
  [./diff_slope]
    type = ParsedAux
    variable = diff_slope
    function = 'c-slope'
    args = 'c slope'
    block = 0
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  solve_type = NEWTON
  # the shift is necessary to facilitate the solve. The Lagrange multipliers
  # introduce zero-on diaginal blocks, which make the matrix hard to invert.
  petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount'
  petsc_options_value = ' lu       NONZERO               1e-10'
  nl_rel_tol = 1e-11
  nl_abs_tol = 1e-10
  l_tol = 1e-10
  dt = 0.01
  num_steps = 20
[]
[Outputs]
  exodus = true
[]
(test/tests/mortar/continuity-2d-conforming/conforming_two_var.i)
[Mesh]
  [file]
    type = FileMeshGenerator
    file = 2blk-conf.e
  []
  [secondary]
    input = file
    type = LowerDBlockFromSidesetGenerator
    sidesets = '101'
    new_block_id = '10001'
    new_block_name = 'secondary_lower'
  []
  [primary]
    input = secondary
    type = LowerDBlockFromSidesetGenerator
    sidesets = '100'
    new_block_id = '10000'
    new_block_name = 'primary_lower'
  []
[]
[Functions]
  [./exact_sln]
    type = ParsedFunction
    value = y
  [../]
  [./ffn]
    type = ParsedFunction
    value = 0
  [../]
[]
[Variables]
  [./u]
    order = FIRST
    family = LAGRANGE
    block = '1 2'
  [../]
  [./lm_u]
    order = FIRST
    family = LAGRANGE
    block = 'secondary_lower'
  [../]
  [./v]
    order = FIRST
    family = LAGRANGE
    block = '1 2'
  [../]
  [./lm_v]
    order = FIRST
    family = LAGRANGE
    block = 'secondary_lower'
  [../]
[]
[Kernels]
  [./diff_u]
    type = Diffusion
    variable = u
  [../]
  [./ffn]
    type = BodyForce
    variable = u
    function = ffn
  [../]
  [./diff_v]
    type = Diffusion
    variable = v
  [../]
  [./coupled_u]
    type = CoupledForce
    variable = v
    v = u
  [../]
[]
[Constraints]
  [./ced_u]
    type = EqualValueConstraint
    variable = lm_u
    secondary_variable = u
    primary_boundary = 100
    primary_subdomain = 10000
    secondary_boundary = 101
    secondary_subdomain = 10001
  [../]
  [./ced_v]
    type = EqualValueConstraint
    variable = lm_v
    secondary_variable = v
    primary_boundary = 100
    primary_subdomain = 10000
    secondary_boundary = 101
    secondary_subdomain = 10001
  [../]
[]
[BCs]
  [./all]
    type = FunctionDirichletBC
    variable = u
    boundary = '1 2 3 4'
    function = exact_sln
  [../]
  [./allv]
    type = DirichletBC
    variable = v
    boundary = '1 2 3 4'
    value = 0
  [../]
[]
[Postprocessors]
  [./l2_error]
    type = ElementL2Error
    variable = u
    function = exact_sln
    block = '1 2'
    execute_on = 'initial timestep_end'
  [../]
  [./l2_v]
    type = ElementL2Norm
    variable = v
    block = '1 2'
    execute_on = 'initial timestep_end'
  [../]
[]
[Preconditioning]
  [./fmp]
    type = SMP
    full = true
    solve_type = 'NEWTON'
  [../]
[]
[Executioner]
  type = Steady
  nl_rel_tol = 1e-12
  l_tol = 1e-12
[]
[Outputs]
  exodus = true
[]
(test/tests/mortar/continuity-2d-non-conforming/dual-soln-continuity.i)
[Mesh]
  second_order = false
  [file]
    type = FileMeshGenerator
    file = nodal_normals_test_offset_nonmatching_gap.e
  []
  [./primary]
    input = file
    type = LowerDBlockFromSidesetGenerator
    sidesets = '2'
    new_block_id = '20'
  [../]
  [./secondary]
    input = primary
    type = LowerDBlockFromSidesetGenerator
    sidesets = '1'
    new_block_id = '10'
  [../]
[]
[Problem]
  kernel_coverage_check = false
[]
[Variables]
  [./T]
    block = '1 2'
    order = FIRST
  [../]
  [./lambda]
    block = '10'
    order = FIRST
    use_dual = true
  [../]
[]
[BCs]
  [./neumann]
    type = FunctionGradientNeumannBC
    exact_solution = exact_soln
    variable = T
    boundary = '3 4 5 6 7 8'
  [../]
[]
[Kernels]
  [./conduction]
    type = Diffusion
    variable = T
    block = '1 2'
  [../]
  [./sink]
    type = Reaction
    variable = T
    block = '1 2'
  [../]
  [./forcing_function]
    type = BodyForce
    variable = T
    function = forcing_function
    block = '1 2'
  [../]
[]
[Functions]
  [./forcing_function]
    type = ParsedFunction
    value = '-4 + x^2 + y^2'
  [../]
  [./exact_soln]
    type = ParsedFunction
    value = 'x^2 + y^2'
  [../]
[]
[Debug]
  show_var_residual_norms = 1
[]
[Constraints]
  [./mortar]
    type = EqualValueConstraint
    primary_boundary = 2
    secondary_boundary = 1
    primary_subdomain = 20
    secondary_subdomain = 10
    variable = lambda
    secondary_variable = T
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  solve_type = NEWTON
  type = Steady
  petsc_options_iname = '-pc_type -snes_linesearch_type -pc_factor_shift_type -pc_factor_shift_amount'
  petsc_options_value = 'lu       basic                 NONZERO               1e-15'
[]
[Outputs]
  exodus = true
  [dofmap]
    type = DOFMap
    execute_on = 'initial'
  []
[]
(modules/contact/test/tests/mortar_tm/2drz/frictionless_first/finite_noaction.i)
E_block = 1e7
E_plank = 1e7
elem = QUAD4
order = FIRST
name = 'finite_noaction'
[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'
  [../]
  [./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)}
  [../]
  [./frictionless_normal_lm]
    order = ${order}
    block = 'frictionless_secondary_subdomain'
  [../]
[]
[Modules/TensorMechanics/Master]
  [./block]
    strain = FINITE
    generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx strain_yy strain_zz'
    block = 'block'
  [../]
  [./plank]
    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'
  [../]
[]
[Constraints]
  [./lm]
    type = NormalNodalLMMechanicalContact
    secondary = block_left
    primary = plank_right
    variable = frictionless_normal_lm
    primary_variable = disp_x
    disp_y = disp_y
    ncp_function_type = min
    use_displaced_mesh = true
  [../]
  [./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
  [../]
[]
[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 = FunctionDirichletBC
    variable = disp_y
    boundary = block_right
    function = '-t'
  [../]
[]
[Materials]
  [./plank]
    type = ComputeIsotropicElasticityTensor
    block = 'plank'
    poissons_ratio = 0.3
    youngs_modulus = ${E_plank}
  [../]
  [./block]
    type = ComputeIsotropicElasticityTensor
    block = 'block'
    poissons_ratio = 0.3
    youngs_modulus = ${E_block}
  [../]
  [./stress]
    type = ComputeFiniteStrainElasticStress
    block = 'plank block'
  [../]
  [./swell]
    type = ComputeEigenstrain
    block = 'plank'
    eigenstrain_name = swell
    eigen_base = '1 0 0 0 0 0 0 0 0'
    prefactor = swell_mat
  [../]
  [./swell_mat]
    type = GenericFunctionMaterial
    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'
  snesmf_reuse_base = false
[]
[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/frictionless_second/finite_noaction.i)
E_block = 1e7
E_plank = 1e7
elem = QUAD9
order = SECOND
name = 'finite_noaction'
[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'
  [../]
  [./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)}
  [../]
  [./frictionless_normal_lm]
    order = ${order}
    block = 'frictionless_secondary_subdomain'
  [../]
[]
[Modules/TensorMechanics/Master]
  [./block]
    strain = FINITE
    generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx strain_yy strain_zz'
    block = 'block'
  [../]
  [./plank]
    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'
  [../]
[]
[Constraints]
  [./lm]
    type = NormalNodalLMMechanicalContact
    secondary = block_left
    primary = plank_right
    variable = frictionless_normal_lm
    primary_variable = disp_x
    disp_y = disp_y
    ncp_function_type = min
    use_displaced_mesh = true
  [../]
  [./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
  [../]
[]
[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 = FunctionDirichletBC
    variable = disp_y
    preset = false
    boundary = block_right
    function = '-t'
  [../]
[]
[Materials]
  [./plank]
    type = ComputeIsotropicElasticityTensor
    block = 'plank'
    poissons_ratio = 0.3
    youngs_modulus = ${E_plank}
  [../]
  [./block]
    type = ComputeIsotropicElasticityTensor
    block = 'block'
    poissons_ratio = 0.3
    youngs_modulus = ${E_block}
  [../]
  [./stress]
    type = ComputeFiniteStrainElasticStress
    block = 'plank block'
  [../]
  [./swell]
    type = ComputeEigenstrain
    block = 'plank'
    eigenstrain_name = swell
    eigen_base = '1 0 0 0 0 0 0 0 0'
    prefactor = swell_mat
  [../]
  [./swell_mat]
    type = GenericFunctionMaterial
    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'
  snesmf_reuse_base = false
[]
[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
[]
(test/tests/bcs/ad_coupled_lower_value/test.i)
[Mesh]
  [./square]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 10
    ny = 10
  [../]
  [lower_d]
    type = LowerDBlockFromSidesetGenerator
    input = square
    new_block_name = 'lower'
    sidesets = 'top right'
  []
[]
[Variables]
  [./u]
    block = 0
  [../]
  [lower]
    block = 'lower'
  []
[]
[Kernels]
  [./diff]
    type = Diffusion
    variable = u
    block = 0
  [../]
[]
[NodalKernels]
  [time]
    type = TimeDerivativeNodalKernel
    variable = lower
    block = lower
  []
  [growth]
    type = ConstantRate
    rate = 1
    variable = lower
    block = lower
  []
[]
[BCs]
  [./dirichlet]
    type = DirichletBC
    variable = u
    boundary = 'left bottom'
    value = 0
  [../]
  [./neumann]
    type = ADCoupledLowerValue
    variable = u
    boundary = 'right top'
    lower_d_var = lower
  [../]
[]
[Executioner]
  type = Transient
  num_steps = 2
[]
[Outputs]
  exodus = true
[]
(modules/contact/test/tests/mortar_tm/2d/frictionless_first/finite_noaction.i)
E_block = 1e7
E_plank = 1e7
elem = QUAD4
order = FIRST
name = 'finite_noaction'
[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)}
  [../]
  [./frictionless_normal_lm]
    order = ${order}
    block = 'frictionless_secondary_subdomain'
  [../]
[]
[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'
  [../]
[]
[Constraints]
  [./lm]
    type = NormalNodalLMMechanicalContact
    secondary = block_left
    primary = plank_right
    variable = frictionless_normal_lm
    primary_variable = disp_x
    disp_y = disp_y
    ncp_function_type = min
    use_displaced_mesh = true
  [../]
  [./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
  [../]
[]
[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 = FunctionDirichletBC
    variable = disp_x
    boundary = block_right
    function = '-0.04*sin(4*(t+1.5))+0.02'
  [../]
  [./right_y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = block_right
    function = '-t'
  [../]
[]
[Materials]
  [./plank]
    type = ComputeIsotropicElasticityTensor
    block = 'plank'
    poissons_ratio = 0.3
    youngs_modulus = ${E_plank}
  [../]
  [./block]
    type = ComputeIsotropicElasticityTensor
    block = 'block'
    poissons_ratio = 0.3
    youngs_modulus = ${E_block}
  [../]
  [./stress]
    type = ComputeFiniteStrainElasticStress
    block = 'plank block'
  [../]
[]
[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 = 13.5
  dt = 0.1
  dtmin = 0.1
  timestep_tolerance = 1e-6
  line_search = 'contact'
  snesmf_reuse_base = false
[]
[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
[]
(test/tests/mortar/continuity-2d-conforming/conforming-2nd-order.i)
[Mesh]
  [file]
    type = FileMeshGenerator
    file = 2blk-conf-2nd.e
  []
  [secondary]
    input = file
    type = LowerDBlockFromSidesetGenerator
    sidesets = '101'
    new_block_id = '10001'
    new_block_name = 'secondary_lower'
  []
  [primary]
    input = secondary
    type = LowerDBlockFromSidesetGenerator
    sidesets = '100'
    new_block_id = '10000'
    new_block_name = 'primary_lower'
  []
[]
[Problem]
  kernel_coverage_check = false
[]
[Functions]
  [./exact_sln]
    type = ParsedFunction
    value = x*x+y*y
  [../]
  [./ffn]
    type = ParsedFunction
    value = -4
  [../]
[]
[Variables]
  [./u]
    order = SECOND
    family = LAGRANGE
    block = '1 2'
  [../]
  [./lm]
    order = SECOND
    family = LAGRANGE
    block = secondary_lower
  [../]
[]
[Kernels]
  [./diff]
    type = Diffusion
    variable = u
  [../]
  [./ffn]
    type = BodyForce
    variable = u
    function = ffn
  [../]
[]
[Constraints]
  [./ced]
    type = EqualValueConstraint
    variable = lm
    secondary_variable = u
    primary_boundary = 100
    primary_subdomain = 10000
    secondary_boundary = 101
    secondary_subdomain = 10001
  [../]
[]
[BCs]
  [./all]
    type = FunctionDirichletBC
    variable = u
    boundary = '1 2 3 4'
    function = exact_sln
  [../]
[]
[Postprocessors]
  [./l2_error]
    type = ElementL2Error
    variable = u
    function = exact_sln
    block = '1 2'
    execute_on = 'initial timestep_end'
  [../]
[]
[Preconditioning]
  [./fmp]
    type = SMP
    full = true
    solve_type = 'NEWTON'
  [../]
[]
[Executioner]
  type = Steady
  nl_rel_tol = 1e-14
  l_tol = 1e-14
[]
[Outputs]
  exodus = true
[]
(test/tests/mortar/continuity-2d-non-conforming/sequencing-stateful-soln-continuity.i)
[Mesh]
  second_order = true
  [file]
    type = FileMeshGenerator
    file = nodal_normals_test_offset_nonmatching_gap.e
  []
  [./primary]
    input = file
    type = LowerDBlockFromSidesetGenerator
    sidesets = '2'
    new_block_id = '20'
  [../]
  [./secondary]
    input = primary
    type = LowerDBlockFromSidesetGenerator
    sidesets = '1'
    new_block_id = '10'
  [../]
[]
[Variables]
  [./T]
    block = '1 2'
    order = SECOND
  [../]
  [./lambda]
    block = '10'
  [../]
[]
[AuxVariables]
  [ssm]
    order = CONSTANT
    family = MONOMIAL
    block = '1 2'
  []
[]
[BCs]
  [./neumann]
    type = FunctionGradientNeumannBC
    exact_solution = exact_soln
    variable = T
    boundary = '3 4 5 6 7 8'
  [../]
[]
[Kernels]
  [./conduction]
    type = Diffusion
    variable = T
    block = '1 2'
  [../]
  [./sink]
    type = Reaction
    variable = T
    block = '1 2'
  [../]
  [./forcing_function]
    type = BodyForce
    variable = T
    function = forcing_function
    block = '1 2'
  [../]
[]
[AuxKernels]
  [ssm]
    type = MaterialRealAux
    variable = ssm
    property = diffusivity
    block = '1 2'
  []
[]
[Materials]
  [./ssm]
    type = SpatialStatefulMaterial
    block = '1 2'
  [../]
[]
[Functions]
  [./forcing_function]
    type = ParsedFunction
    value = '-4 + x^2 + y^2'
  [../]
  [./exact_soln]
    type = ParsedFunction
    value = 'x^2 + y^2'
  [../]
[]
[Debug]
  show_var_residual_norms = 1
[]
[Constraints]
  [./mortar]
    type = EqualValueConstraint
    primary_boundary = 2
    secondary_boundary = 1
    primary_subdomain = 20
    secondary_subdomain = 10
    variable = lambda
    secondary_variable = T
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  solve_type = NEWTON
  type = Steady
  nl_abs_tol = 1e-12
  petsc_options_iname = '-pc_type -snes_linesearch_type -pc_factor_shift_type -pc_factor_shift_amount'
  petsc_options_value = 'lu       basic                 NONZERO               1e-15'
  num_grids = 2
[]
[Outputs]
  exodus = true
[]
[Adaptivity]
  steps = 1
  marker = uniform
  [Markers]
    [uniform]
      type = UniformMarker
      mark = refine
    []
  []
[]
(test/tests/meshgenerators/lower_d_block_generator/names.i)
[Mesh]
  [./gmg]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 10
    ny = 10
  []
  [./lower_d_block]
    type = LowerDBlockFromSidesetGenerator
    input = gmg
    new_block_id = 10
    sidesets = 'bottom bottom right top left'
  []
[]
[Variables]
  [./u]
    block = 0
  [../]
  [./v]
    block = 10
  [../]
[]
[Kernels]
  [./diff]
    type = Diffusion
    variable = u
    block = 0
  [../]
  [./srcv]
    type = BodyForce
    block = 10
    variable = v
    function = 1
  [../]
  [./time_v]
    type = TimeDerivative
    block = 10
    variable = v
  [../]
[]
[BCs]
  [./left]
    type = DirichletBC
    variable = u
    boundary = left
    value = 0
  [../]
  [./right]
    type = DirichletBC
    variable = u
    boundary = right
    value = 1
  [../]
[]
[Executioner]
  type = Transient
  num_steps = 2
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type -pc_hypre_type'
  petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
  exodus = true
[]
(test/tests/mortar/continuity-2d-conforming/equalgradient.i)
[Mesh]
  [file]
    type = FileMeshGenerator
    file = 2blk-conf.e
  []
  [secondary]
    input = file
    type = LowerDBlockFromSidesetGenerator
    sidesets = '101'
    new_block_id = '10001'
    new_block_name = 'secondary_lower'
  []
  [primary]
    input = secondary
    type = LowerDBlockFromSidesetGenerator
    sidesets = '100'
    new_block_id = '10000'
    new_block_name = 'primary_lower'
  []
[]
[Variables]
  [./u]
    order = FIRST
    family = LAGRANGE
    block = '1 2'
  [../]
  [./lmx]
    order = FIRST
    family = LAGRANGE
    block = 'secondary_lower'
  [../]
  [./lmy]
    order = FIRST
    family = LAGRANGE
    block = 'secondary_lower'
  [../]
[]
[ICs]
  [./block1]
    type = FunctionIC
    variable = u
    block = 1
    function = y
  [../]
  [./block2]
    type = FunctionIC
    variable = u
    block = 2
    function = y-0.5
  [../]
[]
[Kernels]
  [./diff]
    type = Diffusion
    variable = u
  [../]
  [./dt]
    type = TimeDerivative
    variable = u
  [../]
[]
[Constraints]
  [./cedx]
    type = EqualGradientConstraint
    secondary_variable = u
    variable = lmx
    primary_boundary = 100
    primary_subdomain = 10000
    secondary_boundary = 101
    secondary_subdomain = 10001
    component = 0
  [../]
  [./cedy]
    type = EqualGradientConstraint
    secondary_variable = u
    variable = lmy
    primary_boundary = 100
    primary_subdomain = 10000
    secondary_boundary = 101
    secondary_subdomain = 10001
    component = 1
  [../]
[]
[BCs]
  [./all]
    type = DiffusionFluxBC
    variable = u
    boundary = '2 4 100 101'
  [../]
  [./boundary]
    type = DirichletBC
    boundary = 1
    variable = u
    value = 0.0
  [../]
  [./top]
    type = FunctionDirichletBC
    boundary = 3
    variable = u
    function = 0.5-t
  [../]
[]
[Preconditioning]
  [./fmp]
    type = SMP
    full = true
    solve_type = 'NEWTON'
  [../]
[]
[Executioner]
  type = Transient
  nl_rel_tol = 1e-11
  l_tol = 1e-10
  l_max_its = 10
  dt = 0.05
  num_steps = 3
[]
[Outputs]
  exodus = true
  print_linear_residuals = false
[]