- componentWhich direction this kernel acts inC++ Type:unsigned int Controllable:No Description:Which direction this kernel acts in 
- constraint_typesType of each constraint: strain, stress, or none. The types are specified in the column-major order, and there must be 9 entries in total.C++ Type:MultiMooseEnum Controllable:No Description:Type of each constraint: strain, stress, or none. The types are specified in the column-major order, and there must be 9 entries in total. 
- displacementsThe displacement componentsC++ Type:std::vector<VariableName> Unit:(no unit assumed) Controllable:No Description:The displacement components 
- targetsFunctions giving the targets to hit for constraint types that are not none.C++ Type:std::vector<FunctionName> Unit:(no unit assumed) Controllable:No Description:Functions giving the targets to hit for constraint types that are not none. 
- variableThe name of the variable that this residual object operates onC++ Type:NonlinearVariableName Unit:(no unit assumed) Controllable:No Description:The name of the variable that this residual object operates on 
HomogenizedTotalLagrangianStressDivergence
Total Lagrangian stress equilibrium kernel with homogenization constraint Jacobian terms
Overview
This object provides the total Lagrangian stress equilibrium kernel and corresponding Jacobian for the homogenization system.  It is identical to the TotalLagrangianStressDivergence class except it also provides the correct off-diagonal Jacobian terms for the Lagrangian kernel homogenization system.
The SolidMechanics/QuasiStatic can add this object automatically, which is the recommended way to set up homogenization constraints.
Example Input File Syntax
The following example manually specifies the parameters required to setup the kernel for a large deformation homogenization problem. The macro_gradient parameter is the name of the ScalarVariable containing the homogenization strain or displacement gradient field. The constraint_types parameters controls the type of constraint (deformation or stress) for each input. The homogenization system documentation lists the order of these inputs for each problem dimension/type.  
[AuxKernels<<<{"href": "../../../syntax/AuxKernels/index.html"}>>>]
  [s11]
    type = RankTwoAux<<<{"description": "Access a component of a RankTwoTensor", "href": "../../auxkernels/RankTwoAux.html"}>>>
    variable<<<{"description": "The name of the variable that this object applies to"}>>> = s11
    rank_two_tensor<<<{"description": "The rank two material tensor name"}>>> = pk1_stress
    index_i<<<{"description": "The index i of ij for the tensor to output (0, 1, 2)"}>>> = 0
    index_j<<<{"description": "The index j of ij for the tensor to output (0, 1, 2)"}>>> = 0
  []
  [s21]
    type = RankTwoAux<<<{"description": "Access a component of a RankTwoTensor", "href": "../../auxkernels/RankTwoAux.html"}>>>
    variable<<<{"description": "The name of the variable that this object applies to"}>>> = s21
    rank_two_tensor<<<{"description": "The rank two material tensor name"}>>> = pk1_stress
    index_i<<<{"description": "The index i of ij for the tensor to output (0, 1, 2)"}>>> = 1
    index_j<<<{"description": "The index j of ij for the tensor to output (0, 1, 2)"}>>> = 0
  []
  [s31]
    type = RankTwoAux<<<{"description": "Access a component of a RankTwoTensor", "href": "../../auxkernels/RankTwoAux.html"}>>>
    variable<<<{"description": "The name of the variable that this object applies to"}>>> = s31
    rank_two_tensor<<<{"description": "The rank two material tensor name"}>>> = pk1_stress
    index_i<<<{"description": "The index i of ij for the tensor to output (0, 1, 2)"}>>> = 2
    index_j<<<{"description": "The index j of ij for the tensor to output (0, 1, 2)"}>>> = 0
  []
  [s12]
    type = RankTwoAux<<<{"description": "Access a component of a RankTwoTensor", "href": "../../auxkernels/RankTwoAux.html"}>>>
    variable<<<{"description": "The name of the variable that this object applies to"}>>> = s12
    rank_two_tensor<<<{"description": "The rank two material tensor name"}>>> = pk1_stress
    index_i<<<{"description": "The index i of ij for the tensor to output (0, 1, 2)"}>>> = 0
    index_j<<<{"description": "The index j of ij for the tensor to output (0, 1, 2)"}>>> = 1
  []
  [s22]
    type = RankTwoAux<<<{"description": "Access a component of a RankTwoTensor", "href": "../../auxkernels/RankTwoAux.html"}>>>
    variable<<<{"description": "The name of the variable that this object applies to"}>>> = s22
    rank_two_tensor<<<{"description": "The rank two material tensor name"}>>> = pk1_stress
    index_i<<<{"description": "The index i of ij for the tensor to output (0, 1, 2)"}>>> = 1
    index_j<<<{"description": "The index j of ij for the tensor to output (0, 1, 2)"}>>> = 1
  []
  [s32]
    type = RankTwoAux<<<{"description": "Access a component of a RankTwoTensor", "href": "../../auxkernels/RankTwoAux.html"}>>>
    variable<<<{"description": "The name of the variable that this object applies to"}>>> = s32
    rank_two_tensor<<<{"description": "The rank two material tensor name"}>>> = pk1_stress
    index_i<<<{"description": "The index i of ij for the tensor to output (0, 1, 2)"}>>> = 2
    index_j<<<{"description": "The index j of ij for the tensor to output (0, 1, 2)"}>>> = 1
  []
  [s13]
    type = RankTwoAux<<<{"description": "Access a component of a RankTwoTensor", "href": "../../auxkernels/RankTwoAux.html"}>>>
    variable<<<{"description": "The name of the variable that this object applies to"}>>> = s13
    rank_two_tensor<<<{"description": "The rank two material tensor name"}>>> = pk1_stress
    index_i<<<{"description": "The index i of ij for the tensor to output (0, 1, 2)"}>>> = 0
    index_j<<<{"description": "The index j of ij for the tensor to output (0, 1, 2)"}>>> = 2
  []
  [s23]
    type = RankTwoAux<<<{"description": "Access a component of a RankTwoTensor", "href": "../../auxkernels/RankTwoAux.html"}>>>
    variable<<<{"description": "The name of the variable that this object applies to"}>>> = s23
    rank_two_tensor<<<{"description": "The rank two material tensor name"}>>> = pk1_stress
    index_i<<<{"description": "The index i of ij for the tensor to output (0, 1, 2)"}>>> = 1
    index_j<<<{"description": "The index j of ij for the tensor to output (0, 1, 2)"}>>> = 2
  []
  [s33]
    type = RankTwoAux<<<{"description": "Access a component of a RankTwoTensor", "href": "../../auxkernels/RankTwoAux.html"}>>>
    variable<<<{"description": "The name of the variable that this object applies to"}>>> = s33
    rank_two_tensor<<<{"description": "The rank two material tensor name"}>>> = pk1_stress
    index_i<<<{"description": "The index i of ij for the tensor to output (0, 1, 2)"}>>> = 2
    index_j<<<{"description": "The index j of ij for the tensor to output (0, 1, 2)"}>>> = 2
  []
  [F11]
    type = RankTwoAux<<<{"description": "Access a component of a RankTwoTensor", "href": "../../auxkernels/RankTwoAux.html"}>>>
    variable<<<{"description": "The name of the variable that this object applies to"}>>> = F11
    rank_two_tensor<<<{"description": "The rank two material tensor name"}>>> = deformation_gradient
    index_i<<<{"description": "The index i of ij for the tensor to output (0, 1, 2)"}>>> = 0
    index_j<<<{"description": "The index j of ij for the tensor to output (0, 1, 2)"}>>> = 0
  []
  [F21]
    type = RankTwoAux<<<{"description": "Access a component of a RankTwoTensor", "href": "../../auxkernels/RankTwoAux.html"}>>>
    variable<<<{"description": "The name of the variable that this object applies to"}>>> = F21
    rank_two_tensor<<<{"description": "The rank two material tensor name"}>>> = deformation_gradient
    index_i<<<{"description": "The index i of ij for the tensor to output (0, 1, 2)"}>>> = 1
    index_j<<<{"description": "The index j of ij for the tensor to output (0, 1, 2)"}>>> = 0
  []
  [F31]
    type = RankTwoAux<<<{"description": "Access a component of a RankTwoTensor", "href": "../../auxkernels/RankTwoAux.html"}>>>
    variable<<<{"description": "The name of the variable that this object applies to"}>>> = F31
    rank_two_tensor<<<{"description": "The rank two material tensor name"}>>> = deformation_gradient
    index_i<<<{"description": "The index i of ij for the tensor to output (0, 1, 2)"}>>> = 2
    index_j<<<{"description": "The index j of ij for the tensor to output (0, 1, 2)"}>>> = 0
  []
  [F12]
    type = RankTwoAux<<<{"description": "Access a component of a RankTwoTensor", "href": "../../auxkernels/RankTwoAux.html"}>>>
    variable<<<{"description": "The name of the variable that this object applies to"}>>> = F12
    rank_two_tensor<<<{"description": "The rank two material tensor name"}>>> = deformation_gradient
    index_i<<<{"description": "The index i of ij for the tensor to output (0, 1, 2)"}>>> = 0
    index_j<<<{"description": "The index j of ij for the tensor to output (0, 1, 2)"}>>> = 1
  []
  [F22]
    type = RankTwoAux<<<{"description": "Access a component of a RankTwoTensor", "href": "../../auxkernels/RankTwoAux.html"}>>>
    variable<<<{"description": "The name of the variable that this object applies to"}>>> = F22
    rank_two_tensor<<<{"description": "The rank two material tensor name"}>>> = deformation_gradient
    index_i<<<{"description": "The index i of ij for the tensor to output (0, 1, 2)"}>>> = 1
    index_j<<<{"description": "The index j of ij for the tensor to output (0, 1, 2)"}>>> = 1
  []
  [F32]
    type = RankTwoAux<<<{"description": "Access a component of a RankTwoTensor", "href": "../../auxkernels/RankTwoAux.html"}>>>
    variable<<<{"description": "The name of the variable that this object applies to"}>>> = F32
    rank_two_tensor<<<{"description": "The rank two material tensor name"}>>> = deformation_gradient
    index_i<<<{"description": "The index i of ij for the tensor to output (0, 1, 2)"}>>> = 2
    index_j<<<{"description": "The index j of ij for the tensor to output (0, 1, 2)"}>>> = 1
  []
  [F13]
    type = RankTwoAux<<<{"description": "Access a component of a RankTwoTensor", "href": "../../auxkernels/RankTwoAux.html"}>>>
    variable<<<{"description": "The name of the variable that this object applies to"}>>> = F13
    rank_two_tensor<<<{"description": "The rank two material tensor name"}>>> = deformation_gradient
    index_i<<<{"description": "The index i of ij for the tensor to output (0, 1, 2)"}>>> = 0
    index_j<<<{"description": "The index j of ij for the tensor to output (0, 1, 2)"}>>> = 2
  []
  [F23]
    type = RankTwoAux<<<{"description": "Access a component of a RankTwoTensor", "href": "../../auxkernels/RankTwoAux.html"}>>>
    variable<<<{"description": "The name of the variable that this object applies to"}>>> = F23
    rank_two_tensor<<<{"description": "The rank two material tensor name"}>>> = deformation_gradient
    index_i<<<{"description": "The index i of ij for the tensor to output (0, 1, 2)"}>>> = 1
    index_j<<<{"description": "The index j of ij for the tensor to output (0, 1, 2)"}>>> = 2
  []
  [F33]
    type = RankTwoAux<<<{"description": "Access a component of a RankTwoTensor", "href": "../../auxkernels/RankTwoAux.html"}>>>
    variable<<<{"description": "The name of the variable that this object applies to"}>>> = F33
    rank_two_tensor<<<{"description": "The rank two material tensor name"}>>> = deformation_gradient
    index_i<<<{"description": "The index i of ij for the tensor to output (0, 1, 2)"}>>> = 2
    index_j<<<{"description": "The index j of ij for the tensor to output (0, 1, 2)"}>>> = 2
  []
[]Input Parameters
- base_nameMaterial property base nameC++ Type:std::string Controllable:No Description:Material property base name 
- blockThe list of blocks (ids or names) that this object will be appliedC++ Type:std::vector<SubdomainName> Controllable:No Description:The list of blocks (ids or names) that this object will be applied 
- compute_field_residualsTrueWhether to compute residuals for the field variable.Default:True C++ Type:bool Controllable:No Description:Whether to compute residuals for the field variable. 
- compute_scalar_residualsTrueWhether to compute scalar residualsDefault:True C++ Type:bool Controllable:No Description:Whether to compute scalar residuals 
- eigenstrain_namesList of eigenstrains used in the strain calculation. Used for computing their derivatives for off-diagonal Jacobian terms.C++ Type:std::vector<MaterialPropertyName> Unit:(no unit assumed) Controllable:No Description:List of eigenstrains used in the strain calculation. Used for computing their derivatives for off-diagonal Jacobian terms. 
- large_kinematicsFalseUse large displacement kinematicsDefault:False C++ Type:bool Controllable:No Description:Use large displacement kinematics 
- macro_varOptional scalar field with the macro gradientC++ Type:std::vector<VariableName> Unit:(no unit assumed) Controllable:No Description:Optional scalar field with the macro gradient 
- matrix_onlyFalseWhether this object is only doing assembly to matrices (no vectors)Default:False C++ Type:bool Controllable:No Description:Whether this object is only doing assembly to matrices (no vectors) 
- out_of_plane_strainThe out-of-plane strain variable for weak plane stress formulation.C++ Type:std::vector<VariableName> Unit:(no unit assumed) Controllable:No Description:The out-of-plane strain variable for weak plane stress formulation. 
- stabilize_strainFalseAverage the volumetric strainsDefault:False C++ Type:bool Controllable:No Description:Average the volumetric strains 
- temperatureThe name of the temperature variable used in the ComputeThermalExpansionEigenstrain. (Not required for simulations without temperature coupling.)C++ Type:std::vector<VariableName> Unit:(no unit assumed) Controllable:No Description:The name of the temperature variable used in the ComputeThermalExpansionEigenstrain. (Not required for simulations without temperature coupling.) 
Optional Parameters
- absolute_value_vector_tagsThe tags for the vectors this residual object should fill with the absolute value of the residual contributionC++ Type:std::vector<TagName> Controllable:No Description:The tags for the vectors this residual object should fill with the absolute value of the residual contribution 
- extra_matrix_tagsThe extra tags for the matrices this Kernel should fillC++ Type:std::vector<TagName> Controllable:No Description:The extra tags for the matrices this Kernel should fill 
- extra_vector_tagsThe extra tags for the vectors this Kernel should fillC++ Type:std::vector<TagName> Controllable:No Description:The extra tags for the vectors this Kernel should fill 
- matrix_tagssystemThe tag for the matrices this Kernel should fillDefault:system C++ Type:MultiMooseEnum Options:nontime, system Controllable:No Description:The tag for the matrices this Kernel should fill 
- vector_tagsnontimeThe tag for the vectors this Kernel should fillDefault:nontime C++ Type:MultiMooseEnum Options:nontime, time Controllable:No Description:The tag for the vectors this Kernel should fill 
Contribution To Tagged Field Data Parameters
- control_tagsAdds user-defined labels for accessing object parameters via control logic.C++ Type:std::vector<std::string> Controllable:No Description:Adds user-defined labels for accessing object parameters via control logic. 
- diag_save_inThe name of auxiliary variables to save this Kernel's diagonal Jacobian contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)C++ Type:std::vector<AuxVariableName> Unit:(no unit assumed) Controllable:No Description:The name of auxiliary variables to save this Kernel's diagonal Jacobian contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.) 
- enableTrueSet the enabled status of the MooseObject.Default:True C++ Type:bool Controllable:Yes Description:Set the enabled status of the MooseObject. 
- implicitTrueDetermines whether this object is calculated using an implicit or explicit formDefault:True C++ Type:bool Controllable:No Description:Determines whether this object is calculated using an implicit or explicit form 
- save_inThe name of auxiliary variables to save this Kernel's residual contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)C++ Type:std::vector<AuxVariableName> Unit:(no unit assumed) Controllable:No Description:The name of auxiliary variables to save this Kernel's residual contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.) 
- search_methodnearest_node_connected_sidesChoice of search algorithm. All options begin by finding the nearest node in the primary boundary to a query point in the secondary boundary. In the default nearest_node_connected_sides algorithm, primary boundary elements are searched iff that nearest node is one of their nodes. This is fast to determine via a pregenerated node-to-elem map and is robust on conforming meshes. In the optional all_proximate_sides algorithm, primary boundary elements are searched iff they touch that nearest node, even if they are not topologically connected to it. This is more CPU-intensive but is necessary for robustness on any boundary surfaces which has disconnections (such as Flex IGA meshes) or non-conformity (such as hanging nodes in adaptively h-refined meshes).Default:nearest_node_connected_sides C++ Type:MooseEnum Options:nearest_node_connected_sides, all_proximate_sides Controllable:No Description:Choice of search algorithm. All options begin by finding the nearest node in the primary boundary to a query point in the secondary boundary. In the default nearest_node_connected_sides algorithm, primary boundary elements are searched iff that nearest node is one of their nodes. This is fast to determine via a pregenerated node-to-elem map and is robust on conforming meshes. In the optional all_proximate_sides algorithm, primary boundary elements are searched iff they touch that nearest node, even if they are not topologically connected to it. This is more CPU-intensive but is necessary for robustness on any boundary surfaces which has disconnections (such as Flex IGA meshes) or non-conformity (such as hanging nodes in adaptively h-refined meshes). 
- seed0The seed for the master random number generatorDefault:0 C++ Type:unsigned int Controllable:No Description:The seed for the master random number generator 
Advanced Parameters
- prop_getter_suffixAn optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.C++ Type:MaterialPropertyName Unit:(no unit assumed) Controllable:No Description:An optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character. 
- use_interpolated_stateFalseFor the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.Default:False C++ Type:bool Controllable:No Description:For the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction. 
Material Property Retrieval Parameters
Input Files
- (modules/solid_mechanics/test/tests/lagrangian/cartesian/total/homogenization/residual_and_jacobian/3d.i)
- (modules/solid_mechanics/test/tests/lagrangian/cartesian/total/homogenization/small-tests/2d.i)
- (modules/solid_mechanics/test/tests/lagrangian/cartesian/total/homogenization/neml2/small_neml.i)
- (modules/solid_mechanics/test/tests/lagrangian/cartesian/total/homogenization/action/noaction_3d.i)
- (modules/solid_mechanics/test/tests/lagrangian/cartesian/total/homogenization/convergence/sd-stress.i)
- (modules/solid_mechanics/test/tests/lagrangian/cartesian/total/homogenization/convergence/ld-strain.i)
- (modules/solid_mechanics/test/tests/lagrangian/cartesian/total/planar/generalized_plane_strain/pull_2D.i)
- (modules/solid_mechanics/test/tests/lagrangian/cartesian/total/homogenization/convergence/sd-strain.i)
- (modules/solid_mechanics/test/tests/lagrangian/cartesian/total/homogenization/neml2/large_neml.i)
- (modules/solid_mechanics/test/tests/lagrangian/cartesian/total/homogenization/action/noaction_2d.i)
- (modules/solid_mechanics/test/tests/lagrangian/cartesian/total/homogenization/small-tests/1d.i)
- (modules/solid_mechanics/test/tests/lagrangian/cartesian/total/homogenization/small-tests/3d.i)
- (modules/solid_mechanics/test/tests/lagrangian/cartesian/total/homogenization/large-tests/1d.i)
- (modules/solid_mechanics/test/tests/lagrangian/cartesian/total/homogenization/large-tests/3d.i)
- (modules/solid_mechanics/test/tests/lagrangian/cartesian/total/homogenization/convergence/ld-stress.i)
- (modules/solid_mechanics/test/tests/lagrangian/cartesian/total/homogenization/large-tests/2d.i)
(modules/solid_mechanics/test/tests/lagrangian/cartesian/total/homogenization/large-tests/3d.i)
# 2D test with just strain control
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
  large_kinematics = true
  macro_gradient = hvar
  constraint_types = ${constraint_types}
  targets = ${targets}
[]
[Mesh]
  [base]
    type = FileMeshGenerator
    file = '3d.exo'
  []
  [sidesets]
    type = SideSetsFromNormalsGenerator
    input = base
    normals = '-1 0 0
                1 0 0
                0 -1 0
                0 1 0
            '
              '    0 0 -1
                0 0 1'
    fixed_normal = true
    new_boundary = 'left right bottom top back front'
  []
[]
[Variables]
  [disp_x]
  []
  [disp_y]
  []
  [disp_z]
  []
  [hvar]
    family = SCALAR
    order = NINTH
  []
[]
[AuxVariables]
  [s11]
    family = MONOMIAL
    order = CONSTANT
  []
  [s21]
    family = MONOMIAL
    order = CONSTANT
  []
  [s31]
    family = MONOMIAL
    order = CONSTANT
  []
  [s12]
    family = MONOMIAL
    order = CONSTANT
  []
  [s22]
    family = MONOMIAL
    order = CONSTANT
  []
  [s32]
    family = MONOMIAL
    order = CONSTANT
  []
  [s13]
    family = MONOMIAL
    order = CONSTANT
  []
  [s23]
    family = MONOMIAL
    order = CONSTANT
  []
  [s33]
    family = MONOMIAL
    order = CONSTANT
  []
  [F11]
    family = MONOMIAL
    order = CONSTANT
  []
  [F21]
    family = MONOMIAL
    order = CONSTANT
  []
  [F31]
    family = MONOMIAL
    order = CONSTANT
  []
  [F12]
    family = MONOMIAL
    order = CONSTANT
  []
  [F22]
    family = MONOMIAL
    order = CONSTANT
  []
  [F32]
    family = MONOMIAL
    order = CONSTANT
  []
  [F13]
    family = MONOMIAL
    order = CONSTANT
  []
  [F23]
    family = MONOMIAL
    order = CONSTANT
  []
  [F33]
    family = MONOMIAL
    order = CONSTANT
  []
[]
[AuxKernels]
  [s11]
    type = RankTwoAux
    variable = s11
    rank_two_tensor = pk1_stress
    index_i = 0
    index_j = 0
  []
  [s21]
    type = RankTwoAux
    variable = s21
    rank_two_tensor = pk1_stress
    index_i = 1
    index_j = 0
  []
  [s31]
    type = RankTwoAux
    variable = s31
    rank_two_tensor = pk1_stress
    index_i = 2
    index_j = 0
  []
  [s12]
    type = RankTwoAux
    variable = s12
    rank_two_tensor = pk1_stress
    index_i = 0
    index_j = 1
  []
  [s22]
    type = RankTwoAux
    variable = s22
    rank_two_tensor = pk1_stress
    index_i = 1
    index_j = 1
  []
  [s32]
    type = RankTwoAux
    variable = s32
    rank_two_tensor = pk1_stress
    index_i = 2
    index_j = 1
  []
  [s13]
    type = RankTwoAux
    variable = s13
    rank_two_tensor = pk1_stress
    index_i = 0
    index_j = 2
  []
  [s23]
    type = RankTwoAux
    variable = s23
    rank_two_tensor = pk1_stress
    index_i = 1
    index_j = 2
  []
  [s33]
    type = RankTwoAux
    variable = s33
    rank_two_tensor = pk1_stress
    index_i = 2
    index_j = 2
  []
  [F11]
    type = RankTwoAux
    variable = F11
    rank_two_tensor = deformation_gradient
    index_i = 0
    index_j = 0
  []
  [F21]
    type = RankTwoAux
    variable = F21
    rank_two_tensor = deformation_gradient
    index_i = 1
    index_j = 0
  []
  [F31]
    type = RankTwoAux
    variable = F31
    rank_two_tensor = deformation_gradient
    index_i = 2
    index_j = 0
  []
  [F12]
    type = RankTwoAux
    variable = F12
    rank_two_tensor = deformation_gradient
    index_i = 0
    index_j = 1
  []
  [F22]
    type = RankTwoAux
    variable = F22
    rank_two_tensor = deformation_gradient
    index_i = 1
    index_j = 1
  []
  [F32]
    type = RankTwoAux
    variable = F32
    rank_two_tensor = deformation_gradient
    index_i = 2
    index_j = 1
  []
  [F13]
    type = RankTwoAux
    variable = F13
    rank_two_tensor = deformation_gradient
    index_i = 0
    index_j = 2
  []
  [F23]
    type = RankTwoAux
    variable = F23
    rank_two_tensor = deformation_gradient
    index_i = 1
    index_j = 2
  []
  [F33]
    type = RankTwoAux
    variable = F33
    rank_two_tensor = deformation_gradient
    index_i = 2
    index_j = 2
  []
[]
[Kernels]
  [sdx]
    type = HomogenizedTotalLagrangianStressDivergence
    variable = disp_x
    component = 0
    scalar_variable = hvar
  []
  [sdy]
    type = HomogenizedTotalLagrangianStressDivergence
    variable = disp_y
    component = 1
    scalar_variable = hvar
  []
  [sdz]
    type = HomogenizedTotalLagrangianStressDivergence
    variable = disp_z
    component = 2
    scalar_variable = hvar
  []
[]
[Functions]
  [strain11]
    type = ParsedFunction
    expression = '8.0e-2*t'
  []
  [strain22]
    type = ParsedFunction
    expression = '-4.0e-2*t'
  []
  [strain33]
    type = ParsedFunction
    expression = '8.0e-2*t'
  []
  [strain23]
    type = ParsedFunction
    expression = '2.0e-2*t'
  []
  [strain13]
    type = ParsedFunction
    expression = '-7.0e-2*t'
  []
  [strain12]
    type = ParsedFunction
    expression = '1.0e-2*t'
  []
  [strain32]
    type = ParsedFunction
    expression = '1.0e-2*t'
  []
  [strain31]
    type = ParsedFunction
    expression = '2.0e-2*t'
  []
  [strain21]
    type = ParsedFunction
    expression = '-1.5e-2*t'
  []
  [stress11]
    type = ParsedFunction
    expression = '4.0e2*t'
  []
  [stress22]
    type = ParsedFunction
    expression = '-2.0e2*t'
  []
  [stress33]
    type = ParsedFunction
    expression = '8.0e2*t'
  []
  [stress23]
    type = ParsedFunction
    expression = '2.0e2*t'
  []
  [stress13]
    type = ParsedFunction
    expression = '-7.0e2*t'
  []
  [stress12]
    type = ParsedFunction
    expression = '1.0e2*t'
  []
  [stress32]
    type = ParsedFunction
    expression = '1.0e2*t'
  []
  [stress31]
    type = ParsedFunction
    expression = '2.0e2*t'
  []
  [stress21]
    type = ParsedFunction
    expression = '-1.5e2*t'
  []
[]
[BCs]
  [Periodic]
    [x]
      variable = disp_x
      auto_direction = 'x y z'
    []
    [y]
      variable = disp_y
      auto_direction = 'x y z'
    []
    [z]
      variable = disp_z
      auto_direction = 'x y z'
    []
  []
  [fix1_x]
    type = DirichletBC
    boundary = "fix_all"
    variable = disp_x
    value = 0
  []
  [fix1_y]
    type = DirichletBC
    boundary = "fix_all"
    variable = disp_y
    value = 0
  []
  [fix1_z]
    type = DirichletBC
    boundary = "fix_all"
    variable = disp_z
    value = 0
  []
  [fix2_x]
    type = DirichletBC
    boundary = "fix_xy"
    variable = disp_x
    value = 0
  []
  [fix2_y]
    type = DirichletBC
    boundary = "fix_xy"
    variable = disp_y
    value = 0
  []
  [fix3_z]
    type = DirichletBC
    boundary = "fix_z"
    variable = disp_z
    value = 0
  []
[]
[Materials]
  [elastic_tensor_1]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 100000.0
    poissons_ratio = 0.3
    block = '1'
  []
  [elastic_tensor_2]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 120000.0
    poissons_ratio = 0.21
    block = '2'
  []
  [elastic_tensor_3]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 80000.0
    poissons_ratio = 0.4
    block = '3'
  []
  [elastic_tensor_4]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 76000.0
    poissons_ratio = 0.11
    block = '4'
  []
  [compute_stress]
    type = ComputeLagrangianLinearElasticStress
  []
  [compute_strain]
    type = ComputeLagrangianStrain
    homogenization_gradient_names = 'homogenization_gradient'
  []
  [compute_homogenization_gradient]
    type = ComputeHomogenizedLagrangianStrain
  []
[]
[Postprocessors]
  [s11]
    type = ElementAverageValue
    variable = s11
    execute_on = 'initial timestep_end'
  []
  [s21]
    type = ElementAverageValue
    variable = s21
    execute_on = 'initial timestep_end'
  []
  [s31]
    type = ElementAverageValue
    variable = s31
    execute_on = 'initial timestep_end'
  []
  [s12]
    type = ElementAverageValue
    variable = s12
    execute_on = 'initial timestep_end'
  []
  [s22]
    type = ElementAverageValue
    variable = s22
    execute_on = 'initial timestep_end'
  []
  [s32]
    type = ElementAverageValue
    variable = s32
    execute_on = 'initial timestep_end'
  []
  [s13]
    type = ElementAverageValue
    variable = s13
    execute_on = 'initial timestep_end'
  []
  [s23]
    type = ElementAverageValue
    variable = s23
    execute_on = 'initial timestep_end'
  []
  [s33]
    type = ElementAverageValue
    variable = s33
    execute_on = 'initial timestep_end'
  []
  [F11]
    type = ElementAverageValue
    variable = F11
    execute_on = 'initial timestep_end'
  []
  [F21]
    type = ElementAverageValue
    variable = F21
    execute_on = 'initial timestep_end'
  []
  [F31]
    type = ElementAverageValue
    variable = F31
    execute_on = 'initial timestep_end'
  []
  [F12]
    type = ElementAverageValue
    variable = F12
    execute_on = 'initial timestep_end'
  []
  [F22]
    type = ElementAverageValue
    variable = F22
    execute_on = 'initial timestep_end'
  []
  [F32]
    type = ElementAverageValue
    variable = F32
    execute_on = 'initial timestep_end'
  []
  [F13]
    type = ElementAverageValue
    variable = F13
    execute_on = 'initial timestep_end'
  []
  [F23]
    type = ElementAverageValue
    variable = F23
    execute_on = 'initial timestep_end'
  []
  [F33]
    type = ElementAverageValue
    variable = F33
    execute_on = 'initial timestep_end'
  []
[]
[Executioner]
  type = Transient
  solve_type = 'newton'
  line_search = none
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  l_max_its = 2
  l_tol = 1e-14
  nl_max_its = 10
  nl_rel_tol = 1e-8
  nl_abs_tol = 1e-10
  start_time = 0.0
  dt = 0.2
  dtmin = 0.2
  end_time = 1.0
[]
[Outputs]
  csv = true
[]
(modules/solid_mechanics/test/tests/lagrangian/cartesian/total/homogenization/residual_and_jacobian/3d.i)
# 2D test with just strain control
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
  large_kinematics = true
  macro_gradient = hvar
  constraint_types = ${constraint_types}
  targets = ${targets}
[]
[Mesh]
  [base]
    type = FileMeshGenerator
    file = '3d.exo'
  []
  [sidesets]
    type = SideSetsFromNormalsGenerator
    input = base
    normals = '-1 0 0
                1 0 0
                0 -1 0
                0 1 0
            '
              '    0 0 -1
                0 0 1'
    fixed_normal = true
    new_boundary = 'left right bottom top back front'
  []
[]
[Variables]
  [disp_x]
  []
  [disp_y]
  []
  [disp_z]
  []
  [hvar]
    family = SCALAR
    order = NINTH
  []
[]
[AuxVariables]
  [s11]
    family = MONOMIAL
    order = CONSTANT
  []
  [s21]
    family = MONOMIAL
    order = CONSTANT
  []
  [s31]
    family = MONOMIAL
    order = CONSTANT
  []
  [s12]
    family = MONOMIAL
    order = CONSTANT
  []
  [s22]
    family = MONOMIAL
    order = CONSTANT
  []
  [s32]
    family = MONOMIAL
    order = CONSTANT
  []
  [s13]
    family = MONOMIAL
    order = CONSTANT
  []
  [s23]
    family = MONOMIAL
    order = CONSTANT
  []
  [s33]
    family = MONOMIAL
    order = CONSTANT
  []
  [F11]
    family = MONOMIAL
    order = CONSTANT
  []
  [F21]
    family = MONOMIAL
    order = CONSTANT
  []
  [F31]
    family = MONOMIAL
    order = CONSTANT
  []
  [F12]
    family = MONOMIAL
    order = CONSTANT
  []
  [F22]
    family = MONOMIAL
    order = CONSTANT
  []
  [F32]
    family = MONOMIAL
    order = CONSTANT
  []
  [F13]
    family = MONOMIAL
    order = CONSTANT
  []
  [F23]
    family = MONOMIAL
    order = CONSTANT
  []
  [F33]
    family = MONOMIAL
    order = CONSTANT
  []
[]
[AuxKernels]
  [s11]
    type = RankTwoAux
    variable = s11
    rank_two_tensor = pk1_stress
    index_i = 0
    index_j = 0
  []
  [s21]
    type = RankTwoAux
    variable = s21
    rank_two_tensor = pk1_stress
    index_i = 1
    index_j = 0
  []
  [s31]
    type = RankTwoAux
    variable = s31
    rank_two_tensor = pk1_stress
    index_i = 2
    index_j = 0
  []
  [s12]
    type = RankTwoAux
    variable = s12
    rank_two_tensor = pk1_stress
    index_i = 0
    index_j = 1
  []
  [s22]
    type = RankTwoAux
    variable = s22
    rank_two_tensor = pk1_stress
    index_i = 1
    index_j = 1
  []
  [s32]
    type = RankTwoAux
    variable = s32
    rank_two_tensor = pk1_stress
    index_i = 2
    index_j = 1
  []
  [s13]
    type = RankTwoAux
    variable = s13
    rank_two_tensor = pk1_stress
    index_i = 0
    index_j = 2
  []
  [s23]
    type = RankTwoAux
    variable = s23
    rank_two_tensor = pk1_stress
    index_i = 1
    index_j = 2
  []
  [s33]
    type = RankTwoAux
    variable = s33
    rank_two_tensor = pk1_stress
    index_i = 2
    index_j = 2
  []
  [F11]
    type = RankTwoAux
    variable = F11
    rank_two_tensor = deformation_gradient
    index_i = 0
    index_j = 0
  []
  [F21]
    type = RankTwoAux
    variable = F21
    rank_two_tensor = deformation_gradient
    index_i = 1
    index_j = 0
  []
  [F31]
    type = RankTwoAux
    variable = F31
    rank_two_tensor = deformation_gradient
    index_i = 2
    index_j = 0
  []
  [F12]
    type = RankTwoAux
    variable = F12
    rank_two_tensor = deformation_gradient
    index_i = 0
    index_j = 1
  []
  [F22]
    type = RankTwoAux
    variable = F22
    rank_two_tensor = deformation_gradient
    index_i = 1
    index_j = 1
  []
  [F32]
    type = RankTwoAux
    variable = F32
    rank_two_tensor = deformation_gradient
    index_i = 2
    index_j = 1
  []
  [F13]
    type = RankTwoAux
    variable = F13
    rank_two_tensor = deformation_gradient
    index_i = 0
    index_j = 2
  []
  [F23]
    type = RankTwoAux
    variable = F23
    rank_two_tensor = deformation_gradient
    index_i = 1
    index_j = 2
  []
  [F33]
    type = RankTwoAux
    variable = F33
    rank_two_tensor = deformation_gradient
    index_i = 2
    index_j = 2
  []
[]
[Kernels]
  [sdx]
    type = HomogenizedTotalLagrangianStressDivergence
    variable = disp_x
    component = 0
    scalar_variable = hvar
  []
  [sdy]
    type = HomogenizedTotalLagrangianStressDivergence
    variable = disp_y
    component = 1
    scalar_variable = hvar
  []
  [sdz]
    type = HomogenizedTotalLagrangianStressDivergence
    variable = disp_z
    component = 2
    scalar_variable = hvar
  []
[]
[Functions]
  [strain11]
    type = ParsedFunction
    expression = '8.0e-2*t'
  []
  [strain22]
    type = ParsedFunction
    expression = '-4.0e-2*t'
  []
  [strain33]
    type = ParsedFunction
    expression = '8.0e-2*t'
  []
  [strain23]
    type = ParsedFunction
    expression = '2.0e-2*t'
  []
  [strain13]
    type = ParsedFunction
    expression = '-7.0e-2*t'
  []
  [strain12]
    type = ParsedFunction
    expression = '1.0e-2*t'
  []
  [strain32]
    type = ParsedFunction
    expression = '1.0e-2*t'
  []
  [strain31]
    type = ParsedFunction
    expression = '2.0e-2*t'
  []
  [strain21]
    type = ParsedFunction
    expression = '-1.5e-2*t'
  []
  [stress11]
    type = ParsedFunction
    expression = '4.0e2*t'
  []
  [stress22]
    type = ParsedFunction
    expression = '-2.0e2*t'
  []
  [stress33]
    type = ParsedFunction
    expression = '8.0e2*t'
  []
  [stress23]
    type = ParsedFunction
    expression = '2.0e2*t'
  []
  [stress13]
    type = ParsedFunction
    expression = '-7.0e2*t'
  []
  [stress12]
    type = ParsedFunction
    expression = '1.0e2*t'
  []
  [stress32]
    type = ParsedFunction
    expression = '1.0e2*t'
  []
  [stress31]
    type = ParsedFunction
    expression = '2.0e2*t'
  []
  [stress21]
    type = ParsedFunction
    expression = '-1.5e2*t'
  []
[]
[BCs]
  [Periodic]
    [x]
      variable = disp_x
      auto_direction = 'x y z'
    []
    [y]
      variable = disp_y
      auto_direction = 'x y z'
    []
    [z]
      variable = disp_z
      auto_direction = 'x y z'
    []
  []
  [fix1_x]
    type = DirichletBC
    boundary = "fix_all"
    variable = disp_x
    value = 0
  []
  [fix1_y]
    type = DirichletBC
    boundary = "fix_all"
    variable = disp_y
    value = 0
  []
  [fix1_z]
    type = DirichletBC
    boundary = "fix_all"
    variable = disp_z
    value = 0
  []
  [fix2_x]
    type = DirichletBC
    boundary = "fix_xy"
    variable = disp_x
    value = 0
  []
  [fix2_y]
    type = DirichletBC
    boundary = "fix_xy"
    variable = disp_y
    value = 0
  []
  [fix3_z]
    type = DirichletBC
    boundary = "fix_z"
    variable = disp_z
    value = 0
  []
[]
[Materials]
  [elastic_tensor_1]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 100000.0
    poissons_ratio = 0.3
    block = '1'
  []
  [elastic_tensor_2]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 120000.0
    poissons_ratio = 0.21
    block = '2'
  []
  [elastic_tensor_3]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 80000.0
    poissons_ratio = 0.4
    block = '3'
  []
  [elastic_tensor_4]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 76000.0
    poissons_ratio = 0.11
    block = '4'
  []
  [compute_stress]
    type = ComputeLagrangianLinearElasticStress
  []
  [compute_strain]
    type = ComputeLagrangianStrain
    homogenization_gradient_names = 'homogenization_gradient'
  []
  [compute_homogenization_gradient]
    type = ComputeHomogenizedLagrangianStrain
  []
[]
[Postprocessors]
  [s11]
    type = ElementAverageValue
    variable = s11
    execute_on = 'initial timestep_end'
  []
  [s21]
    type = ElementAverageValue
    variable = s21
    execute_on = 'initial timestep_end'
  []
  [s31]
    type = ElementAverageValue
    variable = s31
    execute_on = 'initial timestep_end'
  []
  [s12]
    type = ElementAverageValue
    variable = s12
    execute_on = 'initial timestep_end'
  []
  [s22]
    type = ElementAverageValue
    variable = s22
    execute_on = 'initial timestep_end'
  []
  [s32]
    type = ElementAverageValue
    variable = s32
    execute_on = 'initial timestep_end'
  []
  [s13]
    type = ElementAverageValue
    variable = s13
    execute_on = 'initial timestep_end'
  []
  [s23]
    type = ElementAverageValue
    variable = s23
    execute_on = 'initial timestep_end'
  []
  [s33]
    type = ElementAverageValue
    variable = s33
    execute_on = 'initial timestep_end'
  []
  [F11]
    type = ElementAverageValue
    variable = F11
    execute_on = 'initial timestep_end'
  []
  [F21]
    type = ElementAverageValue
    variable = F21
    execute_on = 'initial timestep_end'
  []
  [F31]
    type = ElementAverageValue
    variable = F31
    execute_on = 'initial timestep_end'
  []
  [F12]
    type = ElementAverageValue
    variable = F12
    execute_on = 'initial timestep_end'
  []
  [F22]
    type = ElementAverageValue
    variable = F22
    execute_on = 'initial timestep_end'
  []
  [F32]
    type = ElementAverageValue
    variable = F32
    execute_on = 'initial timestep_end'
  []
  [F13]
    type = ElementAverageValue
    variable = F13
    execute_on = 'initial timestep_end'
  []
  [F23]
    type = ElementAverageValue
    variable = F23
    execute_on = 'initial timestep_end'
  []
  [F33]
    type = ElementAverageValue
    variable = F33
    execute_on = 'initial timestep_end'
  []
[]
[Executioner]
  type = Transient
  residual_and_jacobian_together = true
  solve_type = 'newton'
  line_search = none
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  l_max_its = 2
  l_tol = 1e-14
  nl_max_its = 10
  nl_rel_tol = 1e-8
  nl_abs_tol = 1e-10
  start_time = 0.0
  dt = 0.2
  dtmin = 0.2
  end_time = 1.0
[]
[Outputs]
  csv = true
[]
(modules/solid_mechanics/test/tests/lagrangian/cartesian/total/homogenization/small-tests/2d.i)
# 2D with mixed conditions on stress/strain
[GlobalParams]
  displacements = 'disp_x disp_y'
  large_kinematics = false
  macro_gradient = hvar
  constraint_types = ${constraint_types}
  targets = ${targets}
[]
[Mesh]
  [base]
    type = FileMeshGenerator
    file = '2d.exo'
  []
  [sidesets]
    type = SideSetsFromNormalsGenerator
    input = base
    normals = '-1 0 0
                1 0 0
                0 -1 0
                0 1 0'
    fixed_normal = true
    new_boundary = 'left right bottom top'
  []
[]
[Variables]
  [disp_x]
  []
  [disp_y]
  []
  [hvar]
    family = SCALAR
    order = THIRD
  []
[]
[AuxVariables]
  [sxx]
    family = MONOMIAL
    order = CONSTANT
  []
  [syy]
    family = MONOMIAL
    order = CONSTANT
  []
  [sxy]
    family = MONOMIAL
    order = CONSTANT
  []
  [exx]
    family = MONOMIAL
    order = CONSTANT
  []
  [eyy]
    family = MONOMIAL
    order = CONSTANT
  []
  [exy]
    family = MONOMIAL
    order = CONSTANT
  []
[]
[AuxKernels]
  [sxx]
    type = RankTwoAux
    variable = sxx
    rank_two_tensor = pk1_stress
    index_i = 0
    index_j = 0
  []
  [syy]
    type = RankTwoAux
    variable = syy
    rank_two_tensor = pk1_stress
    index_i = 1
    index_j = 1
  []
  [sxy]
    type = RankTwoAux
    variable = sxy
    rank_two_tensor = pk1_stress
    index_i = 0
    index_j = 1
  []
  [exx]
    type = RankTwoAux
    variable = exx
    rank_two_tensor = mechanical_strain
    index_i = 0
    index_j = 0
  []
  [eyy]
    type = RankTwoAux
    variable = eyy
    rank_two_tensor = mechanical_strain
    index_i = 1
    index_j = 1
  []
  [exy]
    type = RankTwoAux
    variable = exy
    rank_two_tensor = mechanical_strain
    index_i = 0
    index_j = 1
  []
[]
[Kernels]
  [sdx]
    type = HomogenizedTotalLagrangianStressDivergence
    variable = disp_x
    component = 0
    scalar_variable = hvar
  []
  [sdy]
    type = HomogenizedTotalLagrangianStressDivergence
    variable = disp_y
    component = 1
    scalar_variable = hvar
  []
[]
[Functions]
  [strain11]
    type = ParsedFunction
    expression = '4.0e-2*t'
  []
  [strain22]
    type = ParsedFunction
    expression = '-2.0e-2*t'
  []
  [strain12]
    type = ParsedFunction
    expression = '1.0e-2*t'
  []
  [stress11]
    type = ParsedFunction
    expression = '400*t'
  []
  [stress22]
    type = ParsedFunction
    expression = '-200*t'
  []
  [stress12]
    type = ParsedFunction
    expression = '100*t'
  []
[]
[BCs]
  [Periodic]
    [x]
      variable = disp_x
      auto_direction = 'x y'
    []
    [y]
      variable = disp_y
      auto_direction = 'x y'
    []
  []
  [fix1_x]
    type = DirichletBC
    boundary = "fix1"
    variable = disp_x
    value = 0
  []
  [fix1_y]
    type = DirichletBC
    boundary = "fix1"
    variable = disp_y
    value = 0
  []
  [fix2_y]
    type = DirichletBC
    boundary = "fix2"
    variable = disp_y
    value = 0
  []
[]
[Materials]
  [elastic_tensor_1]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 100000.0
    poissons_ratio = 0.3
    block = '1'
  []
  [elastic_tensor_2]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 120000.0
    poissons_ratio = 0.21
    block = '2'
  []
  [elastic_tensor_3]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 80000.0
    poissons_ratio = 0.4
    block = '3'
  []
  [compute_stress]
    type = ComputeLagrangianLinearElasticStress
  []
  [compute_strain]
    type = ComputeLagrangianStrain
    homogenization_gradient_names = 'homogenization_gradient'
  []
  [compute_homogenization_gradient]
    type = ComputeHomogenizedLagrangianStrain
  []
[]
[Postprocessors]
  [sxx]
    type = ElementAverageValue
    variable = sxx
    execute_on = 'initial timestep_end'
  []
  [syy]
    type = ElementAverageValue
    variable = syy
    execute_on = 'initial timestep_end'
  []
  [sxy]
    type = ElementAverageValue
    variable = sxy
    execute_on = 'initial timestep_end'
  []
  [exx]
    type = ElementAverageValue
    variable = exx
    execute_on = 'initial timestep_end'
  []
  [eyy]
    type = ElementAverageValue
    variable = eyy
    execute_on = 'initial timestep_end'
  []
  [exy]
    type = ElementAverageValue
    variable = exy
    execute_on = 'initial timestep_end'
  []
[]
[Executioner]
  type = Transient
  solve_type = 'newton'
  line_search = none
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  l_max_its = 2
  l_tol = 1e-14
  nl_max_its = 30
  nl_rel_tol = 1e-8
  nl_abs_tol = 1e-10
  start_time = 0.0
  dt = 0.2
  dtmin = 0.2
  end_time = 1.0
[]
[Outputs]
  csv = true
[]
(modules/solid_mechanics/test/tests/lagrangian/cartesian/total/homogenization/neml2/small_neml.i)
constraint_types = 'strain none none stress stress stress stress none stress'
targets = 'strain11 zero zero zero zero zero'
[Mesh]
  [base]
    type = FileMeshGenerator
    file = '3d.exo'
  []
  [sidesets]
    type = SideSetsFromNormalsGenerator
    input = base
    normals = '-1 0 0
                1 0 0
                0 -1 0
                0 1 0
                0 0 -1
                0 0 1'
    fixed_normal = true
    new_boundary = 'left right bottom top back front'
  []
[]
[BCs]
  [fix1_x]
    type = DirichletBC
    boundary = fix_all
    displacements = 'disp_x disp_y disp_z'
    matrix_tags = 'system time'
    value = 0
    variable = disp_x
    vector_tags = residual
  []
[]
[BCs]
  [fix1_y]
    type = DirichletBC
    boundary = fix_all
    displacements = 'disp_x disp_y disp_z'
    matrix_tags = 'system time'
    value = 0
    variable = disp_y
    vector_tags = residual
  []
[]
[BCs]
  [fix1_z]
    type = DirichletBC
    boundary = fix_all
    displacements = 'disp_x disp_y disp_z'
    matrix_tags = 'system time'
    value = 0
    variable = disp_z
    vector_tags = residual
  []
[]
[BCs]
  [fix2_x]
    type = DirichletBC
    boundary = fix_xy
    displacements = 'disp_x disp_y disp_z'
    matrix_tags = 'system time'
    value = 0
    variable = disp_x
    vector_tags = residual
  []
[]
[BCs]
  [fix2_y]
    type = DirichletBC
    boundary = fix_xy
    displacements = 'disp_x disp_y disp_z'
    matrix_tags = 'system time'
    value = 0
    variable = disp_y
    vector_tags = residual
  []
[]
[BCs]
  [fix3_z]
    type = DirichletBC
    boundary = fix_z
    displacements = 'disp_x disp_y disp_z'
    matrix_tags = 'system time'
    value = 0
    variable = disp_z
    vector_tags = residual
  []
[]
[Functions]
  [strain11]
    type = ParsedFunction
    expression = t
  []
[]
[Functions]
  [zero]
    type = ConstantFunction
    value = 0
  []
[]
[Materials]
  [compute_homogenization_gradient]
    type = ComputeHomogenizedLagrangianStrain
    constraint_types = ${constraint_types}
    targets = ${targets}
    macro_gradient = hvar
  []
  [compute_strain]
    type = ComputeLagrangianStrain
    homogenization_gradient_names = 'homogenization_gradient'
    displacements = 'disp_x disp_y disp_z'
  []
[]
[Materials]
  [neml2_stress_to_moose]
    type = NEML2ToMOOSESymmetricRankTwoTensorMaterialProperty
    block = ''
    from_neml2 = state/S
    neml2_executor = neml2_model_all
    outputs = none
    to_moose = neml2_stress
  []
  [neml2_jacobian_to_moose]
    type = NEML2ToMOOSESymmetricRankFourTensorMaterialProperty
    block = ''
    from_neml2 = state/S
    neml2_executor = neml2_model_all
    neml2_input_derivative = forces/E
    outputs = none
    to_moose = neml2_jacobian
  []
[]
[Materials]
  [convert_strain]
    type = RankTwoTensorToSymmetricRankTwoTensor
    from = mechanical_strain
    outputs = none
    to = neml2_strain
  []
[]
[Materials]
  [stress]
    type = ComputeLagrangianObjectiveCustomSymmetricStress
    custom_small_jacobian = neml2_jacobian
    custom_small_stress = neml2_stress
    large_kinematics = false
    outputs = none
  []
[]
[BCs]
  [Periodic]
    [x]
      variable = disp_x
      auto_direction = 'x y z'
    []
    [y]
      variable = disp_y
      auto_direction = 'x y z'
    []
    [z]
      variable = disp_z
      auto_direction = 'x y z'
    []
  []
[]
[UserObjects]
  [moose_strain_to_jacobian]
    type = MOOSESymmetricRankTwoTensorMaterialPropertyToNEML2
    block = ''
    execute_on = 'INITIAL LINEAR NONLINEAR'
    from_moose = neml2_strain
    to_neml2 = forces/E
  []
  [neml2_index_model_all]
    type = NEML2BatchIndexGenerator
    block = ''
    execute_on = 'INITIAL LINEAR NONLINEAR'
  []
  [neml2_model_all]
    type = NEML2ModelExecutor
    batch_index_generator = neml2_index_model_all
    device = cpu
    execute_on = 'INITIAL LINEAR NONLINEAR'
    gatherers = moose_strain_to_jacobian
    input = neml2_elastic.i
    model = model
    param_gatherers = ''
  []
[]
[Variables]
  [disp_x]
    type = MooseVariable
    family = LAGRANGE
    order = FIRST
  []
  [disp_y]
    type = MooseVariable
    family = LAGRANGE
    order = FIRST
  []
  [disp_z]
    type = MooseVariable
    family = LAGRANGE
    order = FIRST
  []
  [hvar]
    type = MooseVariableScalar
    family = SCALAR
    order = SIXTH
  []
[]
[AuxKernels]
  [cauchy_stress_xx_all]
    type = MaterialRealAux
    block = ''
    execute_on = TIMESTEP_END
    property = cauchy_stress_xx
    variable = cauchy_stress_xx
  []
  [cauchy_stress_xy_all]
    type = MaterialRealAux
    block = ''
    execute_on = TIMESTEP_END
    property = cauchy_stress_xy
    variable = cauchy_stress_xy
  []
  [cauchy_stress_xz_all]
    type = MaterialRealAux
    block = ''
    execute_on = TIMESTEP_END
    property = cauchy_stress_xz
    variable = cauchy_stress_xz
  []
  [cauchy_stress_yx_all]
    type = MaterialRealAux
    block = ''
    execute_on = TIMESTEP_END
    property = cauchy_stress_yx
    variable = cauchy_stress_yx
  []
  [cauchy_stress_yy_all]
    type = MaterialRealAux
    block = ''
    execute_on = TIMESTEP_END
    property = cauchy_stress_yy
    variable = cauchy_stress_yy
  []
  [cauchy_stress_yz_all]
    type = MaterialRealAux
    block = ''
    execute_on = TIMESTEP_END
    property = cauchy_stress_yz
    variable = cauchy_stress_yz
  []
  [cauchy_stress_zx_all]
    type = MaterialRealAux
    block = ''
    execute_on = TIMESTEP_END
    property = cauchy_stress_zx
    variable = cauchy_stress_zx
  []
  [cauchy_stress_zy_all]
    type = MaterialRealAux
    block = ''
    execute_on = TIMESTEP_END
    property = cauchy_stress_zy
    variable = cauchy_stress_zy
  []
  [cauchy_stress_zz_all]
    type = MaterialRealAux
    block = ''
    execute_on = TIMESTEP_END
    property = cauchy_stress_zz
    variable = cauchy_stress_zz
  []
  [deformation_gradient_xx_all]
    type = MaterialRealAux
    block = ''
    execute_on = TIMESTEP_END
    property = deformation_gradient_xx
    variable = deformation_gradient_xx
  []
  [deformation_gradient_xy_all]
    type = MaterialRealAux
    block = ''
    execute_on = TIMESTEP_END
    property = deformation_gradient_xy
    variable = deformation_gradient_xy
  []
  [deformation_gradient_xz_all]
    type = MaterialRealAux
    block = ''
    execute_on = TIMESTEP_END
    property = deformation_gradient_xz
    variable = deformation_gradient_xz
  []
  [deformation_gradient_yx_all]
    type = MaterialRealAux
    block = ''
    execute_on = TIMESTEP_END
    property = deformation_gradient_yx
    variable = deformation_gradient_yx
  []
  [deformation_gradient_yy_all]
    type = MaterialRealAux
    block = ''
    execute_on = TIMESTEP_END
    property = deformation_gradient_yy
    variable = deformation_gradient_yy
  []
  [deformation_gradient_yz_all]
    type = MaterialRealAux
    block = ''
    execute_on = TIMESTEP_END
    property = deformation_gradient_yz
    variable = deformation_gradient_yz
  []
  [deformation_gradient_zx_all]
    type = MaterialRealAux
    block = ''
    execute_on = TIMESTEP_END
    property = deformation_gradient_zx
    variable = deformation_gradient_zx
  []
  [deformation_gradient_zy_all]
    type = MaterialRealAux
    block = ''
    execute_on = TIMESTEP_END
    property = deformation_gradient_zy
    variable = deformation_gradient_zy
  []
  [deformation_gradient_zz_all]
    type = MaterialRealAux
    block = ''
    execute_on = TIMESTEP_END
    property = deformation_gradient_zz
    variable = deformation_gradient_zz
  []
[]
[AuxVariables]
  [cauchy_stress_xx]
    type = MooseVariableConstMonomial
    family = MONOMIAL
    order = CONSTANT
  []
  [cauchy_stress_xy]
    type = MooseVariableConstMonomial
    family = MONOMIAL
    order = CONSTANT
  []
  [cauchy_stress_xz]
    type = MooseVariableConstMonomial
    family = MONOMIAL
    order = CONSTANT
  []
  [cauchy_stress_yx]
    type = MooseVariableConstMonomial
    family = MONOMIAL
    order = CONSTANT
  []
  [cauchy_stress_yy]
    type = MooseVariableConstMonomial
    family = MONOMIAL
    order = CONSTANT
  []
  [cauchy_stress_yz]
    type = MooseVariableConstMonomial
    family = MONOMIAL
    order = CONSTANT
  []
  [cauchy_stress_zx]
    type = MooseVariableConstMonomial
    family = MONOMIAL
    order = CONSTANT
  []
  [cauchy_stress_zy]
    type = MooseVariableConstMonomial
    family = MONOMIAL
    order = CONSTANT
  []
  [cauchy_stress_zz]
    type = MooseVariableConstMonomial
    family = MONOMIAL
    order = CONSTANT
  []
  [deformation_gradient_xx]
    type = MooseVariableConstMonomial
    family = MONOMIAL
    order = CONSTANT
  []
  [deformation_gradient_xy]
    type = MooseVariableConstMonomial
    family = MONOMIAL
    order = CONSTANT
  []
  [deformation_gradient_xz]
    type = MooseVariableConstMonomial
    family = MONOMIAL
    order = CONSTANT
  []
  [deformation_gradient_yx]
    type = MooseVariableConstMonomial
    family = MONOMIAL
    order = CONSTANT
  []
  [deformation_gradient_yy]
    type = MooseVariableConstMonomial
    family = MONOMIAL
    order = CONSTANT
  []
  [deformation_gradient_yz]
    type = MooseVariableConstMonomial
    family = MONOMIAL
    order = CONSTANT
  []
  [deformation_gradient_zx]
    type = MooseVariableConstMonomial
    family = MONOMIAL
    order = CONSTANT
  []
  [deformation_gradient_zy]
    type = MooseVariableConstMonomial
    family = MONOMIAL
    order = CONSTANT
  []
  [deformation_gradient_zz]
    type = MooseVariableConstMonomial
    family = MONOMIAL
    order = CONSTANT
  []
[]
[Kernels]
  [TM_all0]
    type = HomogenizedTotalLagrangianStressDivergence
    component = 0
    displacements = 'disp_x disp_y disp_z'
    large_kinematics = false
    stabilize_strain = false
    variable = disp_x
    macro_var = hvar
    constraint_types = ${constraint_types}
    targets = ${targets}
  []
  [TM_all1]
    type = HomogenizedTotalLagrangianStressDivergence
    component = 1
    displacements = 'disp_x disp_y disp_z'
    large_kinematics = false
    stabilize_strain = false
    variable = disp_y
    macro_var = hvar
    constraint_types = ${constraint_types}
    targets = ${targets}
  []
  [TM_all2]
    type = HomogenizedTotalLagrangianStressDivergence
    component = 2
    displacements = 'disp_x disp_y disp_z'
    large_kinematics = false
    stabilize_strain = false
    variable = disp_z
    macro_var = hvar
    constraint_types = ${constraint_types}
    targets = ${targets}
  []
[]
[Materials]
  [cauchy_stress_xx_all]
    type = RankTwoCartesianComponent
    block = ''
    index_i = 0
    index_j = 0
    outputs = none
    property_name = cauchy_stress_xx
    rank_two_tensor = cauchy_stress
  []
  [cauchy_stress_xy_all]
    type = RankTwoCartesianComponent
    block = ''
    index_i = 0
    index_j = 1
    outputs = none
    property_name = cauchy_stress_xy
    rank_two_tensor = cauchy_stress
  []
  [cauchy_stress_xz_all]
    type = RankTwoCartesianComponent
    block = ''
    index_i = 0
    index_j = 2
    outputs = none
    property_name = cauchy_stress_xz
    rank_two_tensor = cauchy_stress
  []
  [cauchy_stress_yx_all]
    type = RankTwoCartesianComponent
    block = ''
    index_i = 1
    index_j = 0
    outputs = none
    property_name = cauchy_stress_yx
    rank_two_tensor = cauchy_stress
  []
  [cauchy_stress_yy_all]
    type = RankTwoCartesianComponent
    block = ''
    index_i = 1
    index_j = 1
    outputs = none
    property_name = cauchy_stress_yy
    rank_two_tensor = cauchy_stress
  []
  [cauchy_stress_yz_all]
    type = RankTwoCartesianComponent
    block = ''
    index_i = 1
    index_j = 2
    outputs = none
    property_name = cauchy_stress_yz
    rank_two_tensor = cauchy_stress
  []
  [cauchy_stress_zx_all]
    type = RankTwoCartesianComponent
    block = ''
    index_i = 2
    index_j = 0
    outputs = none
    property_name = cauchy_stress_zx
    rank_two_tensor = cauchy_stress
  []
  [cauchy_stress_zy_all]
    type = RankTwoCartesianComponent
    block = ''
    index_i = 2
    index_j = 1
    outputs = none
    property_name = cauchy_stress_zy
    rank_two_tensor = cauchy_stress
  []
  [cauchy_stress_zz_all]
    type = RankTwoCartesianComponent
    block = ''
    index_i = 2
    index_j = 2
    outputs = none
    property_name = cauchy_stress_zz
    rank_two_tensor = cauchy_stress
  []
  [deformation_gradient_xx_all]
    type = RankTwoCartesianComponent
    block = ''
    index_i = 0
    index_j = 0
    outputs = none
    property_name = deformation_gradient_xx
    rank_two_tensor = deformation_gradient
  []
  [deformation_gradient_xy_all]
    type = RankTwoCartesianComponent
    block = ''
    index_i = 0
    index_j = 1
    outputs = none
    property_name = deformation_gradient_xy
    rank_two_tensor = deformation_gradient
  []
  [deformation_gradient_xz_all]
    type = RankTwoCartesianComponent
    block = ''
    index_i = 0
    index_j = 2
    outputs = none
    property_name = deformation_gradient_xz
    rank_two_tensor = deformation_gradient
  []
  [deformation_gradient_yx_all]
    type = RankTwoCartesianComponent
    block = ''
    index_i = 1
    index_j = 0
    outputs = none
    property_name = deformation_gradient_yx
    rank_two_tensor = deformation_gradient
  []
  [deformation_gradient_yy_all]
    type = RankTwoCartesianComponent
    block = ''
    index_i = 1
    index_j = 1
    outputs = none
    property_name = deformation_gradient_yy
    rank_two_tensor = deformation_gradient
  []
  [deformation_gradient_yz_all]
    type = RankTwoCartesianComponent
    block = ''
    index_i = 1
    index_j = 2
    outputs = none
    property_name = deformation_gradient_yz
    rank_two_tensor = deformation_gradient
  []
  [deformation_gradient_zx_all]
    type = RankTwoCartesianComponent
    block = ''
    index_i = 2
    index_j = 0
    outputs = none
    property_name = deformation_gradient_zx
    rank_two_tensor = deformation_gradient
  []
  [deformation_gradient_zy_all]
    type = RankTwoCartesianComponent
    block = ''
    index_i = 2
    index_j = 1
    outputs = none
    property_name = deformation_gradient_zy
    rank_two_tensor = deformation_gradient
  []
  [deformation_gradient_zz_all]
    type = RankTwoCartesianComponent
    block = ''
    index_i = 2
    index_j = 2
    outputs = none
    property_name = deformation_gradient_zz
    rank_two_tensor = deformation_gradient
  []
[]
[Executioner]
  type = Transient
  residual_and_jacobian_together = true
  solve_type = 'newton'
  line_search = 'none'
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  l_max_its = 2
  l_tol = 1e-14
  nl_max_its = 20
  nl_rel_tol = 1e-8
  nl_abs_tol = 1e-10
  start_time = 0.0
  dt = 0.2
  dtmin = 0.2
  end_time = 1.0
[]
[Outputs]
  [out]
    type = Exodus
  []
[]
[Postprocessors]
  [time]
    type = TimePostprocessor
    execute_on = 'INITIAL TIMESTEP_BEGIN'
  []
  [mCS_xx]
    type = ElementAverageValue
    variable = cauchy_stress_xx
  []
  [mCS_yy]
    type = ElementAverageValue
    variable = cauchy_stress_yy
  []
  [mCS_zz]
    type = ElementAverageValue
    variable = cauchy_stress_zz
  []
  [mCS_xy]
    type = ElementAverageValue
    variable = cauchy_stress_xy
  []
  [mCS_xz]
    type = ElementAverageValue
    variable = cauchy_stress_xz
  []
  [mCS_yx]
    type = ElementAverageValue
    variable = cauchy_stress_yx
  []
  [mCS_yz]
    type = ElementAverageValue
    variable = cauchy_stress_yz
  []
  [mCS_zy]
    type = ElementAverageValue
    variable = cauchy_stress_zy
  []
  [mCS_zx]
    type = ElementAverageValue
    variable = cauchy_stress_zx
  []
[]
(modules/solid_mechanics/test/tests/lagrangian/cartesian/total/homogenization/action/noaction_3d.i)
# 3D test with just mixed stress strain control
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
  large_kinematics = true
[]
[Mesh]
  [base]
    type = FileMeshGenerator
    file = '3d.exo'
  []
  [sidesets]
    type = SideSetsFromNormalsGenerator
    input = base
    normals = '-1 0 0
                1 0 0
                0 -1 0
                0 1 0
            '
              '    0 0 -1
                0 0 1'
    fixed_normal = true
    new_boundary = 'left right bottom top back front'
  []
[]
[Variables]
  [disp_x]
  []
  [disp_y]
  []
  [disp_z]
  []
  [hvar]
    family = SCALAR
    order = NINTH
  []
[]
[AuxVariables]
  [pk1_stress_xx]
    family = MONOMIAL
    order = CONSTANT
  []
  [pk1_stress_yx]
    family = MONOMIAL
    order = CONSTANT
  []
  [pk1_stress_zx]
    family = MONOMIAL
    order = CONSTANT
  []
  [pk1_stress_xy]
    family = MONOMIAL
    order = CONSTANT
  []
  [pk1_stress_yy]
    family = MONOMIAL
    order = CONSTANT
  []
  [pk1_stress_zy]
    family = MONOMIAL
    order = CONSTANT
  []
  [pk1_stress_xz]
    family = MONOMIAL
    order = CONSTANT
  []
  [pk1_stress_yz]
    family = MONOMIAL
    order = CONSTANT
  []
  [pk1_stress_zz]
    family = MONOMIAL
    order = CONSTANT
  []
  [deformation_gradient_xx]
    family = MONOMIAL
    order = CONSTANT
  []
  [deformation_gradient_yx]
    family = MONOMIAL
    order = CONSTANT
  []
  [deformation_gradient_zx]
    family = MONOMIAL
    order = CONSTANT
  []
  [deformation_gradient_xy]
    family = MONOMIAL
    order = CONSTANT
  []
  [deformation_gradient_yy]
    family = MONOMIAL
    order = CONSTANT
  []
  [deformation_gradient_zy]
    family = MONOMIAL
    order = CONSTANT
  []
  [deformation_gradient_xz]
    family = MONOMIAL
    order = CONSTANT
  []
  [deformation_gradient_yz]
    family = MONOMIAL
    order = CONSTANT
  []
  [deformation_gradient_zz]
    family = MONOMIAL
    order = CONSTANT
  []
[]
[AuxKernels]
  [pk1_stress_xx]
    type = RankTwoAux
    variable = pk1_stress_xx
    rank_two_tensor = pk1_stress
    index_i = 0
    index_j = 0
  []
  [pk1_stress_yx]
    type = RankTwoAux
    variable = pk1_stress_yx
    rank_two_tensor = pk1_stress
    index_i = 1
    index_j = 0
  []
  [pk1_stress_zx]
    type = RankTwoAux
    variable = pk1_stress_zx
    rank_two_tensor = pk1_stress
    index_i = 2
    index_j = 0
  []
  [pk1_stress_xy]
    type = RankTwoAux
    variable = pk1_stress_xy
    rank_two_tensor = pk1_stress
    index_i = 0
    index_j = 1
  []
  [pk1_stress_yy]
    type = RankTwoAux
    variable = pk1_stress_yy
    rank_two_tensor = pk1_stress
    index_i = 1
    index_j = 1
  []
  [pk1_stress_zy]
    type = RankTwoAux
    variable = pk1_stress_zy
    rank_two_tensor = pk1_stress
    index_i = 2
    index_j = 1
  []
  [pk1_stress_xz]
    type = RankTwoAux
    variable = pk1_stress_xz
    rank_two_tensor = pk1_stress
    index_i = 0
    index_j = 2
  []
  [pk1_stress_yz]
    type = RankTwoAux
    variable = pk1_stress_yz
    rank_two_tensor = pk1_stress
    index_i = 1
    index_j = 2
  []
  [pk1_stress_zz]
    type = RankTwoAux
    variable = pk1_stress_zz
    rank_two_tensor = pk1_stress
    index_i = 2
    index_j = 2
  []
  [deformation_gradient_xx]
    type = RankTwoAux
    variable = deformation_gradient_xx
    rank_two_tensor = deformation_gradient
    index_i = 0
    index_j = 0
  []
  [deformation_gradient_yx]
    type = RankTwoAux
    variable = deformation_gradient_yx
    rank_two_tensor = deformation_gradient
    index_i = 1
    index_j = 0
  []
  [deformation_gradient_zx]
    type = RankTwoAux
    variable = deformation_gradient_zx
    rank_two_tensor = deformation_gradient
    index_i = 2
    index_j = 0
  []
  [deformation_gradient_xy]
    type = RankTwoAux
    variable = deformation_gradient_xy
    rank_two_tensor = deformation_gradient
    index_i = 0
    index_j = 1
  []
  [deformation_gradient_yy]
    type = RankTwoAux
    variable = deformation_gradient_yy
    rank_two_tensor = deformation_gradient
    index_i = 1
    index_j = 1
  []
  [deformation_gradient_zy]
    type = RankTwoAux
    variable = deformation_gradient_zy
    rank_two_tensor = deformation_gradient
    index_i = 2
    index_j = 1
  []
  [deformation_gradient_xz]
    type = RankTwoAux
    variable = deformation_gradient_xz
    rank_two_tensor = deformation_gradient
    index_i = 0
    index_j = 2
  []
  [deformation_gradient_yz]
    type = RankTwoAux
    variable = deformation_gradient_yz
    rank_two_tensor = deformation_gradient
    index_i = 1
    index_j = 2
  []
  [deformation_gradient_zz]
    type = RankTwoAux
    variable = deformation_gradient_zz
    rank_two_tensor = deformation_gradient
    index_i = 2
    index_j = 2
  []
[]
[Kernels]
  [sdx]
    type = HomogenizedTotalLagrangianStressDivergence
    variable = disp_x
    component = 0
    constraint_types = 'stress strain strain strain stress strain strain strain strain'
    targets = 'stress11 strain21 strain31 strain12 stress22 strain32 strain13 strain23 strain33'
    scalar_variable = hvar
  []
  [sdy]
    type = HomogenizedTotalLagrangianStressDivergence
    variable = disp_y
    component = 1
    constraint_types = 'stress strain strain strain stress strain strain strain strain'
    targets = 'stress11 strain21 strain31 strain12 stress22 strain32 strain13 strain23 strain33'
    scalar_variable = hvar
  []
  [sdz]
    type = HomogenizedTotalLagrangianStressDivergence
    variable = disp_z
    component = 2
    constraint_types = 'stress strain strain strain stress strain strain strain strain'
    targets = 'stress11 strain21 strain31 strain12 stress22 strain32 strain13 strain23 strain33'
    scalar_variable = hvar
  []
[]
[Functions]
  [stress11]
    type = ParsedFunction
    expression = '120.0*t'
  []
  [stress22]
    type = ParsedFunction
    expression = '65*t'
  []
  [strain33]
    type = ParsedFunction
    expression = '8.0e-2*t'
  []
  [strain23]
    type = ParsedFunction
    expression = '2.0e-2*t'
  []
  [strain13]
    type = ParsedFunction
    expression = '-7.0e-2*t'
  []
  [strain12]
    type = ParsedFunction
    expression = '1.0e-2*t'
  []
  [strain32]
    type = ParsedFunction
    expression = '1.0e-2*t'
  []
  [strain31]
    type = ParsedFunction
    expression = '2.0e-2*t'
  []
  [strain21]
    type = ParsedFunction
    expression = '-1.5e-2*t'
  []
[]
[BCs]
  [Periodic]
    [x]
      variable = disp_x
      auto_direction = 'x y z'
    []
    [y]
      variable = disp_y
      auto_direction = 'x y z'
    []
    [z]
      variable = disp_z
      auto_direction = 'x y z'
    []
  []
  [fix1_x]
    type = DirichletBC
    boundary = "fix_all"
    variable = disp_x
    value = 0
  []
  [fix1_y]
    type = DirichletBC
    boundary = "fix_all"
    variable = disp_y
    value = 0
  []
  [fix1_z]
    type = DirichletBC
    boundary = "fix_all"
    variable = disp_z
    value = 0
  []
  [fix2_x]
    type = DirichletBC
    boundary = "fix_xy"
    variable = disp_x
    value = 0
  []
  [fix2_y]
    type = DirichletBC
    boundary = "fix_xy"
    variable = disp_y
    value = 0
  []
  [fix3_z]
    type = DirichletBC
    boundary = "fix_z"
    variable = disp_z
    value = 0
  []
[]
[Materials]
  [elastic_tensor_1]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 100000.0
    poissons_ratio = 0.3
    block = '1'
  []
  [elastic_tensor_2]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 120000.0
    poissons_ratio = 0.21
    block = '2'
  []
  [elastic_tensor_3]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 80000.0
    poissons_ratio = 0.4
    block = '3'
  []
  [elastic_tensor_4]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 76000.0
    poissons_ratio = 0.11
    block = '4'
  []
  [compute_stress]
    type = ComputeLagrangianLinearElasticStress
  []
  [compute_strain]
    type = ComputeLagrangianStrain
    homogenization_gradient_names = 'homogenization_gradient'
  []
  [compute_homogenization_gradient]
    type = ComputeHomogenizedLagrangianStrain
    macro_gradient = hvar
    constraint_types = 'stress strain strain strain stress strain strain strain strain'
    targets = 'stress11 strain21 strain31 strain12 stress22 strain32 strain13 strain23 strain33'
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  solve_type = 'newton'
  line_search = none
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  l_max_its = 2
  l_tol = 1e-14
  nl_max_its = 20
  nl_rel_tol = 1e-8
  nl_abs_tol = 1e-10
  start_time = 0.0
  dt = 0.2
  dtmin = 0.2
  end_time = 1.0
[]
[Outputs]
  file_base = 3d
  exodus = true
[]
(modules/solid_mechanics/test/tests/lagrangian/cartesian/total/homogenization/convergence/sd-stress.i)
# 3D test with stress control
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
  large_kinematics = false
  constraint_types = 'stress none none stress stress none stress stress stress'
  targets = 'stress11 stress12 stress22 stress13 stress23 stress33'
  macro_gradient = hvar
[]
[Mesh]
  [base]
    type = FileMeshGenerator
    file = '3d.exo'
  []
  [sidesets]
    type = SideSetsFromNormalsGenerator
    input = base
    normals = '-1 0 0
                1 0 0
                0 -1 0
                0 1 0
            '
              '    0 0 -1
                0 0 1'
    fixed_normal = true
    new_boundary = 'left right bottom top back front'
  []
[]
[Variables]
  [disp_x]
  []
  [disp_y]
  []
  [disp_z]
  []
  [hvar]
    family = SCALAR
    order = SIXTH
  []
[]
[ICs]
  [disp_x]
    type = RandomIC
    variable = disp_x
    min = -0.1
    max = 0.1
  []
  [disp_y]
    type = RandomIC
    variable = disp_y
    min = -0.1
    max = 0.1
  []
  [disp_z]
    type = RandomIC
    variable = disp_z
    min = -0.1
    max = 0.1
  []
  [hvar]
    type = ScalarConstantIC
    variable = hvar
    value = 0.1
  []
[]
[AuxVariables]
  [sxx]
    family = MONOMIAL
    order = CONSTANT
  []
  [syy]
    family = MONOMIAL
    order = CONSTANT
  []
  [sxy]
    family = MONOMIAL
    order = CONSTANT
  []
  [szz]
    family = MONOMIAL
    order = CONSTANT
  []
  [syz]
    family = MONOMIAL
    order = CONSTANT
  []
  [sxz]
    family = MONOMIAL
    order = CONSTANT
  []
  [exx]
    family = MONOMIAL
    order = CONSTANT
  []
  [eyy]
    family = MONOMIAL
    order = CONSTANT
  []
  [exy]
    family = MONOMIAL
    order = CONSTANT
  []
  [ezz]
    family = MONOMIAL
    order = CONSTANT
  []
  [eyz]
    family = MONOMIAL
    order = CONSTANT
  []
  [exz]
    family = MONOMIAL
    order = CONSTANT
  []
[]
[AuxKernels]
  [sxx]
    type = RankTwoAux
    variable = sxx
    rank_two_tensor = pk1_stress
    index_i = 0
    index_j = 0
  []
  [syy]
    type = RankTwoAux
    variable = syy
    rank_two_tensor = pk1_stress
    index_i = 1
    index_j = 1
  []
  [sxy]
    type = RankTwoAux
    variable = sxy
    rank_two_tensor = pk1_stress
    index_i = 0
    index_j = 1
  []
  [zz]
    type = RankTwoAux
    variable = szz
    rank_two_tensor = pk1_stress
    index_i = 2
    index_j = 2
  []
  [syz]
    type = RankTwoAux
    variable = syz
    rank_two_tensor = pk1_stress
    index_i = 1
    index_j = 2
  []
  [sxz]
    type = RankTwoAux
    variable = sxz
    rank_two_tensor = pk1_stress
    index_i = 0
    index_j = 2
  []
  [exx]
    type = RankTwoAux
    variable = exx
    rank_two_tensor = mechanical_strain
    index_i = 0
    index_j = 0
  []
  [eyy]
    type = RankTwoAux
    variable = eyy
    rank_two_tensor = mechanical_strain
    index_i = 1
    index_j = 1
  []
  [exy]
    type = RankTwoAux
    variable = exy
    rank_two_tensor = mechanical_strain
    index_i = 0
    index_j = 1
  []
  [ezz]
    type = RankTwoAux
    variable = ezz
    rank_two_tensor = mechanical_strain
    index_i = 2
    index_j = 2
  []
  [eyz]
    type = RankTwoAux
    variable = eyz
    rank_two_tensor = mechanical_strain
    index_i = 1
    index_j = 2
  []
  [exz]
    type = RankTwoAux
    variable = exz
    rank_two_tensor = mechanical_strain
    index_i = 0
    index_j = 2
  []
[]
[Kernels]
  [sdx]
    type = HomogenizedTotalLagrangianStressDivergence
    variable = disp_x
    component = 0
    scalar_variable = hvar
  []
  [sdy]
    type = HomogenizedTotalLagrangianStressDivergence
    variable = disp_y
    component = 1
    scalar_variable = hvar
  []
  [sdz]
    type = HomogenizedTotalLagrangianStressDivergence
    variable = disp_z
    component = 2
    scalar_variable = hvar
  []
[]
[Functions]
  [stress11]
    type = ParsedFunction
    expression = '4.0e2*t'
  []
  [stress22]
    type = ParsedFunction
    expression = '-2.0e2*t'
  []
  [stress33]
    type = ParsedFunction
    expression = '8.0e2*t'
  []
  [stress23]
    type = ParsedFunction
    expression = '2.0e2*t'
  []
  [stress13]
    type = ParsedFunction
    expression = '-7.0e2*t'
  []
  [stress12]
    type = ParsedFunction
    expression = '1.0e2*t'
  []
[]
[BCs]
  [Periodic]
    [x]
      variable = disp_x
      auto_direction = 'x y z'
    []
    [y]
      variable = disp_y
      auto_direction = 'x y z'
    []
    [z]
      variable = disp_z
      auto_direction = 'x y z'
    []
  []
  [fix1_x]
    type = DirichletBC
    boundary = "fix_all"
    variable = disp_x
    value = 0
  []
  [fix1_y]
    type = DirichletBC
    boundary = "fix_all"
    variable = disp_y
    value = 0
  []
  [fix1_z]
    type = DirichletBC
    boundary = "fix_all"
    variable = disp_z
    value = 0
  []
  [fix2_x]
    type = DirichletBC
    boundary = "fix_xy"
    variable = disp_x
    value = 0
  []
  [fix2_y]
    type = DirichletBC
    boundary = "fix_xy"
    variable = disp_y
    value = 0
  []
  [fix3_z]
    type = DirichletBC
    boundary = "fix_z"
    variable = disp_z
    value = 0
  []
[]
[Materials]
  [elastic_tensor_1]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 100000.0
    poissons_ratio = 0.3
    block = '1'
  []
  [elastic_tensor_2]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 120000.0
    poissons_ratio = 0.21
    block = '2'
  []
  [elastic_tensor_3]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 80000.0
    poissons_ratio = 0.4
    block = '3'
  []
  [elastic_tensor_4]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 76000.0
    poissons_ratio = 0.11
    block = '4'
  []
  [compute_stress]
    type = ComputeLagrangianLinearElasticStress
  []
  [compute_strain]
    type = ComputeLagrangianStrain
    homogenization_gradient_names = 'homogenization_gradient'
  []
  [compute_homogenization_gradient]
    type = ComputeHomogenizedLagrangianStrain
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Postprocessors]
  [sxx]
    type = ElementAverageValue
    variable = sxx
    execute_on = 'initial timestep_end'
  []
  [syy]
    type = ElementAverageValue
    variable = syy
    execute_on = 'initial timestep_end'
  []
  [sxy]
    type = ElementAverageValue
    variable = sxy
    execute_on = 'initial timestep_end'
  []
  [szz]
    type = ElementAverageValue
    variable = szz
    execute_on = 'initial timestep_end'
  []
  [syz]
    type = ElementAverageValue
    variable = syz
    execute_on = 'initial timestep_end'
  []
  [sxz]
    type = ElementAverageValue
    variable = sxz
    execute_on = 'initial timestep_end'
  []
  [exx]
    type = ElementAverageValue
    variable = exx
    execute_on = 'initial timestep_end'
  []
  [eyy]
    type = ElementAverageValue
    variable = eyy
    execute_on = 'initial timestep_end'
  []
  [exy]
    type = ElementAverageValue
    variable = exy
    execute_on = 'initial timestep_end'
  []
  [ezz]
    type = ElementAverageValue
    variable = ezz
    execute_on = 'initial timestep_end'
  []
  [eyz]
    type = ElementAverageValue
    variable = eyz
    execute_on = 'initial timestep_end'
  []
  [exz]
    type = ElementAverageValue
    variable = exz
    execute_on = 'initial timestep_end'
  []
[]
[Executioner]
  type = Transient
  solve_type = 'newton'
  line_search = none
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  l_max_its = 2
  l_tol = 1e-14
  nl_max_its = 10
  nl_rel_tol = 1e-8
  nl_abs_tol = 1e-10
  start_time = 0.0
  dt = 0.2
  dtmin = 0.2
  end_time = 0.2
[]
[Outputs]
  exodus = false
  csv = false
[]
(modules/solid_mechanics/test/tests/lagrangian/cartesian/total/homogenization/convergence/ld-strain.i)
# 2D test with just strain control
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
  large_kinematics = true
  constraint_types = 'strain strain strain strain strain strain strain strain strain'
  targets = 'strain11 strain21 strain31 strain12 strain22 strain32 strain13 strain23 strain33'
  macro_gradient = hvar
[]
[Mesh]
  [base]
    type = FileMeshGenerator
    file = '3d.exo'
  []
  [sidesets]
    type = SideSetsFromNormalsGenerator
    input = base
    normals = '-1 0 0
                1 0 0
                0 -1 0
                0 1 0
            '
              '    0 0 -1
                0 0 1'
    fixed_normal = true
    new_boundary = 'left right bottom top back front'
  []
[]
[Variables]
  [disp_x]
  []
  [disp_y]
  []
  [disp_z]
  []
  [hvar]
    family = SCALAR
    order = NINTH
  []
[]
[ICs]
  [disp_x]
    type = RandomIC
    variable = disp_x
    min = -0.1
    max = 0.1
  []
  [disp_y]
    type = RandomIC
    variable = disp_y
    min = -0.1
    max = 0.1
  []
  [disp_z]
    type = RandomIC
    variable = disp_z
    min = -0.1
    max = 0.1
  []
  [hvar]
    type = ScalarConstantIC
    variable = hvar
    value = 0.1
  []
[]
[AuxVariables]
  [s11]
    family = MONOMIAL
    order = CONSTANT
  []
  [s21]
    family = MONOMIAL
    order = CONSTANT
  []
  [s31]
    family = MONOMIAL
    order = CONSTANT
  []
  [s12]
    family = MONOMIAL
    order = CONSTANT
  []
  [s22]
    family = MONOMIAL
    order = CONSTANT
  []
  [s32]
    family = MONOMIAL
    order = CONSTANT
  []
  [s13]
    family = MONOMIAL
    order = CONSTANT
  []
  [s23]
    family = MONOMIAL
    order = CONSTANT
  []
  [s33]
    family = MONOMIAL
    order = CONSTANT
  []
  [F11]
    family = MONOMIAL
    order = CONSTANT
  []
  [F21]
    family = MONOMIAL
    order = CONSTANT
  []
  [F31]
    family = MONOMIAL
    order = CONSTANT
  []
  [F12]
    family = MONOMIAL
    order = CONSTANT
  []
  [F22]
    family = MONOMIAL
    order = CONSTANT
  []
  [F32]
    family = MONOMIAL
    order = CONSTANT
  []
  [F13]
    family = MONOMIAL
    order = CONSTANT
  []
  [F23]
    family = MONOMIAL
    order = CONSTANT
  []
  [F33]
    family = MONOMIAL
    order = CONSTANT
  []
[]
[AuxKernels]
  [s11]
    type = RankTwoAux
    variable = s11
    rank_two_tensor = pk1_stress
    index_i = 0
    index_j = 0
  []
  [s21]
    type = RankTwoAux
    variable = s21
    rank_two_tensor = pk1_stress
    index_i = 1
    index_j = 0
  []
  [s31]
    type = RankTwoAux
    variable = s31
    rank_two_tensor = pk1_stress
    index_i = 2
    index_j = 0
  []
  [s12]
    type = RankTwoAux
    variable = s12
    rank_two_tensor = pk1_stress
    index_i = 0
    index_j = 1
  []
  [s22]
    type = RankTwoAux
    variable = s22
    rank_two_tensor = pk1_stress
    index_i = 1
    index_j = 1
  []
  [s32]
    type = RankTwoAux
    variable = s32
    rank_two_tensor = pk1_stress
    index_i = 2
    index_j = 1
  []
  [s13]
    type = RankTwoAux
    variable = s13
    rank_two_tensor = pk1_stress
    index_i = 0
    index_j = 2
  []
  [s23]
    type = RankTwoAux
    variable = s23
    rank_two_tensor = pk1_stress
    index_i = 1
    index_j = 2
  []
  [s33]
    type = RankTwoAux
    variable = s33
    rank_two_tensor = pk1_stress
    index_i = 2
    index_j = 2
  []
  [F11]
    type = RankTwoAux
    variable = F11
    rank_two_tensor = deformation_gradient
    index_i = 0
    index_j = 0
  []
  [F21]
    type = RankTwoAux
    variable = F21
    rank_two_tensor = deformation_gradient
    index_i = 1
    index_j = 0
  []
  [F31]
    type = RankTwoAux
    variable = F31
    rank_two_tensor = deformation_gradient
    index_i = 2
    index_j = 0
  []
  [F12]
    type = RankTwoAux
    variable = F12
    rank_two_tensor = deformation_gradient
    index_i = 0
    index_j = 1
  []
  [F22]
    type = RankTwoAux
    variable = F22
    rank_two_tensor = deformation_gradient
    index_i = 1
    index_j = 1
  []
  [F32]
    type = RankTwoAux
    variable = F32
    rank_two_tensor = deformation_gradient
    index_i = 2
    index_j = 1
  []
  [F13]
    type = RankTwoAux
    variable = F13
    rank_two_tensor = deformation_gradient
    index_i = 0
    index_j = 2
  []
  [F23]
    type = RankTwoAux
    variable = F23
    rank_two_tensor = deformation_gradient
    index_i = 1
    index_j = 2
  []
  [F33]
    type = RankTwoAux
    variable = F33
    rank_two_tensor = deformation_gradient
    index_i = 2
    index_j = 2
  []
[]
[Kernels]
  [sdx]
    type = HomogenizedTotalLagrangianStressDivergence
    variable = disp_x
    component = 0
    scalar_variable = hvar
  []
  [sdy]
    type = HomogenizedTotalLagrangianStressDivergence
    variable = disp_y
    component = 1
    scalar_variable = hvar
  []
  [sdz]
    type = HomogenizedTotalLagrangianStressDivergence
    variable = disp_z
    component = 2
    scalar_variable = hvar
  []
[]
[Functions]
  [strain11]
    type = ParsedFunction
    expression = '8.0e-2*t'
  []
  [strain22]
    type = ParsedFunction
    expression = '-4.0e-2*t'
  []
  [strain33]
    type = ParsedFunction
    expression = '8.0e-2*t'
  []
  [strain23]
    type = ParsedFunction
    expression = '2.0e-2*t'
  []
  [strain13]
    type = ParsedFunction
    expression = '-7.0e-2*t'
  []
  [strain12]
    type = ParsedFunction
    expression = '1.0e-2*t'
  []
  [strain32]
    type = ParsedFunction
    expression = '1.0e-2*t'
  []
  [strain31]
    type = ParsedFunction
    expression = '2.0e-2*t'
  []
  [strain21]
    type = ParsedFunction
    expression = '-1.5e-2*t'
  []
  [zero]
    type = ConstantFunction
    value = 0
  []
[]
[BCs]
  [Periodic]
    [x]
      variable = disp_x
      auto_direction = 'x y z'
    []
    [y]
      variable = disp_y
      auto_direction = 'x y z'
    []
    [z]
      variable = disp_z
      auto_direction = 'x y z'
    []
  []
  [fix1_x]
    type = DirichletBC
    boundary = "fix_all"
    variable = disp_x
    value = 0
  []
  [fix1_y]
    type = DirichletBC
    boundary = "fix_all"
    variable = disp_y
    value = 0
  []
  [fix1_z]
    type = DirichletBC
    boundary = "fix_all"
    variable = disp_z
    value = 0
  []
  [fix2_x]
    type = DirichletBC
    boundary = "fix_xy"
    variable = disp_x
    value = 0
  []
  [fix2_y]
    type = DirichletBC
    boundary = "fix_xy"
    variable = disp_y
    value = 0
  []
  [fix3_z]
    type = DirichletBC
    boundary = "fix_z"
    variable = disp_z
    value = 0
  []
[]
[Materials]
  [elastic_tensor_1]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 100000.0
    poissons_ratio = 0.3
    block = '1'
  []
  [elastic_tensor_2]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 120000.0
    poissons_ratio = 0.21
    block = '2'
  []
  [elastic_tensor_3]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 80000.0
    poissons_ratio = 0.4
    block = '3'
  []
  [elastic_tensor_4]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 76000.0
    poissons_ratio = 0.11
    block = '4'
  []
  [compute_stress]
    type = ComputeLagrangianLinearElasticStress
  []
  [compute_strain]
    type = ComputeLagrangianStrain
    homogenization_gradient_names = 'homogenization_gradient'
  []
  [compute_homogenization_gradient]
    type = ComputeHomogenizedLagrangianStrain
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Postprocessors]
  [s11]
    type = ElementAverageValue
    variable = s11
    execute_on = 'initial timestep_end'
  []
  [s21]
    type = ElementAverageValue
    variable = s21
    execute_on = 'initial timestep_end'
  []
  [s31]
    type = ElementAverageValue
    variable = s31
    execute_on = 'initial timestep_end'
  []
  [s12]
    type = ElementAverageValue
    variable = s12
    execute_on = 'initial timestep_end'
  []
  [s22]
    type = ElementAverageValue
    variable = s22
    execute_on = 'initial timestep_end'
  []
  [s32]
    type = ElementAverageValue
    variable = s32
    execute_on = 'initial timestep_end'
  []
  [s13]
    type = ElementAverageValue
    variable = s13
    execute_on = 'initial timestep_end'
  []
  [s23]
    type = ElementAverageValue
    variable = s23
    execute_on = 'initial timestep_end'
  []
  [s33]
    type = ElementAverageValue
    variable = s33
    execute_on = 'initial timestep_end'
  []
  [F11]
    type = ElementAverageValue
    variable = F11
    execute_on = 'initial timestep_end'
  []
  [F21]
    type = ElementAverageValue
    variable = F21
    execute_on = 'initial timestep_end'
  []
  [F31]
    type = ElementAverageValue
    variable = F31
    execute_on = 'initial timestep_end'
  []
  [F12]
    type = ElementAverageValue
    variable = F12
    execute_on = 'initial timestep_end'
  []
  [F22]
    type = ElementAverageValue
    variable = F22
    execute_on = 'initial timestep_end'
  []
  [F32]
    type = ElementAverageValue
    variable = F32
    execute_on = 'initial timestep_end'
  []
  [F13]
    type = ElementAverageValue
    variable = F13
    execute_on = 'initial timestep_end'
  []
  [F23]
    type = ElementAverageValue
    variable = F23
    execute_on = 'initial timestep_end'
  []
  [F33]
    type = ElementAverageValue
    variable = F33
    execute_on = 'initial timestep_end'
  []
[]
[Executioner]
  type = Transient
  solve_type = 'newton'
  line_search = none
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  l_max_its = 2
  l_tol = 1e-14
  nl_max_its = 20
  nl_rel_tol = 1e-8
  nl_abs_tol = 1e-10
  start_time = 0.0
  dt = 0.2
  dtmin = 0.2
  end_time = 0.2
[]
[Outputs]
  exodus = false
  csv = false
[]
(modules/solid_mechanics/test/tests/lagrangian/cartesian/total/planar/generalized_plane_strain/pull_2D.i)
constraint_types = 'none none none none none none none none strain'
targets = '0'
[GlobalParams]
  displacements = 'disp_x disp_y'
  large_kinematics = true
  stabilize_strain = true
  macro_gradient = hvar
  constraint_types = ${constraint_types}
  targets = ${targets}
[]
[Mesh]
  [gmg]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 5
    ny = 5
  []
  use_displaced_mesh = false
[]
[Variables]
  [disp_x]
  []
  [disp_y]
  []
  [hvar]
    family = SCALAR
    order = FIRST
  []
[]
[Kernels]
  [sdx]
    type = HomogenizedTotalLagrangianStressDivergence
    variable = disp_x
    component = 0
    scalar_variable = hvar
  []
  [sdy]
    type = HomogenizedTotalLagrangianStressDivergence
    variable = disp_y
    component = 1
    scalar_variable = hvar
  []
[]
[BCs]
  [fix_x]
    type = DirichletBC
    variable = disp_x
    boundary = 'top bottom'
    value = 0
  []
  [fix_y]
    type = DirichletBC
    variable = disp_y
    boundary = 'bottom'
    value = 0
  []
  [disp_y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'top'
    function = 't'
  []
[]
[Materials]
  [elastic_tensor]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 1000.0
    poissons_ratio = 0.25
  []
  [compute_homogenization_gradient]
    type = ComputeHomogenizedLagrangianStrain
  []
  [compute_strain]
    type = ComputeLagrangianStrain
    homogenization_gradient_names = 'homogenization_gradient'
  []
  [stress]
    type = ComputeLagrangianLinearElasticStress
  []
  [stress_zz]
    type = RankTwoCartesianComponent
    rank_two_tensor = cauchy_stress
    index_i = 2
    index_j = 2
    property_name = stress_zz
  []
  [strain_zz]
    type = RankTwoCartesianComponent
    rank_two_tensor = mechanical_strain
    index_i = 2
    index_j = 2
    property_name = strain_zz
  []
[]
[Executioner]
  type = Transient
  dt = 0.01
  end_time = 0.1
  solve_type = 'newton'
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  nl_abs_tol = 1e-10
  nl_rel_tol = 1e-10
[]
[Postprocessors]
  [strain_zz]
    type = ElementAverageMaterialProperty
    mat_prop = strain_zz
  []
  [stress_zz]
    type = ElementAverageMaterialProperty
    mat_prop = stress_zz
  []
[]
[Outputs]
  csv = true
[]
(modules/solid_mechanics/test/tests/lagrangian/cartesian/total/homogenization/convergence/sd-strain.i)
# 2D test with just strain control
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
  large_kinematics = false
  constraint_types = 'strain none none strain strain none strain strain strain'
  targets = 'strain11 strain12 strain22 strain13 strain23 strain33'
  macro_gradient = hvar
[]
[Mesh]
  [base]
    type = FileMeshGenerator
    file = '3d.exo'
  []
  [sidesets]
    type = SideSetsFromNormalsGenerator
    input = base
    normals = '-1 0 0
                1 0 0
                0 -1 0
                0 1 0
            '
              '    0 0 -1
                0 0 1'
    fixed_normal = true
    new_boundary = 'left right bottom top back front'
  []
[]
[Variables]
  [disp_x]
  []
  [disp_y]
  []
  [disp_z]
  []
  [hvar]
    family = SCALAR
    order = SIXTH
  []
[]
[ICs]
  [disp_x]
    type = RandomIC
    variable = disp_x
    min = -0.1
    max = 0.1
  []
  [disp_y]
    type = RandomIC
    variable = disp_y
    min = -0.1
    max = 0.1
  []
  [disp_z]
    type = RandomIC
    variable = disp_z
    min = -0.1
    max = 0.1
  []
  [hvar]
    type = ScalarConstantIC
    variable = hvar
    value = 0.1
  []
[]
[AuxVariables]
  [sxx]
    family = MONOMIAL
    order = CONSTANT
  []
  [syy]
    family = MONOMIAL
    order = CONSTANT
  []
  [sxy]
    family = MONOMIAL
    order = CONSTANT
  []
  [szz]
    family = MONOMIAL
    order = CONSTANT
  []
  [syz]
    family = MONOMIAL
    order = CONSTANT
  []
  [sxz]
    family = MONOMIAL
    order = CONSTANT
  []
  [exx]
    family = MONOMIAL
    order = CONSTANT
  []
  [eyy]
    family = MONOMIAL
    order = CONSTANT
  []
  [exy]
    family = MONOMIAL
    order = CONSTANT
  []
  [ezz]
    family = MONOMIAL
    order = CONSTANT
  []
  [eyz]
    family = MONOMIAL
    order = CONSTANT
  []
  [exz]
    family = MONOMIAL
    order = CONSTANT
  []
[]
[AuxKernels]
  [sxx]
    type = RankTwoAux
    variable = sxx
    rank_two_tensor = pk1_stress
    index_i = 0
    index_j = 0
  []
  [syy]
    type = RankTwoAux
    variable = syy
    rank_two_tensor = pk1_stress
    index_i = 1
    index_j = 1
  []
  [sxy]
    type = RankTwoAux
    variable = sxy
    rank_two_tensor = pk1_stress
    index_i = 0
    index_j = 1
  []
  [zz]
    type = RankTwoAux
    variable = szz
    rank_two_tensor = pk1_stress
    index_i = 2
    index_j = 2
  []
  [syz]
    type = RankTwoAux
    variable = syz
    rank_two_tensor = pk1_stress
    index_i = 1
    index_j = 2
  []
  [sxz]
    type = RankTwoAux
    variable = sxz
    rank_two_tensor = pk1_stress
    index_i = 0
    index_j = 2
  []
  [exx]
    type = RankTwoAux
    variable = exx
    rank_two_tensor = mechanical_strain
    index_i = 0
    index_j = 0
  []
  [eyy]
    type = RankTwoAux
    variable = eyy
    rank_two_tensor = mechanical_strain
    index_i = 1
    index_j = 1
  []
  [exy]
    type = RankTwoAux
    variable = exy
    rank_two_tensor = mechanical_strain
    index_i = 0
    index_j = 1
  []
  [ezz]
    type = RankTwoAux
    variable = ezz
    rank_two_tensor = mechanical_strain
    index_i = 2
    index_j = 2
  []
  [eyz]
    type = RankTwoAux
    variable = eyz
    rank_two_tensor = mechanical_strain
    index_i = 1
    index_j = 2
  []
  [exz]
    type = RankTwoAux
    variable = exz
    rank_two_tensor = mechanical_strain
    index_i = 0
    index_j = 2
  []
[]
[Kernels]
  [sdx]
    type = HomogenizedTotalLagrangianStressDivergence
    variable = disp_x
    component = 0
    scalar_variable = hvar
  []
  [sdy]
    type = HomogenizedTotalLagrangianStressDivergence
    variable = disp_y
    component = 1
    scalar_variable = hvar
  []
  [sdz]
    type = HomogenizedTotalLagrangianStressDivergence
    variable = disp_z
    component = 2
    scalar_variable = hvar
  []
[]
[Functions]
  [strain11]
    type = ParsedFunction
    expression = '4.0e-2*t'
  []
  [strain22]
    type = ParsedFunction
    expression = '-2.0e-2*t'
  []
  [strain33]
    type = ParsedFunction
    expression = '8.0e-2*t'
  []
  [strain23]
    type = ParsedFunction
    expression = '2.0e-2*t'
  []
  [strain13]
    type = ParsedFunction
    expression = '-7.0e-2*t'
  []
  [strain12]
    type = ParsedFunction
    expression = '1.0e-2*t'
  []
[]
[BCs]
  [Periodic]
    [x]
      variable = disp_x
      auto_direction = 'x y z'
    []
    [y]
      variable = disp_y
      auto_direction = 'x y z'
    []
    [z]
      variable = disp_z
      auto_direction = 'x y z'
    []
  []
  [fix1_x]
    type = DirichletBC
    boundary = "fix_all"
    variable = disp_x
    value = 0
  []
  [fix1_y]
    type = DirichletBC
    boundary = "fix_all"
    variable = disp_y
    value = 0
  []
  [fix1_z]
    type = DirichletBC
    boundary = "fix_all"
    variable = disp_z
    value = 0
  []
  [fix2_x]
    type = DirichletBC
    boundary = "fix_xy"
    variable = disp_x
    value = 0
  []
  [fix2_y]
    type = DirichletBC
    boundary = "fix_xy"
    variable = disp_y
    value = 0
  []
  [fix3_z]
    type = DirichletBC
    boundary = "fix_z"
    variable = disp_z
    value = 0
  []
[]
[Materials]
  [elastic_tensor_1]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 100000.0
    poissons_ratio = 0.3
    block = '1'
  []
  [elastic_tensor_2]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 120000.0
    poissons_ratio = 0.21
    block = '2'
  []
  [elastic_tensor_3]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 80000.0
    poissons_ratio = 0.4
    block = '3'
  []
  [elastic_tensor_4]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 76000.0
    poissons_ratio = 0.11
    block = '4'
  []
  [compute_stress]
    type = ComputeLagrangianLinearElasticStress
  []
  [compute_strain]
    type = ComputeLagrangianStrain
    homogenization_gradient_names = 'homogenization_gradient'
  []
  [compute_homogenization_gradient]
    type = ComputeHomogenizedLagrangianStrain
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Postprocessors]
  [sxx]
    type = ElementAverageValue
    variable = sxx
    execute_on = 'initial timestep_end'
  []
  [syy]
    type = ElementAverageValue
    variable = syy
    execute_on = 'initial timestep_end'
  []
  [sxy]
    type = ElementAverageValue
    variable = sxy
    execute_on = 'initial timestep_end'
  []
  [szz]
    type = ElementAverageValue
    variable = szz
    execute_on = 'initial timestep_end'
  []
  [syz]
    type = ElementAverageValue
    variable = syz
    execute_on = 'initial timestep_end'
  []
  [sxz]
    type = ElementAverageValue
    variable = sxz
    execute_on = 'initial timestep_end'
  []
  [exx]
    type = ElementAverageValue
    variable = exx
    execute_on = 'initial timestep_end'
  []
  [eyy]
    type = ElementAverageValue
    variable = eyy
    execute_on = 'initial timestep_end'
  []
  [exy]
    type = ElementAverageValue
    variable = exy
    execute_on = 'initial timestep_end'
  []
  [ezz]
    type = ElementAverageValue
    variable = ezz
    execute_on = 'initial timestep_end'
  []
  [eyz]
    type = ElementAverageValue
    variable = eyz
    execute_on = 'initial timestep_end'
  []
  [exz]
    type = ElementAverageValue
    variable = exz
    execute_on = 'initial timestep_end'
  []
[]
[Executioner]
  type = Transient
  solve_type = 'newton'
  line_search = none
  #automatic_scaling = true
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  l_max_its = 2
  l_tol = 1e-14
  nl_max_its = 10
  nl_rel_tol = 1e-8
  nl_abs_tol = 1e-10
  start_time = 0.0
  dt = 0.2
  dtmin = 0.2
  end_time = 0.2
[]
[Outputs]
  exodus = false
  csv = false
[]
(modules/solid_mechanics/test/tests/lagrangian/cartesian/total/homogenization/neml2/large_neml.i)
constraint_types = 'strain strain strain stress stress stress stress strain stress'
targets = 'strain11 zero zero zero zero zero zero zero zero'
[Mesh]
  [base]
    type = FileMeshGenerator
    file = '3d.exo'
  []
  [sidesets]
    type = SideSetsFromNormalsGenerator
    input = base
    normals = '-1 0 0
                1 0 0
                0 -1 0
                0 1 0
            '
              '    0 0 -1
                0 0 1'
    fixed_normal = true
    new_boundary = 'left right bottom top back front'
  []
[]
[BCs]
  [fix1_x]
    type = DirichletBC
    boundary = fix_all
    displacements = 'disp_x disp_y disp_z'
    matrix_tags = 'system time'
    value = 0
    variable = disp_x
    vector_tags = residual
  []
[]
[BCs]
  [fix1_y]
    type = DirichletBC
    boundary = fix_all
    displacements = 'disp_x disp_y disp_z'
    matrix_tags = 'system time'
    value = 0
    variable = disp_y
    vector_tags = residual
  []
[]
[BCs]
  [fix1_z]
    type = DirichletBC
    boundary = fix_all
    displacements = 'disp_x disp_y disp_z'
    matrix_tags = 'system time'
    value = 0
    variable = disp_z
    vector_tags = residual
  []
[]
[BCs]
  [fix2_x]
    type = DirichletBC
    boundary = fix_xy
    displacements = 'disp_x disp_y disp_z'
    matrix_tags = 'system time'
    value = 0
    variable = disp_x
    vector_tags = residual
  []
[]
[BCs]
  [fix2_y]
    type = DirichletBC
    boundary = fix_xy
    displacements = 'disp_x disp_y disp_z'
    matrix_tags = 'system time'
    value = 0
    variable = disp_y
    vector_tags = residual
  []
[]
[BCs]
  [fix3_z]
    type = DirichletBC
    boundary = fix_z
    displacements = 'disp_x disp_y disp_z'
    matrix_tags = 'system time'
    value = 0
    variable = disp_z
    vector_tags = residual
  []
[]
[BCs]
  [Periodic]
    [x]
      variable = disp_x
      auto_direction = 'x y z'
    []
    [y]
      variable = disp_y
      auto_direction = 'x y z'
    []
    [z]
      variable = disp_z
      auto_direction = 'x y z'
    []
  []
[]
[Functions]
  [strain11]
    type = ParsedFunction
    expression = 't'
  []
[]
[Functions]
  [zero]
    type = ConstantFunction
    value = 0
  []
[]
[Materials]
  [convert_strain]
    type = RankTwoTensorToSymmetricRankTwoTensor
    from = mechanical_strain
    outputs = none
    to = neml2_strain
  []
[]
[Materials]
  [stress]
    type = ComputeLagrangianObjectiveCustomSymmetricStress
    custom_small_jacobian = neml2_jacobian
    custom_small_stress = neml2_stress
    large_kinematics = true
    outputs = none
  []
  [compute_homogenization_gradient]
    type = ComputeHomogenizedLagrangianStrain
    constraint_types = ${constraint_types}
    targets = ${targets}
    macro_gradient = hvar
  []
  [compute_strain]
    type = ComputeLagrangianStrain
    homogenization_gradient_names = 'homogenization_gradient'
    displacements = 'disp_x disp_y disp_z'
    large_kinematics = true
  []
[]
[Materials]
  [material_neml2_to_moose_stress]
    type = NEML2ToMOOSESymmetricRankTwoTensorMaterialProperty
    block = ''
    from_neml2 = state/S
    neml2_executor = neml2_model_all
    outputs = none
    to_moose = neml2_stress
  []
  [material_neml2_to_moose_jacobian]
    type = NEML2ToMOOSESymmetricRankFourTensorMaterialProperty
    block = ''
    from_neml2 = state/S
    neml2_executor = neml2_model_all
    neml2_input_derivative = forces/E
    outputs = none
    to_moose = neml2_jacobian
  []
[]
[UserObjects]
  [UO_strain_moose_to_neml2]
    type = MOOSESymmetricRankTwoTensorMaterialPropertyToNEML2
    block = ''
    execute_on = 'INITIAL LINEAR NONLINEAR'
    from_moose = neml2_strain
    to_neml2 = forces/E
  []
  [neml2_index_model_all]
    type = NEML2BatchIndexGenerator
    block = ''
    execute_on = 'INITIAL LINEAR NONLINEAR'
  []
  [neml2_model_all]
    type = NEML2ModelExecutor
    batch_index_generator = neml2_index_model_all
    device = cpu
    execute_on = 'INITIAL LINEAR NONLINEAR'
    gatherers = UO_strain_moose_to_neml2
    input = neml2_elastic.i
    model = model
    param_gatherers = ''
    execution_order_group = 1
  []
[]
[Variables]
  [disp_x]
    type = MooseVariable
    family = LAGRANGE
    order = FIRST
  []
  [disp_y]
    type = MooseVariable
    family = LAGRANGE
    order = FIRST
  []
  [disp_z]
    type = MooseVariable
    family = LAGRANGE
    order = FIRST
  []
[]
[AuxKernels]
  [pk1_stress_xx_all]
    type = MaterialRealAux
    block = ''
    execute_on = TIMESTEP_END
    property = pk1_stress_xx
    variable = pk1_stress_xx
  []
  [pk1_stress_xy_all]
    type = MaterialRealAux
    block = ''
    execute_on = TIMESTEP_END
    property = pk1_stress_xy
    variable = pk1_stress_xy
  []
  [pk1_stress_xz_all]
    type = MaterialRealAux
    block = ''
    execute_on = TIMESTEP_END
    property = pk1_stress_xz
    variable = pk1_stress_xz
  []
  [pk1_stress_yx_all]
    type = MaterialRealAux
    block = ''
    execute_on = TIMESTEP_END
    property = pk1_stress_yx
    variable = pk1_stress_yx
  []
  [pk1_stress_yy_all]
    type = MaterialRealAux
    block = ''
    execute_on = TIMESTEP_END
    property = pk1_stress_yy
    variable = pk1_stress_yy
  []
  [pk1_stress_yz_all]
    type = MaterialRealAux
    block = ''
    execute_on = TIMESTEP_END
    property = pk1_stress_yz
    variable = pk1_stress_yz
  []
  [pk1_stress_zx_all]
    type = MaterialRealAux
    block = ''
    execute_on = TIMESTEP_END
    property = pk1_stress_zx
    variable = pk1_stress_zx
  []
  [pk1_stress_zy_all]
    type = MaterialRealAux
    block = ''
    execute_on = TIMESTEP_END
    property = pk1_stress_zy
    variable = pk1_stress_zy
  []
  [pk1_stress_zz_all]
    type = MaterialRealAux
    block = ''
    execute_on = TIMESTEP_END
    property = pk1_stress_zz
    variable = pk1_stress_zz
  []
  [deformation_gradient_xx_all]
    type = MaterialRealAux
    block = ''
    execute_on = TIMESTEP_END
    property = deformation_gradient_xx
    variable = deformation_gradient_xx
  []
  [deformation_gradient_xy_all]
    type = MaterialRealAux
    block = ''
    execute_on = TIMESTEP_END
    property = deformation_gradient_xy
    variable = deformation_gradient_xy
  []
  [deformation_gradient_xz_all]
    type = MaterialRealAux
    block = ''
    execute_on = TIMESTEP_END
    property = deformation_gradient_xz
    variable = deformation_gradient_xz
  []
  [deformation_gradient_yx_all]
    type = MaterialRealAux
    block = ''
    execute_on = TIMESTEP_END
    property = deformation_gradient_yx
    variable = deformation_gradient_yx
  []
  [deformation_gradient_yy_all]
    type = MaterialRealAux
    block = ''
    execute_on = TIMESTEP_END
    property = deformation_gradient_yy
    variable = deformation_gradient_yy
  []
  [deformation_gradient_yz_all]
    type = MaterialRealAux
    block = ''
    execute_on = TIMESTEP_END
    property = deformation_gradient_yz
    variable = deformation_gradient_yz
  []
  [deformation_gradient_zx_all]
    type = MaterialRealAux
    block = ''
    execute_on = TIMESTEP_END
    property = deformation_gradient_zx
    variable = deformation_gradient_zx
  []
  [deformation_gradient_zy_all]
    type = MaterialRealAux
    block = ''
    execute_on = TIMESTEP_END
    property = deformation_gradient_zy
    variable = deformation_gradient_zy
  []
  [deformation_gradient_zz_all]
    type = MaterialRealAux
    block = ''
    execute_on = TIMESTEP_END
    property = deformation_gradient_zz
    variable = deformation_gradient_zz
  []
[]
[AuxVariables]
  [pk1_stress_xx]
    type = MooseVariableConstMonomial
    family = MONOMIAL
    order = CONSTANT
  []
  [pk1_stress_xy]
    type = MooseVariableConstMonomial
    family = MONOMIAL
    order = CONSTANT
  []
  [pk1_stress_xz]
    type = MooseVariableConstMonomial
    family = MONOMIAL
    order = CONSTANT
  []
  [pk1_stress_yx]
    type = MooseVariableConstMonomial
    family = MONOMIAL
    order = CONSTANT
  []
  [pk1_stress_yy]
    type = MooseVariableConstMonomial
    family = MONOMIAL
    order = CONSTANT
  []
  [pk1_stress_yz]
    type = MooseVariableConstMonomial
    family = MONOMIAL
    order = CONSTANT
  []
  [pk1_stress_zx]
    type = MooseVariableConstMonomial
    family = MONOMIAL
    order = CONSTANT
  []
  [pk1_stress_zy]
    type = MooseVariableConstMonomial
    family = MONOMIAL
    order = CONSTANT
  []
  [pk1_stress_zz]
    type = MooseVariableConstMonomial
    family = MONOMIAL
    order = CONSTANT
  []
  [deformation_gradient_xx]
    type = MooseVariableConstMonomial
    family = MONOMIAL
    order = CONSTANT
  []
  [deformation_gradient_xy]
    type = MooseVariableConstMonomial
    family = MONOMIAL
    order = CONSTANT
  []
  [deformation_gradient_xz]
    type = MooseVariableConstMonomial
    family = MONOMIAL
    order = CONSTANT
  []
  [deformation_gradient_yx]
    type = MooseVariableConstMonomial
    family = MONOMIAL
    order = CONSTANT
  []
  [deformation_gradient_yy]
    type = MooseVariableConstMonomial
    family = MONOMIAL
    order = CONSTANT
  []
  [deformation_gradient_yz]
    type = MooseVariableConstMonomial
    family = MONOMIAL
    order = CONSTANT
  []
  [deformation_gradient_zx]
    type = MooseVariableConstMonomial
    family = MONOMIAL
    order = CONSTANT
  []
  [deformation_gradient_zy]
    type = MooseVariableConstMonomial
    family = MONOMIAL
    order = CONSTANT
  []
  [deformation_gradient_zz]
    type = MooseVariableConstMonomial
    family = MONOMIAL
    order = CONSTANT
  []
[]
[Kernels]
  [TM_all0]
    type = HomogenizedTotalLagrangianStressDivergence
    component = 0
    displacements = 'disp_x disp_y disp_z'
    large_kinematics = true
    stabilize_strain = false
    variable = disp_x
    macro_var = hvar
    constraint_types = ${constraint_types}
    targets = ${targets}
  []
  [TM_all1]
    type = HomogenizedTotalLagrangianStressDivergence
    component = 1
    displacements = 'disp_x disp_y disp_z'
    large_kinematics = true
    stabilize_strain = false
    variable = disp_y
    macro_var = hvar
    constraint_types = ${constraint_types}
    targets = ${targets}
  []
  [TM_all2]
    type = HomogenizedTotalLagrangianStressDivergence
    component = 2
    displacements = 'disp_x disp_y disp_z'
    large_kinematics = true
    stabilize_strain = false
    variable = disp_z
    macro_var = hvar
    constraint_types = ${constraint_types}
    targets = ${targets}
  []
[]
[Materials]
  [pk1_stress_xx_all]
    type = RankTwoCartesianComponent
    block = ''
    index_i = 0
    index_j = 0
    outputs = none
    property_name = pk1_stress_xx
    rank_two_tensor = pk1_stress
  []
  [pk1_stress_xy_all]
    type = RankTwoCartesianComponent
    block = ''
    index_i = 0
    index_j = 1
    outputs = none
    property_name = pk1_stress_xy
    rank_two_tensor = pk1_stress
  []
  [pk1_stress_xz_all]
    type = RankTwoCartesianComponent
    block = ''
    index_i = 0
    index_j = 2
    outputs = none
    property_name = pk1_stress_xz
    rank_two_tensor = pk1_stress
  []
  [pk1_stress_yx_all]
    type = RankTwoCartesianComponent
    block = ''
    index_i = 1
    index_j = 0
    outputs = none
    property_name = pk1_stress_yx
    rank_two_tensor = pk1_stress
  []
  [pk1_stress_yy_all]
    type = RankTwoCartesianComponent
    block = ''
    index_i = 1
    index_j = 1
    outputs = none
    property_name = pk1_stress_yy
    rank_two_tensor = pk1_stress
  []
  [pk1_stress_yz_all]
    type = RankTwoCartesianComponent
    block = ''
    index_i = 1
    index_j = 2
    outputs = none
    property_name = pk1_stress_yz
    rank_two_tensor = pk1_stress
  []
  [pk1_stress_zx_all]
    type = RankTwoCartesianComponent
    block = ''
    index_i = 2
    index_j = 0
    outputs = none
    property_name = pk1_stress_zx
    rank_two_tensor = pk1_stress
  []
  [pk1_stress_zy_all]
    type = RankTwoCartesianComponent
    block = ''
    index_i = 2
    index_j = 1
    outputs = none
    property_name = pk1_stress_zy
    rank_two_tensor = pk1_stress
  []
  [pk1_stress_zz_all]
    type = RankTwoCartesianComponent
    block = ''
    index_i = 2
    index_j = 2
    outputs = none
    property_name = pk1_stress_zz
    rank_two_tensor = pk1_stress
  []
  [deformation_gradient_xx_all]
    type = RankTwoCartesianComponent
    block = ''
    index_i = 0
    index_j = 0
    outputs = none
    property_name = deformation_gradient_xx
    rank_two_tensor = deformation_gradient
  []
  [deformation_gradient_xy_all]
    type = RankTwoCartesianComponent
    block = ''
    index_i = 0
    index_j = 1
    outputs = none
    property_name = deformation_gradient_xy
    rank_two_tensor = deformation_gradient
  []
  [deformation_gradient_xz_all]
    type = RankTwoCartesianComponent
    block = ''
    index_i = 0
    index_j = 2
    outputs = none
    property_name = deformation_gradient_xz
    rank_two_tensor = deformation_gradient
  []
  [deformation_gradient_yx_all]
    type = RankTwoCartesianComponent
    block = ''
    index_i = 1
    index_j = 0
    outputs = none
    property_name = deformation_gradient_yx
    rank_two_tensor = deformation_gradient
  []
  [deformation_gradient_yy_all]
    type = RankTwoCartesianComponent
    block = ''
    index_i = 1
    index_j = 1
    outputs = none
    property_name = deformation_gradient_yy
    rank_two_tensor = deformation_gradient
  []
  [deformation_gradient_yz_all]
    type = RankTwoCartesianComponent
    block = ''
    index_i = 1
    index_j = 2
    outputs = none
    property_name = deformation_gradient_yz
    rank_two_tensor = deformation_gradient
  []
  [deformation_gradient_zx_all]
    type = RankTwoCartesianComponent
    block = ''
    index_i = 2
    index_j = 0
    outputs = none
    property_name = deformation_gradient_zx
    rank_two_tensor = deformation_gradient
  []
  [deformation_gradient_zy_all]
    type = RankTwoCartesianComponent
    block = ''
    index_i = 2
    index_j = 1
    outputs = none
    property_name = deformation_gradient_zy
    rank_two_tensor = deformation_gradient
  []
  [deformation_gradient_zz_all]
    type = RankTwoCartesianComponent
    block = ''
    index_i = 2
    index_j = 2
    outputs = none
    property_name = deformation_gradient_zz
    rank_two_tensor = deformation_gradient
  []
[]
[Variables]
  [hvar]
    type = MooseVariableScalar
    family = SCALAR
    order = NINTH
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  residual_and_jacobian_together = true
  solve_type = 'newton'
  line_search = 'none'
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  l_max_its = 2
  l_tol = 1e-14
  nl_max_its = 20
  nl_rel_tol = 1e-8
  nl_abs_tol = 1e-10
  start_time = 0.0
  dt = 0.2
  dtmin = 0.2
  end_time = 1.0
[]
[Outputs]
  [out]
    type = Exodus
  []
[]
[Postprocessors]
  [time]
    type = TimePostprocessor
    execute_on = 'INITIAL TIMESTEP_BEGIN'
  []
  [mCS_xx]
    type     = ElementAverageValue
    variable = pk1_stress_xx
  []
  [mCS_yy]
    type     = ElementAverageValue
    variable = pk1_stress_yy
  []
  [mCS_zz]
    type     = ElementAverageValue
    variable = pk1_stress_zz
  []
  [mCS_xy]
    type     = ElementAverageValue
    variable = pk1_stress_xy
  []
  [mCS_xz]
    type     = ElementAverageValue
    variable = pk1_stress_xz
  []
  [mCS_yx]
    type     = ElementAverageValue
    variable = pk1_stress_yx
  []
  [mCS_yz]
    type     = ElementAverageValue
    variable = pk1_stress_yz
  []
  [mCS_zy]
    type     = ElementAverageValue
    variable = pk1_stress_zy
  []
  [mCS_zx]
    type     = ElementAverageValue
    variable = pk1_stress_zx
  []
[]
(modules/solid_mechanics/test/tests/lagrangian/cartesian/total/homogenization/action/noaction_2d.i)
# 2D with mixed conditions on stress/strain
[GlobalParams]
  displacements = 'disp_x disp_y'
  large_kinematics = false
[]
[Mesh]
  [base]
    type = FileMeshGenerator
    file = '2d.exo'
  []
  [sidesets]
    type = SideSetsFromNormalsGenerator
    input = base
    normals = '-1 0 0
                1 0 0
                0 -1 0
                0 1 0'
    fixed_normal = true
    new_boundary = 'left right bottom top'
  []
[]
[Variables]
  [disp_x]
  []
  [disp_y]
  []
  [hvar]
    family = SCALAR
    order = THIRD
  []
[]
[AuxVariables]
  [pk1_stress_xx]
    family = MONOMIAL
    order = CONSTANT
  []
  [pk1_stress_yx]
    family = MONOMIAL
    order = CONSTANT
  []
  [pk1_stress_zx]
    family = MONOMIAL
    order = CONSTANT
  []
  [pk1_stress_xy]
    family = MONOMIAL
    order = CONSTANT
  []
  [pk1_stress_yy]
    family = MONOMIAL
    order = CONSTANT
  []
  [pk1_stress_zy]
    family = MONOMIAL
    order = CONSTANT
  []
  [pk1_stress_xz]
    family = MONOMIAL
    order = CONSTANT
  []
  [pk1_stress_yz]
    family = MONOMIAL
    order = CONSTANT
  []
  [pk1_stress_zz]
    family = MONOMIAL
    order = CONSTANT
  []
  [deformation_gradient_xx]
    family = MONOMIAL
    order = CONSTANT
  []
  [deformation_gradient_yx]
    family = MONOMIAL
    order = CONSTANT
  []
  [deformation_gradient_zx]
    family = MONOMIAL
    order = CONSTANT
  []
  [deformation_gradient_xy]
    family = MONOMIAL
    order = CONSTANT
  []
  [deformation_gradient_yy]
    family = MONOMIAL
    order = CONSTANT
  []
  [deformation_gradient_zy]
    family = MONOMIAL
    order = CONSTANT
  []
  [deformation_gradient_xz]
    family = MONOMIAL
    order = CONSTANT
  []
  [deformation_gradient_yz]
    family = MONOMIAL
    order = CONSTANT
  []
  [deformation_gradient_zz]
    family = MONOMIAL
    order = CONSTANT
  []
[]
[AuxKernels]
  [pk1_stress_xx]
    type = RankTwoAux
    variable = pk1_stress_xx
    rank_two_tensor = pk1_stress
    index_i = 0
    index_j = 0
  []
  [pk1_stress_yx]
    type = RankTwoAux
    variable = pk1_stress_yx
    rank_two_tensor = pk1_stress
    index_i = 1
    index_j = 0
  []
  [pk1_stress_zx]
    type = RankTwoAux
    variable = pk1_stress_zx
    rank_two_tensor = pk1_stress
    index_i = 2
    index_j = 0
  []
  [pk1_stress_xy]
    type = RankTwoAux
    variable = pk1_stress_xy
    rank_two_tensor = pk1_stress
    index_i = 0
    index_j = 1
  []
  [pk1_stress_yy]
    type = RankTwoAux
    variable = pk1_stress_yy
    rank_two_tensor = pk1_stress
    index_i = 1
    index_j = 1
  []
  [pk1_stress_zy]
    type = RankTwoAux
    variable = pk1_stress_zy
    rank_two_tensor = pk1_stress
    index_i = 2
    index_j = 1
  []
  [pk1_stress_xz]
    type = RankTwoAux
    variable = pk1_stress_xz
    rank_two_tensor = pk1_stress
    index_i = 0
    index_j = 2
  []
  [pk1_stress_yz]
    type = RankTwoAux
    variable = pk1_stress_yz
    rank_two_tensor = pk1_stress
    index_i = 1
    index_j = 2
  []
  [pk1_stress_zz]
    type = RankTwoAux
    variable = pk1_stress_zz
    rank_two_tensor = pk1_stress
    index_i = 2
    index_j = 2
  []
  [deformation_gradient_xx]
    type = RankTwoAux
    variable = deformation_gradient_xx
    rank_two_tensor = deformation_gradient
    index_i = 0
    index_j = 0
  []
  [deformation_gradient_yx]
    type = RankTwoAux
    variable = deformation_gradient_yx
    rank_two_tensor = deformation_gradient
    index_i = 1
    index_j = 0
  []
  [deformation_gradient_zx]
    type = RankTwoAux
    variable = deformation_gradient_zx
    rank_two_tensor = deformation_gradient
    index_i = 2
    index_j = 0
  []
  [deformation_gradient_xy]
    type = RankTwoAux
    variable = deformation_gradient_xy
    rank_two_tensor = deformation_gradient
    index_i = 0
    index_j = 1
  []
  [deformation_gradient_yy]
    type = RankTwoAux
    variable = deformation_gradient_yy
    rank_two_tensor = deformation_gradient
    index_i = 1
    index_j = 1
  []
  [deformation_gradient_zy]
    type = RankTwoAux
    variable = deformation_gradient_zy
    rank_two_tensor = deformation_gradient
    index_i = 2
    index_j = 1
  []
  [deformation_gradient_xz]
    type = RankTwoAux
    variable = deformation_gradient_xz
    rank_two_tensor = deformation_gradient
    index_i = 0
    index_j = 2
  []
  [deformation_gradient_yz]
    type = RankTwoAux
    variable = deformation_gradient_yz
    rank_two_tensor = deformation_gradient
    index_i = 1
    index_j = 2
  []
  [deformation_gradient_zz]
    type = RankTwoAux
    variable = deformation_gradient_zz
    rank_two_tensor = deformation_gradient
    index_i = 2
    index_j = 2
  []
[]
[Kernels]
  [sdx]
    type = HomogenizedTotalLagrangianStressDivergence
    variable = disp_x
    component = 0
    scalar_variable = hvar
    constraint_types = 'stress none none stress strain none none none none'
    targets = 'stress11 stress12 strain22'
  []
  [sdy]
    type = HomogenizedTotalLagrangianStressDivergence
    variable = disp_y
    component = 1
    scalar_variable = hvar
    constraint_types = 'stress none none stress strain none none none none'
    targets = 'stress11 stress12 strain22'
  []
[]
[Functions]
  [stress11]
    type = ParsedFunction
    expression = '400*t'
  []
  [strain22]
    type = ParsedFunction
    expression = '-2.0e-2*t'
  []
  [stress12]
    type = ParsedFunction
    expression = '100*t'
  []
[]
[BCs]
  [Periodic]
    [x]
      variable = disp_x
      auto_direction = 'x y'
    []
    [y]
      variable = disp_y
      auto_direction = 'x y'
    []
  []
  [fix1_x]
    type = DirichletBC
    boundary = "fix1"
    variable = disp_x
    value = 0
  []
  [fix1_y]
    type = DirichletBC
    boundary = "fix1"
    variable = disp_y
    value = 0
  []
  [fix2_y]
    type = DirichletBC
    boundary = "fix2"
    variable = disp_y
    value = 0
  []
[]
[Materials]
  [elastic_tensor_1]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 100000.0
    poissons_ratio = 0.3
    block = '1'
  []
  [elastic_tensor_2]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 120000.0
    poissons_ratio = 0.21
    block = '2'
  []
  [elastic_tensor_3]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 80000.0
    poissons_ratio = 0.4
    block = '3'
  []
  [compute_stress]
    type = ComputeLagrangianLinearElasticStress
  []
  [compute_strain]
    type = ComputeLagrangianStrain
    homogenization_gradient_names = 'homogenization_gradient'
  []
  [compute_homogenization_gradient]
    type = ComputeHomogenizedLagrangianStrain
    constraint_types = 'stress none none stress strain none none none none'
    targets = 'stress11 stress12 strain22'
    macro_gradient = hvar
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  solve_type = 'newton'
  line_search = none
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  l_max_its = 2
  l_tol = 1e-14
  nl_max_its = 30
  nl_rel_tol = 1e-8
  nl_abs_tol = 1e-10
  start_time = 0.0
  dt = 0.2
  dtmin = 0.2
  end_time = 1.0
[]
[Outputs]
  file_base = 2d
  exodus = true
[]
(modules/solid_mechanics/test/tests/lagrangian/cartesian/total/homogenization/small-tests/1d.i)
# 1D strain controlled test
[GlobalParams]
  displacements = 'disp_x'
  large_kinematics = false
  macro_gradient = hvar
  constraint_types = ${constraint_types}
  targets = ${targets}
[]
[Mesh]
  [base]
    type = FileMeshGenerator
    file = '1d.exo'
  []
  [ss]
    type = SideSetsFromPointsGenerator
    input = base
    points = '-1 0 0
               7 0 0'
    new_boundary = 'left right'
  []
[]
[Variables]
  [disp_x]
  []
  [hvar]
    family = SCALAR
    order = FIRST
  []
[]
[AuxVariables]
  [sxx]
    family = MONOMIAL
    order = CONSTANT
  []
  [exx]
    family = MONOMIAL
    order = CONSTANT
  []
[]
[AuxKernels]
  [sxx]
    type = RankTwoAux
    variable = sxx
    rank_two_tensor = pk1_stress
    index_i = 0
    index_j = 0
  []
  [exx]
    type = RankTwoAux
    variable = exx
    rank_two_tensor = mechanical_strain
    index_i = 0
    index_j = 0
  []
[]
[Kernels]
  [sdx]
    type = HomogenizedTotalLagrangianStressDivergence
    variable = disp_x
    component = 0
    scalar_variable = hvar
  []
[]
[Functions]
  [func_stress]
    type = ParsedFunction
    expression = '1800*t'
  []
  [func_strain]
    type = ParsedFunction
    expression = '1.0e-2*t'
  []
[]
[BCs]
  [Periodic]
    [all]
      variable = disp_x
      auto_direction = 'x'
    []
  []
  [centerfix_x]
    type = DirichletBC
    boundary = "fixme"
    variable = disp_x
    value = 0
  []
[]
[Materials]
  [elastic_tensor_1]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 100000.0
    poissons_ratio = 0.3
    block = '1'
  []
  [elastic_tensor_2]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 120000.0
    poissons_ratio = 0.21
    block = '2'
  []
  [elastic_tensor_3]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 80000.0
    poissons_ratio = 0.4
    block = '3'
  []
  [elastic_tensor_4]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 76000.0
    poissons_ratio = 0.11
    block = '4'
  []
  [compute_stress]
    type = ComputeLagrangianLinearElasticStress
  []
  [compute_strain]
    type = ComputeLagrangianStrain
    homogenization_gradient_names = 'homogenization_gradient'
  []
  [compute_homogenization_gradient]
    type = ComputeHomogenizedLagrangianStrain
  []
[]
[Postprocessors]
  [sxx]
    type = ElementAverageValue
    variable = sxx
    execute_on = 'initial timestep_end'
  []
  [exx]
    type = ElementAverageValue
    variable = exx
    execute_on = 'initial timestep_end'
  []
[]
[Executioner]
  type = Transient
  solve_type = 'newton'
  line_search = default
  automatic_scaling = true
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  l_max_its = 2
  l_tol = 1e-14
  nl_max_its = 15
  nl_rel_tol = 1e-6
  nl_abs_tol = 1e-8
  start_time = 0.0
  dt = 0.2
  dtmin = 0.2
  end_time = 1.0
[]
[Outputs]
  exodus = false
  csv = true
[]
(modules/solid_mechanics/test/tests/lagrangian/cartesian/total/homogenization/small-tests/3d.i)
# 2D test with just strain control
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
  large_kinematics = false
  macro_gradient = hvar
  constraint_types = ${constraint_types}
  targets = ${targets}
[]
[Mesh]
  [base]
    type = FileMeshGenerator
    file = '3d.exo'
  []
  [sidesets]
    type = SideSetsFromNormalsGenerator
    input = base
    normals = '-1 0 0
                1 0 0
                0 -1 0
                0 1 0
            '
              '    0 0 -1
                0 0 1'
    fixed_normal = true
    new_boundary = 'left right bottom top back front'
  []
[]
[Variables]
  [disp_x]
  []
  [disp_y]
  []
  [disp_z]
  []
  [hvar]
    family = SCALAR
    order = SIXTH
  []
[]
[AuxVariables]
  [sxx]
    family = MONOMIAL
    order = CONSTANT
  []
  [syy]
    family = MONOMIAL
    order = CONSTANT
  []
  [sxy]
    family = MONOMIAL
    order = CONSTANT
  []
  [szz]
    family = MONOMIAL
    order = CONSTANT
  []
  [syz]
    family = MONOMIAL
    order = CONSTANT
  []
  [sxz]
    family = MONOMIAL
    order = CONSTANT
  []
  [exx]
    family = MONOMIAL
    order = CONSTANT
  []
  [eyy]
    family = MONOMIAL
    order = CONSTANT
  []
  [exy]
    family = MONOMIAL
    order = CONSTANT
  []
  [ezz]
    family = MONOMIAL
    order = CONSTANT
  []
  [eyz]
    family = MONOMIAL
    order = CONSTANT
  []
  [exz]
    family = MONOMIAL
    order = CONSTANT
  []
[]
[AuxKernels]
  [sxx]
    type = RankTwoAux
    variable = sxx
    rank_two_tensor = pk1_stress
    index_i = 0
    index_j = 0
  []
  [syy]
    type = RankTwoAux
    variable = syy
    rank_two_tensor = pk1_stress
    index_i = 1
    index_j = 1
  []
  [sxy]
    type = RankTwoAux
    variable = sxy
    rank_two_tensor = pk1_stress
    index_i = 0
    index_j = 1
  []
  [zz]
    type = RankTwoAux
    variable = szz
    rank_two_tensor = pk1_stress
    index_i = 2
    index_j = 2
  []
  [syz]
    type = RankTwoAux
    variable = syz
    rank_two_tensor = pk1_stress
    index_i = 1
    index_j = 2
  []
  [sxz]
    type = RankTwoAux
    variable = sxz
    rank_two_tensor = pk1_stress
    index_i = 0
    index_j = 2
  []
  [exx]
    type = RankTwoAux
    variable = exx
    rank_two_tensor = mechanical_strain
    index_i = 0
    index_j = 0
  []
  [eyy]
    type = RankTwoAux
    variable = eyy
    rank_two_tensor = mechanical_strain
    index_i = 1
    index_j = 1
  []
  [exy]
    type = RankTwoAux
    variable = exy
    rank_two_tensor = mechanical_strain
    index_i = 0
    index_j = 1
  []
  [ezz]
    type = RankTwoAux
    variable = ezz
    rank_two_tensor = mechanical_strain
    index_i = 2
    index_j = 2
  []
  [eyz]
    type = RankTwoAux
    variable = eyz
    rank_two_tensor = mechanical_strain
    index_i = 1
    index_j = 2
  []
  [exz]
    type = RankTwoAux
    variable = exz
    rank_two_tensor = mechanical_strain
    index_i = 0
    index_j = 2
  []
[]
[Kernels]
  [sdx]
    type = HomogenizedTotalLagrangianStressDivergence
    variable = disp_x
    component = 0
    scalar_variable = hvar
  []
  [sdy]
    type = HomogenizedTotalLagrangianStressDivergence
    variable = disp_y
    component = 1
    scalar_variable = hvar
  []
  [sdz]
    type = HomogenizedTotalLagrangianStressDivergence
    variable = disp_z
    component = 2
    scalar_variable = hvar
  []
[]
[Functions]
  [strain11]
    type = ParsedFunction
    expression = '4.0e-2*t'
  []
  [strain22]
    type = ParsedFunction
    expression = '-2.0e-2*t'
  []
  [strain33]
    type = ParsedFunction
    expression = '8.0e-2*t'
  []
  [strain23]
    type = ParsedFunction
    expression = '2.0e-2*t'
  []
  [strain13]
    type = ParsedFunction
    expression = '-7.0e-2*t'
  []
  [strain12]
    type = ParsedFunction
    expression = '1.0e-2*t'
  []
  [stress11]
    type = ParsedFunction
    expression = '4.0e2*t'
  []
  [stress22]
    type = ParsedFunction
    expression = '-2.0e2*t'
  []
  [stress33]
    type = ParsedFunction
    expression = '8.0e2*t'
  []
  [stress23]
    type = ParsedFunction
    expression = '2.0e2*t'
  []
  [stress13]
    type = ParsedFunction
    expression = '-7.0e2*t'
  []
  [stress12]
    type = ParsedFunction
    expression = '1.0e2*t'
  []
[]
[BCs]
  [Periodic]
    [x]
      variable = disp_x
      auto_direction = 'x y z'
    []
    [y]
      variable = disp_y
      auto_direction = 'x y z'
    []
    [z]
      variable = disp_z
      auto_direction = 'x y z'
    []
  []
  [fix1_x]
    type = DirichletBC
    boundary = "fix_all"
    variable = disp_x
    value = 0
  []
  [fix1_y]
    type = DirichletBC
    boundary = "fix_all"
    variable = disp_y
    value = 0
  []
  [fix1_z]
    type = DirichletBC
    boundary = "fix_all"
    variable = disp_z
    value = 0
  []
  [fix2_x]
    type = DirichletBC
    boundary = "fix_xy"
    variable = disp_x
    value = 0
  []
  [fix2_y]
    type = DirichletBC
    boundary = "fix_xy"
    variable = disp_y
    value = 0
  []
  [fix3_z]
    type = DirichletBC
    boundary = "fix_z"
    variable = disp_z
    value = 0
  []
[]
[Materials]
  [elastic_tensor_1]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 100000.0
    poissons_ratio = 0.3
    block = '1'
  []
  [elastic_tensor_2]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 120000.0
    poissons_ratio = 0.21
    block = '2'
  []
  [elastic_tensor_3]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 80000.0
    poissons_ratio = 0.4
    block = '3'
  []
  [elastic_tensor_4]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 76000.0
    poissons_ratio = 0.11
    block = '4'
  []
  [compute_stress]
    type = ComputeLagrangianLinearElasticStress
  []
  [compute_strain]
    type = ComputeLagrangianStrain
    homogenization_gradient_names = 'homogenization_gradient'
  []
  [compute_homogenization_gradient]
    type = ComputeHomogenizedLagrangianStrain
  []
[]
[Postprocessors]
  [sxx]
    type = ElementAverageValue
    variable = sxx
    execute_on = 'initial timestep_end'
  []
  [syy]
    type = ElementAverageValue
    variable = syy
    execute_on = 'initial timestep_end'
  []
  [sxy]
    type = ElementAverageValue
    variable = sxy
    execute_on = 'initial timestep_end'
  []
  [szz]
    type = ElementAverageValue
    variable = szz
    execute_on = 'initial timestep_end'
  []
  [syz]
    type = ElementAverageValue
    variable = syz
    execute_on = 'initial timestep_end'
  []
  [sxz]
    type = ElementAverageValue
    variable = sxz
    execute_on = 'initial timestep_end'
  []
  [exx]
    type = ElementAverageValue
    variable = exx
    execute_on = 'initial timestep_end'
  []
  [eyy]
    type = ElementAverageValue
    variable = eyy
    execute_on = 'initial timestep_end'
  []
  [exy]
    type = ElementAverageValue
    variable = exy
    execute_on = 'initial timestep_end'
  []
  [ezz]
    type = ElementAverageValue
    variable = ezz
    execute_on = 'initial timestep_end'
  []
  [eyz]
    type = ElementAverageValue
    variable = eyz
    execute_on = 'initial timestep_end'
  []
  [exz]
    type = ElementAverageValue
    variable = exz
    execute_on = 'initial timestep_end'
  []
[]
[Executioner]
  type = Transient
  solve_type = 'newton'
  line_search = none
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  l_max_its = 2
  l_tol = 1e-14
  nl_max_its = 10
  nl_rel_tol = 1e-8
  nl_abs_tol = 1e-10
  start_time = 0.0
  dt = 0.2
  dtmin = 0.2
  end_time = 1.0
[]
[Outputs]
  csv = true
[]
(modules/solid_mechanics/test/tests/lagrangian/cartesian/total/homogenization/large-tests/1d.i)
# 1D strain controlled test
[GlobalParams]
  displacements = 'disp_x'
  large_kinematics = true
  macro_gradient = hvar
  constraint_types = ${constraint_types}
  targets = ${targets}
[]
[Mesh]
  [base]
    type = FileMeshGenerator
    file = '1d.exo'
  []
  [ss]
    type = SideSetsFromPointsGenerator
    input = base
    points = '-1 0 0
               7 0 0'
    new_boundary = 'left right'
  []
[]
[Variables]
  [disp_x]
  []
  [hvar]
    family = SCALAR
    order = FIRST
  []
[]
[AuxVariables]
  [s11]
    family = MONOMIAL
    order = CONSTANT
  []
  [s21]
    family = MONOMIAL
    order = CONSTANT
  []
  [s31]
    family = MONOMIAL
    order = CONSTANT
  []
  [s12]
    family = MONOMIAL
    order = CONSTANT
  []
  [s22]
    family = MONOMIAL
    order = CONSTANT
  []
  [s32]
    family = MONOMIAL
    order = CONSTANT
  []
  [s13]
    family = MONOMIAL
    order = CONSTANT
  []
  [s23]
    family = MONOMIAL
    order = CONSTANT
  []
  [s33]
    family = MONOMIAL
    order = CONSTANT
  []
  [F11]
    family = MONOMIAL
    order = CONSTANT
  []
  [F21]
    family = MONOMIAL
    order = CONSTANT
  []
  [F31]
    family = MONOMIAL
    order = CONSTANT
  []
  [F12]
    family = MONOMIAL
    order = CONSTANT
  []
  [F22]
    family = MONOMIAL
    order = CONSTANT
  []
  [F32]
    family = MONOMIAL
    order = CONSTANT
  []
  [F13]
    family = MONOMIAL
    order = CONSTANT
  []
  [F23]
    family = MONOMIAL
    order = CONSTANT
  []
  [F33]
    family = MONOMIAL
    order = CONSTANT
  []
[]
[AuxKernels]
  [s11]
    type = RankTwoAux
    variable = s11
    rank_two_tensor = pk1_stress
    index_i = 0
    index_j = 0
  []
  [s21]
    type = RankTwoAux
    variable = s21
    rank_two_tensor = pk1_stress
    index_i = 1
    index_j = 0
  []
  [s31]
    type = RankTwoAux
    variable = s31
    rank_two_tensor = pk1_stress
    index_i = 2
    index_j = 0
  []
  [s12]
    type = RankTwoAux
    variable = s12
    rank_two_tensor = pk1_stress
    index_i = 0
    index_j = 1
  []
  [s22]
    type = RankTwoAux
    variable = s22
    rank_two_tensor = pk1_stress
    index_i = 1
    index_j = 1
  []
  [s32]
    type = RankTwoAux
    variable = s32
    rank_two_tensor = pk1_stress
    index_i = 2
    index_j = 1
  []
  [s13]
    type = RankTwoAux
    variable = s13
    rank_two_tensor = pk1_stress
    index_i = 0
    index_j = 2
  []
  [s23]
    type = RankTwoAux
    variable = s23
    rank_two_tensor = pk1_stress
    index_i = 1
    index_j = 2
  []
  [s33]
    type = RankTwoAux
    variable = s33
    rank_two_tensor = pk1_stress
    index_i = 2
    index_j = 2
  []
  [F11]
    type = RankTwoAux
    variable = F11
    rank_two_tensor = deformation_gradient
    index_i = 0
    index_j = 0
  []
  [F21]
    type = RankTwoAux
    variable = F21
    rank_two_tensor = deformation_gradient
    index_i = 1
    index_j = 0
  []
  [F31]
    type = RankTwoAux
    variable = F31
    rank_two_tensor = deformation_gradient
    index_i = 2
    index_j = 0
  []
  [F12]
    type = RankTwoAux
    variable = F12
    rank_two_tensor = deformation_gradient
    index_i = 0
    index_j = 1
  []
  [F22]
    type = RankTwoAux
    variable = F22
    rank_two_tensor = deformation_gradient
    index_i = 1
    index_j = 1
  []
  [F32]
    type = RankTwoAux
    variable = F32
    rank_two_tensor = deformation_gradient
    index_i = 2
    index_j = 1
  []
  [F13]
    type = RankTwoAux
    variable = F13
    rank_two_tensor = deformation_gradient
    index_i = 0
    index_j = 2
  []
  [F23]
    type = RankTwoAux
    variable = F23
    rank_two_tensor = deformation_gradient
    index_i = 1
    index_j = 2
  []
  [F33]
    type = RankTwoAux
    variable = F33
    rank_two_tensor = deformation_gradient
    index_i = 2
    index_j = 2
  []
[]
[Kernels]
  [sdx]
    type = HomogenizedTotalLagrangianStressDivergence
    variable = disp_x
    component = 0
    scalar_variable = hvar
  []
[]
[Functions]
  [func_stress]
    type = ParsedFunction
    expression = '400*t'
  []
  [func_strain]
    type = ParsedFunction
    expression = '4.0e-1*t'
  []
[]
[BCs]
  [Periodic]
    [all]
      variable = disp_x
      auto_direction = 'x'
    []
  []
  [centerfix_x]
    type = DirichletBC
    boundary = "fixme"
    variable = disp_x
    value = 0
  []
[]
[Materials]
  [elastic_tensor_1]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 100000.0
    poissons_ratio = 0.3
    block = '1'
  []
  [elastic_tensor_2]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 120000.0
    poissons_ratio = 0.21
    block = '2'
  []
  [elastic_tensor_3]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 80000.0
    poissons_ratio = 0.4
    block = '3'
  []
  [elastic_tensor_4]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 76000.0
    poissons_ratio = 0.11
    block = '4'
  []
  [compute_stress]
    type = ComputeLagrangianLinearElasticStress
  []
  [compute_strain]
    type = ComputeLagrangianStrain
    homogenization_gradient_names = 'homogenization_gradient'
  []
  [compute_homogenization_gradient]
    type = ComputeHomogenizedLagrangianStrain
  []
[]
[Postprocessors]
  [s11]
    type = ElementAverageValue
    variable = s11
    execute_on = 'initial timestep_end'
  []
  [s21]
    type = ElementAverageValue
    variable = s21
    execute_on = 'initial timestep_end'
  []
  [s31]
    type = ElementAverageValue
    variable = s31
    execute_on = 'initial timestep_end'
  []
  [s12]
    type = ElementAverageValue
    variable = s12
    execute_on = 'initial timestep_end'
  []
  [s22]
    type = ElementAverageValue
    variable = s22
    execute_on = 'initial timestep_end'
  []
  [s32]
    type = ElementAverageValue
    variable = s32
    execute_on = 'initial timestep_end'
  []
  [s13]
    type = ElementAverageValue
    variable = s13
    execute_on = 'initial timestep_end'
  []
  [s23]
    type = ElementAverageValue
    variable = s23
    execute_on = 'initial timestep_end'
  []
  [s33]
    type = ElementAverageValue
    variable = s33
    execute_on = 'initial timestep_end'
  []
  [F11]
    type = ElementAverageValue
    variable = F11
    execute_on = 'initial timestep_end'
  []
  [F21]
    type = ElementAverageValue
    variable = F21
    execute_on = 'initial timestep_end'
  []
  [F31]
    type = ElementAverageValue
    variable = F31
    execute_on = 'initial timestep_end'
  []
  [F12]
    type = ElementAverageValue
    variable = F12
    execute_on = 'initial timestep_end'
  []
  [F22]
    type = ElementAverageValue
    variable = F22
    execute_on = 'initial timestep_end'
  []
  [F32]
    type = ElementAverageValue
    variable = F32
    execute_on = 'initial timestep_end'
  []
  [F13]
    type = ElementAverageValue
    variable = F13
    execute_on = 'initial timestep_end'
  []
  [F23]
    type = ElementAverageValue
    variable = F23
    execute_on = 'initial timestep_end'
  []
  [F33]
    type = ElementAverageValue
    variable = F33
    execute_on = 'initial timestep_end'
  []
[]
[Executioner]
  type = Transient
  solve_type = 'newton'
  line_search = default
  automatic_scaling = true
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  l_max_its = 2
  l_tol = 1e-14
  nl_max_its = 15
  nl_rel_tol = 1e-6
  nl_abs_tol = 1e-8
  start_time = 0.0
  dt = 0.2
  dtmin = 0.2
  end_time = 1.0
[]
[Outputs]
  exodus = false
  csv = true
[]
(modules/solid_mechanics/test/tests/lagrangian/cartesian/total/homogenization/large-tests/3d.i)
# 2D test with just strain control
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
  large_kinematics = true
  macro_gradient = hvar
  constraint_types = ${constraint_types}
  targets = ${targets}
[]
[Mesh]
  [base]
    type = FileMeshGenerator
    file = '3d.exo'
  []
  [sidesets]
    type = SideSetsFromNormalsGenerator
    input = base
    normals = '-1 0 0
                1 0 0
                0 -1 0
                0 1 0
            '
              '    0 0 -1
                0 0 1'
    fixed_normal = true
    new_boundary = 'left right bottom top back front'
  []
[]
[Variables]
  [disp_x]
  []
  [disp_y]
  []
  [disp_z]
  []
  [hvar]
    family = SCALAR
    order = NINTH
  []
[]
[AuxVariables]
  [s11]
    family = MONOMIAL
    order = CONSTANT
  []
  [s21]
    family = MONOMIAL
    order = CONSTANT
  []
  [s31]
    family = MONOMIAL
    order = CONSTANT
  []
  [s12]
    family = MONOMIAL
    order = CONSTANT
  []
  [s22]
    family = MONOMIAL
    order = CONSTANT
  []
  [s32]
    family = MONOMIAL
    order = CONSTANT
  []
  [s13]
    family = MONOMIAL
    order = CONSTANT
  []
  [s23]
    family = MONOMIAL
    order = CONSTANT
  []
  [s33]
    family = MONOMIAL
    order = CONSTANT
  []
  [F11]
    family = MONOMIAL
    order = CONSTANT
  []
  [F21]
    family = MONOMIAL
    order = CONSTANT
  []
  [F31]
    family = MONOMIAL
    order = CONSTANT
  []
  [F12]
    family = MONOMIAL
    order = CONSTANT
  []
  [F22]
    family = MONOMIAL
    order = CONSTANT
  []
  [F32]
    family = MONOMIAL
    order = CONSTANT
  []
  [F13]
    family = MONOMIAL
    order = CONSTANT
  []
  [F23]
    family = MONOMIAL
    order = CONSTANT
  []
  [F33]
    family = MONOMIAL
    order = CONSTANT
  []
[]
[AuxKernels]
  [s11]
    type = RankTwoAux
    variable = s11
    rank_two_tensor = pk1_stress
    index_i = 0
    index_j = 0
  []
  [s21]
    type = RankTwoAux
    variable = s21
    rank_two_tensor = pk1_stress
    index_i = 1
    index_j = 0
  []
  [s31]
    type = RankTwoAux
    variable = s31
    rank_two_tensor = pk1_stress
    index_i = 2
    index_j = 0
  []
  [s12]
    type = RankTwoAux
    variable = s12
    rank_two_tensor = pk1_stress
    index_i = 0
    index_j = 1
  []
  [s22]
    type = RankTwoAux
    variable = s22
    rank_two_tensor = pk1_stress
    index_i = 1
    index_j = 1
  []
  [s32]
    type = RankTwoAux
    variable = s32
    rank_two_tensor = pk1_stress
    index_i = 2
    index_j = 1
  []
  [s13]
    type = RankTwoAux
    variable = s13
    rank_two_tensor = pk1_stress
    index_i = 0
    index_j = 2
  []
  [s23]
    type = RankTwoAux
    variable = s23
    rank_two_tensor = pk1_stress
    index_i = 1
    index_j = 2
  []
  [s33]
    type = RankTwoAux
    variable = s33
    rank_two_tensor = pk1_stress
    index_i = 2
    index_j = 2
  []
  [F11]
    type = RankTwoAux
    variable = F11
    rank_two_tensor = deformation_gradient
    index_i = 0
    index_j = 0
  []
  [F21]
    type = RankTwoAux
    variable = F21
    rank_two_tensor = deformation_gradient
    index_i = 1
    index_j = 0
  []
  [F31]
    type = RankTwoAux
    variable = F31
    rank_two_tensor = deformation_gradient
    index_i = 2
    index_j = 0
  []
  [F12]
    type = RankTwoAux
    variable = F12
    rank_two_tensor = deformation_gradient
    index_i = 0
    index_j = 1
  []
  [F22]
    type = RankTwoAux
    variable = F22
    rank_two_tensor = deformation_gradient
    index_i = 1
    index_j = 1
  []
  [F32]
    type = RankTwoAux
    variable = F32
    rank_two_tensor = deformation_gradient
    index_i = 2
    index_j = 1
  []
  [F13]
    type = RankTwoAux
    variable = F13
    rank_two_tensor = deformation_gradient
    index_i = 0
    index_j = 2
  []
  [F23]
    type = RankTwoAux
    variable = F23
    rank_two_tensor = deformation_gradient
    index_i = 1
    index_j = 2
  []
  [F33]
    type = RankTwoAux
    variable = F33
    rank_two_tensor = deformation_gradient
    index_i = 2
    index_j = 2
  []
[]
[Kernels]
  [sdx]
    type = HomogenizedTotalLagrangianStressDivergence
    variable = disp_x
    component = 0
    scalar_variable = hvar
  []
  [sdy]
    type = HomogenizedTotalLagrangianStressDivergence
    variable = disp_y
    component = 1
    scalar_variable = hvar
  []
  [sdz]
    type = HomogenizedTotalLagrangianStressDivergence
    variable = disp_z
    component = 2
    scalar_variable = hvar
  []
[]
[Functions]
  [strain11]
    type = ParsedFunction
    expression = '8.0e-2*t'
  []
  [strain22]
    type = ParsedFunction
    expression = '-4.0e-2*t'
  []
  [strain33]
    type = ParsedFunction
    expression = '8.0e-2*t'
  []
  [strain23]
    type = ParsedFunction
    expression = '2.0e-2*t'
  []
  [strain13]
    type = ParsedFunction
    expression = '-7.0e-2*t'
  []
  [strain12]
    type = ParsedFunction
    expression = '1.0e-2*t'
  []
  [strain32]
    type = ParsedFunction
    expression = '1.0e-2*t'
  []
  [strain31]
    type = ParsedFunction
    expression = '2.0e-2*t'
  []
  [strain21]
    type = ParsedFunction
    expression = '-1.5e-2*t'
  []
  [stress11]
    type = ParsedFunction
    expression = '4.0e2*t'
  []
  [stress22]
    type = ParsedFunction
    expression = '-2.0e2*t'
  []
  [stress33]
    type = ParsedFunction
    expression = '8.0e2*t'
  []
  [stress23]
    type = ParsedFunction
    expression = '2.0e2*t'
  []
  [stress13]
    type = ParsedFunction
    expression = '-7.0e2*t'
  []
  [stress12]
    type = ParsedFunction
    expression = '1.0e2*t'
  []
  [stress32]
    type = ParsedFunction
    expression = '1.0e2*t'
  []
  [stress31]
    type = ParsedFunction
    expression = '2.0e2*t'
  []
  [stress21]
    type = ParsedFunction
    expression = '-1.5e2*t'
  []
[]
[BCs]
  [Periodic]
    [x]
      variable = disp_x
      auto_direction = 'x y z'
    []
    [y]
      variable = disp_y
      auto_direction = 'x y z'
    []
    [z]
      variable = disp_z
      auto_direction = 'x y z'
    []
  []
  [fix1_x]
    type = DirichletBC
    boundary = "fix_all"
    variable = disp_x
    value = 0
  []
  [fix1_y]
    type = DirichletBC
    boundary = "fix_all"
    variable = disp_y
    value = 0
  []
  [fix1_z]
    type = DirichletBC
    boundary = "fix_all"
    variable = disp_z
    value = 0
  []
  [fix2_x]
    type = DirichletBC
    boundary = "fix_xy"
    variable = disp_x
    value = 0
  []
  [fix2_y]
    type = DirichletBC
    boundary = "fix_xy"
    variable = disp_y
    value = 0
  []
  [fix3_z]
    type = DirichletBC
    boundary = "fix_z"
    variable = disp_z
    value = 0
  []
[]
[Materials]
  [elastic_tensor_1]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 100000.0
    poissons_ratio = 0.3
    block = '1'
  []
  [elastic_tensor_2]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 120000.0
    poissons_ratio = 0.21
    block = '2'
  []
  [elastic_tensor_3]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 80000.0
    poissons_ratio = 0.4
    block = '3'
  []
  [elastic_tensor_4]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 76000.0
    poissons_ratio = 0.11
    block = '4'
  []
  [compute_stress]
    type = ComputeLagrangianLinearElasticStress
  []
  [compute_strain]
    type = ComputeLagrangianStrain
    homogenization_gradient_names = 'homogenization_gradient'
  []
  [compute_homogenization_gradient]
    type = ComputeHomogenizedLagrangianStrain
  []
[]
[Postprocessors]
  [s11]
    type = ElementAverageValue
    variable = s11
    execute_on = 'initial timestep_end'
  []
  [s21]
    type = ElementAverageValue
    variable = s21
    execute_on = 'initial timestep_end'
  []
  [s31]
    type = ElementAverageValue
    variable = s31
    execute_on = 'initial timestep_end'
  []
  [s12]
    type = ElementAverageValue
    variable = s12
    execute_on = 'initial timestep_end'
  []
  [s22]
    type = ElementAverageValue
    variable = s22
    execute_on = 'initial timestep_end'
  []
  [s32]
    type = ElementAverageValue
    variable = s32
    execute_on = 'initial timestep_end'
  []
  [s13]
    type = ElementAverageValue
    variable = s13
    execute_on = 'initial timestep_end'
  []
  [s23]
    type = ElementAverageValue
    variable = s23
    execute_on = 'initial timestep_end'
  []
  [s33]
    type = ElementAverageValue
    variable = s33
    execute_on = 'initial timestep_end'
  []
  [F11]
    type = ElementAverageValue
    variable = F11
    execute_on = 'initial timestep_end'
  []
  [F21]
    type = ElementAverageValue
    variable = F21
    execute_on = 'initial timestep_end'
  []
  [F31]
    type = ElementAverageValue
    variable = F31
    execute_on = 'initial timestep_end'
  []
  [F12]
    type = ElementAverageValue
    variable = F12
    execute_on = 'initial timestep_end'
  []
  [F22]
    type = ElementAverageValue
    variable = F22
    execute_on = 'initial timestep_end'
  []
  [F32]
    type = ElementAverageValue
    variable = F32
    execute_on = 'initial timestep_end'
  []
  [F13]
    type = ElementAverageValue
    variable = F13
    execute_on = 'initial timestep_end'
  []
  [F23]
    type = ElementAverageValue
    variable = F23
    execute_on = 'initial timestep_end'
  []
  [F33]
    type = ElementAverageValue
    variable = F33
    execute_on = 'initial timestep_end'
  []
[]
[Executioner]
  type = Transient
  solve_type = 'newton'
  line_search = none
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  l_max_its = 2
  l_tol = 1e-14
  nl_max_its = 10
  nl_rel_tol = 1e-8
  nl_abs_tol = 1e-10
  start_time = 0.0
  dt = 0.2
  dtmin = 0.2
  end_time = 1.0
[]
[Outputs]
  csv = true
[]
(modules/solid_mechanics/test/tests/lagrangian/cartesian/total/homogenization/convergence/ld-stress.i)
# 2D test with just strain control
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
  large_kinematics = true
  constraint_types = 'stress strain strain stress stress strain stress stress stress'
  macro_gradient = hvar
  targets = 'stress11 zero zero stress12 stress22 zero stress13 stress23 stress33'
[]
[Mesh]
  [base]
    type = FileMeshGenerator
    file = '3d.exo'
  []
  [sidesets]
    type = SideSetsFromNormalsGenerator
    input = base
    normals = '-1 0 0
                1 0 0
                0 -1 0
                0 1 0
            '
              '    0 0 -1
                0 0 1'
    fixed_normal = true
    new_boundary = 'left right bottom top back front'
  []
[]
[Variables]
  [disp_x]
  []
  [disp_y]
  []
  [disp_z]
  []
  [hvar]
    family = SCALAR
    order = NINTH
  []
[]
[ICs]
  [disp_x]
    type = RandomIC
    variable = disp_x
    min = -0.1
    max = 0.1
  []
  [disp_y]
    type = RandomIC
    variable = disp_y
    min = -0.1
    max = 0.1
  []
  [disp_z]
    type = RandomIC
    variable = disp_z
    min = -0.1
    max = 0.1
  []
  [hvar]
    type = ScalarConstantIC
    variable = hvar
    value = 0.1
  []
[]
[AuxVariables]
  [s11]
    family = MONOMIAL
    order = CONSTANT
  []
  [s21]
    family = MONOMIAL
    order = CONSTANT
  []
  [s31]
    family = MONOMIAL
    order = CONSTANT
  []
  [s12]
    family = MONOMIAL
    order = CONSTANT
  []
  [s22]
    family = MONOMIAL
    order = CONSTANT
  []
  [s32]
    family = MONOMIAL
    order = CONSTANT
  []
  [s13]
    family = MONOMIAL
    order = CONSTANT
  []
  [s23]
    family = MONOMIAL
    order = CONSTANT
  []
  [s33]
    family = MONOMIAL
    order = CONSTANT
  []
  [F11]
    family = MONOMIAL
    order = CONSTANT
  []
  [F21]
    family = MONOMIAL
    order = CONSTANT
  []
  [F31]
    family = MONOMIAL
    order = CONSTANT
  []
  [F12]
    family = MONOMIAL
    order = CONSTANT
  []
  [F22]
    family = MONOMIAL
    order = CONSTANT
  []
  [F32]
    family = MONOMIAL
    order = CONSTANT
  []
  [F13]
    family = MONOMIAL
    order = CONSTANT
  []
  [F23]
    family = MONOMIAL
    order = CONSTANT
  []
  [F33]
    family = MONOMIAL
    order = CONSTANT
  []
[]
[AuxKernels]
  [s11]
    type = RankTwoAux
    variable = s11
    rank_two_tensor = pk1_stress
    index_i = 0
    index_j = 0
  []
  [s21]
    type = RankTwoAux
    variable = s21
    rank_two_tensor = pk1_stress
    index_i = 1
    index_j = 0
  []
  [s31]
    type = RankTwoAux
    variable = s31
    rank_two_tensor = pk1_stress
    index_i = 2
    index_j = 0
  []
  [s12]
    type = RankTwoAux
    variable = s12
    rank_two_tensor = pk1_stress
    index_i = 0
    index_j = 1
  []
  [s22]
    type = RankTwoAux
    variable = s22
    rank_two_tensor = pk1_stress
    index_i = 1
    index_j = 1
  []
  [s32]
    type = RankTwoAux
    variable = s32
    rank_two_tensor = pk1_stress
    index_i = 2
    index_j = 1
  []
  [s13]
    type = RankTwoAux
    variable = s13
    rank_two_tensor = pk1_stress
    index_i = 0
    index_j = 2
  []
  [s23]
    type = RankTwoAux
    variable = s23
    rank_two_tensor = pk1_stress
    index_i = 1
    index_j = 2
  []
  [s33]
    type = RankTwoAux
    variable = s33
    rank_two_tensor = pk1_stress
    index_i = 2
    index_j = 2
  []
  [F11]
    type = RankTwoAux
    variable = F11
    rank_two_tensor = deformation_gradient
    index_i = 0
    index_j = 0
  []
  [F21]
    type = RankTwoAux
    variable = F21
    rank_two_tensor = deformation_gradient
    index_i = 1
    index_j = 0
  []
  [F31]
    type = RankTwoAux
    variable = F31
    rank_two_tensor = deformation_gradient
    index_i = 2
    index_j = 0
  []
  [F12]
    type = RankTwoAux
    variable = F12
    rank_two_tensor = deformation_gradient
    index_i = 0
    index_j = 1
  []
  [F22]
    type = RankTwoAux
    variable = F22
    rank_two_tensor = deformation_gradient
    index_i = 1
    index_j = 1
  []
  [F32]
    type = RankTwoAux
    variable = F32
    rank_two_tensor = deformation_gradient
    index_i = 2
    index_j = 1
  []
  [F13]
    type = RankTwoAux
    variable = F13
    rank_two_tensor = deformation_gradient
    index_i = 0
    index_j = 2
  []
  [F23]
    type = RankTwoAux
    variable = F23
    rank_two_tensor = deformation_gradient
    index_i = 1
    index_j = 2
  []
  [F33]
    type = RankTwoAux
    variable = F33
    rank_two_tensor = deformation_gradient
    index_i = 2
    index_j = 2
  []
[]
[Kernels]
  [sdx]
    type = HomogenizedTotalLagrangianStressDivergence
    variable = disp_x
    component = 0
    scalar_variable = hvar
  []
  [sdy]
    type = HomogenizedTotalLagrangianStressDivergence
    variable = disp_y
    component = 1
    scalar_variable = hvar
  []
  [sdz]
    type = HomogenizedTotalLagrangianStressDivergence
    variable = disp_z
    component = 2
    scalar_variable = hvar
  []
[]
[Functions]
  [stress11]
    type = ParsedFunction
    expression = '4.0e2*t'
  []
  [stress22]
    type = ParsedFunction
    expression = '-2.0e2*t'
  []
  [stress33]
    type = ParsedFunction
    expression = '8.0e2*t'
  []
  [stress23]
    type = ParsedFunction
    expression = '2.0e2*t'
  []
  [stress13]
    type = ParsedFunction
    expression = '-7.0e2*t'
  []
  [stress12]
    type = ParsedFunction
    expression = '1.0e2*t'
  []
  [stress32]
    type = ParsedFunction
    expression = '1.0e2*t'
  []
  [stress31]
    type = ParsedFunction
    expression = '2.0e2*t'
  []
  [stress21]
    type = ParsedFunction
    expression = '-1.5e2*t'
  []
  [zero]
    type = ConstantFunction
    value = 0
  []
[]
[BCs]
  [Periodic]
    [x]
      variable = disp_x
      auto_direction = 'x y z'
    []
    [y]
      variable = disp_y
      auto_direction = 'x y z'
    []
    [z]
      variable = disp_z
      auto_direction = 'x y z'
    []
  []
  [fix1_x]
    type = DirichletBC
    boundary = "fix_all"
    variable = disp_x
    value = 0
  []
  [fix1_y]
    type = DirichletBC
    boundary = "fix_all"
    variable = disp_y
    value = 0
  []
  [fix1_z]
    type = DirichletBC
    boundary = "fix_all"
    variable = disp_z
    value = 0
  []
  [fix2_x]
    type = DirichletBC
    boundary = "fix_xy"
    variable = disp_x
    value = 0
  []
  [fix2_y]
    type = DirichletBC
    boundary = "fix_xy"
    variable = disp_y
    value = 0
  []
  [fix3_z]
    type = DirichletBC
    boundary = "fix_z"
    variable = disp_z
    value = 0
  []
[]
[Materials]
  [elastic_tensor_1]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 100000.0
    poissons_ratio = 0.3
    block = '1'
  []
  [elastic_tensor_2]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 120000.0
    poissons_ratio = 0.21
    block = '2'
  []
  [elastic_tensor_3]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 80000.0
    poissons_ratio = 0.4
    block = '3'
  []
  [elastic_tensor_4]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 76000.0
    poissons_ratio = 0.11
    block = '4'
  []
  [compute_stress]
    type = ComputeLagrangianLinearElasticStress
  []
  [compute_strain]
    type = ComputeLagrangianStrain
    homogenization_gradient_names = 'homogenization_gradient'
  []
  [compute_homogenization_gradient]
    type = ComputeHomogenizedLagrangianStrain
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Postprocessors]
  [s11]
    type = ElementAverageValue
    variable = s11
    execute_on = 'initial timestep_end'
  []
  [s21]
    type = ElementAverageValue
    variable = s21
    execute_on = 'initial timestep_end'
  []
  [s31]
    type = ElementAverageValue
    variable = s31
    execute_on = 'initial timestep_end'
  []
  [s12]
    type = ElementAverageValue
    variable = s12
    execute_on = 'initial timestep_end'
  []
  [s22]
    type = ElementAverageValue
    variable = s22
    execute_on = 'initial timestep_end'
  []
  [s32]
    type = ElementAverageValue
    variable = s32
    execute_on = 'initial timestep_end'
  []
  [s13]
    type = ElementAverageValue
    variable = s13
    execute_on = 'initial timestep_end'
  []
  [s23]
    type = ElementAverageValue
    variable = s23
    execute_on = 'initial timestep_end'
  []
  [s33]
    type = ElementAverageValue
    variable = s33
    execute_on = 'initial timestep_end'
  []
  [F11]
    type = ElementAverageValue
    variable = F11
    execute_on = 'initial timestep_end'
  []
  [F21]
    type = ElementAverageValue
    variable = F21
    execute_on = 'initial timestep_end'
  []
  [F31]
    type = ElementAverageValue
    variable = F31
    execute_on = 'initial timestep_end'
  []
  [F12]
    type = ElementAverageValue
    variable = F12
    execute_on = 'initial timestep_end'
  []
  [F22]
    type = ElementAverageValue
    variable = F22
    execute_on = 'initial timestep_end'
  []
  [F32]
    type = ElementAverageValue
    variable = F32
    execute_on = 'initial timestep_end'
  []
  [F13]
    type = ElementAverageValue
    variable = F13
    execute_on = 'initial timestep_end'
  []
  [F23]
    type = ElementAverageValue
    variable = F23
    execute_on = 'initial timestep_end'
  []
  [F33]
    type = ElementAverageValue
    variable = F33
    execute_on = 'initial timestep_end'
  []
[]
[Executioner]
  type = Transient
  solve_type = 'newton'
  line_search = none
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  l_max_its = 2
  l_tol = 1e-14
  nl_max_its = 10
  nl_rel_tol = 1e-8
  nl_abs_tol = 1e-10
  start_time = 0.0
  dt = 0.2
  dtmin = 0.2
  end_time = 0.2
[]
[Outputs]
  exodus = false
  csv = false
[]
(modules/solid_mechanics/test/tests/lagrangian/cartesian/total/homogenization/large-tests/2d.i)
# 2D with mixed conditions on stress/strain
[GlobalParams]
  displacements = 'disp_x disp_y'
  large_kinematics = true
  macro_gradient = hvar
  constraint_types = ${constraint_types}
  targets = ${targets}
[]
[Mesh]
  [base]
    type = FileMeshGenerator
    file = '2d.exo'
  []
  [sidesets]
    type = SideSetsFromNormalsGenerator
    input = base
    normals = '-1 0 0
                1 0 0
                0 -1 0
                0 1 0'
    fixed_normal = true
    new_boundary = 'left right bottom top'
  []
[]
[Variables]
  [disp_x]
  []
  [disp_y]
  []
  [hvar]
    family = SCALAR
    order = FOURTH
  []
[]
[AuxVariables]
  [s11]
    family = MONOMIAL
    order = CONSTANT
  []
  [s21]
    family = MONOMIAL
    order = CONSTANT
  []
  [s31]
    family = MONOMIAL
    order = CONSTANT
  []
  [s12]
    family = MONOMIAL
    order = CONSTANT
  []
  [s22]
    family = MONOMIAL
    order = CONSTANT
  []
  [s32]
    family = MONOMIAL
    order = CONSTANT
  []
  [s13]
    family = MONOMIAL
    order = CONSTANT
  []
  [s23]
    family = MONOMIAL
    order = CONSTANT
  []
  [s33]
    family = MONOMIAL
    order = CONSTANT
  []
  [F11]
    family = MONOMIAL
    order = CONSTANT
  []
  [F21]
    family = MONOMIAL
    order = CONSTANT
  []
  [F31]
    family = MONOMIAL
    order = CONSTANT
  []
  [F12]
    family = MONOMIAL
    order = CONSTANT
  []
  [F22]
    family = MONOMIAL
    order = CONSTANT
  []
  [F32]
    family = MONOMIAL
    order = CONSTANT
  []
  [F13]
    family = MONOMIAL
    order = CONSTANT
  []
  [F23]
    family = MONOMIAL
    order = CONSTANT
  []
  [F33]
    family = MONOMIAL
    order = CONSTANT
  []
[]
[AuxKernels]
  [s11]
    type = RankTwoAux
    variable = s11
    rank_two_tensor = pk1_stress
    index_i = 0
    index_j = 0
  []
  [s21]
    type = RankTwoAux
    variable = s21
    rank_two_tensor = pk1_stress
    index_i = 1
    index_j = 0
  []
  [s31]
    type = RankTwoAux
    variable = s31
    rank_two_tensor = pk1_stress
    index_i = 2
    index_j = 0
  []
  [s12]
    type = RankTwoAux
    variable = s12
    rank_two_tensor = pk1_stress
    index_i = 0
    index_j = 1
  []
  [s22]
    type = RankTwoAux
    variable = s22
    rank_two_tensor = pk1_stress
    index_i = 1
    index_j = 1
  []
  [s32]
    type = RankTwoAux
    variable = s32
    rank_two_tensor = pk1_stress
    index_i = 2
    index_j = 1
  []
  [s13]
    type = RankTwoAux
    variable = s13
    rank_two_tensor = pk1_stress
    index_i = 0
    index_j = 2
  []
  [s23]
    type = RankTwoAux
    variable = s23
    rank_two_tensor = pk1_stress
    index_i = 1
    index_j = 2
  []
  [s33]
    type = RankTwoAux
    variable = s33
    rank_two_tensor = pk1_stress
    index_i = 2
    index_j = 2
  []
  [F11]
    type = RankTwoAux
    variable = F11
    rank_two_tensor = deformation_gradient
    index_i = 0
    index_j = 0
  []
  [F21]
    type = RankTwoAux
    variable = F21
    rank_two_tensor = deformation_gradient
    index_i = 1
    index_j = 0
  []
  [F31]
    type = RankTwoAux
    variable = F31
    rank_two_tensor = deformation_gradient
    index_i = 2
    index_j = 0
  []
  [F12]
    type = RankTwoAux
    variable = F12
    rank_two_tensor = deformation_gradient
    index_i = 0
    index_j = 1
  []
  [F22]
    type = RankTwoAux
    variable = F22
    rank_two_tensor = deformation_gradient
    index_i = 1
    index_j = 1
  []
  [F32]
    type = RankTwoAux
    variable = F32
    rank_two_tensor = deformation_gradient
    index_i = 2
    index_j = 1
  []
  [F13]
    type = RankTwoAux
    variable = F13
    rank_two_tensor = deformation_gradient
    index_i = 0
    index_j = 2
  []
  [F23]
    type = RankTwoAux
    variable = F23
    rank_two_tensor = deformation_gradient
    index_i = 1
    index_j = 2
  []
  [F33]
    type = RankTwoAux
    variable = F33
    rank_two_tensor = deformation_gradient
    index_i = 2
    index_j = 2
  []
[]
[Kernels]
  [sdx]
    type = HomogenizedTotalLagrangianStressDivergence
    variable = disp_x
    component = 0
    scalar_variable = hvar
  []
  [sdy]
    type = HomogenizedTotalLagrangianStressDivergence
    variable = disp_y
    component = 1
    scalar_variable = hvar
  []
[]
[Functions]
  [strain11]
    type = ParsedFunction
    expression = '4.0e-1*t'
  []
  [strain22]
    type = ParsedFunction
    expression = '-2.0e-1*t'
  []
  [strain12]
    type = ParsedFunction
    expression = '1.0e-1*t'
  []
  [strain21]
    type = ParsedFunction
    expression = '-1.5e-1*t'
  []
  [stress11]
    type = ParsedFunction
    expression = '4.0e2*t'
  []
  [stress22]
    type = ParsedFunction
    expression = '-2.0e2*t'
  []
  [stress12]
    type = ParsedFunction
    expression = '1.0e2*t'
  []
  [stress21]
    type = ParsedFunction
    expression = '-1.5e2*t'
  []
[]
[BCs]
  [Periodic]
    [x]
      variable = disp_x
      auto_direction = 'x y'
    []
    [y]
      variable = disp_y
      auto_direction = 'x y'
    []
  []
  [fix1_x]
    type = DirichletBC
    boundary = "fix1"
    variable = disp_x
    value = 0
  []
  [fix1_y]
    type = DirichletBC
    boundary = "fix1"
    variable = disp_y
    value = 0
  []
  [fix2_y]
    type = DirichletBC
    boundary = "fix2"
    variable = disp_y
    value = 0
  []
[]
[Materials]
  [elastic_tensor_1]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 100000.0
    poissons_ratio = 0.3
    block = '1'
  []
  [elastic_tensor_2]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 120000.0
    poissons_ratio = 0.21
    block = '2'
  []
  [elastic_tensor_3]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 80000.0
    poissons_ratio = 0.4
    block = '3'
  []
  [compute_stress]
    type = ComputeLagrangianLinearElasticStress
  []
  [compute_strain]
    type = ComputeLagrangianStrain
    homogenization_gradient_names = 'homogenization_gradient'
  []
  [compute_homogenization_gradient]
    type = ComputeHomogenizedLagrangianStrain
  []
[]
[Postprocessors]
  [s11]
    type = ElementAverageValue
    variable = s11
    execute_on = 'initial timestep_end'
  []
  [s21]
    type = ElementAverageValue
    variable = s21
    execute_on = 'initial timestep_end'
  []
  [s31]
    type = ElementAverageValue
    variable = s31
    execute_on = 'initial timestep_end'
  []
  [s12]
    type = ElementAverageValue
    variable = s12
    execute_on = 'initial timestep_end'
  []
  [s22]
    type = ElementAverageValue
    variable = s22
    execute_on = 'initial timestep_end'
  []
  [s32]
    type = ElementAverageValue
    variable = s32
    execute_on = 'initial timestep_end'
  []
  [s13]
    type = ElementAverageValue
    variable = s13
    execute_on = 'initial timestep_end'
  []
  [s23]
    type = ElementAverageValue
    variable = s23
    execute_on = 'initial timestep_end'
  []
  [s33]
    type = ElementAverageValue
    variable = s33
    execute_on = 'initial timestep_end'
  []
  [F11]
    type = ElementAverageValue
    variable = F11
    execute_on = 'initial timestep_end'
  []
  [F21]
    type = ElementAverageValue
    variable = F21
    execute_on = 'initial timestep_end'
  []
  [F31]
    type = ElementAverageValue
    variable = F31
    execute_on = 'initial timestep_end'
  []
  [F12]
    type = ElementAverageValue
    variable = F12
    execute_on = 'initial timestep_end'
  []
  [F22]
    type = ElementAverageValue
    variable = F22
    execute_on = 'initial timestep_end'
  []
  [F32]
    type = ElementAverageValue
    variable = F32
    execute_on = 'initial timestep_end'
  []
  [F13]
    type = ElementAverageValue
    variable = F13
    execute_on = 'initial timestep_end'
  []
  [F23]
    type = ElementAverageValue
    variable = F23
    execute_on = 'initial timestep_end'
  []
  [F33]
    type = ElementAverageValue
    variable = F33
    execute_on = 'initial timestep_end'
  []
[]
[Executioner]
  type = Transient
  solve_type = 'newton'
  line_search = none
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  l_max_its = 2
  l_tol = 1e-14
  nl_max_its = 30
  nl_rel_tol = 1e-8
  nl_abs_tol = 1e-10
  start_time = 0.0
  dt = 0.2
  dtmin = 0.2
  end_time = 1.0
[]
[Outputs]
  csv = true
[]