- propertyThe material property name.C++ Type:MaterialPropertyName Unit:(no unit assumed) Controllable:No Description:The material property name. 
- variableThe name of the variable that this object applies toC++ Type:AuxVariableName Unit:(no unit assumed) Controllable:No Description:The name of the variable that this object applies to 
MaterialStdVectorAux
Extracts a component of a material type std::vector<Real> to an aux variable. If the std::vector is not of sufficient size then zero is returned
Converting a field from the material system, here a component of a vector material property, to a variable may be desirable for several reasons: to match the format expected by certain kernels (thus lagging the field between time steps) or for output/testing/debugging.
This is particularly useful to examine anisotropic material properties. For output purposes only, an alternative is to use the output_properties argument of the Material or specify output_material_properties in the parameters of the desired output type nested in the [Outputs] block. This AuxKernel is used in the back-end by these parameters.
The MaterialRealVectorValueAux provides similar functionality.
The AD system currently does not support auxiliary variables. If you convert material properties, which do support automatic differentiation, to auxiliary variables, the derivatives will be ignored.
Example syntax
In this example, the MaterialStdVectorAux is being used to examine the first component of an anisotropic permeability.
  [relpermwater]
    type = MaterialStdVectorAux
    property = PorousFlow_relative_permeability_qp
    index = 0
    variable = relpermwater
Input Parameters
- 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 
- boundaryThe list of boundaries (ids or names) from the mesh where this object appliesC++ Type:std::vector<BoundaryName> Controllable:No Description:The list of boundaries (ids or names) from the mesh where this object applies 
- check_boundary_restrictedTrueWhether to check for multiple element sides on the boundary in the case of a boundary restricted, element aux variable. Setting this to false will allow contribution to a single element's elemental value(s) from multiple boundary sides on the same element (example: when the restricted boundary exists on two or more sides of an element, such as at a corner of a meshDefault:True C++ Type:bool Controllable:No Description:Whether to check for multiple element sides on the boundary in the case of a boundary restricted, element aux variable. Setting this to false will allow contribution to a single element's elemental value(s) from multiple boundary sides on the same element (example: when the restricted boundary exists on two or more sides of an element, such as at a corner of a mesh 
- execute_onLINEAR TIMESTEP_ENDThe list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html.Default:LINEAR TIMESTEP_END C++ Type:ExecFlagEnum Options:XFEM_MARK, FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, LINEAR_CONVERGENCE, NONLINEAR, NONLINEAR_CONVERGENCE, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, MULTIAPP_FIXED_POINT_CONVERGENCE, FINAL, CUSTOM, PRE_DISPLACE Controllable:No Description:The list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html. 
- factor1The factor by which to multiply your material property for visualizationDefault:1 C++ Type:double Unit:(no unit assumed) Controllable:No Description:The factor by which to multiply your material property for visualization 
- index0The index to consider for this kernelDefault:0 C++ Type:unsigned int Controllable:No Description:The index to consider for this kernel 
- offset0The offset to add to your material property for visualizationDefault:0 C++ Type:double Unit:(no unit assumed) Controllable:No Description:The offset to add to your material property for visualization 
Optional 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. 
- enableTrueSet the enabled status of the MooseObject.Default:True C++ Type:bool Controllable:Yes Description:Set the enabled status of the MooseObject. 
- 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 
- selected_qpEvaluate the material property at a specified quadrature point. This only needs to be used if you are interested in a particular quadrature point in each element. Otherwise do not include this parameter in your input file.C++ Type:unsigned int Controllable:No Description:Evaluate the material property at a specified quadrature point. This only needs to be used if you are interested in a particular quadrature point in each element. Otherwise do not include this parameter in your input file. 
- use_displaced_meshFalseWhether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.Default:False C++ Type:bool Controllable:No Description:Whether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used. 
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/tensile/small_deform8_update_version.i)
- (modules/solid_mechanics/test/tests/capped_weak_plane/pull_and_shear.i)
- (modules/solid_mechanics/test/tests/capped_mohr_coulomb/random4.i)
- (modules/solid_mechanics/test/tests/tensile/small_deform2_update_version.i)
- (modules/solid_mechanics/examples/coal_mining/cosserat_mc_wp_sticky.i)
- (modules/solid_mechanics/examples/coal_mining/cosserat_mc_wp.i)
- (modules/solid_mechanics/test/tests/capped_mohr_coulomb/random2.i)
- (modules/combined/test/tests/j2_plasticity_vs_LSH/j2_hard1_mod.i)
- (modules/solid_mechanics/test/tests/jacobian/cto18.i)
- (modules/porous_flow/test/tests/infiltration_and_drainage/rsc01.i)
- (modules/solid_mechanics/test/tests/j2_plasticity/small_deform2.i)
- (test/tests/materials/types/test.i)
- (modules/solid_mechanics/test/tests/drucker_prager/small_deform3_lode_zero.i)
- (modules/solid_mechanics/test/tests/mohr_coulomb/planar_hard1.i)
- (modules/solid_mechanics/test/tests/multiple_two_parameter_plasticity/dp_and_wp.i)
- (modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform22.i)
- (modules/solid_mechanics/test/tests/ad_anisotropic_creep/ad_aniso_creep_temperature_coefficients_function_variation.i)
- (modules/porous_flow/test/tests/density/GravDensity01.i)
- (modules/solid_mechanics/examples/coal_mining/cosserat_mc_only.i)
- (modules/solid_mechanics/test/tests/multi/three_surface06.i)
- (modules/solid_mechanics/test/tests/weak_plane_tensile/small_deform_hard3.i)
- (modules/solid_mechanics/test/tests/j2_plasticity/hard2.i)
- (modules/solid_mechanics/test/tests/capped_mohr_coulomb/random1.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/monolithic_material_based/cp_slip_rate_integ/crysp_linesearch.i)
- (modules/solid_mechanics/test/tests/mohr_coulomb/uni_axial1_small_strain.i)
- (modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform1.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/user_object_based/test.i)
- (modules/solid_mechanics/test/tests/capped_weak_plane/push_and_shear.i)
- (modules/solid_mechanics/test/tests/mean_cap_TC/small_deform3.i)
- (modules/solid_mechanics/test/tests/capped_weak_plane/small_deform_cosserat3.i)
- (modules/solid_mechanics/test/tests/mohr_coulomb/small_deform2.i)
- (modules/solid_mechanics/test/tests/orthotropic_plasticity/powerRuleHardening.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/twinning/check_direction_twin_propagation.i)
- (modules/solid_mechanics/test/tests/capped_weak_plane/pull_push_h.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/hcp_single_crystal/update_method_hcp_capyramidal_active.i)
- (modules/porous_flow/test/tests/infiltration_and_drainage/rd02.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/hcp_single_crystal/update_method_hcp_no_substructure.i)
- (modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform21.i)
- (modules/solid_mechanics/test/tests/jacobian/cto17.i)
- (modules/solid_mechanics/test/tests/drucker_prager/small_deform2_lode_zero.i)
- (modules/solid_mechanics/test/tests/multi/three_surface10.i)
- (modules/solid_mechanics/test/tests/capped_drucker_prager/small_deform3_lode_zero.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/user_object_based/user_object_011orientation.i)
- (modules/solid_mechanics/test/tests/capped_weak_plane/small_deform9.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/stress_update_material_based/linesearch.i)
- (modules/solid_mechanics/test/tests/tensile/small_deform_hard3_update_version.i)
- (modules/solid_mechanics/test/tests/drucker_prager/small_deform3_inner_edge.i)
- (modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform13.i)
- (modules/porous_flow/test/tests/infiltration_and_drainage/wli01.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/user_object_based/substep.i)
- (modules/solid_mechanics/test/tests/mohr_coulomb/small_deform6.i)
- (modules/solid_mechanics/test/tests/mean_cap_TC/random01.i)
- (modules/solid_mechanics/test/tests/multi/eight_surface14.i)
- (modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform3.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/stress_update_material_based/update_method_011orientation.i)
- (modules/solid_mechanics/test/tests/weak_plane_tensile/small_deform_hard1.i)
- (modules/solid_mechanics/test/tests/notched_plastic_block/biaxial_abbo.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/user_object_based/user_object.i)
- (modules/solid_mechanics/test/tests/capped_weak_plane/small_deform10.i)
- (modules/solid_mechanics/test/tests/tensile/small_deform5.i)
- (modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform_hard3.i)
- (modules/solid_mechanics/test/tests/weak_plane_tensile/small_deform_hard2.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/twinning/combined_twinning_slip_100compression.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/hcp_single_crystal/update_method_hcp_representative_slip_systems.i)
- (modules/solid_mechanics/test/tests/tensile/planar8.i)
- (modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform_hard13.i)
- (modules/solid_mechanics/test/tests/orthotropic_plasticity/orthotropic.i)
- (modules/combined/test/tests/j2_plasticity_vs_LSH/j2_hard1_mod_small_strain.i)
- (modules/solid_mechanics/test/tests/mohr_coulomb/planar_hard2.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/twinning/only_twinning_fcc.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/stress_update_material_based/bicrystal_test.i)
- (modules/solid_mechanics/test/tests/multi/three_surface09.i)
- (modules/solid_mechanics/test/tests/capped_weak_plane/small_deform_cosserat2.i)
- (modules/solid_mechanics/test/tests/weak_plane_shear/except1.i)
- (modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform_hard22.i)
- (modules/solid_mechanics/test/tests/mohr_coulomb/random.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/monolithic_material_based/crysp_linesearch.i)
- (modules/solid_mechanics/test/tests/mohr_coulomb/uni_axial2_planar.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/monolithic_material_based/crysp_save_euler.i)
- (modules/solid_mechanics/test/tests/multi/four_surface24.i)
- (modules/solid_mechanics/test/tests/multi/three_surface02.i)
- (modules/solid_mechanics/test/tests/weak_plane_shear/large_deform_harden3.i)
- (modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform7.i)
- (modules/solid_mechanics/test/tests/mohr_coulomb/small_deform3.i)
- (modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform15.i)
- (modules/solid_mechanics/test/tests/weak_plane_shear/large_deform4.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/twinning/coplanar_twin_hardening.i)
- (modules/solid_mechanics/test/tests/weak_plane_shear/except2.i)
- (modules/porous_flow/test/tests/infiltration_and_drainage/rd03.i)
- (modules/solid_mechanics/test/tests/mohr_coulomb/uni_axial3_planar.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/twinning/upper_twin_fraction_limit.i)
- (modules/solid_mechanics/test/tests/weak_plane_tensile/small_deform1N.i)
- (modules/solid_mechanics/test/tests/multi/three_surface03.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/monolithic_material_based/cp_slip_rate_integ/crysp.i)
- (modules/solid_mechanics/test/tests/weak_plane_shear/small_deform4.i)
- (modules/solid_mechanics/test/tests/multi/three_surface22.i)
- (modules/solid_mechanics/test/tests/mohr_coulomb/small_deform_hard3.i)
- (modules/solid_mechanics/test/tests/tensile/planar1.i)
- (modules/solid_mechanics/test/tests/multi/three_surface21.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/monolithic_material_based/crysp_user_object.i)
- (modules/solid_mechanics/test/tests/weak_plane_shear/small_deform_harden3.i)
- (modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform17.i)
- (modules/solid_mechanics/test/tests/mean_cap/random.i)
- (modules/solid_mechanics/test/tests/mohr_coulomb/uni_axial3.i)
- (modules/solid_mechanics/test/tests/jacobian/cto14.i)
- (modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform23.i)
- (modules/solid_mechanics/test/tests/mohr_coulomb/planar1.i)
- (modules/combined/test/tests/j2_plasticity_vs_LSH/j2_hard1_mod_optimised.i)
- (modules/solid_mechanics/test/tests/mohr_coulomb/small_deform_hard_cubic.i)
- (modules/solid_mechanics/test/tests/mean_cap/small_deform2.i)
- (modules/solid_mechanics/test/tests/tensile/planar4.i)
- (modules/solid_mechanics/examples/coal_mining/cosserat_wp_only.i)
- (modules/solid_mechanics/test/tests/weak_plane_shear/small_deform2.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/monolithic_material_based/crysp.i)
- (modules/solid_mechanics/test/tests/capped_weak_plane/small_deform_cosserat1.i)
- (modules/solid_mechanics/test/tests/weak_plane_tensile/small_deform2.i)
- (modules/solid_mechanics/test/tests/mohr_coulomb/small_deform2_small_strain.i)
- (modules/solid_mechanics/test/tests/mohr_coulomb/small_deform_hard2.i)
- (modules/solid_mechanics/test/tests/capped_drucker_prager/small_deform3_inner_tip.i)
- (modules/solid_mechanics/test/tests/tensile/small_deform2.i)
- (modules/solid_mechanics/test/tests/multi/three_surface20.i)
- (modules/solid_mechanics/test/tests/capped_weak_plane/small_deform2.i)
- (modules/solid_mechanics/test/tests/mohr_coulomb/small_deform_hard1.i)
- (modules/solid_mechanics/test/tests/mohr_coulomb/small_deform1_uo.i)
- (modules/solid_mechanics/test/tests/tensile/random_update.i)
- (modules/solid_mechanics/test/tests/mean_cap_TC/small_deform5.i)
- (modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform5.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/monolithic_material_based/crysp_fileread.i)
- (modules/solid_mechanics/test/tests/capped_drucker_prager/small_deform2_native.i)
- (modules/solid_mechanics/test/tests/tensile/random_smoothed.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/monolithic_material_based/cp_slip_rate_integ/crysp_substep.i)
- (modules/solid_mechanics/test/tests/weak_plane_tensile/large_deform2.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/stress_update_material_based/substep.i)
- (modules/solid_mechanics/test/tests/tensile/planar2.i)
- (modules/solid_mechanics/test/tests/capped_drucker_prager/small_deform2_inner_tip.i)
- (modules/solid_mechanics/test/tests/capped_weak_plane/small_deform8.i)
- (modules/solid_mechanics/test/tests/mohr_coulomb/uni_axial2.i)
- (modules/solid_mechanics/test/tests/notched_plastic_block/biaxial_smooth.i)
- (modules/porous_flow/test/tests/infiltration_and_drainage/rsc02.i)
- (modules/solid_mechanics/test/tests/capped_weak_plane/pull_and_shear_1step.i)
- (modules/solid_mechanics/test/tests/drucker_prager/small_deform3_outer_tip.i)
- (modules/solid_mechanics/test/tests/tensile/small_deform6.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/stress_update_material_based/use_substep_dt.i)
- (modules/solid_mechanics/test/tests/mohr_coulomb/planar_hard4.i)
- (modules/porous_flow/test/tests/gravity/grav02f.i)
- (modules/solid_mechanics/test/tests/tensile/planar5.i)
- (modules/solid_mechanics/test/tests/weak_plane_shear/small_deform3.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/twinning/combined_twinning_slip_error.i)
- (modules/solid_mechanics/test/tests/tensile/small_deform4.i)
- (modules/solid_mechanics/test/tests/drucker_prager/small_deform2_native.i)
- (modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform18.i)
- (modules/solid_mechanics/test/tests/capped_weak_plane/beam.i)
- (modules/solid_mechanics/test/tests/multi/three_surface01.i)
- (modules/solid_mechanics/test/tests/drucker_prager/random_hyperbolic.i)
- (modules/solid_mechanics/test/tests/mohr_coulomb/many_deforms_cap.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/user_object_based/exception.i)
- (modules/solid_mechanics/test/tests/capped_weak_plane/small_deform6.i)
- (modules/solid_mechanics/examples/coal_mining/coarse.i)
- (modules/solid_mechanics/test/tests/drucker_prager/small_deform2_outer_tip.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/user_object_based/linesearch.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/user_object_based/user_object_Voce_BCC.i)
- (modules/solid_mechanics/test/tests/tensile/small_deform7.i)
- (modules/solid_mechanics/test/tests/weak_plane_tensile/small_deform_hard_cubic.i)
- (modules/solid_mechanics/test/tests/capped_weak_plane/small_deform4.i)
- (modules/solid_mechanics/test/tests/multi/two_surface02.i)
- (modules/solid_mechanics/test/tests/multi/three_surface16.i)
- (modules/solid_mechanics/test/tests/capped_drucker_prager/small_deform3_inner_edge.i)
- (modules/solid_mechanics/test/tests/multi/four_surface14.i)
- (modules/solid_mechanics/test/tests/weak_plane_shear/small_deform_harden2.i)
- (modules/solid_mechanics/test/tests/j2_plasticity/small_deform1.i)
- (modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform16.i)
- (modules/solid_mechanics/test/tests/capped_drucker_prager/small_deform3_native.i)
- (modules/solid_mechanics/test/tests/weak_plane_tensile/small_deform1.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/cp_eigenstrains/hcp_volumetric_eigenstrain_decrease.i)
- (modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform1_cosserat.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/cp_eigenstrains/volumetric_eigenstrain_increase.i)
- (modules/solid_mechanics/test/tests/multi/six_surface14.i)
- (modules/solid_mechanics/test/tests/jacobian/cto16.i)
- (modules/solid_mechanics/test/tests/tensile/small_deform3.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/stress_update_material_based/update_method_test.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/monolithic_material_based/crysp_cutback.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/user_object_based/fileread.i)
- (modules/porous_flow/test/tests/gravity/grav02g.i)
- (modules/solid_mechanics/test/tests/capped_weak_plane/small_deform_cosserat4.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/hcp_twinning/demonstration_combined_hcp_slip_twins.i)
- (modules/solid_mechanics/test/tests/weak_plane_shear/small_deform1.i)
- (modules/solid_mechanics/test/tests/multi/three_surface13.i)
- (modules/solid_mechanics/test/tests/capped_weak_plane/small_deform3.i)
- (modules/solid_mechanics/test/tests/mohr_coulomb/random_planar.i)
- (modules/solid_mechanics/test/tests/capped_weak_plane/small_deform7.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/hcp_single_crystal/update_method_hcp_aprismatic_capyramidal.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/stress_update_material_based/exception.i)
- (modules/solid_mechanics/test/tests/isotropicSD_plasticity/isotropicSD.i)
- (modules/solid_mechanics/test/tests/capped_weak_plane/except6.i)
- (modules/solid_mechanics/test/tests/multi/three_surface11.i)
- (modules/solid_mechanics/test/tests/weak_plane_tensile/large_deform1.i)
- (modules/solid_mechanics/test/tests/capped_drucker_prager/small_deform2_lode_zero.i)
- (modules/solid_mechanics/test/tests/mean_cap_TC/random02.i)
- (modules/solid_mechanics/test/tests/multiple_two_parameter_plasticity/dp_then_wp.i)
- (modules/solid_mechanics/test/tests/notched_plastic_block/biaxial_planar.i)
- (modules/solid_mechanics/test/tests/multi/three_surface12.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/hcp_single_crystal/update_method_hcp_aprismatic_active.i)
- (modules/solid_mechanics/test/tests/multi/paper5.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/hcp_single_crystal/update_method_hcp_no_negative_aprismatic.i)
- (modules/solid_mechanics/test/tests/j2_plasticity/small_deform3.i)
- (modules/solid_mechanics/test/tests/mean_cap_TC/small_deform1.i)
- (modules/solid_mechanics/test/tests/tensile/small_deform1.i)
- (modules/solid_mechanics/test/tests/jacobian/cto15.i)
- (modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform19.i)
- (modules/solid_mechanics/test/tests/tensile/small_deform3_update_version.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/user_object_based/save_euler.i)
- (modules/solid_mechanics/test/tests/multi/three_surface04.i)
- (modules/solid_mechanics/test/tests/mohr_coulomb/small_deform5.i)
- (modules/solid_mechanics/test/tests/multiple_two_parameter_plasticity/cycled_dp_then_wp.i)
- (modules/solid_mechanics/test/tests/tensile/planar6.i)
- (modules/solid_mechanics/test/tests/mean_cap_TC/small_deform4.i)
- (modules/solid_mechanics/test/tests/multi/rock1.i)
- (modules/solid_mechanics/test/tests/multi/two_surface03.i)
- (modules/solid_mechanics/test/tests/capped_weak_plane/small_deform5.i)
- (modules/solid_mechanics/test/tests/mean_cap_TC/random04.i)
- (modules/solid_mechanics/test/tests/capped_drucker_prager/random.i)
- (modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform11.i)
- (modules/solid_mechanics/test/tests/tensile/random_planar.i)
- (modules/porous_flow/test/tests/infiltration_and_drainage/rd01.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/user_object_based/prop_block_read.i)
- (modules/solid_mechanics/test/tests/multi/three_surface08.i)
- (modules/solid_mechanics/examples/coal_mining/fine.i)
- (modules/solid_mechanics/test/tests/capped_weak_plane/small_deform_inclined2.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/hcp_twinning/modified_kalidindi_for_hcp.i)
- (modules/solid_mechanics/test/tests/weak_plane_shear/large_deform3.i)
- (modules/solid_mechanics/test/tests/tensile/small_deform6_update_version.i)
- (modules/solid_mechanics/test/tests/mohr_coulomb/planar3.i)
- (modules/solid_mechanics/test/tests/capped_weak_plane/small_deform11.i)
- (modules/solid_mechanics/test/tests/capped_weak_plane/small_deform_inclined5.i)
- (modules/porous_flow/examples/coal_mining/coarse_with_fluid.i)
- (modules/solid_mechanics/test/tests/weak_plane_shear/large_deform1.i)
- (modules/solid_mechanics/test/tests/capped_weak_plane/pull_push.i)
- (modules/solid_mechanics/test/tests/capped_drucker_prager/small_deform2_outer_tip.i)
- (modules/porous_flow/test/tests/infiltration_and_drainage/bw02.i)
- (modules/solid_mechanics/test/tests/capped_mohr_coulomb/random3.i)
- (modules/solid_mechanics/test/tests/multi/two_surface01.i)
- (modules/solid_mechanics/test/tests/multi/two_surface04.i)
- (modules/solid_mechanics/test/tests/tensile/small_deform1_update_version.i)
- (modules/solid_mechanics/test/tests/tensile/small_deform9_update_version.i)
- (modules/solid_mechanics/test/tests/drucker_prager/small_deform3_inner_tip.i)
- (modules/porous_flow/test/tests/buckley_leverett/bl01.i)
- (modules/solid_mechanics/test/tests/multi/three_surface15.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/monolithic_material_based/crysp_read_slip_prop.i)
- (modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform12.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/monolithic_material_based/crysp_substep.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/twinning/combined_twinning_slip_111tension.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/hcp_single_crystal/update_method_hcp_basal_active.i)
- (modules/solid_mechanics/test/tests/weak_plane_shear/small_deform_harden1.i)
- (modules/solid_mechanics/test/tests/mean_cap/small_deform1.i)
- (modules/solid_mechanics/test/tests/mohr_coulomb/planar_hard3.i)
- (modules/porous_flow/examples/coal_mining/fine_with_fluid.i)
- (modules/solid_mechanics/test/tests/tensile/planar7.i)
- (modules/solid_mechanics/test/tests/drucker_prager/small_deform2_inner_edge.i)
- (modules/porous_flow/test/tests/infiltration_and_drainage/bw01.i)
- (modules/solid_mechanics/test/tests/mohr_coulomb/uni_axial1.i)
- (modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform9_cosserat.i)
- (modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform_hard21.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/twinning/non_coplanar_twin_hardening.i)
- (modules/solid_mechanics/test/tests/mean_cap_TC/small_deform7.i)
- (modules/solid_mechanics/test/tests/multi/two_surface05.i)
- (modules/solid_mechanics/test/tests/drucker_prager/small_deform3_native.i)
- (modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform9.i)
- (modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform6.i)
- (modules/solid_mechanics/test/tests/multi/three_surface05.i)
- (modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform2.i)
- (modules/porous_flow/test/tests/infiltration_and_drainage/wli02.i)
- (modules/solid_mechanics/test/tests/mohr_coulomb/planar_hard5.i)
- (modules/solid_mechanics/test/tests/uel/tensile_umat_moose_umat.i)
- (modules/solid_mechanics/test/tests/tensile/small_deform_hard3.i)
- (modules/solid_mechanics/test/tests/weak_plane_shear/small_deform_harden4.i)
- (modules/solid_mechanics/test/tests/capped_weak_plane/small_deform_inclined3.i)
- (modules/solid_mechanics/test/tests/notched_plastic_block/cmc_smooth.i)
- (modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform8.i)
- (modules/solid_mechanics/test/tests/tensile/small_deform5_update_version.i)
- (modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform25.i)
- (modules/solid_mechanics/examples/coal_mining/cosserat_elastic.i)
- (modules/solid_mechanics/examples/coal_mining/cosserat_mc_wp_sticky_longitudinal.i)
- (modules/solid_mechanics/test/tests/mohr_coulomb/small_deform4.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/user_object_based/use_substep_dt.i)
- (modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform24.i)
- (modules/solid_mechanics/test/tests/capped_drucker_prager/small_deform2_inner_edge.i)
- (modules/solid_mechanics/test/tests/j2_plasticity/hard1.i)
- (modules/solid_mechanics/test/tests/multi/three_surface14.i)
- (modules/solid_mechanics/test/tests/tensile/planar3.i)
- (modules/solid_mechanics/test/tests/mean_cap_TC/random03.i)
- (modules/solid_mechanics/test/tests/mean_cap_TC/small_deform2.i)
- (modules/solid_mechanics/test/tests/multi/three_surface00.i)
- (modules/solid_mechanics/test/tests/isotropicSD_plasticity/powerRuleHardening.i)
- (modules/solid_mechanics/test/tests/capped_drucker_prager/small_deform3_outer_tip.i)
- (modules/solid_mechanics/test/tests/notched_plastic_block/cmc_planar.i)
- (modules/solid_mechanics/test/tests/weak_plane_shear/large_deform2.i)
- (modules/solid_mechanics/test/tests/multi/three_surface07.i)
- (modules/solid_mechanics/test/tests/mean_cap_TC/small_deform6.i)
- (modules/solid_mechanics/test/tests/drucker_prager/small_deform2_inner_tip.i)
(modules/porous_flow/test/tests/gravity/grav02g.i)
# Checking that gravity head is established in the transient situation when 0<=saturation<=1 (note the less-than-or-equal-to).
# 2phase (PS), 2components, Brooks-Corey capillary pressure, constant fluid bulk-moduli for each phase, constant viscosity,
# constant permeability, Brooks-Corey relative permeabilities with residual saturation
[Mesh]
  type = GeneratedMesh
  dim = 2
  ny = 10
  ymax = 100
[]
[GlobalParams]
  PorousFlowDictator = dictator
  gravity = '0 -10 0'
[]
[Variables]
  [ppwater]
    initial_condition = 1.5e6
  []
  [sgas]
    initial_condition = 0.3
  []
[]
[AuxVariables]
  [massfrac_ph0_sp0]
    initial_condition = 1
  []
  [massfrac_ph1_sp0]
    initial_condition = 0
  []
  [ppgas]
    family = MONOMIAL
    order = CONSTANT
  []
  [swater]
    family = MONOMIAL
    order = CONSTANT
  []
  [relpermwater]
    family = MONOMIAL
    order = CONSTANT
  []
  [relpermgas]
    family = MONOMIAL
    order = CONSTANT
  []
[]
[Kernels]
  [mass0]
    type = PorousFlowMassTimeDerivative
    fluid_component = 0
    variable = ppwater
  []
  [flux0]
    type = PorousFlowAdvectiveFlux
    fluid_component = 0
    variable = ppwater
  []
  [mass1]
    type = PorousFlowMassTimeDerivative
    fluid_component = 1
    variable = sgas
  []
  [flux1]
    type = PorousFlowAdvectiveFlux
    fluid_component = 1
    variable = sgas
  []
[]
[AuxKernels]
  [ppgas]
    type = PorousFlowPropertyAux
    property = pressure
    phase = 1
    variable = ppgas
  []
  [swater]
    type = PorousFlowPropertyAux
    property = saturation
    phase = 0
    variable = swater
  []
  [relpermwater]
    type = MaterialStdVectorAux
    property = PorousFlow_relative_permeability_qp
    index = 0
    variable = relpermwater
  []
  [relpermgas]
    type = PorousFlowPropertyAux
    property = relperm
    phase = 1
    variable = relpermgas
  []
[]
[UserObjects]
  [dictator]
    type = PorousFlowDictator
    porous_flow_vars = 'ppwater sgas'
    number_fluid_phases = 2
    number_fluid_components = 2
  []
  [pc]
    type = PorousFlowCapillaryPressureBC
    lambda = 2
    pe = 1e4
  []
[]
[FluidProperties]
  [simple_fluid0]
    type = SimpleFluidProperties
    bulk_modulus = 2e9
    density0 = 1000
    viscosity = 1e-3
    thermal_expansion = 0
  []
  [simple_fluid1]
    type = SimpleFluidProperties
    bulk_modulus = 2e9
    density0 = 10
    viscosity = 1e-5
    thermal_expansion = 0
  []
[]
[Materials]
  [temperature]
    type = PorousFlowTemperature
  []
  [ppss]
    type = PorousFlow2PhasePS
    phase0_porepressure = ppwater
    phase1_saturation = sgas
    capillary_pressure = pc
  []
  [massfrac]
    type = PorousFlowMassFraction
    mass_fraction_vars = 'massfrac_ph0_sp0 massfrac_ph1_sp0'
  []
  [simple_fluid0]
    type = PorousFlowSingleComponentFluid
    fp = simple_fluid0
    phase = 0
  []
  [simple_fluid1]
    type = PorousFlowSingleComponentFluid
    fp = simple_fluid1
    phase = 1
  []
  [porosity]
    type = PorousFlowPorosityConst
    porosity = 0.1
  []
  [permeability]
    type = PorousFlowPermeabilityConst
    permeability = '1e-11 0 0 0 1e-11 0  0 0 1e-11'
  []
  [relperm_water]
    type = PorousFlowRelativePermeabilityBC
    lambda = 2
    phase = 0
    s_res = 0.25
    sum_s_res = 0.35
  []
  [relperm_gas]
    type = PorousFlowRelativePermeabilityBC
    lambda = 2
    phase = 1
    s_res = 0.1
    sum_s_res = 0.35
    nw_phase = true
  []
[]
[Postprocessors]
  [mass_ph0]
    type = PorousFlowFluidMass
    fluid_component = 0
    execute_on = 'initial timestep_end'
  []
  [mass_ph1]
    type = PorousFlowFluidMass
    fluid_component = 1
    execute_on = 'initial timestep_end'
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
    petsc_options_iname = '-ksp_type -pc_type -snes_stol -snes_max_it'
    petsc_options_value = 'bcgs bjacobi 1E-13 15'
  []
[]
[Executioner]
  type = Transient
  solve_type = Newton
  end_time = 1e5
  [TimeStepper]
    type = IterationAdaptiveDT
    dt = 5e3
  []
[]
[Outputs]
  execute_on = 'initial timestep_end'
  file_base = grav02g
  exodus = true
  perf_graph = true
  csv = false
[]
(modules/solid_mechanics/test/tests/tensile/small_deform8_update_version.i)
# A single unit element is stretched by 1E-6m in z direction.
# with Lame lambda = 0.6E6 and Lame mu (shear) = 1E6
# stress_zz = 2.6 Pa
# stress_xx = 0.6 Pa
# stress_yy = 0.6 Pa
# tensile_strength is set to 0.5Pa
#
# stress_zz = 0.5
# plastic multiplier = 2.1/2.6 E-6
# stress_xx = 0.6 - (2.1/2.6*0.6) = 0.115
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    strain = finite
    generate_output = 'max_principal_stress mid_principal_stress min_principal_stress stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1.0E-6*z'
  [../]
[]
[AuxVariables]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./f0_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./intnl_auxk]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl
  [../]
[]
[Postprocessors]
  [./s_I]
    type = PointValue
    point = '0 0 0'
    variable = max_principal_stress
  [../]
  [./s_II]
    type = PointValue
    point = '0 0 0'
    variable = mid_principal_stress
  [../]
  [./s_III]
    type = PointValue
    point = '0 0 0'
    variable = min_principal_stress
  [../]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./f2]
    type = PointValue
    point = '0 0 0'
    variable = f2
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
  [./intnl]
    type = PointValue
    point = '0 0 0'
    variable = intnl
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '0.6E6 1E6'
  [../]
  [./tensile]
    type = TensileStressUpdate
    tensile_strength = ts
    smoothing_tol = 0.0
    yield_function_tol = 1.0E-12
  [../]
  [./stress]
    type = ComputeMultipleInelasticStress
    inelastic_models = tensile
    perform_finite_strain_rotations = false
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform8_update_version
  exodus = false
  [./csv]
    type = CSV
  [../]
[]
(modules/solid_mechanics/test/tests/capped_weak_plane/pull_and_shear.i)
# Dynamic problem with plasticity.
# A column of material (not subject to gravity) has the z-displacement
# of its sides fixed, but the centre of its bottom side is pulled
# downwards.  This causes failure in the bottom elements.
#
# The problem utilises damping in the following way.
# The DynamicStressDivergenceTensors forms the residual
# integral  grad(stress) + zeta*grad(stress-dot)
#     = V/L * elasticity * (du/dx + zeta * dv/dx)
# where V is the elemental volume, and L is the length-scale,
# and u is the displacement, and v is the velocity.
# The InertialForce forms the residual
# integral  density * (accel + eta * velocity)
#     = V * density * (a + eta * v)
# where a is the acceleration.
# So, a damped oscillator description with both these
# kernels looks like
# 0 = V * (density * a + density * eta * v + elasticity * zeta * v / L^2 + elasticity / L^2 * u)
# Critical damping is when the coefficient of v is
# 2 * sqrt(density * elasticity / L^2)
# In the case at hand, density=1E4, elasticity~1E10 (Young is 16GPa),
# L~1 to 10 (in the horizontal or vertical direction), so this coefficient ~ 1E7 to 1E6.
# Choosing eta = 1E3 and zeta = 1E-2 gives approximate critical damping.
# If zeta is high then steady-state is achieved very quickly.
#
# In the case of plasticity, the effective stiffness of the elements
# is significantly less.  Therefore, the above parameters give
# overdamping.
#
# This simulation is a nice example of the irreversable and non-uniqueness
# of simulations involving plasticity.  The result depends on the damping
# parameters and the time stepping.
[Mesh]
  [generated_mesh]
    type = GeneratedMeshGenerator
    dim = 3
    nx = 10
    ny = 1
    nz = 5
    bias_z = 1.5
    xmin = -10
    xmax = 10
    ymin = -10
    ymax = 10
    zmin = -100
    zmax = 0
  []
  [bottomz_middle]
    type = BoundingBoxNodeSetGenerator
    new_boundary = bottomz_middle
    bottom_left = '-1 -1500 -105'
    top_right = '1 1500 -95'
    input = generated_mesh
  []
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
  beta = 0.25 # Newmark time integration
  gamma = 0.5 # Newmark time integration
  eta = 1E3 #0.3E4 # higher values mean more damping via density
[]
[Variables]
  [disp_x]
  []
  [disp_y]
  []
  [disp_z]
  []
[]
[Kernels]
  [DynamicSolidMechanics] # zeta*K*vel + K * disp
    stiffness_damping_coefficient = 1E-2 # higher values mean more damping via stiffness
    hht_alpha = 0 # better nonlinear convergence than for alpha>0
  []
  [inertia_x] # M*accel + eta*M*vel
    type = InertialForce
    use_displaced_mesh = false
    variable = disp_x
    velocity = vel_x
    acceleration = accel_x
  []
  [inertia_y]
    type = InertialForce
    use_displaced_mesh = false
    variable = disp_y
    velocity = vel_y
    acceleration = accel_y
  []
  [inertia_z]
    type = InertialForce
    use_displaced_mesh = false
    variable = disp_z
    velocity = vel_z
    acceleration = accel_z
  []
[]
[BCs]
  [no_x2]
    type = DirichletBC
    variable = disp_x
    boundary = right
    value = 0.0
  []
  [no_x1]
    type = DirichletBC
    variable = disp_x
    boundary = left
    value = 0.0
  []
  [no_y1]
    type = DirichletBC
    variable = disp_y
    boundary = bottom
    value = 0.0
  []
  [no_y2]
    type = DirichletBC
    variable = disp_y
    boundary = top
    value = 0.0
  []
  [z_fixed_sides_xmin]
    type = DirichletBC
    variable = disp_z
    boundary = left
    value = 0
  []
  [z_fixed_sides_xmax]
    type = DirichletBC
    variable = disp_z
    boundary = right
    value = 0
  []
  [bottomz]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = bottomz_middle
    function = max(-10*t,-10)
  []
[]
[AuxVariables]
  [accel_x]
  []
  [vel_x]
  []
  [accel_y]
  []
  [vel_y]
  []
  [accel_z]
  []
  [vel_z]
  []
  [stress_xx]
    order = CONSTANT
    family = MONOMIAL
  []
  [stress_xy]
    order = CONSTANT
    family = MONOMIAL
  []
  [stress_xz]
    order = CONSTANT
    family = MONOMIAL
  []
  [stress_yy]
    order = CONSTANT
    family = MONOMIAL
  []
  [stress_yz]
    order = CONSTANT
    family = MONOMIAL
  []
  [stress_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [strainp_xx]
    order = CONSTANT
    family = MONOMIAL
  []
  [strainp_xy]
    order = CONSTANT
    family = MONOMIAL
  []
  [strainp_xz]
    order = CONSTANT
    family = MONOMIAL
  []
  [strainp_yy]
    order = CONSTANT
    family = MONOMIAL
  []
  [strainp_yz]
    order = CONSTANT
    family = MONOMIAL
  []
  [strainp_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [straint_xx]
    order = CONSTANT
    family = MONOMIAL
  []
  [straint_xy]
    order = CONSTANT
    family = MONOMIAL
  []
  [straint_xz]
    order = CONSTANT
    family = MONOMIAL
  []
  [straint_yy]
    order = CONSTANT
    family = MONOMIAL
  []
  [straint_yz]
    order = CONSTANT
    family = MONOMIAL
  []
  [straint_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [f_shear]
    order = CONSTANT
    family = MONOMIAL
  []
  [f_tensile]
    order = CONSTANT
    family = MONOMIAL
  []
  [f_compressive]
    order = CONSTANT
    family = MONOMIAL
  []
  [intnl_shear]
    order = CONSTANT
    family = MONOMIAL
  []
  [intnl_tensile]
    order = CONSTANT
    family = MONOMIAL
  []
  [iter]
    order = CONSTANT
    family = MONOMIAL
  []
  [ls]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[AuxKernels]
  [accel_x] # Calculates and stores acceleration at the end of time step
    type = NewmarkAccelAux
    variable = accel_x
    displacement = disp_x
    velocity = vel_x
    execute_on = timestep_end
  []
  [vel_x] # Calculates and stores velocity at the end of the time step
    type = NewmarkVelAux
    variable = vel_x
    acceleration = accel_x
    execute_on = timestep_end
  []
  [accel_y]
    type = NewmarkAccelAux
    variable = accel_y
    displacement = disp_y
    velocity = vel_y
    execute_on = timestep_end
  []
  [vel_y]
    type = NewmarkVelAux
    variable = vel_y
    acceleration = accel_y
    execute_on = timestep_end
  []
  [accel_z]
    type = NewmarkAccelAux
    variable = accel_z
    displacement = disp_z
    velocity = vel_z
    execute_on = timestep_end
  []
  [vel_z]
    type = NewmarkVelAux
    variable = vel_z
    acceleration = accel_z
    execute_on = timestep_end
  []
  [stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  []
  [stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  []
  [stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  []
  [stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  []
  [stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  []
  [stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  []
  [strainp_xx]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_xx
    index_i = 0
    index_j = 0
  []
  [strainp_xy]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_xy
    index_i = 0
    index_j = 1
  []
  [strainp_xz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_xz
    index_i = 0
    index_j = 2
  []
  [strainp_yy]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_yy
    index_i = 1
    index_j = 1
  []
  [strainp_yz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_yz
    index_i = 1
    index_j = 2
  []
  [strainp_zz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_zz
    index_i = 2
    index_j = 2
  []
  [straint_xx]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_xx
    index_i = 0
    index_j = 0
  []
  [straint_xy]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_xy
    index_i = 0
    index_j = 1
  []
  [straint_xz]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_xz
    index_i = 0
    index_j = 2
  []
  [straint_yy]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_yy
    index_i = 1
    index_j = 1
  []
  [straint_yz]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_yz
    index_i = 1
    index_j = 2
  []
  [straint_zz]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_zz
    index_i = 2
    index_j = 2
  []
  [f_shear]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f_shear
  []
  [f_tensile]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f_tensile
  []
  [f_compressive]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f_compressive
  []
  [intnl_shear]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl_shear
  []
  [intnl_tensile]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 1
    variable = intnl_tensile
  []
  [iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  []
  [ls]
    type = MaterialRealAux
    property = plastic_linesearch_needed
    variable = ls
  []
[]
[UserObjects]
  [coh]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  []
  [tanphi]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  []
  [tanpsi]
    type = SolidMechanicsHardeningConstant
    value = 0.166666666667
  []
  [t_strength]
    type = SolidMechanicsHardeningConstant
    value = 0
  []
  [c_strength]
    type = SolidMechanicsHardeningConstant
    value = 1E80
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '6.4E9 6.4E9' # young 16MPa, Poisson 0.25
  []
  [strain]
    type = ComputeIncrementalStrain
  []
  [admissible]
    type = ComputeMultipleInelasticStress
    inelastic_models = stress
    perform_finite_strain_rotations = false
  []
  [stress]
    type = CappedWeakPlaneStressUpdate
    cohesion = coh
    tan_friction_angle = tanphi
    tan_dilation_angle = tanpsi
    tensile_strength = t_strength
    compressive_strength = c_strength
    tip_smoother = 1E6
    smoothing_tol = 0.5E6
    yield_function_tol = 1E-2
  []
  [density]
    type = GenericConstantMaterial
    block = 0
    prop_names = density
    prop_values = 1E4
  []
[]
[Preconditioning]
  [andy]
    type = SMP
    full = true
    petsc_options = '-snes_converged_reason -snes_linesearch_monitor'
    petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
    petsc_options_value = ' asm      2              lu            gmres     200'
  []
[]
[Executioner]
  solve_type = 'NEWTON'
  petsc_options = '-snes_converged_reason'
  line_search = bt
  nl_abs_tol = 1E1
  nl_rel_tol = 1e-5
  l_tol = 1E-10
  l_max_its = 100
  nl_max_its = 100
  num_steps = 8
  dt = 0.1
  type = Transient
[]
[Outputs]
  file_base = pull_and_shear
  exodus = true
  csv = true
[]
(modules/solid_mechanics/test/tests/capped_mohr_coulomb/random4.i)
# Using CappedMohrCoulomb
# Plasticity models:
# Tensile strength = 0.1MPa
# Compressive strength = 1.0MPa
# Cohesion = 1MPa
# Friction angle = dilation angle = 0.5
#
# Lame lambda = 1GPa.  Lame mu = 1.3GPa
#
# A line of elements is perturbed randomly, and return to the yield surface at each quadpoint is checked
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 100
  ny = 12
  nz = 1
  xmin = 0
  xmax = 100
  ymin = 0
  ymax = 12
  zmin = 0
  zmax = 1
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[ICs]
  [./x]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_x
  [../]
  [./y]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_y
  [../]
  [./z]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_z
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '0'
  [../]
[]
[AuxVariables]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f3]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f4]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f5]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f6]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f7]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f8]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f9]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f10]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f11]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./f0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./f3]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 3
    variable = f3
  [../]
  [./f4]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 4
    variable = f4
  [../]
  [./f5]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 5
    variable = f5
  [../]
  [./f6]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 6
    variable = f6
  [../]
  [./f7]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 7
    variable = f7
  [../]
  [./f8]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 8
    variable = f8
  [../]
  [./f9]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 9
    variable = f9
  [../]
  [./f10]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 10
    variable = f10
  [../]
  [./f11]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 11
    variable = f11
  [../]
  [./int0]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = int0
  [../]
  [./int1]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 1
    variable = int1
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
[]
[Postprocessors]
  [./tot_iters]
    type = ElementIntegralMaterialProperty
    mat_prop = plastic_NR_iterations
    outputs = console
  [../]
  [./intnl0_max]
    type = ElementExtremeValue
    variable = int0
    outputs = console
  [../]
  [./intnl1_max]
    type = ElementExtremeValue
    variable = int1
    outputs = console
  [../]
  [./raw_f0]
    type = ElementExtremeValue
    variable = f0
    outputs = console
  [../]
  [./raw_f1]
    type = ElementExtremeValue
    variable = f1
    outputs = console
  [../]
  [./raw_f2]
    type = ElementExtremeValue
    variable = f2
    outputs = console
  [../]
  [./raw_f3]
    type = ElementExtremeValue
    variable = f3
    outputs = console
  [../]
  [./raw_f4]
    type = ElementExtremeValue
    variable = f4
    outputs = console
  [../]
  [./raw_f5]
    type = ElementExtremeValue
    variable = f5
    outputs = console
  [../]
  [./raw_f6]
    type = ElementExtremeValue
    variable = f6
    outputs = console
  [../]
  [./raw_f7]
    type = ElementExtremeValue
    variable = f7
    outputs = console
  [../]
  [./raw_f8]
    type = ElementExtremeValue
    variable = f8
    outputs = console
  [../]
  [./raw_f9]
    type = ElementExtremeValue
    variable = f9
    outputs = console
  [../]
  [./raw_f10]
    type = ElementExtremeValue
    variable = f10
    outputs = console
  [../]
  [./raw_f11]
    type = ElementExtremeValue
    variable = f11
    outputs = console
  [../]
  [./iter]
    type = ElementExtremeValue
    variable = iter
    outputs = console
  [../]
  [./f0]
    type = FunctionValuePostprocessor
    function = should_be_zero0_fcn
  [../]
  [./f1]
    type = FunctionValuePostprocessor
    function = should_be_zero1_fcn
  [../]
  [./f2]
    type = FunctionValuePostprocessor
    function = should_be_zero2_fcn
  [../]
  [./f3]
    type = FunctionValuePostprocessor
    function = should_be_zero3_fcn
  [../]
  [./f4]
    type = FunctionValuePostprocessor
    function = should_be_zero4_fcn
  [../]
  [./f5]
    type = FunctionValuePostprocessor
    function = should_be_zero5_fcn
  [../]
  [./f6]
    type = FunctionValuePostprocessor
    function = should_be_zero6_fcn
  [../]
  [./f7]
    type = FunctionValuePostprocessor
    function = should_be_zero7_fcn
  [../]
  [./f8]
    type = FunctionValuePostprocessor
    function = should_be_zero8_fcn
  [../]
  [./f9]
    type = FunctionValuePostprocessor
    function = should_be_zero9_fcn
  [../]
  [./f10]
    type = FunctionValuePostprocessor
    function = should_be_zero10_fcn
  [../]
  [./f11]
    type = FunctionValuePostprocessor
    function = should_be_zero11_fcn
  [../]
[]
[Functions]
  [./should_be_zero0_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-1,0,a)'
    symbol_names = 'a'
    symbol_values = 'raw_f0'
  [../]
  [./should_be_zero1_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-1,0,a)'
    symbol_names = 'a'
    symbol_values = 'raw_f1'
  [../]
  [./should_be_zero2_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-1,0,a)'
    symbol_names = 'a'
    symbol_values = 'raw_f2'
  [../]
  [./should_be_zero3_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-1,0,a)'
    symbol_names = 'a'
    symbol_values = 'raw_f3'
  [../]
  [./should_be_zero4_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-1,0,a)'
    symbol_names = 'a'
    symbol_values = 'raw_f4'
  [../]
  [./should_be_zero5_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-1,0,a)'
    symbol_names = 'a'
    symbol_values = 'raw_f5'
  [../]
  [./should_be_zero6_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-1,0,a)'
    symbol_names = 'a'
    symbol_values = 'raw_f6'
  [../]
  [./should_be_zero7_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-1,0,a)'
    symbol_names = 'a'
    symbol_values = 'raw_f7'
  [../]
  [./should_be_zero8_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-1,0,a)'
    symbol_names = 'a'
    symbol_values = 'raw_f8'
  [../]
  [./should_be_zero9_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-1,0,a)'
    symbol_names = 'a'
    symbol_values = 'raw_f9'
  [../]
  [./should_be_zero10_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-1,0,a)'
    symbol_names = 'a'
    symbol_values = 'raw_f10'
  [../]
  [./should_be_zero11_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-1,0,a)'
    symbol_names = 'a'
    symbol_values = 'raw_f11'
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningCubic
    value_0 = 1E6
    value_residual = 2E6
    internal_limit = 1
  [../]
  [./cs]
    type = SolidMechanicsHardeningCubic
    value_0 = 1E7
    value_residual = 0.5E7
    internal_limit = 1
  [../]
  [./coh]
    type = SolidMechanicsHardeningCubic
    value_0 = 2E6
    value_residual = 1E6
    internal_limit = 1
  [../]
  [./phi]
    type = SolidMechanicsHardeningCubic
    value_0 = 0.6
    value_residual = 0.2
    internal_limit = 1
  [../]
  [./psi]
    type = SolidMechanicsHardeningCubic
    value_0 = 0.5
    value_residual = 0.1
    internal_limit = 1
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '1E9 1.3E9'
  [../]
  [./tensile]
    type = CappedMohrCoulombStressUpdate
    tensile_strength = ts
    compressive_strength = cs
    cohesion = coh
    friction_angle = phi
    dilation_angle = psi
    smoothing_tol = 1E5
    max_NR_iterations = 1000
    yield_function_tol = 1.0E-1
  [../]
  [./stress]
    type = ComputeMultipleInelasticStress
    inelastic_models = tensile
    perform_finite_strain_rotations = false
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  dtmin = 1
  type = Transient
[]
[Outputs]
  file_base = random4
  csv = true
[]
(modules/solid_mechanics/test/tests/tensile/small_deform2_update_version.i)
# Using TensileStressUpdate
# checking for small deformation
# A single element is stretched equally in all directions.
# This causes the return direction to be along the sigma_I = sigma_II = sigma_III line
# tensile_strength is set to 1Pa, and smoothing_tol = 0.1Pa
# The smoothed yield function comes from two smoothing operations.
# The first is on sigma_I and sigma_II (sigma_I >= sigma_II >= sigma_III):
# yf = sigma_I + ismoother(0) - tensile_strength
#    = sigma_I + (0.5 * smoothing_tol - smoothing_tol / Pi) - tensile_strength
#    = sigma_I + 0.018169 - 1
# The second has the argument of ismoother equal to -0.018169.
# ismoother(-0.018169) = 0.5 * (-0.018169 + 0.1) - 0.1 * cos (0.5 * Pi * -0.018169 / 0.1) / Pi
#                     = 0.010372
# So the final yield function is
# yf = sigma_I + 0.018169 + 0.010372 - 1 = sigma_I + 0.028541 - 1
# However, because of the asymmetry in smoothing (the yield function is obtained
# by first smoothing sigma_I-ts and sigma_II-ts, and then by smoothing this
# result with sigma_III-ts) the result is sigma_I = sigma_II > sigma_III
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    strain = finite
    generate_output = 'max_principal_stress mid_principal_stress min_principal_stress stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '1E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '1E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1E-6*z'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_I]
    type = PointValue
    point = '0 0 0'
    variable = max_principal_stress
  [../]
  [./s_II]
    type = PointValue
    point = '0 0 0'
    variable = mid_principal_stress
  [../]
  [./s_III]
    type = PointValue
    point = '0 0 0'
    variable = min_principal_stress
  [../]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 2.0E6'
  [../]
  [./tensile]
    type = TensileStressUpdate
    tensile_strength = ts
    smoothing_tol = 0.1
    yield_function_tol = 1.0E-12
  [../]
  [./stress]
    type = ComputeMultipleInelasticStress
    inelastic_models = tensile
    perform_finite_strain_rotations = false
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform2_update_version
  exodus = false
  [./csv]
    type = CSV
  [../]
[]
(modules/solid_mechanics/examples/coal_mining/cosserat_mc_wp_sticky.i)
# Strata deformation and fracturing around a coal mine
#
# A 2D geometry is used that simulates a transverse section of
# the coal mine.  The model is actually 3D, but the "x"
# dimension is only 10m long, meshed with 1 element, and
# there is no "x" displacement.  The mine is 400m deep
# and just the roof is studied (0<=z<=400).  The model sits
# between 0<=y<=450.  The excavation sits in 0<=y<=150.  This
# is a "half model": the boundary conditions are such that
# the model simulates an excavation sitting in -150<=y<=150
# inside a model of the region -450<=y<=450.  The
# excavation height is 3m (ie, the excavation lies within
# 0<=z<=3).
#
# Time is meaningless in this example
# as quasi-static solutions are sought at each timestep, but
# the number of timesteps controls the resolution of the
# process.
#
# The boundary conditions for this elastic simulation are:
#  - disp_x = 0 everywhere
#  - disp_y = 0 at y=0 and y=450
#  - disp_z = 0 at z=0, but there is a time-dependent
#               Young's modulus that simulates excavation
#  - wc_x = 0 at y=0 and y=450.
# That is, rollers on the sides, free at top,
# and prescribed at bottom in the unexcavated portion.
#
# The small strain formulation is used.
#
# All stresses are measured in MPa.  The initial stress is consistent with
# the weight force from density 2500 kg/m^3, ie, stress_zz = -0.025*(300-z) MPa
# where gravity = 10 m.s^-2 = 1E-5 MPa m^2/kg.  The maximum and minimum
# principal horizontal stresses are assumed to be equal to 0.8*stress_zz.
#
# Material properties:
# Young's modulus = 8 GPa
# Poisson's ratio = 0.25
# Cosserat layer thickness = 1 m
# Cosserat-joint normal stiffness = large
# Cosserat-joint shear stiffness = 1 GPa
# MC cohesion = 3 MPa
# MC friction angle = 37 deg
# MC dilation angle = 8 deg
# MC tensile strength = 1 MPa
# MC compressive strength = 100 MPa, varying down to 1 MPa when tensile strain = 1
# WeakPlane cohesion = 0.1 MPa
# WeakPlane friction angle = 30 deg
# WeakPlane dilation angle = 10 deg
# WeakPlane tensile strength = 0.1 MPa
# WeakPlane compressive strength = 100 MPa softening to 1 MPa at strain = 1
#
[Mesh]
  [generated_mesh]
    type = GeneratedMeshGenerator
    dim = 3
    nx = 1
    xmin = -5
    xmax = 5
    nz = 40
    zmin = 0
    zmax = 403.003
    bias_z = 1.1
    ny = 30 # make this a multiple of 3, so y=150 is at a node
    ymin = 0
    ymax = 450
  []
  [left]
    type = SideSetsAroundSubdomainGenerator
    block = 0
    new_boundary = 11
    normal = '0 -1 0'
    input = generated_mesh
  []
  [right]
    type = SideSetsAroundSubdomainGenerator
    block = 0
    new_boundary = 12
    normal = '0 1 0'
    input = left
  []
  [front]
    type = SideSetsAroundSubdomainGenerator
    block = 0
    new_boundary = 13
    normal = '-1 0 0'
    input = right
  []
  [back]
    type = SideSetsAroundSubdomainGenerator
    block = 0
    new_boundary = 14
    normal = '1 0 0'
    input = front
  []
  [top]
    type = SideSetsAroundSubdomainGenerator
    block = 0
    new_boundary = 15
    normal = '0 0 1'
    input = back
  []
  [bottom]
    type = SideSetsAroundSubdomainGenerator
    block = 0
    new_boundary = 16
    normal = '0 0 -1'
    input = top
  []
  [excav]
    type = SubdomainBoundingBoxGenerator
    block_id = 1
    bottom_left = '-5 0 0'
    top_right = '5 150 3'
    input = bottom
  []
  [roof]
    type = SideSetsAroundSubdomainGenerator
    block = 1
    new_boundary = 18
    normal = '0 0 1'
    input = excav
  []
[]
[GlobalParams]
  perform_finite_strain_rotations = false
  displacements = 'disp_x disp_y disp_z'
  Cosserat_rotations = 'wc_x wc_y wc_z'
[]
[Variables]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
  [./wc_x]
  [../]
[]
[Kernels]
  [./cy_elastic]
    type = CosseratStressDivergenceTensors
    use_displaced_mesh = false
    variable = disp_y
    component = 1
  [../]
  [./cz_elastic]
    type = CosseratStressDivergenceTensors
    use_displaced_mesh = false
    variable = disp_z
    component = 2
  [../]
  [./x_couple]
    type = StressDivergenceTensors
    use_displaced_mesh = false
    variable = wc_x
    displacements = 'wc_x wc_y wc_z'
    component = 0
    base_name = couple
  [../]
  [./x_moment]
    type = MomentBalancing
    use_displaced_mesh = false
    variable = wc_x
    component = 0
  [../]
  [./gravity]
    type = Gravity
    use_displaced_mesh = false
    variable = disp_z
    value = -10E-6 # remember this is in MPa
  [../]
[]
[AuxVariables]
  [./disp_x]
  [../]
  [./wc_y]
  [../]
  [./wc_z]
  [../]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./wp_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./wp_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./wp_shear_f]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./wp_tensile_f]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_shear_f]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_tensile_f]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yx
    index_i = 1
    index_j = 0
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zx
    index_i = 2
    index_j = 0
  [../]
  [./stress_zy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zy
    index_i = 2
    index_j = 1
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./mc_shear]
    type = MaterialStdVectorAux
    index = 0
    property = mc_plastic_internal_parameter
    variable = mc_shear
  [../]
  [./mc_tensile]
    type = MaterialStdVectorAux
    index = 1
    property = mc_plastic_internal_parameter
    variable = mc_tensile
  [../]
  [./wp_shear]
    type = MaterialStdVectorAux
    index = 0
    property = wp_plastic_internal_parameter
    variable = wp_shear
  [../]
  [./wp_tensile]
    type = MaterialStdVectorAux
    index = 1
    property = wp_plastic_internal_parameter
    variable = wp_tensile
  [../]
  [./mc_shear_f]
    type = MaterialStdVectorAux
    index = 6
    property = mc_plastic_yield_function
    variable = mc_shear_f
  [../]
  [./mc_tensile_f]
    type = MaterialStdVectorAux
    index = 0
    property = mc_plastic_yield_function
    variable = mc_tensile_f
  [../]
  [./wp_shear_f]
    type = MaterialStdVectorAux
    index = 0
    property = wp_plastic_yield_function
    variable = wp_shear_f
  [../]
  [./wp_tensile_f]
    type = MaterialStdVectorAux
    index = 1
    property = wp_plastic_yield_function
    variable = wp_tensile_f
  [../]
[]
[BCs]
  [./no_y]
    type = DirichletBC
    variable = disp_y
    boundary = '11 12'
    value = 0.0
  [../]
  [./no_z]
    type = DirichletBC
    variable = disp_z
    boundary = '16'
    value = 0.0
  [../]
  [./no_wc_x]
    type = DirichletBC
    variable = wc_x
    boundary = '11 12'
    value = 0.0
  [../]
  [./roof]
    type = StickyBC
    variable = disp_z
    min_value = -3.0
    boundary = '18'
  [../]
[]
[Functions]
  [./ini_xx]
    type = ParsedFunction
    expression = '-0.8*2500*10E-6*(403.003-z)'
  [../]
  [./ini_zz]
    type = ParsedFunction
    expression = '-2500*10E-6*(403.003-z)'
  [../]
  [./excav_sideways]
    type = ParsedFunction
    symbol_names = 'end_t ymin ymax  minval maxval slope'
    symbol_values = '1.0   0    150.0 1E-9 1 15'
    # excavation face at ymin+(ymax-ymin)*min(t/end_t,1)
    # slope is the distance over which the modulus reduces from maxval to minval
    expression = 'if(y<ymin+(ymax-ymin)*min(t/end_t,1),minval,if(y<ymin+(ymax-ymin)*min(t/end_t,1)+slope,minval+(maxval-minval)*(y-(ymin+(ymax-ymin)*min(t/end_t,1)))/slope,maxval))'
  [../]
  [./density_sideways]
    type = ParsedFunction
    symbol_names = 'end_t ymin ymax  minval maxval'
    symbol_values = '1.0   0    150.0 0 2500'
    expression = 'if(y<ymin+(ymax-ymin)*min(t/end_t,1),minval,maxval)'
  [../]
[]
[UserObjects]
  [./mc_coh_strong_harden]
    type = SolidMechanicsHardeningExponential
    value_0 = 2.99 # MPa
    value_residual = 3.01 # MPa
    rate = 1.0
  [../]
  [./mc_fric]
    type = SolidMechanicsHardeningConstant
    value = 0.65 # 37deg
  [../]
  [./mc_dil]
    type = SolidMechanicsHardeningConstant
    value = 0.15 # 8deg
  [../]
  [./mc_tensile_str_strong_harden]
    type = SolidMechanicsHardeningExponential
    value_0 = 1.0 # MPa
    value_residual = 1.0 # MPa
    rate = 1.0
  [../]
  [./mc_compressive_str]
    type = SolidMechanicsHardeningCubic
    value_0 = 100 # Large!
    value_residual = 100
    internal_limit = 0.1
  [../]
  [./wp_coh_harden]
    type = SolidMechanicsHardeningCubic
    value_0 = 0.1
    value_residual = 0.1
    internal_limit = 10
  [../]
  [./wp_tan_fric]
    type = SolidMechanicsHardeningConstant
    value = 0.36 # 20deg
  [../]
  [./wp_tan_dil]
    type = SolidMechanicsHardeningConstant
    value = 0.18 # 10deg
  [../]
  [./wp_tensile_str_harden]
    type = SolidMechanicsHardeningCubic
    value_0 = 0.1
    value_residual = 0.1
    internal_limit = 10
  [../]
  [./wp_compressive_str_soften]
    type = SolidMechanicsHardeningCubic
    value_0 = 100
    value_residual = 1
    internal_limit = 1.0
  [../]
[]
[Materials]
  [./elasticity_tensor_0]
    type = ComputeLayeredCosseratElasticityTensor
    block = 0
    young = 8E3 # MPa
    poisson = 0.25
    layer_thickness = 1.0
    joint_normal_stiffness = 1E9 # huge
    joint_shear_stiffness = 1E3 # MPa
  [../]
  [./elasticity_tensor_1]
    type = ComputeLayeredCosseratElasticityTensor
    block = 1
    young = 8E3 # MPa
    poisson = 0.25
    layer_thickness = 1.0
    joint_normal_stiffness = 1E9 # huge
    joint_shear_stiffness = 1E3 # MPa
    elasticity_tensor_prefactor = excav_sideways
  [../]
  [./strain]
    type = ComputeCosseratIncrementalSmallStrain
    eigenstrain_names = ini_stress
  [../]
  [./ini_stress]
    type = ComputeEigenstrainFromInitialStress
    eigenstrain_name = ini_stress
    initial_stress = 'ini_xx 0 0  0 ini_xx 0  0 0 ini_zz'
  [../]
  [./stress_0]
    # this is needed so as to correctly apply the initial stress
    type = ComputeMultipleInelasticCosseratStress
    block = 0
    inelastic_models = 'mc wp'
    cycle_models = true
    relative_tolerance = 2.0
    absolute_tolerance = 1E6
    max_iterations = 1
    tangent_operator = nonlinear
    perform_finite_strain_rotations = false
  [../]
  [./stress_1]
    type = ComputeMultipleInelasticCosseratStress
    block = 1
    inelastic_models = ''
    relative_tolerance = 2.0
    absolute_tolerance = 1E6
    max_iterations = 1
    tangent_operator = nonlinear
    perform_finite_strain_rotations = false
  [../]
  [./mc]
    type = CappedMohrCoulombCosseratStressUpdate
    warn_about_precision_loss = false
    host_youngs_modulus = 8E3
    host_poissons_ratio = 0.25
    base_name = mc
    tensile_strength = mc_tensile_str_strong_harden
    compressive_strength = mc_compressive_str
    cohesion = mc_coh_strong_harden
    friction_angle = mc_fric
    dilation_angle = mc_dil
    max_NR_iterations = 100000
    smoothing_tol = 0.1 # MPa  # Must be linked to cohesion
    yield_function_tol = 1E-9 # MPa.  this is essentially the lowest possible without lots of precision loss
    perfect_guess = true
    min_step_size = 1.0
  [../]
  [./wp]
    type = CappedWeakPlaneCosseratStressUpdate
    warn_about_precision_loss = false
    base_name = wp
    cohesion = wp_coh_harden
    tan_friction_angle = wp_tan_fric
    tan_dilation_angle = wp_tan_dil
    tensile_strength = wp_tensile_str_harden
    compressive_strength = wp_compressive_str_soften
    max_NR_iterations = 10000
    tip_smoother = 0.1
    smoothing_tol = 0.1 # MPa  # Note, this must be tied to cohesion, otherwise get no possible return at cone apex
    yield_function_tol = 1E-11 # MPa.  this is essentially the lowest possible without lots of precision loss
    perfect_guess = true
    min_step_size = 1.0E-3
  [../]
  [./density_0]
    type = GenericConstantMaterial
    block = 0
    prop_names = density
    prop_values = 2500
  [../]
  [./density_1]
    type = GenericFunctionMaterial
    block = 1
    prop_names = density
    prop_values = density_sideways
  [../]
[]
[Postprocessors]
  [./subs_max]
    type = PointValue
    point = '0 0 403.003'
    variable = disp_z
    use_displaced_mesh = false
  [../]
[]
[Preconditioning]
  [./SMP]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  solve_type = 'NEWTON'
  petsc_options = '-snes_converged_reason'
  petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
  petsc_options_value = ' asm      2              lu            gmres     200'
  line_search = bt
  nl_abs_tol = 1e-8
  nl_rel_tol = 1e-8
  l_max_its = 30
  nl_max_its = 1000
  start_time = 0.0
  dt = 0.01
  end_time = 1.0
[]
[Outputs]
  file_base = cosserat_mc_wp_sticky
  time_step_interval = 1
  print_linear_residuals = false
  exodus = true
  csv = true
  console = true
[]
(modules/solid_mechanics/examples/coal_mining/cosserat_mc_wp.i)
# Strata deformation and fracturing around a coal mine
#
# A 2D geometry is used that simulates a transverse section of
# the coal mine.  The model is actually 3D, but the "x"
# dimension is only 10m long, meshed with 1 element, and
# there is no "x" displacement.  The mine is 300m deep
# and just the roof is studied (0<=z<=300).  The model sits
# between 0<=y<=450.  The excavation sits in 0<=y<=150.  This
# is a "half model": the boundary conditions are such that
# the model simulates an excavation sitting in -150<=y<=150
# inside a model of the region -450<=y<=450.  The
# excavation height is 3m (ie, the excavation lies within
# 0<=z<=3).  Mining is simulated by moving the excavation's
# roof down, until disp_z=-3 at t=1.
# Time is meaningless in this example
# as quasi-static solutions are sought at each timestep, but
# the number of timesteps controls the resolution of the
# process.
#
# The boundary conditions are:
#  - disp_x = 0 everywhere
#  - disp_y = 0 at y=0 and y=450
#  - disp_z = 0 for y>150
#  - disp_z = -3 at maximum, for 0<=y<=150.  See excav function.
# That is, rollers on the sides, free at top, and prescribed at bottom.
#
# The small strain formulation is used.
#
# All stresses are measured in MPa.  The initial stress is consistent with
# the weight force from density 2500 kg/m^3, ie, stress_zz = -0.025*(300-z) MPa
# where gravity = 10 m.s^-2 = 1E-5 MPa m^2/kg.  The maximum and minimum
# principal horizontal stresses are assumed to be equal to 0.8*stress_zz.
#
# Material properties:
# Young's modulus = 8 GPa
# Poisson's ratio = 0.25
# Cosserat layer thickness = 1 m
# Cosserat-joint normal stiffness = large
# Cosserat-joint shear stiffness = 1 GPa
# MC cohesion = 3 MPa
# MC friction angle = 37 deg
# MC dilation angle = 8 deg
# MC tensile strength = 1 MPa
# MC compressive strength = 100 MPa, varying down to 1 MPa when tensile strain = 1
# WeakPlane cohesion = 0.1 MPa
# WeakPlane friction angle = 30 deg
# WeakPlane dilation angle = 10 deg
# WeakPlane tensile strength = 0.1 MPa
# WeakPlane compressive strength = 100 MPa softening to 1 MPa at strain = 1
#
[Mesh]
  [generated_mesh]
    type = GeneratedMeshGenerator
    dim = 3
    nx = 1
    xmin = -5
    xmax = 5
    nz = 40
    zmin = 0
    zmax = 400.0
    bias_z = 1.1
    ny = 30 # make this a multiple of 3, so y=150 is at a node
    ymin = 0
    ymax = 450
  []
  [left]
    type = SideSetsAroundSubdomainGenerator
    new_boundary = 11
    normal = '0 -1 0'
    input = generated_mesh
  []
  [right]
    type = SideSetsAroundSubdomainGenerator
    new_boundary = 12
    normal = '0 1 0'
    input = left
  []
  [front]
    type = SideSetsAroundSubdomainGenerator
    new_boundary = 13
    normal = '-1 0 0'
    input = right
  []
  [back]
    type = SideSetsAroundSubdomainGenerator
    new_boundary = 14
    normal = '1 0 0'
    input = front
  []
  [top]
    type = SideSetsAroundSubdomainGenerator
    new_boundary = 15
    normal = '0 0 1'
    input = back
  []
  [bottom]
    type = SideSetsAroundSubdomainGenerator
    new_boundary = 16
    normal = '0 0 -1'
    input = top
  []
  [excav]
    type = SubdomainBoundingBoxGenerator
    block_id = 1
    bottom_left = '-5 0 0'
    top_right = '5 150 3'
    input = bottom
  []
  [roof]
    type = SideSetsBetweenSubdomainsGenerator
    new_boundary = 21
    primary_block = 0
    paired_block = 1
    input = excav
  []
  [hole]
    type = BlockDeletionGenerator
    block = 1
    input = roof
  []
[]
[GlobalParams]
  block = 0
  perform_finite_strain_rotations = false
  displacements = 'disp_x disp_y disp_z'
  Cosserat_rotations = 'wc_x wc_y wc_z'
[]
[Variables]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
  [./wc_x]
  [../]
[]
[Kernels]
  [./cy_elastic]
    type = CosseratStressDivergenceTensors
    use_displaced_mesh = false
    variable = disp_y
    component = 1
  [../]
  [./cz_elastic]
    type = CosseratStressDivergenceTensors
    use_displaced_mesh = false
    variable = disp_z
    component = 2
  [../]
  [./x_couple]
    type = StressDivergenceTensors
    use_displaced_mesh = false
    variable = wc_x
    displacements = 'wc_x wc_y wc_z'
    component = 0
    base_name = couple
  [../]
  [./x_moment]
    type = MomentBalancing
    use_displaced_mesh = false
    variable = wc_x
    component = 0
  [../]
  [./gravity]
    type = Gravity
    use_displaced_mesh = false
    variable = disp_z
    value = -10E-6
  [../]
[]
[AuxVariables]
  [./disp_x]
  [../]
  [./wc_y]
  [../]
  [./wc_z]
  [../]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./wp_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./wp_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./wp_shear_f]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./wp_tensile_f]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_shear_f]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_tensile_f]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./mc_shear]
    type = MaterialStdVectorAux
    index = 0
    property = mc_plastic_internal_parameter
    variable = mc_shear
  [../]
  [./mc_tensile]
    type = MaterialStdVectorAux
    index = 1
    property = mc_plastic_internal_parameter
    variable = mc_tensile
  [../]
  [./wp_shear]
    type = MaterialStdVectorAux
    index = 0
    property = wp_plastic_internal_parameter
    variable = wp_shear
  [../]
  [./wp_tensile]
    type = MaterialStdVectorAux
    index = 1
    property = wp_plastic_internal_parameter
    variable = wp_tensile
  [../]
  [./mc_shear_f]
    type = MaterialStdVectorAux
    index = 6
    property = mc_plastic_yield_function
    variable = mc_shear_f
  [../]
  [./mc_tensile_f]
    type = MaterialStdVectorAux
    index = 0
    property = mc_plastic_yield_function
    variable = mc_tensile_f
  [../]
  [./wp_shear_f]
    type = MaterialStdVectorAux
    index = 0
    property = wp_plastic_yield_function
    variable = wp_shear_f
  [../]
  [./wp_tensile_f]
    type = MaterialStdVectorAux
    index = 1
    property = wp_plastic_yield_function
    variable = wp_tensile_f
  [../]
[]
[BCs]
  [./no_y]
    type = DirichletBC
    variable = disp_y
    boundary = '11 12 16 21' # note addition of 16 and 21
    value = 0.0
  [../]
  [./no_z]
    type = DirichletBC
    variable = disp_z
    boundary = '16'
    value = 0.0
  [../]
  [./no_wc_x]
    type = DirichletBC
    variable = wc_x
    boundary = '11 12'
    value = 0.0
  [../]
  [./roof]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 21
    function = excav_sideways
  [../]
[]
[Functions]
  [./ini_xx]
    type = ParsedFunction
    expression = '-0.8*2500*10E-6*(400-z)'
  [../]
  [./ini_zz]
    type = ParsedFunction
    expression = '-2500*10E-6*(400-z)'
  [../]
  [./excav_sideways]
    type = ParsedFunction
    symbol_names = 'end_t ymin ymax  e_h  closure_dist'
    symbol_values = '1.0   0    150.0 -3.0 15.0'
    expression = 'e_h*max(min((min(t/end_t,1)*(ymax-ymin)+ymin-y)/closure_dist,1),0)'
  [../]
  [./excav_downwards]
    type = ParsedFunction
    symbol_names = 'end_t ymin ymax  e_h  closure_dist'
    symbol_values = '1.0   0    150.0 -3.0 15.0'
    expression = 'e_h*min(t/end_t,1)*max(min(((ymax-ymin)+ymin-y)/closure_dist,1),0)'
  [../]
[]
[UserObjects]
  [./mc_coh_strong_harden]
    type = SolidMechanicsHardeningExponential
    value_0 = 2.99 # MPa
    value_residual = 3.01 # MPa
    rate = 1.0
  [../]
  [./mc_fric]
    type = SolidMechanicsHardeningConstant
    value = 0.65 # 37deg
  [../]
  [./mc_dil]
    type = SolidMechanicsHardeningConstant
    value = 0.15 # 8deg
  [../]
  [./mc_tensile_str_strong_harden]
    type = SolidMechanicsHardeningExponential
    value_0 = 1.0 # MPa
    value_residual = 1.0 # MPa
    rate = 1.0
  [../]
  [./mc_compressive_str]
    type = SolidMechanicsHardeningCubic
    value_0 = 100 # Large!
    value_residual = 100
    internal_limit = 0.1
  [../]
  [./wp_coh_harden]
    type = SolidMechanicsHardeningCubic
    value_0 = 0.1
    value_residual = 0.1
    internal_limit = 10
  [../]
  [./wp_tan_fric]
    type = SolidMechanicsHardeningConstant
    value = 0.36 # 20deg
  [../]
  [./wp_tan_dil]
    type = SolidMechanicsHardeningConstant
    value = 0.18 # 10deg
  [../]
  [./wp_tensile_str_harden]
    type = SolidMechanicsHardeningCubic
    value_0 = 0.1
    value_residual = 0.1
    internal_limit = 10
  [../]
  [./wp_compressive_str_soften]
    type = SolidMechanicsHardeningCubic
    value_0 = 100
    value_residual = 1
    internal_limit = 1.0
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeLayeredCosseratElasticityTensor
    young = 8E3 # MPa
    poisson = 0.25
    layer_thickness = 1.0
    joint_normal_stiffness = 1E9 # huge
    joint_shear_stiffness = 1E3
  [../]
  [./strain]
    type = ComputeCosseratIncrementalSmallStrain
    eigenstrain_names = ini_stress
  [../]
  [./ini_stress]
    type = ComputeEigenstrainFromInitialStress
    initial_stress = 'ini_xx 0 0  0 ini_xx 0  0 0 ini_zz'
    eigenstrain_name = ini_stress
  [../]
  [./stress]
    type = ComputeMultipleInelasticCosseratStress
    block = 0
    inelastic_models = 'mc wp'
    cycle_models = true
    relative_tolerance = 2.0
    absolute_tolerance = 1E6
    max_iterations = 1
    tangent_operator = nonlinear
    perform_finite_strain_rotations = false
  [../]
  [./mc]
    type = CappedMohrCoulombCosseratStressUpdate
    block = 0
    warn_about_precision_loss = false
    host_youngs_modulus = 8E3
    host_poissons_ratio = 0.25
    base_name = mc
    tensile_strength = mc_tensile_str_strong_harden
    compressive_strength = mc_compressive_str
    cohesion = mc_coh_strong_harden
    friction_angle = mc_fric
    dilation_angle = mc_dil
    max_NR_iterations = 10000
    smoothing_tol = 0.1 # MPa  # Must be linked to cohesion
    yield_function_tol = 1E-9 # MPa.  this is essentially the lowest possible without lots of precision loss
    perfect_guess = true
    min_step_size = 1.0
  [../]
  [./wp]
    type = CappedWeakPlaneCosseratStressUpdate
    block = 0
    warn_about_precision_loss = false
    base_name = wp
    cohesion = wp_coh_harden
    tan_friction_angle = wp_tan_fric
    tan_dilation_angle = wp_tan_dil
    tensile_strength = wp_tensile_str_harden
    compressive_strength = wp_compressive_str_soften
    max_NR_iterations = 10000
    tip_smoother = 0.1
    smoothing_tol = 0.1 # MPa  # Note, this must be tied to cohesion, otherwise get no possible return at cone apex
    yield_function_tol = 1E-11 # MPa.  this is essentially the lowest possible without lots of precision loss
    perfect_guess = true
    min_step_size = 1.0
  [../]
  [./density]
    type = GenericConstantMaterial
    prop_names = density
    prop_values = 2500
  [../]
[]
[Postprocessors]
  [./subsidence]
    type = PointValue
    point = '0 0 400'
    variable = disp_z
    use_displaced_mesh = false
  [../]
[]
[Preconditioning]
  [./SMP]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  solve_type = 'NEWTON'
  petsc_options = '-snes_converged_reason'
  petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
  petsc_options_value = ' asm      2              lu            gmres     200'
  line_search = bt
  nl_abs_tol = 1e-3
  nl_rel_tol = 1e-5
  l_max_its = 30
  nl_max_its = 1000
  start_time = 0.0
  dt = 0.2
  end_time = 0.2
[]
[Outputs]
  file_base = cosserat_mc_wp
  time_step_interval = 1
  print_linear_residuals = false
  csv = true
  exodus = true
  [./console]
    type = Console
    output_linear = false
  [../]
[]
(modules/solid_mechanics/test/tests/capped_mohr_coulomb/random2.i)
# Using CappedMohrCoulomb with compressive failure only
# Plasticity models:
# Compressive strength = 1 MPa
#
# Lame lambda = 1GPa.  Lame mu = 1.3GPa
#
# A line of elements is perturbed randomly, and return to the yield surface at each quadpoint is checked
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1234
  nz = 1
  xmin = 0
  xmax = 1
  ymin = 0
  ymax = 1234
  zmin = 0
  zmax = 1
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[ICs]
  [./x]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_x
  [../]
  [./y]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_y
  [../]
  [./z]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_z
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '0'
  [../]
[]
[AuxVariables]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./f0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./int0]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 0
    variable = int0
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
[]
[Postprocessors]
  [./tot_iters]
    type = ElementIntegralMaterialProperty
    mat_prop = plastic_NR_iterations
    outputs = console
  [../]
  [./raw_f0]
    type = ElementExtremeValue
    variable = f0
    outputs = console
  [../]
  [./raw_f1]
    type = ElementExtremeValue
    variable = f1
    outputs = console
  [../]
  [./raw_f2]
    type = ElementExtremeValue
    variable = f2
    outputs = console
  [../]
  [./iter]
    type = ElementExtremeValue
    variable = iter
    outputs = console
  [../]
  [./f0]
    type = FunctionValuePostprocessor
    function = should_be_zero0_fcn
  [../]
  [./f1]
    type = FunctionValuePostprocessor
    function = should_be_zero1_fcn
  [../]
  [./f2]
    type = FunctionValuePostprocessor
    function = should_be_zero2_fcn
  [../]
[]
[Functions]
  [./should_be_zero0_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-1,0,a)'
    symbol_names = 'a'
    symbol_values = 'raw_f0'
  [../]
  [./should_be_zero1_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-1,0,a)'
    symbol_names = 'a'
    symbol_values = 'raw_f1'
  [../]
  [./should_be_zero2_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-1,0,a)'
    symbol_names = 'a'
    symbol_values = 'raw_f2'
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1E12
  [../]
  [./cs]
    type = SolidMechanicsHardeningCubic
    value_0 = 1E6
    value_residual = 0
    internal_limit = 1
  [../]
  [./coh]
    type = SolidMechanicsHardeningConstant
    value = 1E12
  [../]
  [./ang]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '1E9 1.3E9'
  [../]
  [./tensile]
    type = CappedMohrCoulombStressUpdate
    tensile_strength = ts
    compressive_strength = cs
    cohesion = coh
    friction_angle = ang
    dilation_angle = ang
    smoothing_tol = 1E5
    max_NR_iterations = 100
    yield_function_tol = 1.0E-1
  [../]
  [./stress]
    type = ComputeMultipleInelasticStress
    inelastic_models = tensile
    perform_finite_strain_rotations = false
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = random2
  csv = true
[]
(modules/combined/test/tests/j2_plasticity_vs_LSH/j2_hard1_mod.i)
# Test designed to compare results and active time between SH/LinearStrainHardening
# material vs TM j2 plastic user object. As number of elements increases, TM
# active time increases at a much higher rate than SM. Testing at 4x4x4
# (64 elements).
#
# plot vm_stress vs intnl to see constant hardening
#
# Original test located at:
# solid_mechanics/tests/j2_plasticity/hard1.i
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 4
  ny = 4
  nz = 4
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Physics/SolidMechanics/QuasiStatic]
  [all]
    add_variables = true
    strain = FINITE
    generate_output = 'stress_zz vonmises_stress effective_plastic_strain'
  []
[]
[AuxVariables]
  [intnl]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[AuxKernels]
  [intnl]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = intnl
  []
[]
[BCs]
  [left]
    type = DirichletBC
    variable = disp_x
    boundary = left
    value = 0.0
  []
  [bottom]
    type = DirichletBC
    variable = disp_y
    boundary = bottom
    value = 0.0
  []
  [back]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0.0
  []
  [z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = 't/60'
  []
[]
[UserObjects]
  [str]
    type = TensorMechanicsHardeningConstant
    value = 2.4e2
  []
  [j2]
    type = TensorMechanicsPlasticJ2
    yield_strength = str
    yield_function_tolerance = 1E-3
    internal_constraint_tolerance = 1E-9
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    #with E = 2.1e5 and nu = 0.3
    #Hooke's law: E-nu to Lambda-G
    C_ijkl = '121154 80769.2'
  []
  [mc]
    type = ComputeMultiPlasticityStress
    ep_plastic_tolerance = 1E-9
    plastic_models = j2
    tangent_operator = elastic
  []
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  petsc_options = '-snes_ksp_ew'
  petsc_options_iname = '-ksp_gmres_restart'
  petsc_options_value = '101'
  line_search = 'none'
  l_max_its = 100
  nl_max_its = 100
  nl_rel_tol = 1e-6
  nl_abs_tol = 1e-10
  l_tol = 1e-4
  start_time = 0.0
  end_time = 0.5
  dt = 0.01
[]
[Postprocessors]
  [stress_zz]
    type = ElementAverageValue
    variable = stress_zz
  []
  [intnl]
    type = ElementAverageValue
    variable = intnl
  []
  [eq_pl_strain]
    type = PointValue
    point = '0 0 0'
    variable = effective_plastic_strain
  []
  [vm_stress]
    type = PointValue
    point = '0 0 0'
    variable = vonmises_stress
  []
[]
[Outputs]
  csv = true
  print_linear_residuals = false
  perf_graph = true
[]
(modules/solid_mechanics/test/tests/jacobian/cto18.i)
# Jacobian check for nonlinear, multi-surface plasticity.
# Returns to the edge of the tensile yield surface
#
# Plasticity models:
# Tensile with strength = 1MPa softening to 0.5MPa in 2E-2 strain
#
# Lame lambda = 0.5GPa.  Lame mu = 1GPa
#
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./linesearch]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./ld]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./constr_added]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int0]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./linesearch]
    type = MaterialRealAux
    property = plastic_linesearch_needed
    variable = linesearch
  [../]
  [./ld]
    type = MaterialRealAux
    property = plastic_linear_dependence_encountered
    variable = ld
  [../]
  [./constr_added]
    type = MaterialRealAux
    property = plastic_constraints_added
    variable = constr_added
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./int0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    variable = int0
    index = 0
  [../]
  [./int1]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    variable = int1
    index = 1
  [../]
  [./int2]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    variable = int2
    index = 2
  [../]
[]
[Postprocessors]
  [./max_int0]
    type = ElementExtremeValue
    variable = int0
    outputs = console
  [../]
  [./max_int1]
    type = ElementExtremeValue
    variable = int1
    outputs = console
  [../]
  [./max_int2]
    type = ElementExtremeValue
    variable = int2
    outputs = console
  [../]
  [./max_iter]
    type = ElementExtremeValue
    variable = iter
    outputs = console
  [../]
  [./av_linesearch]
    type = ElementAverageValue
    variable = linesearch
    outputs = 'console'  [../]
  [./av_ld]
    type = ElementAverageValue
    variable = ld
    outputs = 'console'  [../]
  [./av_constr_added]
    type = ElementAverageValue
    variable = constr_added
    outputs = 'console'  [../]
  [./av_iter]
    type = ElementAverageValue
    variable = iter
    outputs = 'console'  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningCubic
    value_0 = 1
    value_residual = 0.5
    internal_limit = 2E-2
  [../]
  [./tensile]
    type = SolidMechanicsPlasticTensileMulti
    tensile_strength = ts
    yield_function_tolerance = 1.0E-6  # Note larger value
    shift = 1.0E-6                     # Note larger value
    internal_constraint_tolerance = 1.0E-7
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '0.5E3 1E3'
  [../]
  [./strain]
    type = ComputeIncrementalStrain
    displacements = 'disp_x disp_y disp_z'
    eigenstrain_names = ini_stress
  [../]
  [./ini_stress]
    type = ComputeEigenstrainFromInitialStress
    initial_stress = '-1 0.1 0.2  0.1 15 -0.3  0.2 -0.3 14'
    eigenstrain_name = ini_stress
  [../]
  [./multi]
    type = ComputeMultiPlasticityStress
    ep_plastic_tolerance = 1E-7
    plastic_models = 'tensile'
    max_NR_iterations = 5
    deactivation_scheme = 'safe'
    min_stepsize = 1
    tangent_operator = nonlinear
  [../]
[]
[Preconditioning]
  [./andy]
    type = SMP
    full = true
    #petsc_options = '-snes_test_display'
    petsc_options_iname = '-ksp_type -pc_type -snes_atol -snes_rtol -snes_max_it -snes_type'
    petsc_options_value = 'bcgs bjacobi 1E-15 1E-10 10000 test'
  [../]
[]
[Executioner]
  type = Transient
  solve_type = Newton
[]
[Outputs]
  file_base = cto18
  exodus = false
[]
(modules/porous_flow/test/tests/infiltration_and_drainage/rsc01.i)
# RSC test with high-res time and spatial resolution
[Mesh]
  type = GeneratedMesh
  dim = 2
  nx = 600
  ny = 1
  xmin = 0
  xmax = 10 # x is the depth variable, called zeta in RSC
  ymin = 0
  ymax = 0.05
[]
[GlobalParams]
  PorousFlowDictator = dictator
  gravity = '0 0 0'
[]
[Functions]
  [dts]
    type = PiecewiseLinear
    y = '3E-3 3E-2 0.05'
    x = '0 1 5'
  []
[]
[UserObjects]
  [dictator]
    type = PorousFlowDictator
    porous_flow_vars = 'pwater poil'
    number_fluid_phases = 2
    number_fluid_components = 2
  []
  [pc]
    type = PorousFlowCapillaryPressureRSC
    oil_viscosity = 2E-3
    scale_ratio = 2E3
    shift = 10
  []
[]
[FluidProperties]
  [water]
    type = SimpleFluidProperties
    bulk_modulus = 2e9
    density0 = 10
    thermal_expansion = 0
    viscosity = 1e-3
  []
  [oil]
    type = SimpleFluidProperties
    bulk_modulus = 2e9
    density0 = 20
    thermal_expansion = 0
    viscosity = 2e-3
  []
[]
[Materials]
  [temperature]
    type = PorousFlowTemperature
  []
  [ppss]
    type = PorousFlow2PhasePP
    phase0_porepressure = pwater
    phase1_porepressure = poil
    capillary_pressure = pc
  []
  [massfrac]
    type = PorousFlowMassFraction
    mass_fraction_vars = 'massfrac_ph0_sp0 massfrac_ph1_sp0'
  []
  [water]
    type = PorousFlowSingleComponentFluid
    fp = water
    phase = 0
    compute_enthalpy = false
    compute_internal_energy = false
  []
  [oil]
    type = PorousFlowSingleComponentFluid
    fp = oil
    phase = 1
    compute_enthalpy = false
    compute_internal_energy = false
  []
  [relperm_water]
    type = PorousFlowRelativePermeabilityCorey
    n = 1
    phase = 0
  []
  [relperm_oil]
    type = PorousFlowRelativePermeabilityCorey
    n = 1
    phase = 1
  []
  [porosity]
    type = PorousFlowPorosityConst
    porosity = 0.25
  []
  [permeability]
    type = PorousFlowPermeabilityConst
    permeability = '1E-5 0 0  0 1E-5 0  0 0 1E-5'
  []
[]
[Variables]
  [pwater]
  []
  [poil]
  []
[]
[ICs]
  [water_init]
    type = ConstantIC
    variable = pwater
    value = 0
  []
  [oil_init]
    type = ConstantIC
    variable = poil
    value = 15
  []
[]
[Kernels]
  [mass0]
    type = PorousFlowMassTimeDerivative
    fluid_component = 0
    variable = pwater
  []
  [flux0]
    type = PorousFlowAdvectiveFlux
    fluid_component = 0
    variable = pwater
  []
  [mass1]
    type = PorousFlowMassTimeDerivative
    fluid_component = 1
    variable = poil
  []
  [flux1]
    type = PorousFlowAdvectiveFlux
    fluid_component = 1
    variable = poil
  []
[]
[AuxVariables]
  [SWater]
    family = MONOMIAL
    order = CONSTANT
  []
  [SOil]
    family = MONOMIAL
    order = CONSTANT
  []
  [massfrac_ph0_sp0]
    initial_condition = 1
  []
  [massfrac_ph1_sp0]
    initial_condition = 0
  []
[]
[AuxKernels]
  [SWater]
    type = MaterialStdVectorAux
    property = PorousFlow_saturation_qp
    index = 0
    variable = SWater
  []
  [SOil]
    type = MaterialStdVectorAux
    property = PorousFlow_saturation_qp
    index = 1
    variable = SOil
  []
[]
[BCs]
# we are pumping water into a system that has virtually incompressible fluids, hence the pressures rise enormously.  this adversely affects convergence because of almost-overflows and precision-loss problems.  The fixed things help keep pressures low and so prevent these awful behaviours.   the movement of the saturation front is the same regardless of the fixed things.
  active = 'recharge fixedoil fixedwater'
  [recharge]
    type = PorousFlowSink
    variable = pwater
    boundary = 'left'
    flux_function = -1.0
  []
  [fixedwater]
    type = DirichletBC
    variable = pwater
    boundary = 'right'
    value = 0
  []
  [fixedoil]
    type = DirichletBC
    variable = poil
    boundary = 'right'
    value = 15
  []
[]
[Preconditioning]
  [andy]
    type = SMP
    full = true
    petsc_options = '-snes_converged_reason -ksp_diagonal_scale -ksp_diagonal_scale_fix -ksp_gmres_modifiedgramschmidt -snes_linesearch_monitor'
    petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap -snes_atol -snes_rtol -snes_max_it'
    petsc_options_value = 'gmres      asm      lu           NONZERO                   2               1E-10      1E-10      10000'
  []
[]
[VectorPostprocessors]
  [swater]
    type = LineValueSampler
    warn_discontinuous_face_values = false
    variable = SWater
    start_point = '0 0 0'
    end_point = '7 0 0'
    sort_by = x
    num_points = 21
    execute_on = timestep_end
  []
[]
[Executioner]
  type = Transient
  solve_type = Newton
  petsc_options = '-snes_converged_reason'
  end_time = 5
  [TimeStepper]
    type = FunctionDT
    function = dts
  []
[]
[Outputs]
  file_base = rsc01
  [along_line]
    type = CSV
    execute_vector_postprocessors_on = final
  []
  [exodus]
    type = Exodus
    execute_on = 'initial final'
  []
[]
(modules/solid_mechanics/test/tests/j2_plasticity/small_deform2.i)
# UserObject J2 test
# apply uniform stretch in z direction to give
# trial stress_zz = 7, so sqrt(3*J2) = 7
# with zero Poisson's ratio, this should return to
# stress_zz = 3, stress_xx = 2 = stress_yy
# (note that stress_zz - stress_xx = stress_zz - stress_yy = 1, so sqrt(3*j2) = 1,
#  and that the mean stress remains = 7/3)
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '3.5E-6*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = f
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = f
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
[]
[UserObjects]
  [./str]
    type = SolidMechanicsHardeningConstant
    value = 1
  [../]
  [./j2]
    type = SolidMechanicsPlasticJ2
    yield_strength = str
    yield_function_tolerance = 1E-3
    internal_constraint_tolerance = 1E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E6'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = j2
    debug_fspb = crash
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform2
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(test/tests/materials/types/test.i)
[Mesh]
  type = GeneratedMesh
  dim = 2
  xmin = 0
  xmax = 1
  ymin = 0
  ymax = 1
  nx = 2
  ny = 2
[]
[Variables]
  [./u]
    order = FIRST
    family = LAGRANGE
  [../]
[]
[AuxVariables]
  [./real]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stdvec0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stdvec1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stdvec0_qp0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stdvec0_qp1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./realvec0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./realvec1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./realvec2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./densemat00]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./densemat01]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./tensor00]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./tensor11]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./tensor22]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stdvecgrad00]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stdvecgrad01]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stdvecgrad02]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stdvecgrad10]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stdvecgrad11]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stdvecgrad12]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[Kernels]
  [./diff]
    type = Diffusion
    variable = u
  [../]
[]
[AuxKernels]
  [./real0]
    type = MaterialRealAux
    variable = real
    property = real_prop
    execute_on = timestep_end
  [../]
  [./stdvec0]
    type = MaterialStdVectorAux
    variable = stdvec0
    property = stdvec_prop
    index = 0
    execute_on = timestep_end
  [../]
  [./stdvec1]
    type = MaterialStdVectorAux
    variable = stdvec1
    property = stdvec_prop
    index = 1
    execute_on = timestep_end
  [../]
  [./stdvec0_qp0]
    type = MaterialStdVectorAux
    variable = stdvec0_qp0
    property = stdvec_prop_qp
    index = 0
    selected_qp = 0
    execute_on = timestep_end
  [../]
  [./stdvec0_qp1]
    type = MaterialStdVectorAux
    variable = stdvec0_qp1
    property = stdvec_prop_qp
    index = 0
    selected_qp = 1
    execute_on = timestep_end
  [../]
  [./densemat00]
    type = MaterialRealDenseMatrixAux
    variable = densemat00
    property = matrix_prop
    row = 0
    column = 0
    execute_on = timestep_end
  [../]
  [./densemat01]
    type = MaterialRealDenseMatrixAux
    variable = densemat01
    property = matrix_prop
    row = 0
    column = 1
    execute_on = timestep_end
  [../]
  [./realvec0]
    type = MaterialRealVectorValueAux
    variable = realvec0
    property = realvec_prop
    component = 0
    execute_on = timestep_end
  [../]
  [./realvec1]
    type = MaterialRealVectorValueAux
    variable = realvec1
    property = realvec_prop
    component = 1
    execute_on = timestep_end
  [../]
  [./realvec2]
    type = MaterialRealVectorValueAux
    variable = realvec2
    property = realvec_prop
    component = 2
    execute_on = timestep_end
  [../]
  [./realtensor00]
    type = MaterialRealTensorValueAux
    variable = tensor00
    property = tensor_prop
    row = 0
    column = 0
    execute_on = timestep_end
  [../]
  [./realtensor11]
    type = MaterialRealTensorValueAux
    variable = tensor11
    property = tensor_prop
    row = 1
    column = 1
    execute_on = timestep_end
  [../]
  [./realtensor22]
    type = MaterialRealTensorValueAux
    variable = tensor22
    property = tensor_prop
    row = 2
    column = 2
    execute_on = timestep_end
  [../]
  [./stdvecgrad00]
    type = MaterialStdVectorRealGradientAux
    variable = stdvecgrad00
    property = stdvec_grad_prop
  [../]
  [./stdvecgrad01]
    type = MaterialStdVectorRealGradientAux
    variable = stdvecgrad01
    property = stdvec_grad_prop
    component = 1
  [../]
  [./stdvecgrad02]
    type = MaterialStdVectorRealGradientAux
    variable = stdvecgrad02
    property = stdvec_grad_prop
    component = 2
  [../]
  [./stdvecgrad10]
    type = MaterialStdVectorRealGradientAux
    variable = stdvecgrad10
    index = 1
    property = stdvec_grad_prop
  [../]
  [./stdvecgrad11]
    type = MaterialStdVectorRealGradientAux
    variable = stdvecgrad11
    index = 1
    component = 1
    property = stdvec_grad_prop
  [../]
  [./stdvecgrad12]
    type = MaterialStdVectorRealGradientAux
    variable = stdvecgrad12
    index = 1
    component = 2
    property = stdvec_grad_prop
  [../]
[]
[BCs]
  [./left]
    type = DirichletBC
    variable = u
    boundary = 3
    value = 0
  [../]
  [./right]
    type = DirichletBC
    variable = u
    boundary = 1
    value = 1
  [../]
[]
[Materials]
  [./mat]
    type = TypesMaterial
    block = 0
  [../]
[]
[Executioner]
  type = Steady
  solve_type = PJFNK
[]
[Outputs]
  file_base = test_out
  exodus = true
[]
(modules/solid_mechanics/test/tests/drucker_prager/small_deform3_lode_zero.i)
# apply repeated stretches in x z directions, and smaller stretches along the y direction,
# so that sigma_I = sigma_II,
# which means that lode angle = 30deg.
# The allows yield surface in meridional plane to be mapped out
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '1E-6*x*t'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '-1.7E-6*y*t'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1E-6*z*t'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_int]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./mc_int_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = mc_int
  [../]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./internal]
    type = PointValue
    point = '0 0 0'
    variable = mc_int
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 10
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 35
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 5
    convert_to_radians = true
  [../]
  [./mc]
    type = SolidMechanicsPlasticDruckerPragerHyperbolic
    mc_cohesion = mc_coh
    mc_friction_angle = mc_phi
    mc_dilation_angle = mc_psi
    smoother = 8
    mc_interpolation_scheme = lode_zero
    yield_function_tolerance = 1E-7
    internal_constraint_tolerance = 1E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./strain]
    type = ComputeIncrementalStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-13
    plastic_models = mc
    debug_fspb = crash
  [../]
[]
[Executioner]
  end_time = 10
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform3_lode_zero
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/mohr_coulomb/planar_hard1.i)
# apply uniform stretches in x, y and z directions.
# let mc_cohesion = 10, mc_cohesion_residual = 2, mc_cohesion_rate =
# With cohesion = C, friction_angle = 60deg, tip_smoother = 4, the
# algorithm should return to
# sigma_m = C*Cos(60)/Sin(60)
# This allows checking of the relationship for C
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '1E-6*x*t'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '1E-6*y*t'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1E-6*z*t'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_int]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./mc_int_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = mc_int
  [../]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./internal]
    type = PointValue
    point = '0 0 0'
    variable = mc_int
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./mc_coh]
    type = SolidMechanicsHardeningExponential
    value_0 = 10
    value_residual = 2
    rate = 1E4
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 60
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 5
    convert_to_radians = true
  [../]
  [./mc]
    type = SolidMechanicsPlasticMohrCoulombMulti
    cohesion = mc_coh
    friction_angle = mc_phi
    dilation_angle = mc_psi
    yield_function_tolerance = 1E-5
    use_custom_returnMap = true
    shift = 1E-12
    internal_constraint_tolerance = 1E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0.7E7 1E7'
  [../]
  [./strain]
    type = ComputeIncrementalStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-12
    plastic_models = mc
  [../]
[]
[Executioner]
  end_time = 10
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = planar_hard1
  exodus = false
  [./csv]
    type = CSV
    execute_on = timestep_end
    [../]
[]
(modules/solid_mechanics/test/tests/multiple_two_parameter_plasticity/dp_and_wp.i)
# Use ComputeMultipleInelasticStress with two inelastic models: CappedDruckerPrager and CappedWeakPlane.
# The relative_tolerance and absolute_tolerance parameters are set small so that many
# Picard iterations need to be performed.
#
# The CappedDruckerPrager has tensile strength 3E2 and large cohesion,
# and the return-map sets stress = trial_stress - diag(d, d, d), for
# some d to be determined
# The CappedWeakPlane has tensile strength zero and large cohesion,
# and the return-map sets stress = diag(t - v*w/(1-v), t - v*w/(1-v), t - w)
# where t is trial stress, v is Poisson's ratio, and w is to be determined
#
# d and w are determined by demanding that the final stress shouldn't depend
# on the order of return-mapping (DP first then WP, or WP first then DP).
#
# Let the initial_stress = diag(I, I, I).
# The returned stress is diag(I - d - v*w/(1-v), I - d - v*w/(1-v), I - d - w).  This
# must obey Tr(stress) <= dp_tensile_strength, and I-d-w <= wp_tensile_strength.
#
# For I = 1E3, and v = 0.2, the solution is d = 800 and w = 200, with
# stress = diag(150, 150, 0)
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    eigenstrain_names = ini_stress
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = 0
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = 0
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = 0
  [../]
[]
[AuxVariables]
  [./yield_fcn_dp]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn_wp]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_dp_auxk]
    type = MaterialStdVectorAux
    index = 1    # this is the tensile yield function - it should be zero
    property = cdp_plastic_yield_function
    variable = yield_fcn_dp
  [../]
  [./yield_fcn_wp_auxk]
    type = MaterialStdVectorAux
    index = 1    # this is the tensile yield function - it should be zero
    property = cwp_plastic_yield_function
    variable = yield_fcn_wp
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f_dp]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn_dp
  [../]
  [./f_wp]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn_wp
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 300
  [../]
  [./cs]
    type = SolidMechanicsHardeningConstant
    value = 1E4
  [../]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 1E4
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 20
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 0
  [../]
  [./dp]
    type = SolidMechanicsPlasticDruckerPrager
    mc_cohesion = mc_coh
    mc_friction_angle = mc_phi
    mc_dilation_angle = mc_psi
    internal_constraint_tolerance = 1 # irrelevant here
    yield_function_tolerance = 1      # irrelevant here
  [../]
  [./wp_coh]
    type = SolidMechanicsHardeningConstant
    value = 1E4
  [../]
  [./wp_tanphi]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
  [./wp_tanpsi]
    type = SolidMechanicsHardeningConstant
    value = 0.1111077
  [../]
  [./wp_t_strength]
    type = SolidMechanicsHardeningConstant
    value = 0
  [../]
  [./wp_c_strength]
    type = SolidMechanicsHardeningConstant
    value = 1E4
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeIsotropicElasticityTensor
    poissons_ratio = 0.2
    youngs_modulus = 1E7
  [../]
  [./ini_stress]
    type = ComputeEigenstrainFromInitialStress
    initial_stress = '1E3 0 0  0 1E3 0  0 0 1E3'
    eigenstrain_name = ini_stress
  [../]
  [./admissible]
    type = ComputeMultipleInelasticStress
    relative_tolerance = 1E-8
    inelastic_models = 'cdp cwp'
    perform_finite_strain_rotations = false
  [../]
  [./cdp]
    type = CappedDruckerPragerStressUpdate
    base_name = cdp
    DP_model = dp
    tensile_strength = ts
    compressive_strength = cs
    yield_function_tol = 1E-5
    tip_smoother = 1E3
    smoothing_tol = 1E3
  [../]
  [./cwp]
    type = CappedWeakPlaneStressUpdate
    base_name = cwp
    cohesion = wp_coh
    tan_friction_angle = wp_tanphi
    tan_dilation_angle = wp_tanpsi
    tensile_strength = wp_t_strength
    compressive_strength = wp_c_strength
    tip_smoother = 1E3
    smoothing_tol = 1E3
    yield_function_tol = 1E-5
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = dp_and_wp
  csv = true
[]
(modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform22.i)
# Mohr-Coulomb only
# apply stretches in x direction and smaller stretches in the y direction
# to observe return to the MC plane
# This tests uses hardening of the cohesion.  The returned configuration
# should obey
# 0 = 0.5 * (Smax - Smin) + 0.5 * (Smax + Smin) * sin(phi) - C cos(phi)
# which allows inference of C.
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'max_principal_stress mid_principal_stress min_principal_stress stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0.4E-6*x*t'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0.1E-6*y*t'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '0'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 6
    property = plastic_yield_function
    variable = yield_fcn
  [../]
  [./iter_auxk]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./intnl_auxk]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl
  [../]
[]
[Postprocessors]
  [./s_max]
    type = PointValue
    point = '0 0 0'
    variable = max_principal_stress
  [../]
  [./s_mid]
    type = PointValue
    point = '0 0 0'
    variable = mid_principal_stress
  [../]
  [./s_min]
    type = PointValue
    point = '0 0 0'
    variable = min_principal_stress
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
  [./intnl]
    type = PointValue
    point = '0 0 0'
    variable = intnl
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./mc_coh]
    type = SolidMechanicsHardeningCubic
    value_0 = 10
    value_residual = 20
    internal_limit = 5E-6
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 30
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 30
    convert_to_radians = true
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 1E7
    poissons_ratio = 0.3
  [../]
  [./mc]
    type = CappedMohrCoulombStressUpdate
    tensile_strength = ts
    compressive_strength = ts
    cohesion = mc_coh
    friction_angle = mc_phi
    dilation_angle = mc_psi
    smoothing_tol = 0
    yield_function_tol = 1.0E-9
  [../]
  [./stress]
    type = ComputeMultipleInelasticStress
    inelastic_models = mc
    perform_finite_strain_rotations = false
  [../]
[]
[Executioner]
  end_time = 10
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform_hard21
  csv = true
[]
(modules/solid_mechanics/test/tests/ad_anisotropic_creep/ad_aniso_creep_temperature_coefficients_function_variation.i)
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 3
    nx = 10
    ny = 2
    nz = 2
    xmin = 0.0
    ymin = 0.0
    zmin = 0.0
    xmax = 10.0
    ymax = 1.0
    zmax = 1.0
  []
  [corner_node]
    type = ExtraNodesetGenerator
    new_boundary = '100'
    nodes = '3 69'
    input = gen
  []
  [corner_node_2]
    type = ExtraNodesetGenerator
    new_boundary = '101'
    nodes = '4 47'
    input = corner_node
  []
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
  volumetric_locking_correction = true
[]
[AuxVariables]
  [temperature]
    order = CONSTANT
    family = MONOMIAL
  []
  [hydrostatic_stress]
    order = CONSTANT
    family = MONOMIAL
  []
  [creep_strain_xx]
    order = CONSTANT
    family = MONOMIAL
  []
  [creep_strain_xy]
    order = CONSTANT
    family = MONOMIAL
  []
  [creep_strain_yy]
    order = CONSTANT
    family = MONOMIAL
  []
  [creep_strain_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [creep_strain_xz]
    order = CONSTANT
    family = MONOMIAL
  []
  [creep_strain_yz]
    order = CONSTANT
    family = MONOMIAL
  []
  [hill_constants_f]
    order = CONSTANT
    family = MONOMIAL
  []
  [hill_constants_g]
    order = CONSTANT
    family = MONOMIAL
  []
  [hill_constants_h]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[AuxKernels]
  [temperature]
    type = FunctionAux
    variable = temperature
    function = time_temperature
  []
  [hydrostatic_stress]
    type = ADRankTwoScalarAux
    variable = hydrostatic_stress
    rank_two_tensor = stress
    scalar_type = Hydrostatic
  []
  [creep_strain_xx]
    type = ADRankTwoAux
    rank_two_tensor = creep_strain
    variable = creep_strain_xx
    index_i = 0
    index_j = 0
  []
  [creep_strain_xy]
    type = ADRankTwoAux
    rank_two_tensor = creep_strain
    variable = creep_strain_xy
    index_i = 0
    index_j = 1
  []
  [creep_strain_yy]
    type = ADRankTwoAux
    rank_two_tensor = creep_strain
    variable = creep_strain_yy
    index_i = 1
    index_j = 1
  []
  [creep_strain_zz]
    type = ADRankTwoAux
    rank_two_tensor = creep_strain
    variable = creep_strain_zz
    index_i = 2
    index_j = 2
  []
  [creep_strain_xz]
    type = ADRankTwoAux
    rank_two_tensor = creep_strain
    variable = creep_strain_xz
    index_i = 0
    index_j = 2
  []
  [creep_strain_yz]
    type = ADRankTwoAux
    rank_two_tensor = creep_strain
    variable = creep_strain_yz
    index_i = 1
    index_j = 2
  []
  [sigma_xx]
    type = ADRankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 1
    index_j = 1
  []
  [hill_constant_f]
    type = MaterialStdVectorAux
    property = hill_constants
    variable = hill_constants_f
    index = 0
  []
  [hill_constant_g]
    type = MaterialStdVectorAux
    property = hill_constants
    variable = hill_constants_g
    index = 1
  []
  [hill_constant_h]
    type = MaterialStdVectorAux
    property = hill_constants
    variable = hill_constants_h
    index = 2
  []
[]
[ICs]
  [temp]
    type = ConstantIC
    variable = temperature
    value = 50.0
  []
[]
[Functions]
  [pull]
    type = PiecewiseLinear
    x = '0 1.0e-9 1.0'
    y = '0 -4e1 -4e1'
  []
  [F]
    type = PiecewiseLinear
    x = '50 200'
    y = '0.2 0.5'
  []
  [G]
    type = PiecewiseLinear
    x = '50 200'
    y = '0.9 0.6'
  []
  [H]
    type = PiecewiseLinear
    x = '50 200'
    y = '0.5 0.3'
  []
  [L]
    type = PiecewiseLinear
    x = '50 200'
    y = '1.5 1.5'
  []
  [M]
    type = PiecewiseLinear
    x = '50 200'
    y = '1.5 1.5'
  []
  [N]
    type = PiecewiseLinear
    x = '50 200'
    y = '1.5 1.5'
  []
  [time_temperature]
    type = PiecewiseLinear
    x = '0 1.0e-2'
    y = '50 200'
  []
[]
[Physics/SolidMechanics/QuasiStatic]
  [all]
    strain = FINITE
    generate_output = 'elastic_strain_xx stress_xx'
    use_automatic_differentiation = true
    add_variables = true
  []
[]
[Materials]
  [elasticity_tensor]
    type = ADComputeIsotropicElasticityTensor
    youngs_modulus = 700
    poissons_ratio = 0.0
  []
  [elastic_strain]
    type = ADComputeMultipleInelasticStress
    inelastic_models = 'trial_creep_aniso_iso'
    max_iterations = 50
  []
  [hill_constants]
    type = ADHillConstants
    # F G H L M N
    hill_constants = "0.5 0.5 0.5 1.5 1.5 1.5"
    function_names = 'F G H L M N'
    temperature = temperature
  []
  [trial_creep_aniso_iso]
    type = ADHillCreepStressUpdate
    coefficient = 1e-16
    n_exponent = 9
    m_exponent = 0
    activation_energy = 0
    max_inelastic_increment = 0.00003
    relative_tolerance = 1e-20
    absolute_tolerance = 1e-20
    internal_solve_output_on = never
    # Force it to not use integration error
    max_integration_error = 1.0
  []
[]
[BCs]
  [no_disp_x]
    type = ADDirichletBC
    variable = disp_x
    boundary = left
    value = 0.0
  []
  [no_disp_y]
    type = ADDirichletBC
    variable = disp_y
    boundary = 100
    value = 0.0
  []
  [no_disp_z]
    type = ADDirichletBC
    variable = disp_z
    boundary = 101
    value = 0.0
  []
  [Pressure]
    [Side1]
      boundary = right
      function = pull
    []
  []
[]
[Executioner]
  type = Transient
  solve_type = NEWTON
  petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
  petsc_options_value = 'lu     superlu_dist'
  nl_rel_tol = 1e-13
  nl_abs_tol = 1.0e-14
  l_max_its = 90
  num_steps = 20
  dt = 5.0e-4
  start_time = 0
  automatic_scaling = true
[]
[Postprocessors]
  [matl_ts_min]
    type = MaterialTimeStepPostprocessor
  []
  [max_disp_x]
    type = ElementExtremeValue
    variable = disp_x
  []
  [max_disp_y]
    type = ElementExtremeValue
    variable = disp_y
  []
  [max_hydro]
    type = ElementAverageValue
    variable = hydrostatic_stress
  []
  [dt]
    type = TimestepSize
  []
  [num_lin]
    type = NumLinearIterations
    outputs = console
  []
  [num_nonlin]
    type = NumNonlinearIterations
    outputs = console
  []
  [creep_strain_xx]
    type = ElementalVariableValue
    variable = creep_strain_xx
    execute_on = 'TIMESTEP_END'
    elementid = 39
  []
  [creep_strain_yy]
    type = ElementalVariableValue
    variable = creep_strain_yy
    execute_on = 'TIMESTEP_END'
    elementid = 39
  []
  [creep_strain_zz]
    type = ElementalVariableValue
    variable = creep_strain_zz
    execute_on = 'TIMESTEP_END'
    elementid = 39
  []
  [creep_strain_xy]
    type = ElementalVariableValue
    variable = creep_strain_xy
    execute_on = 'TIMESTEP_END'
    elementid = 39
  []
  [creep_strain_yz]
    type = ElementalVariableValue
    variable = creep_strain_yz
    execute_on = 'TIMESTEP_END'
    elementid = 39
  []
  [creep_strain_xz]
    type = ElementalVariableValue
    variable = creep_strain_xz
    execute_on = 'TIMESTEP_END'
    elementid = 39
  []
  [elastic_strain_xx]
    type = ElementalVariableValue
    variable = elastic_strain_xx
    execute_on = 'TIMESTEP_END'
    elementid = 39
  []
  [sigma_xx]
    type = ElementalVariableValue
    variable = stress_xx
    execute_on = 'TIMESTEP_END'
    elementid = 39
  []
[]
[Outputs]
  csv = true
  exodus = true
  perf_graph = true
[]
(modules/porous_flow/test/tests/density/GravDensity01.i)
# Trivial test of PorousFlowTotalGravitationalDensityFullySaturatedFromPorosity
# Porosity = 0.1
# Solid density = 3
# Fluid density = 2
# Fluid bulk modulus = 4
# Fluid pressure = 0
# Bulk density: rho = 3 * (1 - 0.1) + 2 * 0.1 = 2.9
# Derivative wrt fluid pressure: d_rho / d_pp = d_rho / d_rho_f * d_rho_f / d_pp
#   = phi * rho_f / B
#   where rho_f = rho_0 * exp(pp / B) is fluid density, pp is fluid pressure, phi is
#   porosity and B is fluid bulk modulus
# With pp = 0, d_rho / d_pp = phi * rho_0 / B = 0.1 * 2 / 4 = 0.05
[Mesh]
  type = GeneratedMesh
  dim = 3
  xmin = 0
  xmax = 1
  ymin = 0
  ymax = 1
  zmin = -1
  zmax = 0
  nx = 1
  ny = 1
  nz = 1
  # This test uses ElementalVariableValue postprocessors on specific
  # elements, so element numbering needs to stay unchanged
  allow_renumbering = false
[]
[GlobalParams]
  PorousFlowDictator = dictator
[]
[FluidProperties]
  [simple_fluid]
    type = SimpleFluidProperties
    thermal_expansion = 0
    bulk_modulus = 4
    density0 = 2
  []
[]
[Variables]
  [pp]
    [InitialCondition]
      type = ConstantIC
      value = 0
    []
  []
[]
[Kernels]
  [dummy]
    type = Diffusion
    variable = pp
  []
[]
[BCs]
  [p]
    type = DirichletBC
    variable = pp
    boundary = 'front back'
    value = 0
  []
[]
[AuxVariables]
  [density]
    order = CONSTANT
    family = MONOMIAL
  []
  [ddensity_dpp]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[AuxKernels]
  [density]
    type = MaterialRealAux
    property = density
    variable = density
  []
  [ddensity_dpp]
    type = MaterialStdVectorAux
    property = ddensity_dvar
    variable = ddensity_dpp
    index = 0
  []
[]
[Postprocessors]
  [density]
    type = ElementalVariableValue
    elementid = 0
    variable = density
    execute_on = 'timestep_end'
  []
  [ddensity_dpp]
    type = ElementalVariableValue
    elementid = 0
    variable = ddensity_dpp
    execute_on = 'timestep_end'
  []
[]
[UserObjects]
  [dictator]
    type = PorousFlowDictator
    porous_flow_vars = 'pp'
    number_fluid_phases = 1
    number_fluid_components = 1
  []
[]
[Materials]
  [temperature]
    type = PorousFlowTemperature
  []
  [ppss_qp]
    type = PorousFlow1PhaseFullySaturated
    porepressure = pp
  []
  [simple_fluid]
    type = PorousFlowSingleComponentFluid
    fp = simple_fluid
    phase = 0
  []
  [porosity]
    type = PorousFlowPorosityConst
    porosity = 0.1
  []
  [density]
    type = PorousFlowTotalGravitationalDensityFullySaturatedFromPorosity
    rho_s = 3
  []
[]
[Preconditioning]
  [andy]
    type = SMP
    full = true
  []
[]
[Executioner]
  solve_type = Newton
  type = Steady
[]
[Outputs]
  file_base = GravDensity01
  csv = true
  execute_on = 'timestep_end'
[]
(modules/solid_mechanics/examples/coal_mining/cosserat_mc_only.i)
# Strata deformation and fracturing around a coal mine
#
# A 2D geometry is used that simulates a transverse section of
# the coal mine.  The model is actually 3D, but the "x"
# dimension is only 10m long, meshed with 1 element, and
# there is no "x" displacement.  The mine is 300m deep
# and just the roof is studied (0<=z<=300).  The model sits
# between 0<=y<=450.  The excavation sits in 0<=y<=150.  This
# is a "half model": the boundary conditions are such that
# the model simulates an excavation sitting in -150<=y<=150
# inside a model of the region -450<=y<=450.  The
# excavation height is 3m (ie, the excavation lies within
# 0<=z<=3).  Mining is simulated by moving the excavation's
# roof down, until disp_z=-3 at t=1.
# Time is meaningless in this example
# as quasi-static solutions are sought at each timestep, but
# the number of timesteps controls the resolution of the
# process.
#
# The boundary conditions are:
#  - disp_x = 0 everywhere
#  - disp_y = 0 at y=0 and y=450
#  - disp_z = 0 for y>150
#  - disp_z = -3 at maximum, for 0<=y<=150.  See excav function.
# That is, rollers on the sides, free at top, and prescribed at bottom.
#
# The small strain formulation is used.
#
# All stresses are measured in MPa.  The initial stress is consistent with
# the weight force from density 2500 kg/m^3, ie, stress_zz = -0.025*(300-z) MPa
# where gravity = 10 m.s^-2 = 1E-5 MPa m^2/kg.  The maximum and minimum
# principal horizontal stresses are assumed to be equal to 0.8*stress_zz.
#
# Below you will see weak-plane parameters and AuxVariables, etc.
# These are not actally used in this example.
#
# Material properties:
# Young's modulus = 8 GPa
# Poisson's ratio = 0.25
# Cosserat layer thickness = 1 m
# Cosserat-joint normal stiffness = large
# Cosserat-joint shear stiffness = 1 GPa
# MC cohesion = 3 MPa
# MC friction angle = 37 deg
# MC dilation angle = 8 deg
# MC tensile strength = 1 MPa
# MC compressive strength = 100 MPa, varying down to 1 MPa when tensile strain = 1
#
[Mesh]
  [generated_mesh]
    type = GeneratedMeshGenerator
    dim = 3
    nx = 1
    xmin = -5
    xmax = 5
    nz = 40
    zmin = 0
    zmax = 400.0
    bias_z = 1.1
    ny = 30 # make this a multiple of 3, so y=150 is at a node
    ymin = 0
    ymax = 450
  []
  [left]
    type = SideSetsAroundSubdomainGenerator
    new_boundary = 11
    normal = '0 -1 0'
    input = generated_mesh
  []
  [right]
    type = SideSetsAroundSubdomainGenerator
    new_boundary = 12
    normal = '0 1 0'
    input = left
  []
  [front]
    type = SideSetsAroundSubdomainGenerator
    new_boundary = 13
    normal = '-1 0 0'
    input = right
  []
  [back]
    type = SideSetsAroundSubdomainGenerator
    new_boundary = 14
    normal = '1 0 0'
    input = front
  []
  [top]
    type = SideSetsAroundSubdomainGenerator
    new_boundary = 15
    normal = '0 0 1'
    input = back
  []
  [bottom]
    type = SideSetsAroundSubdomainGenerator
    new_boundary = 16
    normal = '0 0 -1'
    input = top
  []
  [excav]
    type = SubdomainBoundingBoxGenerator
    block_id = 1
    bottom_left = '-5 0 0'
    top_right = '5 150 3'
    input = bottom
  []
  [roof]
    type = SideSetsBetweenSubdomainsGenerator
    new_boundary = 21
    primary_block = 0
    paired_block = 1
    input = excav
  []
  [hole]
    type = BlockDeletionGenerator
    block = 1
    input = roof
  []
[]
[GlobalParams]
  block = 0
  perform_finite_strain_rotations = false
  displacements = 'disp_x disp_y disp_z'
  Cosserat_rotations = 'wc_x wc_y wc_z'
[]
[Variables]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
  [./wc_x]
  [../]
[]
[Kernels]
  [./cy_elastic]
    type = CosseratStressDivergenceTensors
    use_displaced_mesh = false
    variable = disp_y
    component = 1
  [../]
  [./cz_elastic]
    type = CosseratStressDivergenceTensors
    use_displaced_mesh = false
    variable = disp_z
    component = 2
  [../]
  [./x_couple]
    type = StressDivergenceTensors
    use_displaced_mesh = false
    variable = wc_x
    displacements = 'wc_x wc_y wc_z'
    component = 0
    base_name = couple
  [../]
  [./x_moment]
    type = MomentBalancing
    use_displaced_mesh = false
    variable = wc_x
    component = 0
  [../]
  [./gravity]
    type = Gravity
    use_displaced_mesh = false
    variable = disp_z
    value = -10E-6
  [../]
[]
[AuxVariables]
  [./disp_x]
  [../]
  [./wc_y]
  [../]
  [./wc_z]
  [../]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./wp_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./wp_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./wp_shear_f]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./wp_tensile_f]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_shear_f]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_tensile_f]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./mc_shear]
    type = MaterialStdVectorAux
    index = 0
    property = mc_plastic_internal_parameter
    variable = mc_shear
  [../]
  [./mc_tensile]
    type = MaterialStdVectorAux
    index = 1
    property = mc_plastic_internal_parameter
    variable = mc_tensile
  [../]
  [./wp_shear]
    type = MaterialStdVectorAux
    index = 0
    property = wp_plastic_internal_parameter
    variable = wp_shear
  [../]
  [./wp_tensile]
    type = MaterialStdVectorAux
    index = 1
    property = wp_plastic_internal_parameter
    variable = wp_tensile
  [../]
  [./mc_shear_f]
    type = MaterialStdVectorAux
    index = 6
    property = mc_plastic_yield_function
    variable = mc_shear_f
  [../]
  [./mc_tensile_f]
    type = MaterialStdVectorAux
    index = 0
    property = mc_plastic_yield_function
    variable = mc_tensile_f
  [../]
  [./wp_shear_f]
    type = MaterialStdVectorAux
    index = 0
    property = wp_plastic_yield_function
    variable = wp_shear_f
  [../]
  [./wp_tensile_f]
    type = MaterialStdVectorAux
    index = 1
    property = wp_plastic_yield_function
    variable = wp_tensile_f
  [../]
[]
[BCs]
  [./no_y]
    type = DirichletBC
    variable = disp_y
    boundary = '11 12 16 21' # note addition of 16 and 21
    value = 0.0
  [../]
  [./no_z]
    type = DirichletBC
    variable = disp_z
    boundary = '16'
    value = 0.0
  [../]
  [./no_wc_x]
    type = DirichletBC
    variable = wc_x
    boundary = '11 12'
    value = 0.0
  [../]
  [./roof]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 21
    function = excav_sideways
  [../]
[]
[Functions]
  [./ini_xx]
    type = ParsedFunction
    expression = '-0.8*2500*10E-6*(400-z)'
  [../]
  [./ini_zz]
    type = ParsedFunction
    expression = '-2500*10E-6*(400-z)'
  [../]
  [./excav_sideways]
    type = ParsedFunction
    symbol_names = 'end_t ymin ymax  e_h  closure_dist'
    symbol_values = '1.0   0    150.0 -3.0 15.0'
    expression = 'e_h*max(min((t/end_t*(ymax-ymin)+ymin-y)/closure_dist,1),0)'
  [../]
  [./excav_downwards]
    type = ParsedFunction
    symbol_names = 'end_t ymin ymax  e_h  closure_dist'
    symbol_values = '1.0   0    150.0 -3.0 15.0'
    expression = 'e_h*t/end_t*max(min(((ymax-ymin)+ymin-y)/closure_dist,1),0)'
  [../]
[]
[UserObjects]
  [./mc_coh_strong_harden]
    type = SolidMechanicsHardeningExponential
    value_0 = 2.99 # MPa
    value_residual = 3.01 # MPa
    rate = 1.0
  [../]
  [./mc_fric]
    type = SolidMechanicsHardeningConstant
    value = 0.65 # 37deg
  [../]
  [./mc_dil]
    type = SolidMechanicsHardeningConstant
    value = 0.15 # 8deg
  [../]
  [./mc_tensile_str_strong_harden]
    type = SolidMechanicsHardeningExponential
    value_0 = 1.0 # MPa
    value_residual = 1.0 # MPa
    rate = 1.0
  [../]
  [./mc_compressive_str]
    type = SolidMechanicsHardeningCubic
    value_0 = 100 # Large!
    value_residual = 100
    internal_limit = 0.1
  [../]
  [./wp_coh_harden]
    type = SolidMechanicsHardeningCubic
    value_0 = 0.1
    value_residual = 0.1
    internal_limit = 10
  [../]
  [./wp_tan_fric]
    type = SolidMechanicsHardeningConstant
    value = 0.36 # 20deg
  [../]
  [./wp_tan_dil]
    type = SolidMechanicsHardeningConstant
    value = 0.18 # 10deg
  [../]
  [./wp_tensile_str_harden]
    type = SolidMechanicsHardeningCubic
    value_0 = 0.1
    value_residual = 0.1
    internal_limit = 10
  [../]
  [./wp_compressive_str_soften]
    type = SolidMechanicsHardeningCubic
    value_0 = 100
    value_residual = 1.0
    internal_limit = 1.0
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeLayeredCosseratElasticityTensor
    young = 8E3 # MPa
    poisson = 0.25
    layer_thickness = 1.0
    joint_normal_stiffness = 1E9 # huge
    joint_shear_stiffness = 1E3
  [../]
  [./strain]
    type = ComputeCosseratIncrementalSmallStrain
    eigenstrain_names = ini_stress
  [../]
  [./ini_stress]
    type = ComputeEigenstrainFromInitialStress
    initial_stress = 'ini_xx 0 0  0 ini_xx 0  0 0 ini_zz'
    eigenstrain_name = ini_stress
  [../]
  [./stress]
    type = ComputeMultipleInelasticCosseratStress
    block = 0
    inelastic_models = mc
    relative_tolerance = 2.0
    absolute_tolerance = 1E6
    max_iterations = 1
    tangent_operator = nonlinear
    perform_finite_strain_rotations = false
  [../]
  [./mc]
    type = CappedMohrCoulombCosseratStressUpdate
    block = 0
    warn_about_precision_loss = false
    host_youngs_modulus = 8E3
    host_poissons_ratio = 0.25
    base_name = mc
    tensile_strength = mc_tensile_str_strong_harden
    compressive_strength = mc_compressive_str
    cohesion = mc_coh_strong_harden
    friction_angle = mc_fric
    dilation_angle = mc_dil
    max_NR_iterations = 100000
    smoothing_tol = 0.1 # MPa  # Must be linked to cohesion
    yield_function_tol = 1E-9 # MPa.  this is essentially the lowest possible without lots of precision loss
    perfect_guess = true
    min_step_size = 1.0
  [../]
  [./wp]
    type = CappedWeakPlaneCosseratStressUpdate
    block = 0
    warn_about_precision_loss = false
    base_name = wp
    cohesion = wp_coh_harden
    tan_friction_angle = wp_tan_fric
    tan_dilation_angle = wp_tan_dil
    tensile_strength = wp_tensile_str_harden
    compressive_strength = wp_compressive_str_soften
    max_NR_iterations = 10000
    tip_smoother = 0.1
    smoothing_tol = 0.1 # MPa  # Note, this must be tied to cohesion, otherwise get no possible return at cone apex
    yield_function_tol = 1E-11 # MPa.  this is essentially the lowest possible without lots of precision loss
    perfect_guess = true
    min_step_size = 1.0E-3
  [../]
  [./density]
    type = GenericConstantMaterial
    prop_names = density
    prop_values = 2500
  [../]
[]
[Postprocessors]
  [./subsidence]
    type = PointValue
    point = '0 0 400'
    variable = disp_z
    use_displaced_mesh = false
  [../]
[]
[Preconditioning]
  [./SMP]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  solve_type = 'NEWTON'
  petsc_options = '-snes_converged_reason'
  petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
  petsc_options_value = ' asm      2              lu            gmres     200'
  line_search = bt
  nl_abs_tol = 1e-3
  nl_rel_tol = 1e-5
  l_max_its = 30
  nl_max_its = 1000
  start_time = 0.0
  dt = 0.2
  end_time = 0.2
[]
[Outputs]
  file_base = cosserat_mc_only
  time_step_interval = 1
  print_linear_residuals = false
  csv = true
  exodus = true
  [./console]
    type = Console
    output_linear = false
  [../]
[]
(modules/solid_mechanics/test/tests/multi/three_surface06.i)
# Plasticit models:
# SimpleTester0 with a = 0 and b = 1 and strength = 1
# SimpleTester1 with a = 1 and b = 0 and strength = 1
# SimpleTester2 with a = 1 and b = 1 and strength = 1.5
#
# Lame lambda = 0 (Poisson=0).  Lame mu = 0.5E6
#
# A single element is stretched by 1.1E-6m in y direction and 1.0E-6 in z direction.
# trial stress_yy = 1.1 and stress_zz = 1.0
#
# Then SimpleTester1 and SimpleTester2 should activate and the algorithm will return to
# the corner stress_yy=1.0, stress_zz=0.5
# However, this will mean internal1 < 0, so SimpleTester1 will be deactivated and
# then the algorithm will return to
# stress_yy=0.8, stress_zz=0.7
# internal1 should be 0.0, and internal2 should be 0.3
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '1.1E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1.0E-6*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int2]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./int0]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 0
    variable = int0
  [../]
  [./int1]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 1
    variable = int1
  [../]
  [./int2]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 2
    variable = int2
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./f2]
    type = PointValue
    point = '0 0 0'
    variable = f2
  [../]
  [./int0]
    type = PointValue
    point = '0 0 0'
    variable = int0
  [../]
  [./int1]
    type = PointValue
    point = '0 0 0'
    variable = int1
  [../]
  [./int2]
    type = PointValue
    point = '0 0 0'
    variable = int2
  [../]
[]
[UserObjects]
  [./simple0]
    type = SolidMechanicsPlasticSimpleTester
    a = 0
    b = 1
    strength = 1
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
  [./simple1]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 0
    strength = 1
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
  [./simple2]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 1
    strength = 1.5
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 0.5E6'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./multi]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = 'simple0 simple1 simple2'
    max_NR_iterations = 2
    min_stepsize = 1
    debug_fspb = crash
    debug_jac_at_stress = '10 0 0 0 10 0 0 0 10'
    debug_jac_at_pm = '1 1'
    debug_jac_at_intnl = '1 1'
    debug_stress_change = 1E-5
    debug_pm_change = '1E-6 1E-6'
    debug_intnl_change = '1E-6 1E-6'
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = three_surface06
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/weak_plane_tensile/small_deform_hard3.i)
# Checking evolution tensile strength
# A single element is stretched by 1E-6*t in z direction, and
# the yield-surface evolution is mapped out
[GlobalParams]
  displacements = 'x_disp y_disp z_disp'
[]
[Mesh]
  type = GeneratedMesh
  dim = 3
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  add_variables = true
  generate_output = 'stress_zz'
[]
[BCs]
  [bottomx]
    type = DirichletBC
    variable = x_disp
    boundary = back
    value = 0.0
  []
  [bottomy]
    type = DirichletBC
    variable = y_disp
    boundary = back
    value = 0.0
  []
  [bottomz]
    type = DirichletBC
    variable = z_disp
    boundary = back
    value = 0.0
  []
  [topx]
    type = DirichletBC
    variable = x_disp
    boundary = front
    value = 0
  []
  [topy]
    type = DirichletBC
    variable = y_disp
    boundary = front
    value = 0
  []
  [topz]
    type = FunctionDirichletBC
    variable = z_disp
    boundary = front
    function = 1E-6*t
  []
[]
[AuxVariables]
  [wpt_internal]
    order = CONSTANT
    family = MONOMIAL
  []
  [yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[AuxKernels]
  [wpt_internal]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = wpt_internal
  []
  [yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  []
[]
[Postprocessors]
  [wpt_internal]
    type = PointValue
    point = '0 0 0'
    variable = wpt_internal
  []
  [s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  []
  [f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  []
[]
[UserObjects]
  [str]
    type = SolidMechanicsHardeningExponential
    value_0 = 10
    value_residual = 4
    rate = 1E6
  []
  [wpt]
    type = SolidMechanicsPlasticWeakPlaneTensile
    tensile_strength = str
    yield_function_tolerance = 1E-6
    internal_constraint_tolerance = 1E-11
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  []
  [mc]
    type = ComputeMultiPlasticityStress
    plastic_models = wpt
    transverse_direction = '0 0 1'
    ep_plastic_tolerance = 1E-11
  []
[]
[Executioner]
  end_time = 4
  dt = 0.5
  type = Transient
[]
[Outputs]
  csv = true
[]
(modules/solid_mechanics/test/tests/j2_plasticity/hard2.i)
# UserObject J2 test, with hardening, but with rate=1E6
# apply uniform compression in x direction to give
# trial stress_xx = 5, so sqrt(3*J2) = 5
# with zero Poisson's ratio, lambda_mu = 1E6, and strength=2, strength_residual=1,
# the equations that we need to solve are:
#
# stress_yy = stress_zz  [because of the symmetry of the problem: to keep Lode angle constant]
# stress_xx - stress_yy = 1 + (2 - 1)*exp(-0.5*(1E6*q)^2)   [yield_fcn = 0]
# stress_xx + stress_yy + stress_zz = 5   [mean stress constant]
# q = gamma
# stress_xx = 1E6*2*gamma*(stress_xx - 5/3)*sqrt(3)/2/sqrt(J2), where sqrt(J2) = (1 + (2 - 1)*exp(-0.5*(1E6*q)^2))/Sqrt(3)
# so RHS = 1E6*2*gamma*(stress_xx - 5/3)*3/2/(stress_xx - stress_yy)
#
# stress_xx = 2.672
# stress_yy = 1.164
# q = 1.164E-6
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '2.5E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '0E-6*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = f
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./intnl]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = intnl
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = f
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
  [./intnl]
    type = PointValue
    point = '0 0 0'
    variable = intnl
  [../]
[]
[UserObjects]
  [./str]
    type = SolidMechanicsHardeningGaussian
    value_0 = 2
    value_residual = 1
    rate = 1E12
  [../]
  [./j2]
    type = SolidMechanicsPlasticJ2
    yield_strength = str
    yield_function_tolerance = 1E-5
    internal_constraint_tolerance = 1E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E6'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = j2
    debug_fspb = crash
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = hard2
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/capped_mohr_coulomb/random1.i)
# Using CappedMohrCoulomb with tensile failure only
# Plasticity models:
# Tensile strength = 1MPa
#
# Lame lambda = 1GPa.  Lame mu = 1.3GPa
#
# A line of elements is perturbed randomly, and return to the yield surface at each quadpoint is checked
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1000
  ny = 1234
  nz = 1
  xmin = 0
  xmax = 1000
  ymin = 0
  ymax = 1234
  zmin = 0
  zmax = 1
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[ICs]
  [./x]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_x
  [../]
  [./y]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_y
  [../]
  [./z]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_z
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '0'
  [../]
[]
[AuxVariables]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./f0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./int0]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 0
    variable = int0
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
[]
[Postprocessors]
  [./tot_iters]
    type = ElementIntegralMaterialProperty
    mat_prop = plastic_NR_iterations
    outputs = console
  [../]
  [./raw_f0]
    type = ElementExtremeValue
    variable = f0
    outputs = console
  [../]
  [./raw_f1]
    type = ElementExtremeValue
    variable = f1
    outputs = console
  [../]
  [./raw_f2]
    type = ElementExtremeValue
    variable = f2
    outputs = console
  [../]
  [./iter]
    type = ElementExtremeValue
    variable = iter
    outputs = console
  [../]
  [./f0]
    type = FunctionValuePostprocessor
    function = should_be_zero0_fcn
  [../]
  [./f1]
    type = FunctionValuePostprocessor
    function = should_be_zero1_fcn
  [../]
  [./f2]
    type = FunctionValuePostprocessor
    function = should_be_zero2_fcn
  [../]
[]
[Functions]
  [./should_be_zero0_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-1,0,a)'
    symbol_names = 'a'
    symbol_values = 'raw_f0'
  [../]
  [./should_be_zero1_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-1,0,a)'
    symbol_names = 'a'
    symbol_values = 'raw_f1'
  [../]
  [./should_be_zero2_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-1,0,a)'
    symbol_names = 'a'
    symbol_values = 'raw_f2'
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningCubic
    value_0 = 1E6
    value_residual = 0
    internal_limit = 1
  [../]
  [./cs]
    type = SolidMechanicsHardeningConstant
    value = 1E12
  [../]
  [./coh]
    type = SolidMechanicsHardeningConstant
    value = 1E12
  [../]
  [./ang]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '1E9 1.3E9'
  [../]
  [./tensile]
    type = CappedMohrCoulombStressUpdate
    tensile_strength = ts
    compressive_strength = cs
    cohesion = coh
    friction_angle = ang
    dilation_angle = ang
    smoothing_tol = 1E5
    max_NR_iterations = 100
    yield_function_tol = 1.0E-1
  [../]
  [./stress]
    type = ComputeMultipleInelasticStress
    inelastic_models = tensile
    perform_finite_strain_rotations = false
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = random1
  csv = true
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/monolithic_material_based/cp_slip_rate_integ/crysp_linesearch.i)
[Mesh]
  type = GeneratedMesh
  dim = 3
  elem_type = HEX8
  displacements = 'disp_x disp_y disp_z'
[]
[Variables]
  [./disp_x]
    block = 0
  [../]
  [./disp_y]
    block = 0
  [../]
  [./disp_z]
    block = 0
  [../]
[]
[AuxVariables]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
  [./fp_zz]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
  [./e_zz]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
  [./gss1]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
[]
[Functions]
  [./tdisp]
    type = ParsedFunction
    expression = 0.0001*t
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
    use_displaced_mesh = true
  [../]
[]
[AuxKernels]
  [./stress_zz]
    type = RankTwoAux
    variable = stress_zz
    rank_two_tensor = stress
    index_j = 2
    index_i = 2
    execute_on = timestep_end
    block = 0
  [../]
  [./fp_zz]
    type = RankTwoAux
    variable = fp_zz
    rank_two_tensor = fp
    index_j = 2
    index_i = 2
    execute_on = timestep_end
    block = 0
  [../]
  [./e_zz]
    type = RankTwoAux
    variable = e_zz
    rank_two_tensor = lage
    index_j = 2
    index_i = 2
    execute_on = timestep_end
    block = 0
  [../]
  [./gss1]
    type = MaterialStdVectorAux
    variable = gss1
    property = gss
    index = 0
    execute_on = timestep_end
    block = 0
  [../]
[]
[BCs]
  [./symmy]
    type = DirichletBC
    variable = disp_y
    boundary = bottom
    value = 0
  [../]
  [./symmx]
    type = DirichletBC
    variable = disp_x
    boundary = left
    value = 0
  [../]
  [./symmz]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0
  [../]
  [./tdisp]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = tdisp
  [../]
[]
[Materials]
  [./crysp]
    type = FiniteStrainCPSlipRateRes
    block = 0
    slip_sys_file_name = input_slip_sys.txt
    nss = 12
    num_slip_sys_flowrate_props = 2 #Number of properties in a slip system
    flowprops = '1 4 0.001 0.01 5 8 0.001 0.01 9 12 0.001 0.01'
    hprops = '1.0 541.5 60.8 109.8 2.5'
    gprops = '1 4 60.8 5 8 60.8 9 12 60.8'
    tan_mod_type = exact
    slip_incr_tol = 1
    maximum_substep_iteration = 12
    use_line_search = true
    rtol = 1e-8
    abs_tol = 1e-12
    line_search_method = 'BISECTION'
  [../]
  [./elasticity_tensor]
    type = ComputeElasticityTensorCP
    block = 0
    C_ijkl = '1.684e5 1.214e5 1.214e5 1.684e5 1.214e5 1.684e5 0.754e5 0.754e5 0.754e5'
    fill_method = symmetric9
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[Postprocessors]
  [./stress_zz]
    type = ElementAverageValue
    variable = stress_zz
    block = 'ANY_BLOCK_ID 0'
  [../]
  [./fp_zz]
    type = ElementAverageValue
    variable = fp_zz
    block = 'ANY_BLOCK_ID 0'
  [../]
  [./e_zz]
    type = ElementAverageValue
    variable = e_zz
    block = 'ANY_BLOCK_ID 0'
  [../]
  [./gss1]
    type = ElementAverageValue
    variable = gss1
    block = 'ANY_BLOCK_ID 0'
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  #Preconditioned JFNK (default)
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  nl_rel_tol = 1e-10
  nl_abs_tol = 1e-10
  dt = 10
  dtmin = 0.05
  dtmax = 1e4
  num_steps = 10
[]
[Outputs]
  file_base = crysp_linesearch_out
  exodus = true
  print_linear_residuals = true
  perf_graph = true
[]
(modules/solid_mechanics/test/tests/mohr_coulomb/uni_axial1_small_strain.i)
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  # back = zmin
  # front = zmax
  # bottom = ymin
  # top = ymax
  # left = xmin
  # right = xmax
  [./xmin_xzero]
    type = DirichletBC
    variable = disp_x
    boundary = 'left'
    value = '0'
  [../]
  [./ymin_yzero]
    type = DirichletBC
    variable = disp_y
    boundary = 'bottom'
    value = '0'
  [../]
  [./zmin_zzero]
    type = DirichletBC
    variable = disp_z
    boundary = 'back'
    value = '0'
  [../]
  [./zmax_disp]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front'
    function = '-1E-3*t'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_int]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./mc_int_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = mc_int
  [../]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./mc_int]
    type = PointValue
    point = '0 0 0'
    variable = mc_int
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 10E6
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningExponential
    value_0 = 0
    value_residual = 0.6981317 # 40deg
    rate = 10000
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 0
  [../]
  [./mc]
    type = SolidMechanicsPlasticMohrCoulomb
    cohesion = mc_coh
    friction_angle = mc_phi
    dilation_angle = mc_psi
    mc_tip_smoother = 0
    mc_edge_smoother = 25
    yield_function_tolerance = 1E-3
    internal_constraint_tolerance = 1E-10
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '5.77E10 3.85E10' # young = 100Gpa, poisson = 0.3
  [../]
  [./strain]
    type = ComputeIncrementalStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-10
    plastic_models = mc
    max_NR_iterations = 1000
    debug_fspb = crash
  [../]
[]
[Preconditioning]
  [./andy]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  end_time = 0.5
  dt = 0.05
  solve_type = NEWTON
  type = Transient
  line_search = 'none'
  nl_rel_tol = 1E-10
  l_tol = 1E-3
  l_max_its = 200
  nl_max_its = 10
  petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
  petsc_options_value = ' asm      2              lu            gmres     200'
[]
[Outputs]
  file_base = uni_axial1_small_strain
  exodus = true
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform1.i)
# Using CappedMohrCoulomb with tensile failure only
# checking for small deformation
# A single element is stretched by 1E-6m in z direction, and by small amounts in x and y directions
# stress_zz = Youngs Modulus*Strain = 2E6*1E-6 = 2 Pa
# tensile_strength is set to 1Pa
# Then the final stress should return to the yeild surface and the minimum principal stress value should be 1pa.
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0.1E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0.2E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1E-6*z'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1
  [../]
  [./coh]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./ang]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 2.0E6'
  [../]
  [./tensile]
    type = CappedMohrCoulombStressUpdate
    tensile_strength = ts
    compressive_strength = ts
    cohesion = coh
    friction_angle = ang
    dilation_angle = ang
    smoothing_tol = 0.0
    yield_function_tol = 1.0E-9
  [../]
  [./stress]
    type = ComputeMultipleInelasticStress
    inelastic_models = tensile
    perform_finite_strain_rotations = false
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform1
  csv = true
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/user_object_based/test.i)
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
  type = GeneratedMesh
  dim = 3
  elem_type = HEX8
[]
[AuxVariables]
  [./pk2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./fp_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./e_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./gss]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./slip_increment]
   order = CONSTANT
   family = MONOMIAL
  [../]
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  add_variables = true
  generate_output = stress_zz
[]
[AuxKernels]
  [./pk2]
   type = RankTwoAux
   variable = pk2
   rank_two_tensor = pk2
   index_j = 2
   index_i = 2
   execute_on = timestep_end
  [../]
  [./fp_zz]
    type = RankTwoAux
    variable = fp_zz
    rank_two_tensor = fp
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  [../]
  [./e_zz]
    type = RankTwoAux
    variable = e_zz
    rank_two_tensor = lage
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  [../]
  [./slip_inc]
   type = MaterialStdVectorAux
   variable = slip_increment
   property = slip_rate_gss
   index = 0
   execute_on = timestep_end
  [../]
  [./gss]
    type = MaterialStdVectorAux
    variable = gss
    property = state_var_gss
    index = 0
    execute_on = timestep_end
  [../]
[]
[BCs]
  [./symmy]
    type = DirichletBC
    variable = disp_y
    boundary = bottom
    value = 0
  [../]
  [./symmx]
    type = DirichletBC
    variable = disp_x
    boundary = left
    value = 0
  [../]
  [./symmz]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0
  [../]
  [./tdisp]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = '0.01*t'
  [../]
[]
[UserObjects]
  [./slip_rate_gss]
    type = CrystalPlasticitySlipRateGSS
    variable_size = 12
    slip_sys_file_name = input_slip_sys.txt
    num_slip_sys_flowrate_props = 2
    flowprops = '1 4 0.001 0.1 5 8 0.001 0.1 9 12 0.001 0.1'
    uo_state_var_name = state_var_gss
  [../]
  [./slip_resistance_gss]
    type = CrystalPlasticitySlipResistanceGSS
    variable_size = 12
    uo_state_var_name = state_var_gss
  [../]
  [./state_var_gss]
    type = CrystalPlasticityStateVariable
    variable_size = 12
    groups = '0 4 8 12'
    group_values = '60.8 60.8 60.8'
    uo_state_var_evol_rate_comp_name = state_var_evol_rate_comp_gss
    scale_factor = 1.0
  [../]
  [./state_var_evol_rate_comp_gss]
    type = CrystalPlasticityStateVarRateComponentGSS
    variable_size = 12
    hprops = '1.0 541.5 109.8 2.5'
    uo_slip_rate_name = slip_rate_gss
    uo_state_var_name = state_var_gss
  [../]
[]
[Materials]
  [./crysp]
    type = FiniteStrainUObasedCP
    stol = 1e-2
    tan_mod_type = exact
    uo_slip_rates = 'slip_rate_gss'
    uo_slip_resistances = 'slip_resistance_gss'
    uo_state_vars = 'state_var_gss'
    uo_state_var_evol_rate_comps = 'state_var_evol_rate_comp_gss'
  [../]
  [./elasticity_tensor]
    type = ComputeElasticityTensorCP
    C_ijkl = '1.684e5 1.214e5 1.214e5 1.684e5 1.214e5 1.684e5 0.754e5 0.754e5 0.754e5'
    fill_method = symmetric9
  [../]
[]
[Postprocessors]
  [./stress_zz]
    type = ElementAverageValue
    variable = stress_zz
  [../]
  [./pk2]
   type = ElementAverageValue
   variable = pk2
  [../]
  [./fp_zz]
    type = ElementAverageValue
    variable = fp_zz
  [../]
  [./e_zz]
    type = ElementAverageValue
    variable = e_zz
  [../]
  [./gss]
    type = ElementAverageValue
    variable = gss
  [../]
  [./slip_increment]
   type = ElementAverageValue
   variable = slip_increment
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  dt = 0.05
  solve_type = 'PJFNK'
  petsc_options_iname = -pc_hypre_type
  petsc_options_value = boomerang
  nl_abs_tol = 1e-10
  nl_rel_step_tol = 1e-10
  dtmax = 10.0
  nl_rel_tol = 1e-10
  dtmin = 0.05
  num_steps = 10
  nl_abs_step_tol = 1e-10
[]
[Outputs]
  exodus = true
[]
(modules/solid_mechanics/test/tests/capped_weak_plane/push_and_shear.i)
# Dynamic problem with plasticity.
# A column of material (not subject to gravity) has the z-displacement
# of its sides fixed, but the centre of its bottom side is pushed
# upwards.  This causes failure in the bottom elements.
#
# The problem utilises damping in the following way.
# The DynamicStressDivergenceTensors forms the residual
# integral  grad(stress) + zeta*grad(stress-dot)
#     = V/L * elasticity * (du/dx + zeta * dv/dx)
# where V is the elemental volume, and L is the length-scale,
# and u is the displacement, and v is the velocity.
# The InertialForce forms the residual
# integral  density * (accel + eta * velocity)
#     = V * density * (a + eta * v)
# where a is the acceleration.
# So, a damped oscillator description with both these
# kernels looks like
# 0 = V * (density * a + density * eta * v + elasticity * zeta * v / L^2 + elasticity / L^2 * u)
# Critical damping is when the coefficient of v is
# 2 * sqrt(density * elasticity / L^2)
# In the case at hand, density=1E4, elasticity~1E10 (Young is 16GPa),
# L~1 to 10 (in the horizontal or vertical direction), so this coefficient ~ 1E7 to 1E6.
# Choosing eta = 1E3 and zeta = 1E-2 gives approximate critical damping.
# If zeta is high then steady-state is achieved very quickly.
#
# In the case of plasticity, the effective stiffness of the elements
# is significantly less.  Therefore, the above parameters give
# overdamping.
#
# This simulation is a nice example of the irreversable and non-uniqueness
# of simulations involving plasticity.  The result depends on the damping
# parameters and the time stepping.
[Mesh]
  [generated_mesh]
    type = GeneratedMeshGenerator
    dim = 3
    nx = 10
    ny = 1
    nz = 5
    bias_z = 1.5
    xmin = -10
    xmax = 10
    ymin = -10
    ymax = 10
    zmin = -100
    zmax = 0
  []
  [bottomz_middle]
    type = BoundingBoxNodeSetGenerator
    new_boundary = bottomz_middle
    bottom_left = '-1 -1500 -105'
    top_right = '1 1500 -95'
    input = generated_mesh
  []
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
  beta = 0.25 # Newmark time integration
  gamma = 0.5 # Newmark time integration
  eta = 1E3 #0.3E4 # higher values mean more damping via density
[]
[Variables]
  [disp_x]
  []
  [disp_y]
  []
  [disp_z]
  []
[]
[Kernels]
  [DynamicSolidMechanics] # zeta*K*vel + K * disp
    displacements = 'disp_x disp_y disp_z'
    stiffness_damping_coefficient = 1E-2 # higher values mean more damping via stiffness
    hht_alpha = 0 # better nonlinear convergence than for alpha>0
  []
  [inertia_x] # M*accel + eta*M*vel
    type = InertialForce
    use_displaced_mesh = false
    variable = disp_x
    velocity = vel_x
    acceleration = accel_x
  []
  [inertia_y]
    type = InertialForce
    use_displaced_mesh = false
    variable = disp_y
    velocity = vel_y
    acceleration = accel_y
  []
  [inertia_z]
    type = InertialForce
    use_displaced_mesh = false
    variable = disp_z
    velocity = vel_z
    acceleration = accel_z
  []
[]
[BCs]
  [no_x2]
    type = DirichletBC
    variable = disp_x
    boundary = right
    value = 0.0
  []
  [no_x1]
    type = DirichletBC
    variable = disp_x
    boundary = left
    value = 0.0
  []
  [no_y1]
    type = DirichletBC
    variable = disp_y
    boundary = bottom
    value = 0.0
  []
  [no_y2]
    type = DirichletBC
    variable = disp_y
    boundary = top
    value = 0.0
  []
  [z_fixed_sides_xmin]
    type = DirichletBC
    variable = disp_z
    boundary = left
    value = 0
  []
  [z_fixed_sides_xmax]
    type = DirichletBC
    variable = disp_z
    boundary = right
    value = 0
  []
  [bottomz]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = bottomz_middle
    function = min(10*t,1)
  []
[]
[AuxVariables]
  [accel_x]
  []
  [vel_x]
  []
  [accel_y]
  []
  [vel_y]
  []
  [accel_z]
  []
  [vel_z]
  []
  [stress_xx]
    order = CONSTANT
    family = MONOMIAL
  []
  [stress_xy]
    order = CONSTANT
    family = MONOMIAL
  []
  [stress_xz]
    order = CONSTANT
    family = MONOMIAL
  []
  [stress_yy]
    order = CONSTANT
    family = MONOMIAL
  []
  [stress_yz]
    order = CONSTANT
    family = MONOMIAL
  []
  [stress_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [strainp_xx]
    order = CONSTANT
    family = MONOMIAL
  []
  [strainp_xy]
    order = CONSTANT
    family = MONOMIAL
  []
  [strainp_xz]
    order = CONSTANT
    family = MONOMIAL
  []
  [strainp_yy]
    order = CONSTANT
    family = MONOMIAL
  []
  [strainp_yz]
    order = CONSTANT
    family = MONOMIAL
  []
  [strainp_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [straint_xx]
    order = CONSTANT
    family = MONOMIAL
  []
  [straint_xy]
    order = CONSTANT
    family = MONOMIAL
  []
  [straint_xz]
    order = CONSTANT
    family = MONOMIAL
  []
  [straint_yy]
    order = CONSTANT
    family = MONOMIAL
  []
  [straint_yz]
    order = CONSTANT
    family = MONOMIAL
  []
  [straint_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [f_shear]
    order = CONSTANT
    family = MONOMIAL
  []
  [f_tensile]
    order = CONSTANT
    family = MONOMIAL
  []
  [f_compressive]
    order = CONSTANT
    family = MONOMIAL
  []
  [intnl_shear]
    order = CONSTANT
    family = MONOMIAL
  []
  [intnl_tensile]
    order = CONSTANT
    family = MONOMIAL
  []
  [iter]
    order = CONSTANT
    family = MONOMIAL
  []
  [ls]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[AuxKernels]
  [accel_x] # Calculates and stores acceleration at the end of time step
    type = NewmarkAccelAux
    variable = accel_x
    displacement = disp_x
    velocity = vel_x
    execute_on = timestep_end
  []
  [vel_x] # Calculates and stores velocity at the end of the time step
    type = NewmarkVelAux
    variable = vel_x
    acceleration = accel_x
    execute_on = timestep_end
  []
  [accel_y]
    type = NewmarkAccelAux
    variable = accel_y
    displacement = disp_y
    velocity = vel_y
    execute_on = timestep_end
  []
  [vel_y]
    type = NewmarkVelAux
    variable = vel_y
    acceleration = accel_y
    execute_on = timestep_end
  []
  [accel_z]
    type = NewmarkAccelAux
    variable = accel_z
    displacement = disp_z
    velocity = vel_z
    execute_on = timestep_end
  []
  [vel_z]
    type = NewmarkVelAux
    variable = vel_z
    acceleration = accel_z
    execute_on = timestep_end
  []
  [stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  []
  [stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  []
  [stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  []
  [stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  []
  [stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  []
  [stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  []
  [strainp_xx]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_xx
    index_i = 0
    index_j = 0
  []
  [strainp_xy]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_xy
    index_i = 0
    index_j = 1
  []
  [strainp_xz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_xz
    index_i = 0
    index_j = 2
  []
  [strainp_yy]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_yy
    index_i = 1
    index_j = 1
  []
  [strainp_yz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_yz
    index_i = 1
    index_j = 2
  []
  [strainp_zz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_zz
    index_i = 2
    index_j = 2
  []
  [straint_xx]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_xx
    index_i = 0
    index_j = 0
  []
  [straint_xy]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_xy
    index_i = 0
    index_j = 1
  []
  [straint_xz]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_xz
    index_i = 0
    index_j = 2
  []
  [straint_yy]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_yy
    index_i = 1
    index_j = 1
  []
  [straint_yz]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_yz
    index_i = 1
    index_j = 2
  []
  [straint_zz]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_zz
    index_i = 2
    index_j = 2
  []
  [f_shear]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f_shear
  []
  [f_tensile]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f_tensile
  []
  [f_compressive]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f_compressive
  []
  [intnl_shear]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl_shear
  []
  [intnl_tensile]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 1
    variable = intnl_tensile
  []
  [iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  []
  [ls]
    type = MaterialRealAux
    property = plastic_linesearch_needed
    variable = ls
  []
[]
[UserObjects]
  [coh]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  []
  [tanphi]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  []
  [tanpsi]
    type = SolidMechanicsHardeningConstant
    value = 0.166666666667
  []
  [t_strength]
    type = SolidMechanicsHardeningConstant
    value = 1E80
  []
  [c_strength]
    type = SolidMechanicsHardeningConstant
    value = 0
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '6.4E9 6.4E9' # young 16MPa, Poisson 0.25
  []
  [strain]
    type = ComputeIncrementalStrain
  []
  [admissible]
    type = ComputeMultipleInelasticStress
    inelastic_models = stress
    perform_finite_strain_rotations = false
  []
  [stress]
    type = CappedWeakPlaneStressUpdate
    cohesion = coh
    tan_friction_angle = tanphi
    tan_dilation_angle = tanpsi
    tensile_strength = t_strength
    compressive_strength = c_strength
    tip_smoother = 0.5E6
    smoothing_tol = 0.5E6
    yield_function_tol = 1E-2
  []
  [density]
    type = GenericConstantMaterial
    block = 0
    prop_names = density
    prop_values = 1E4
  []
[]
[Preconditioning]
  [andy]
    type = SMP
    full = true
    petsc_options = '-snes_converged_reason -snes_linesearch_monitor'
    petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
    petsc_options_value = ' asm      2              lu            gmres     200'
  []
[]
[Executioner]
  solve_type = 'NEWTON'
  petsc_options = '-snes_converged_reason'
  line_search = bt
  nl_abs_tol = 1E1
  nl_rel_tol = 1e-5
  l_tol = 1E-10
  l_max_its = 100
  nl_max_its = 100
  end_time = 0.5
  dt = 0.1
  type = Transient
[]
[Outputs]
  file_base = push_and_shear
  exodus = true
  csv = true
[]
(modules/solid_mechanics/test/tests/mean_cap_TC/small_deform3.i)
# apply nonuniform compression in x, y and z directions such that
# trial_stress(0, 0) = 2
# trial_stress(1, 1) = -8
# trial_stress(2, 2) = -10
# With compressive_strength = -1, the algorithm should return to trace(stress) = -1, or
# stress(0, 0) = 7
# stress(1, 1) = -3
# stress(2, 2) = -5
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '1E-7*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '-4E-7*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '-5E-7*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = f
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = f
  [../]
[]
[UserObjects]
  [./tensile_strength]
    type = SolidMechanicsHardeningConstant
    value = 2
  [../]
  [./compressive_strength]
    type = SolidMechanicsHardeningConstant
    value = -1
  [../]
  [./cap]
    type = SolidMechanicsPlasticMeanCapTC
    tensile_strength = tensile_strength
    compressive_strength = compressive_strength
    yield_function_tolerance = 1E-3
    internal_constraint_tolerance = 1E-9
    use_custom_returnMap = false
    use_custom_cto = false
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./strain]
    type = ComputeIncrementalStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mean_cap]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = cap
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform3
  exodus = false
  [./csv]
    type = CSV
  [../]
[]
(modules/solid_mechanics/test/tests/capped_weak_plane/small_deform_cosserat3.i)
# Plastic deformation.  Layered Cosserat with parameters:
# Young = 10.0
# Poisson = 0.25
# layer_thickness = 10
# joint_normal_stiffness = 2.5
# joint_shear_stiffness = 2.0
# These give the following nonzero components of the elasticity tensor:
# E_0000 = E_1111 = 1.156756756757E+01
# E_0011 = E_1100 = 3.855855855856E+00
# E_2222 = E_pp = 8.108108108108E+00
# E_0022 = E_1122 = E_2200 = E_2211 = 2.702702702703E+00
# G = E_0101 = E_0110 = E_1001 = E_1010 = 4
# Gt = E_qq = E_0202 = E_0220 = E_2002 = E_1212 = E_1221 = E_2112 = 3.333333333333E+00
# E_2020 = E_2121 = 3.666666666667E+00
# They give the following nonzero components of the bending rigidity tensor:
# D = 8.888888888889E+02
# B_0101 = B_1010 = 8.080808080808E+00
# B_0110 = B_1001 = -2.020202020202E+00
#
# Applying the following deformation to the zmax surface of a unit cube:
# disp_x = 32*t/Gt
# disp_y = 24*t/Gt
# disp_z = 10*t/E_2222
# omega_x = omega_y = omega_z = 0
# yields the following strains:
# strain_xz = 32*t/Gt = 9.6*t
# strain_yz = 24*t/Gt = 7.2*t
# strain_zz = 10*t/E_2222 = 1.23333333*t
# and all other components, and the curvature, are zero.
# The nonzero components of stress are therefore:
# stress_xx = stress_yy = 3.33333*t
# stress_xz = stress_zx = 32*t
# stress_yz = stress_zy = 24*t
# stress_zz = 10*t
# The moment stress is zero.
# So q = 40*t and p = 10*t
#
# Use tan(friction_angle) = 0.5 and tan(dilation_angle) = E_qq/Epp/2, and cohesion=20,
# the system should return to p=0, q=20, ie stress_zz=0, stress_xz=16,
# stress_yz=12 on the first time step (t=1)
# and
# stress_xx = stress_yy = 0
# and
# stress_zx = 32, and stress_zy = 24.
# Although this has resulted in a non-symmetric stress tensor, the
# moments generated are cancelled by the boundary conditions on
# omega_x and omega_y.  (Removing these boundary conditions results
# in a symmetric stress tensor, and some omega!=0 being generated.)
# No moment stresses are generated because omega=0=curvature.
#
# The total strains are given above (strain_xz = 9.6,
# strain_yz = 7.2 and strain_zz = 1.23333).
# Since q returned from 40 to 20, plastic_strain_xz = strain_xz/2 = 4.8
# and plastic_strain_yz = strain_yz/2 = 3.6.
# Since p returned to zero, all of the total strain_zz is
# plastic, ie plastic_strain_zz = 1.23333
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
  Cosserat_rotations = 'wc_x wc_y wc_z'
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
  [./wc_x]
  [../]
  [./wc_y]
  [../]
[]
[Kernels]
  [./cx_elastic]
    type = CosseratStressDivergenceTensors
    variable = disp_x
    component = 0
  [../]
  [./cy_elastic]
    type = CosseratStressDivergenceTensors
    variable = disp_y
    component = 1
  [../]
  [./cz_elastic]
    type = CosseratStressDivergenceTensors
    variable = disp_z
    component = 2
  [../]
  [./x_couple]
    type = StressDivergenceTensors
    variable = wc_x
    displacements = 'wc_x wc_y wc_z'
    component = 0
    base_name = couple
  [../]
  [./y_couple]
    type = StressDivergenceTensors
    variable = wc_y
    displacements = 'wc_x wc_y wc_z'
    component = 1
    base_name = couple
  [../]
  [./x_moment]
    type = MomentBalancing
    variable = wc_x
    component = 0
  [../]
  [./y_moment]
    type = MomentBalancing
    variable = wc_y
    component = 1
  [../]
[]
[BCs]
  [./bottomx]
    type = DirichletBC
    variable = disp_x
    boundary = back
    value = 0.0
  [../]
  [./bottomy]
    type = DirichletBC
    variable = disp_y
    boundary = back
    value = 0.0
  [../]
  [./bottomz]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0.0
  [../]
  [./bottom_wc_x]
    type = DirichletBC
    variable = wc_x
    boundary = back
    value = 0.0
  [../]
  [./bottom_wc_y]
    type = DirichletBC
    variable = wc_y
    boundary = back
    value = 0.0
  [../]
  [./topx]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = front
    function = 32*t/3.333333333333E+00
  [../]
  [./topy]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = front
    function = 24*t/3.333333333333E+00
  [../]
  [./topz]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = 10*t/8.108108108108E+00
  [../]
  [./top_wc_x]
    type = DirichletBC
    variable = wc_x
    boundary = front
    value = 0.0
  [../]
  [./top_wc_y]
    type = DirichletBC
    variable = wc_y
    boundary = front
    value = 0.0
  [../]
[]
[AuxVariables]
  [./wc_z]
  [../]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./couple_stress_xx]
    family = MONOMIAL
    order = CONSTANT
  [../]
  [./couple_stress_xy]
    family = MONOMIAL
    order = CONSTANT
  [../]
  [./couple_stress_xz]
    family = MONOMIAL
    order = CONSTANT
  [../]
  [./couple_stress_yx]
    family = MONOMIAL
    order = CONSTANT
  [../]
  [./couple_stress_yy]
    family = MONOMIAL
    order = CONSTANT
  [../]
  [./couple_stress_yz]
    family = MONOMIAL
    order = CONSTANT
  [../]
  [./couple_stress_zx]
    family = MONOMIAL
    order = CONSTANT
  [../]
  [./couple_stress_zy]
    family = MONOMIAL
    order = CONSTANT
  [../]
  [./couple_stress_zz]
    family = MONOMIAL
    order = CONSTANT
  [../]
  [./strainp_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_yx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_zx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_zy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_yx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_zx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_zy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_compressive]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./ls]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yx
    index_i = 1
    index_j = 0
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zx
    index_i = 2
    index_j = 0
  [../]
  [./stress_zy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zy
    index_i = 2
    index_j = 1
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./couple_stress_xx]
    type = RankTwoAux
    rank_two_tensor = couple_stress
    variable = couple_stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./couple_stress_xy]
    type = RankTwoAux
    rank_two_tensor = couple_stress
    variable = couple_stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./couple_stress_xz]
    type = RankTwoAux
    rank_two_tensor = couple_stress
    variable = couple_stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./couple_stress_yx]
    type = RankTwoAux
    rank_two_tensor = couple_stress
    variable = couple_stress_yx
    index_i = 1
    index_j = 0
  [../]
  [./couple_stress_yy]
    type = RankTwoAux
    rank_two_tensor = couple_stress
    variable = couple_stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./couple_stress_yz]
    type = RankTwoAux
    rank_two_tensor = couple_stress
    variable = couple_stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./couple_stress_zx]
    type = RankTwoAux
    rank_two_tensor = couple_stress
    variable = couple_stress_zx
    index_i = 2
    index_j = 0
  [../]
  [./couple_stress_zy]
    type = RankTwoAux
    rank_two_tensor = couple_stress
    variable = couple_stress_zy
    index_i = 2
    index_j = 1
  [../]
  [./couple_stress_zz]
    type = RankTwoAux
    rank_two_tensor = couple_stress
    variable = couple_stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./strainp_xx]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_xx
    index_i = 0
    index_j = 0
  [../]
  [./strainp_xy]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_xy
    index_i = 0
    index_j = 1
  [../]
  [./strainp_xz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_xz
    index_i = 0
    index_j = 2
  [../]
  [./strainp_yx]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_yx
    index_i = 1
    index_j = 0
  [../]
  [./strainp_yy]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_yy
    index_i = 1
    index_j = 1
  [../]
  [./strainp_yz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_yz
    index_i = 1
    index_j = 2
  [../]
  [./strainp_zx]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_zx
    index_i = 2
    index_j = 0
  [../]
  [./strainp_zy]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_zy
    index_i = 2
    index_j = 1
  [../]
  [./strainp_zz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_zz
    index_i = 2
    index_j = 2
  [../]
  [./straint_xx]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_xx
    index_i = 0
    index_j = 0
  [../]
  [./straint_xy]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_xy
    index_i = 0
    index_j = 1
  [../]
  [./straint_xz]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_xz
    index_i = 0
    index_j = 2
  [../]
  [./straint_yx]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_yx
    index_i = 1
    index_j = 0
  [../]
  [./straint_yy]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_yy
    index_i = 1
    index_j = 1
  [../]
  [./straint_yz]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_yz
    index_i = 1
    index_j = 2
  [../]
  [./straint_zx]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_zx
    index_i = 2
    index_j = 0
  [../]
  [./straint_zy]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_zy
    index_i = 2
    index_j = 1
  [../]
  [./straint_zz]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_zz
    index_i = 2
    index_j = 2
  [../]
  [./f_shear]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f_shear
  [../]
  [./f_tensile]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f_tensile
  [../]
  [./f_compressive]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f_compressive
  [../]
  [./intnl_shear]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl_shear
  [../]
  [./intnl_tensile]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 1
    variable = intnl_tensile
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./ls]
    type = MaterialRealAux
    property = plastic_linesearch_needed
    variable = ls
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yx]
    type = PointValue
    point = '0 0 0'
    variable = stress_yx
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zx]
    type = PointValue
    point = '0 0 0'
    variable = stress_zx
  [../]
  [./s_zy]
    type = PointValue
    point = '0 0 0'
    variable = stress_zy
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./c_s_xx]
    type = PointValue
    point = '0 0 0'
    variable = couple_stress_xx
  [../]
  [./c_s_xy]
    type = PointValue
    point = '0 0 0'
    variable = couple_stress_xy
  [../]
  [./c_s_xz]
    type = PointValue
    point = '0 0 0'
    variable = couple_stress_xz
  [../]
  [./c_s_yx]
    type = PointValue
    point = '0 0 0'
    variable = couple_stress_yx
  [../]
  [./c_s_yy]
    type = PointValue
    point = '0 0 0'
    variable = couple_stress_yy
  [../]
  [./c_s_yz]
    type = PointValue
    point = '0 0 0'
    variable = couple_stress_yz
  [../]
  [./c_s_zx]
    type = PointValue
    point = '0 0 0'
    variable = couple_stress_zx
  [../]
  [./c_s_zy]
    type = PointValue
    point = '0 0 0'
    variable = couple_stress_zy
  [../]
  [./c_s_zz]
    type = PointValue
    point = '0 0 0'
    variable = couple_stress_zz
  [../]
  [./strainp_xx]
    type = PointValue
    point = '0 0 0'
    variable = strainp_xx
  [../]
  [./strainp_xy]
    type = PointValue
    point = '0 0 0'
    variable = strainp_xy
  [../]
  [./strainp_xz]
    type = PointValue
    point = '0 0 0'
    variable = strainp_xz
  [../]
  [./strainp_yx]
    type = PointValue
    point = '0 0 0'
    variable = strainp_yx
  [../]
  [./strainp_yy]
    type = PointValue
    point = '0 0 0'
    variable = strainp_yy
  [../]
  [./strainp_yz]
    type = PointValue
    point = '0 0 0'
    variable = strainp_yz
  [../]
  [./strainp_zx]
    type = PointValue
    point = '0 0 0'
    variable = strainp_zx
  [../]
  [./strainp_zy]
    type = PointValue
    point = '0 0 0'
    variable = strainp_zy
  [../]
  [./strainp_zz]
    type = PointValue
    point = '0 0 0'
    variable = strainp_zz
  [../]
  [./straint_xx]
    type = PointValue
    point = '0 0 0'
    variable = straint_xx
  [../]
  [./straint_xy]
    type = PointValue
    point = '0 0 0'
    variable = straint_xy
  [../]
  [./straint_xz]
    type = PointValue
    point = '0 0 0'
    variable = straint_xz
  [../]
  [./straint_yx]
    type = PointValue
    point = '0 0 0'
    variable = straint_yx
  [../]
  [./straint_yy]
    type = PointValue
    point = '0 0 0'
    variable = straint_yy
  [../]
  [./straint_yz]
    type = PointValue
    point = '0 0 0'
    variable = straint_yz
  [../]
  [./straint_zx]
    type = PointValue
    point = '0 0 0'
    variable = straint_zx
  [../]
  [./straint_zy]
    type = PointValue
    point = '0 0 0'
    variable = straint_zy
  [../]
  [./straint_zz]
    type = PointValue
    point = '0 0 0'
    variable = straint_zz
  [../]
  [./f_shear]
    type = PointValue
    point = '0 0 0'
    variable = f_shear
  [../]
  [./f_tensile]
    type = PointValue
    point = '0 0 0'
    variable = f_tensile
  [../]
  [./f_compressive]
    type = PointValue
    point = '0 0 0'
    variable = f_compressive
  [../]
  [./intnl_shear]
    type = PointValue
    point = '0 0 0'
    variable = intnl_shear
  [../]
  [./intnl_tensile]
    type = PointValue
    point = '0 0 0'
    variable = intnl_tensile
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
  [./ls]
    type = PointValue
    point = '0 0 0'
    variable = ls
  [../]
[]
[UserObjects]
  [./coh]
    type = SolidMechanicsHardeningConstant
    value = 20
  [../]
  [./tanphi]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
  [./tanpsi]
    type = SolidMechanicsHardeningConstant
    value = 2.055555555556E-01
  [../]
  [./t_strength]
    type = SolidMechanicsHardeningConstant
    value = 100
  [../]
  [./c_strength]
    type = SolidMechanicsHardeningConstant
    value = 100
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeLayeredCosseratElasticityTensor
    young = 10.0
    poisson = 0.25
    layer_thickness = 10.0
    joint_normal_stiffness = 2.5
    joint_shear_stiffness = 2.0
  [../]
  [./strain]
    type = ComputeCosseratIncrementalSmallStrain
  [../]
  [./admissible]
    type = ComputeMultipleInelasticCosseratStress
    inelastic_models = stress
    perform_finite_strain_rotations = false
  [../]
  [./stress]
    type = CappedWeakPlaneCosseratStressUpdate
    cohesion = coh
    tan_friction_angle = tanphi
    tan_dilation_angle = tanpsi
    tensile_strength = t_strength
    compressive_strength = c_strength
    tip_smoother = 0
    smoothing_tol = 0
    yield_function_tol = 1E-5
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform_cosserat3
  csv = true
[]
(modules/solid_mechanics/test/tests/mohr_coulomb/small_deform2.i)
# apply repeated stretches in x, y and z directions, so that mean_stress = 0
# This maps out the yield surface in the octahedral plane for zero mean stress
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '2E-6*x*sin(t)'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '2E-6*y*sin(2*t)'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '-2E-6*z*(sin(t)+sin(2*t))'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 10
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 20
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 0
  [../]
  [./mc]
    type = SolidMechanicsPlasticMohrCoulomb
    cohesion = mc_coh
    friction_angle = mc_phi
    dilation_angle = mc_psi
    mc_tip_smoother = 4
    mc_edge_smoother = 20
    yield_function_tolerance = 1E-3
    internal_constraint_tolerance = 1E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = mc
    debug_fspb = crash
  [../]
[]
[Executioner]
  end_time = 100
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform2
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/orthotropic_plasticity/powerRuleHardening.i)
# UserObject Orthotropic test, with power rule hardening with rate 1e1.
# Linear strain is applied in the x direction.
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin =  -.5
  xmax = .5
  ymin = -.5
  ymax = .5
  zmin = -.5
  zmax = .5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    strain = FINITE
    add_variables = true
    generate_output = 'stress_xx stress_yy stress_zz stress_xy stress_yz'
  [../]
[]
[BCs]
  [./xdisp]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'right'
    function = '0.005*t'
  [../]
  [./yfix]
    type = DirichletBC
    variable = disp_y
    #boundary = 'bottom top'
    boundary = 'bottom'
    value = 0
  [../]
  [./xfix]
    type = DirichletBC
    variable = disp_x
    boundary = 'left'
    value = 0
  [../]
  [./zfix]
    type = DirichletBC
    variable = disp_z
    #boundary = 'front back'
    boundary = 'back'
    value = 0
  [../]
[]
[AuxVariables]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./plastic_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./plastic_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./plastic_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./plastic_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./plastic_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./plastic_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./sdev]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./sdet]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./plastic_xx]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = plastic_xx
    index_i = 0
    index_j = 0
  [../]
  [./plastic_xy]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = plastic_xy
    index_i = 0
    index_j = 1
  [../]
  [./plastic_xz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = plastic_xz
    index_i = 0
    index_j = 2
  [../]
  [./plastic_yy]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = plastic_yy
    index_i = 1
    index_j = 1
  [../]
  [./plastic_yz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = plastic_yz
    index_i = 1
    index_j = 2
  [../]
  [./plastic_zz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = plastic_zz
    index_i = 2
    index_j = 2
  [../]
  [./f]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = f
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./intnl]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = intnl
  [../]
  [./sdev]
    type = RankTwoScalarAux
    variable = sdev
    rank_two_tensor = stress
    scalar_type = VonMisesStress
  [../]
[]
[Postprocessors]
  [./sdev]
    type = PointValue
    point = '0 0 0'
    variable = sdev
  [../]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./p_xx]
    type = PointValue
    point = '0 0 0'
    variable = plastic_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./p_xy]
    type = PointValue
    point = '0 0 0'
    variable = plastic_xy
  [../]
  [./p_xz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_xz
  [../]
  [./p_yz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_yz
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./p_yy]
    type = PointValue
    point = '0 0 0'
    variable = plastic_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./p_zz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_zz
  [../]
  [./intnl]
    type = PointValue
    point = '0 0 0'
    variable = intnl
  [../]
[]
[UserObjects]
  [./str]
    type = SolidMechanicsHardeningPowerRule
    value_0 = 300
    epsilon0 = 1
    exponent = 1e1
  [../]
  [./Orthotropic]
    type = SolidMechanicsPlasticOrthotropic
    b = -0.1
    c1 = '1 1 1 1 1 1'
    c2 = '1 1 1 1 1 1'
    associative = true
    yield_strength = str
    yield_function_tolerance = 1e-5
    internal_constraint_tolerance = 1e-9
    use_custom_returnMap = false
    use_custom_cto = false
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '121e3 80e3'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1e-9
    plastic_models = Orthotropic
    debug_fspb = crash
    tangent_operator = elastic
  [../]
[]
[Executioner]
  type = Transient
  num_steps = 3
  dt = .25
  nl_rel_tol = 1e-6
  nl_max_its = 10
  l_tol = 1e-4
  l_max_its = 50
  solve_type = PJFNK
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Outputs]
  perf_graph = false
  csv = true
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/twinning/check_direction_twin_propagation.i)
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
  [cube]
    type = GeneratedMeshGenerator
    dim = 3
    nx = 3
    ny = 3
    nz = 3
    elem_type = HEX8
  []
[]
[AuxVariables]
  [twin_volume_fraction_0]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_1]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_2]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_3]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_4]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_5]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_6]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_7]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_8]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_9]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_10]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_11]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_tau_0]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_tau_1]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_tau_2]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_tau_3]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_tau_4]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_tau_5]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_tau_6]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_tau_7]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_tau_8]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_tau_9]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_tau_10]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_tau_11]
   order = CONSTANT
   family = MONOMIAL
  []
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  add_variables = true
[]
[AuxKernels]
  [twin_volume_fraction_0]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_0
   property = twin_system_volume_fraction
   index = 0
   execute_on = timestep_end
  []
  [twin_volume_fraction_1]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_1
   property = twin_system_volume_fraction
   index = 1
   execute_on = timestep_end
  []
  [twin_volume_fraction_2]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_2
   property = twin_system_volume_fraction
   index = 2
   execute_on = timestep_end
  []
  [twin_volume_fraction_3]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_3
   property = twin_system_volume_fraction
   index = 3
   execute_on = timestep_end
  []
  [twin_volume_fraction_4]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_4
   property = twin_system_volume_fraction
   index = 4
   execute_on = timestep_end
  []
  [twin_volume_fraction_5]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_5
   property = twin_system_volume_fraction
   index = 5
   execute_on = timestep_end
  []
  [twin_volume_fraction_6]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_6
   property = twin_system_volume_fraction
   index = 6
   execute_on = timestep_end
  []
  [twin_volume_fraction_7]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_7
   property = twin_system_volume_fraction
   index = 7
   execute_on = timestep_end
  []
  [twin_volume_fraction_8]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_8
   property = twin_system_volume_fraction
   index = 8
   execute_on = timestep_end
  []
  [twin_volume_fraction_9]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_9
   property = twin_system_volume_fraction
   index = 9
   execute_on = timestep_end
  []
  [twin_volume_fraction_10]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_10
   property = twin_system_volume_fraction
   index = 10
   execute_on = timestep_end
  []
  [twin_volume_fraction_11]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_11
   property = twin_system_volume_fraction
   index = 11
   execute_on = timestep_end
  []
  [twin_tau_0]
    type = MaterialStdVectorAux
    variable = twin_tau_0
    property = applied_shear_stress
    index = 0
    execute_on = timestep_end
  []
  [twin_tau_1]
    type = MaterialStdVectorAux
    variable = twin_tau_1
    property = applied_shear_stress
    index = 1
    execute_on = timestep_end
  []
  [twin_tau_2]
    type = MaterialStdVectorAux
    variable = twin_tau_2
    property = applied_shear_stress
    index = 2
    execute_on = timestep_end
  []
  [twin_tau_3]
    type = MaterialStdVectorAux
    variable = twin_tau_3
    property = applied_shear_stress
    index = 3
    execute_on = timestep_end
  []
  [twin_tau_4]
    type = MaterialStdVectorAux
    variable = twin_tau_4
    property = applied_shear_stress
    index = 4
    execute_on = timestep_end
  []
  [twin_tau_5]
    type = MaterialStdVectorAux
    variable = twin_tau_5
    property = applied_shear_stress
    index = 5
    execute_on = timestep_end
  []
  [twin_tau_6]
    type = MaterialStdVectorAux
    variable = twin_tau_6
    property = applied_shear_stress
    index = 6
    execute_on = timestep_end
  []
  [twin_tau_7]
    type = MaterialStdVectorAux
    variable = twin_tau_7
    property = applied_shear_stress
    index = 7
    execute_on = timestep_end
  []
  [twin_tau_8]
    type = MaterialStdVectorAux
    variable = twin_tau_8
    property = applied_shear_stress
    index = 8
    execute_on = timestep_end
  []
  [twin_tau_9]
    type = MaterialStdVectorAux
    variable = twin_tau_9
    property = applied_shear_stress
    index = 9
    execute_on = timestep_end
  []
  [twin_tau_10]
    type = MaterialStdVectorAux
    variable = twin_tau_10
    property = applied_shear_stress
    index = 10
    execute_on = timestep_end
  []
  [twin_tau_11]
    type = MaterialStdVectorAux
    variable = twin_tau_11
    property = applied_shear_stress
    index = 11
    execute_on = timestep_end
  []
[]
[BCs]
  [fix_y]
    type = DirichletBC
    variable = disp_y
    preset = true
    boundary = 'bottom'
    value = 0
  []
  [fix_x]
    type = DirichletBC
    variable = disp_x
    boundary = 'left'
    value = 0
  []
  [fix_z]
    type = DirichletBC
    variable = disp_z
    boundary = 'back'
    value = 0
  []
  [tdisp]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = '-5.0e-4*t'
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensorCP
    C_ijkl = '1.08e5 6.034e4 6.034e4 1.08e5 6.03e4 1.08e5 2.86e4 2.86e4 2.86e4' #Tallon and Wolfenden. J. Phys. Chem. Solids (1979)
    fill_method = symmetric9
    euler_angle_1 = 54.74
    euler_angle_2 = 45.0
    euler_angle_3 = 270.0
  []
  [stress]
    type = ComputeMultipleCrystalPlasticityStress
    crystal_plasticity_models = 'twin_only_xtalpl'
    tan_mod_type = exact
  []
  [twin_only_xtalpl]
    type = CrystalPlasticityTwinningKalidindiUpdate
    number_slip_systems = 12
    slip_sys_file_name = 'fcc_input_twinning_systems.txt'
    initial_twin_lattice_friction = 2.0
  []
[]
[Postprocessors]
  [twin_volume_fraction_0]
    type = ElementAverageValue
    variable = twin_volume_fraction_0
  []
  [twin_volume_fraction_1]
    type = ElementAverageValue
    variable = twin_volume_fraction_1
  []
  [twin_volume_fraction_2]
    type = ElementAverageValue
    variable = twin_volume_fraction_2
  []
  [twin_volume_fraction_3]
    type = ElementAverageValue
    variable = twin_volume_fraction_3
  []
  [twin_volume_fraction_4]
    type = ElementAverageValue
    variable = twin_volume_fraction_4
  []
  [twin_volume_fraction_5]
    type = ElementAverageValue
    variable = twin_volume_fraction_5
  []
  [twin_volume_fraction_6]
    type = ElementAverageValue
    variable = twin_volume_fraction_6
  []
  [twin_volume_fraction_7]
    type = ElementAverageValue
    variable = twin_volume_fraction_7
  []
  [twin_volume_fraction_8]
    type = ElementAverageValue
    variable = twin_volume_fraction_8
  []
  [twin_volume_fraction_9]
    type = ElementAverageValue
    variable = twin_volume_fraction_9
  []
  [twin_volume_fraction_10]
    type = ElementAverageValue
    variable = twin_volume_fraction_10
  []
  [twin_volume_fraction_11]
    type = ElementAverageValue
    variable = twin_volume_fraction_11
  []
  [twin_tau_0]
    type = ElementAverageValue
    variable = twin_tau_0
  []
  [twin_tau_1]
    type = ElementAverageValue
    variable = twin_tau_1
  []
  [twin_tau_2]
    type = ElementAverageValue
    variable = twin_tau_2
  []
  [twin_tau_3]
    type = ElementAverageValue
    variable = twin_tau_3
  []
  [twin_tau_4]
    type = ElementAverageValue
    variable = twin_tau_4
  []
  [twin_tau_5]
    type = ElementAverageValue
    variable = twin_tau_5
  []
  [twin_tau_6]
    type = ElementAverageValue
    variable = twin_tau_6
  []
  [twin_tau_7]
    type = ElementAverageValue
    variable = twin_tau_7
  []
  [twin_tau_8]
    type = ElementAverageValue
    variable = twin_tau_8
  []
  [twin_tau_9]
    type = ElementAverageValue
    variable = twin_tau_9
  []
  [twin_tau_10]
    type = ElementAverageValue
    variable = twin_tau_10
  []
  [twin_tau_11]
    type = ElementAverageValue
    variable = twin_tau_11
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
  petsc_options_value = ' asm      2              lu            gmres     200'
  nl_abs_tol = 1e-10
  nl_rel_tol = 1e-10
  nl_abs_step_tol = 1e-10
  dt = 0.025
  dtmin = 0.0125
  num_steps = 9
[]
[Outputs]
  csv = true
  perf_graph = true
[]
(modules/solid_mechanics/test/tests/capped_weak_plane/pull_push_h.i)
# A column of elements has its bottom pulled down, and then pushed up again.
# Hardening of the tensile strength means that the top element also
# experiences plastic deformation
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 2
  xmin = -10
  xmax = 10
  ymin = -10
  ymax = 10
  zmin = -100
  zmax = 0
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
  [../]
[]
[BCs]
  [./no_x2]
    type = DirichletBC
    variable = disp_x
    boundary = right
    value = 0.0
  [../]
  [./no_x1]
    type = DirichletBC
    variable = disp_x
    boundary = left
    value = 0.0
  [../]
  [./no_y1]
    type = DirichletBC
    variable = disp_y
    boundary = bottom
    value = 0.0
  [../]
  [./no_y2]
    type = DirichletBC
    variable = disp_y
    boundary = top
    value = 0.0
  [../]
  [./topz]
    type = DirichletBC
    variable = disp_z
    boundary = front
    value = 0
  [../]
  [./bottomz]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = back
    function = 'if(t>1,-2.0+t,-t)'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_compressive]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./ls]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./strainp_xx]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_xx
    index_i = 0
    index_j = 0
  [../]
  [./strainp_xy]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_xy
    index_i = 0
    index_j = 1
  [../]
  [./strainp_xz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_xz
    index_i = 0
    index_j = 2
  [../]
  [./strainp_yy]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_yy
    index_i = 1
    index_j = 1
  [../]
  [./strainp_yz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_yz
    index_i = 1
    index_j = 2
  [../]
  [./strainp_zz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_zz
    index_i = 2
    index_j = 2
  [../]
  [./straint_xx]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_xx
    index_i = 0
    index_j = 0
  [../]
  [./straint_xy]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_xy
    index_i = 0
    index_j = 1
  [../]
  [./straint_xz]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_xz
    index_i = 0
    index_j = 2
  [../]
  [./straint_yy]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_yy
    index_i = 1
    index_j = 1
  [../]
  [./straint_yz]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_yz
    index_i = 1
    index_j = 2
  [../]
  [./straint_zz]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_zz
    index_i = 2
    index_j = 2
  [../]
  [./f_shear]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f_shear
  [../]
  [./f_tensile]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f_tensile
  [../]
  [./f_compressive]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f_compressive
  [../]
  [./intnl_shear]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl_shear
  [../]
  [./intnl_tensile]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 1
    variable = intnl_tensile
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./ls]
    type = MaterialRealAux
    property = plastic_linesearch_needed
    variable = ls
  [../]
[]
[UserObjects]
  [./coh_irrelevant]
    type = SolidMechanicsHardeningCubic
    value_0 = 2E6
    value_residual = 1E6
    internal_limit = 0.01
  [../]
  [./tanphi]
    type = SolidMechanicsHardeningCubic
    value_0 = 0.5
    value_residual = 0.2
    internal_limit = 0.01
  [../]
  [./tanpsi]
    type = SolidMechanicsHardeningConstant
    value = 0.166666666667
  [../]
  [./t_strength]
    type = SolidMechanicsHardeningCubic
    value_0 = 0
    value_residual = 1E8
    internal_limit = 0.1
  [../]
  [./c_strength]
    type = SolidMechanicsHardeningCubic
    value_0 = 1E8
    value_residual = 0.0
    internal_limit = 0.01
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '6.4E9 6.4E9'  # young 16MPa, Poisson 0.25
  [../]
  [./strain]
    type = ComputeIncrementalStrain
  [../]
  [./admissible]
    type = ComputeMultipleInelasticStress
    inelastic_models = stress
    tangent_operator = nonlinear
    perform_finite_strain_rotations = false
  [../]
  [./stress]
    type = CappedWeakPlaneStressUpdate
    cohesion = coh_irrelevant
    tan_friction_angle = tanphi
    tan_dilation_angle = tanpsi
    tensile_strength = t_strength
    compressive_strength = c_strength
    max_NR_iterations = 1000
    tip_smoother = 0
    smoothing_tol = 0
    yield_function_tol = 1E-5
    perfect_guess = false
    min_step_size = 0.1
  [../]
[]
[Preconditioning]
  [./andy]
    type = SMP
    full = true
    #petsc_options = '-snes_converged_reason -snes_linesearch_monitor'
    petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
    petsc_options_value = ' asm      2              lu            gmres     200'
  [../]
[]
[Executioner]
  solve_type = 'NEWTON'
  petsc_options = '-snes_converged_reason'
  line_search = bt
  nl_abs_tol = 1E-2
  nl_rel_tol = 1e-15
  l_tol = 1E-10
  l_max_its = 100
  nl_max_its = 100
  end_time = 3.0
  dt = 0.1
  type = Transient
[]
[Outputs]
  file_base = pull_push_h
  exodus = true
  csv = true
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/hcp_single_crystal/update_method_hcp_capyramidal_active.i)
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
  [cube]
    type = GeneratedMeshGenerator
    dim = 3
    nx = 2
    ny = 2
    nz = 2
    elem_type = HEX8
  []
  [center_node]
    type = BoundingBoxNodeSetGenerator
    input = cube
    new_boundary = 'center_point'
    top_right = '0.51 0.51 0'
    bottom_left = '0.49 0.49 0'
  []
  [back_edge_y]
    type = BoundingBoxNodeSetGenerator
    input = center_node
    new_boundary = 'back_edge_y'
    bottom_left = '0.9 0.5 0'
    top_right = '1.1 0.5 0'
  []
  [back_edge_x]
    type = BoundingBoxNodeSetGenerator
    input = back_edge_y
    new_boundary = back_edge_x
    bottom_left = '0.5 0.9 0'
    top_right =   '0.5 1.0 0'
  []
[]
[AuxVariables]
  [temperature]
    initial_condition = 300
  []
  [pk2]
    order = CONSTANT
    family = MONOMIAL
  []
  [e_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [resolved_shear_stress_0]
   order = CONSTANT
   family = MONOMIAL
  []
  [resolved_shear_stress_3]
   order = CONSTANT
   family = MONOMIAL
  []
  [resolved_shear_stress_4]
   order = CONSTANT
   family = MONOMIAL
  []
  [resolved_shear_stress_8]
   order = CONSTANT
   family = MONOMIAL
  []
  [resolved_shear_stress_9]
   order = CONSTANT
   family = MONOMIAL
  []
  [resolved_shear_stress_13]
   order = CONSTANT
   family = MONOMIAL
  []
  [resolved_shear_stress_14]
   order = CONSTANT
   family = MONOMIAL
  []
  [forest_dislocations_0]
   order = CONSTANT
   family = MONOMIAL
  []
  [forest_dislocations_3]
   order = CONSTANT
   family = MONOMIAL
  []
  [forest_dislocations_4]
   order = CONSTANT
   family = MONOMIAL
  []
  [forest_dislocations_8]
   order = CONSTANT
   family = MONOMIAL
  []
  [forest_dislocations_9]
   order = CONSTANT
   family = MONOMIAL
  []
  [forest_dislocations_13]
   order = CONSTANT
   family = MONOMIAL
  []
  [forest_dislocations_14]
   order = CONSTANT
   family = MONOMIAL
  []
  [substructure_density]
   order = CONSTANT
   family = MONOMIAL
  []
  [slip_resistance_0]
   order = CONSTANT
   family = MONOMIAL
  []
  [slip_resistance_3]
   order = CONSTANT
   family = MONOMIAL
  []
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  incremental = true
  add_variables = true
[]
[AuxKernels]
  [pk2]
    type = RankTwoAux
    variable = pk2
    rank_two_tensor = second_piola_kirchhoff_stress
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [e_zz]
    type = RankTwoAux
    variable = e_zz
    rank_two_tensor = total_lagrangian_strain
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [tau_0]
    type = MaterialStdVectorAux
    variable = resolved_shear_stress_0
    property = applied_shear_stress
    index = 0
    execute_on = timestep_end
  []
  [tau_3]
    type = MaterialStdVectorAux
    variable = resolved_shear_stress_3
    property = applied_shear_stress
    index = 3
    execute_on = timestep_end
  []
  [tau_4]
    type = MaterialStdVectorAux
    variable = resolved_shear_stress_4
    property = applied_shear_stress
    index = 4
    execute_on = timestep_end
  []
  [tau_8]
    type = MaterialStdVectorAux
    variable = resolved_shear_stress_8
    property = applied_shear_stress
    index = 8
    execute_on = timestep_end
  []
  [tau_9]
    type = MaterialStdVectorAux
    variable = resolved_shear_stress_9
    property = applied_shear_stress
    index = 9
    execute_on = timestep_end
  []
  [tau_13]
    type = MaterialStdVectorAux
    variable = resolved_shear_stress_13
    property = applied_shear_stress
    index = 13
    execute_on = timestep_end
  []
  [tau_14]
    type = MaterialStdVectorAux
    variable = resolved_shear_stress_14
    property = applied_shear_stress
    index = 14
    execute_on = timestep_end
  []
  [forest_dislocations_0]
    type = MaterialStdVectorAux
    variable = forest_dislocations_0
    property = forest_dislocation_density
    index = 0
    execute_on = timestep_end
  []
  [forest_dislocations_3]
    type = MaterialStdVectorAux
    variable = forest_dislocations_3
    property = forest_dislocation_density
    index = 3
    execute_on = timestep_end
  []
  [forest_dislocations_4]
    type = MaterialStdVectorAux
    variable = forest_dislocations_4
    property = forest_dislocation_density
    index = 4
    execute_on = timestep_end
  []
  [forest_dislocations_8]
    type = MaterialStdVectorAux
    variable = forest_dislocations_8
    property = forest_dislocation_density
    index = 8
    execute_on = timestep_end
  []
  [forest_dislocations_9]
    type = MaterialStdVectorAux
    variable = forest_dislocations_9
    property = forest_dislocation_density
    index = 9
    execute_on = timestep_end
  []
  [forest_dislocations_13]
    type = MaterialStdVectorAux
    variable = forest_dislocations_13
    property = forest_dislocation_density
    index = 13
    execute_on = timestep_end
  []
  [forest_dislocations_14]
    type = MaterialStdVectorAux
    variable = forest_dislocations_14
    property = forest_dislocation_density
    index = 14
    execute_on = timestep_end
  []
  [substructure_density]
    type = MaterialRealAux
    variable = substructure_density
    property = total_substructure_density
    execute_on = timestep_end
  []
  [slip_resistance_0]
    type = MaterialStdVectorAux
    variable = slip_resistance_0
    property = slip_resistance
    index = 0
    execute_on = timestep_end
  []
  [slip_resistance_3]
    type = MaterialStdVectorAux
    variable = slip_resistance_3
    property = slip_resistance
    index = 3
    execute_on = timestep_end
  []
[]
[BCs]
  [fix_y]
    type = DirichletBC
    variable = disp_y
    preset = true
    boundary = 'center_point back_edge_y'
    value = 0
  []
  [fix_x]
    type = DirichletBC
    variable = disp_x
    boundary = 'center_point back_edge_x'
    value = 0
  []
  [fix_z]
    type = DirichletBC
    variable = disp_z
    boundary = 'back'
    value = 0
  []
  [tdisp]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = '0.001*t'
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensorCP
    C_ijkl = '1.622e5 9.18e4 6.88e4 1.622e5 6.88e4 1.805e5 4.67e4 4.67e4 4.67e4' #alpha Ti, Alankar et al. Acta Materialia 59 (2011) 7003-7009
    fill_method = symmetric9
    euler_angle_1 =  68
    euler_angle_2 =  14
    euler_angle_3 =  -53
  []
  [stress]
    type = ComputeMultipleCrystalPlasticityStress
    crystal_plasticity_models = 'trial_xtalpl'
    tan_mod_type = exact
  []
  [trial_xtalpl]
    type = CrystalPlasticityHCPDislocationSlipBeyerleinUpdate
    number_slip_systems = 15
    slip_sys_file_name = hcp_aprismatic_capyramidal_slip_sys.txt
    unit_cell_dimension = '2.934e-7 2.934e-7 4.657e-7' #Ti, in mm, https://materialsproject.org/materials/mp-46/
    temperature = temperature
    initial_forest_dislocation_density = 15.0e4
    initial_substructure_density = 5.0e2
    slip_system_modes = 2
    number_slip_systems_per_mode = '3 12'
    lattice_friction_per_mode = '1 1.5'
    effective_shear_modulus_per_mode = '4.7e4 4.7e4' #Ti, in MPa, https://materialsproject.org/materials/mp-46/
    burgers_vector_per_mode = '2.934e-7 6.586e-7' #Ti, in mm, https://materialsproject.org/materials/mp-46/
    slip_generation_coefficient_per_mode = '1e5 2e7'
    normalized_slip_activiation_energy_per_mode = '4e-3 3e-2'
    slip_energy_proportionality_factor_per_mode = '330 100'
    substructure_rate_coefficient_per_mode = '400 100'
    applied_strain_rate = 0.001
    gamma_o = 1.0e-3
    Hall_Petch_like_constant_per_mode = '0 0' #minimize impact
    grain_size = 20.0e-3 #20 microns
  []
[]
[Postprocessors]
  [pk2]
    type = ElementAverageValue
    variable = pk2
  []
  [e_zz]
    type = ElementAverageValue
    variable = e_zz
  []
  [tau_0]
    type = ElementAverageValue
    variable = resolved_shear_stress_0
  []
  [tau_3]
    type = ElementAverageValue
    variable = resolved_shear_stress_3
  []
  [tau_4]
    type = ElementAverageValue
    variable = resolved_shear_stress_4
  []
  [tau_8]
    type = ElementAverageValue
    variable = resolved_shear_stress_8
  []
  [tau_9]
    type = ElementAverageValue
    variable = resolved_shear_stress_9
  []
  [tau_13]
    type = ElementAverageValue
    variable = resolved_shear_stress_13
  []
  [tau_14]
    type = ElementAverageValue
    variable = resolved_shear_stress_14
  []
  [forest_dislocation_0]
    type = ElementAverageValue
    variable = forest_dislocations_0
  []
  [forest_dislocation_3]
    type = ElementAverageValue
    variable = forest_dislocations_3
  []
  [forest_dislocation_4]
    type = ElementAverageValue
    variable = forest_dislocations_4
  []
  [forest_dislocation_8]
    type = ElementAverageValue
    variable = forest_dislocations_8
  []
  [forest_dislocation_9]
    type = ElementAverageValue
    variable = forest_dislocations_9
  []
  [forest_dislocation_13]
    type = ElementAverageValue
    variable = forest_dislocations_13
  []
  [forest_dislocation_14]
    type = ElementAverageValue
    variable = forest_dislocations_14
  []
  [substructure_density]
    type = ElementAverageValue
    variable = substructure_density
  []
  [slip_resistance_0]
    type = ElementAverageValue
    variable = slip_resistance_0
  []
  [slip_resistance_3]
    type = ElementAverageValue
    variable = slip_resistance_3
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
  petsc_options_value = ' asm      2              lu            gmres     200'
  nl_abs_tol = 1e-10
  nl_rel_tol = 1e-10
  nl_abs_step_tol = 1e-10
  dt = 0.015
  dtmin = 1.0e-4
  dtmax = 0.1
  end_time = 0.15
[]
[Outputs]
  csv = true
[]
(modules/porous_flow/test/tests/infiltration_and_drainage/rd02.i)
[Mesh]
  type = GeneratedMesh
  dim = 2
  nx = 120
  ny = 1
  xmin = 0
  xmax = 6
  ymin = 0
  ymax = 0.05
[]
[GlobalParams]
  PorousFlowDictator = dictator
[]
[Functions]
  [dts]
    type = PiecewiseLinear
    y = '1E-2 1 10 500 5000 50000'
    x = '0 10 100 1000 10000 500000'
  []
[]
[UserObjects]
  [dictator]
    type = PorousFlowDictator
    porous_flow_vars = pressure
    number_fluid_phases = 1
    number_fluid_components = 1
  []
  [pc]
    type = PorousFlowCapillaryPressureVG
    m = 0.336
    alpha = 1.43e-4
  []
[]
[FluidProperties]
  [simple_fluid]
    type = SimpleFluidProperties
    bulk_modulus = 2e7
    viscosity = 1.01e-3
    density0 = 1000
    thermal_expansion = 0
  []
[]
[Materials]
  [massfrac]
    type = PorousFlowMassFraction
  []
  [temperature]
    type = PorousFlowTemperature
  []
  [simple_fluid]
    type = PorousFlowSingleComponentFluid
    fp = simple_fluid
    phase = 0
  []
  [ppss]
    type = PorousFlow1PhaseP
    porepressure = pressure
    capillary_pressure = pc
  []
  [relperm]
    type = PorousFlowRelativePermeabilityVG
    m = 0.336
    seff_turnover = 0.99
    phase = 0
  []
  [porosity]
    type = PorousFlowPorosityConst
    porosity = 0.33
  []
  [permeability]
    type = PorousFlowPermeabilityConst
    permeability = '0.295E-12 0 0  0 0.295E-12 0  0 0 0.295E-12'
  []
[]
[Variables]
  [pressure]
    initial_condition = 0.0
  []
[]
[Kernels]
  [mass0]
    type = PorousFlowMassTimeDerivative
    fluid_component = 0
    variable = pressure
  []
  [flux0]
    type = PorousFlowAdvectiveFlux
    fluid_component = 0
    variable = pressure
    gravity = '-10 0 0'
  []
[]
[AuxVariables]
  [SWater]
    family = MONOMIAL
    order = CONSTANT
  []
[]
[AuxKernels]
  [SWater]
    type = MaterialStdVectorAux
    property = PorousFlow_saturation_qp
    index = 0
    variable = SWater
  []
[]
[BCs]
  [base]
    type = DirichletBC
    boundary = left
    value = 0.0
    variable = pressure
  []
[]
[Preconditioning]
  [andy]
    type = SMP
    full = true
    petsc_options = '-snes_converged_reason -ksp_diagonal_scale -ksp_diagonal_scale_fix -ksp_gmres_modifiedgramschmidt -snes_linesearch_monitor'
    petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap -snes_atol -snes_rtol -snes_max_it'
    petsc_options_value = 'gmres      asm      lu           NONZERO                   2               1E-10      1E-10      10'
  []
[]
[VectorPostprocessors]
  [swater]
    type = LineValueSampler
    warn_discontinuous_face_values = false
    variable = SWater
    start_point = '0 0 0'
    end_point = '6 0 0'
    sort_by = x
    num_points = 121
    execute_on = timestep_end
  []
[]
[Executioner]
  type = Transient
  solve_type = Newton
  petsc_options = '-snes_converged_reason'
  end_time = 345600
  [TimeStepper]
    type = FunctionDT
    function = dts
  []
[]
[Outputs]
  file_base = rd02
  [exodus]
    type = Exodus
    execute_on = 'initial final'
  []
  [along_line]
    type = CSV
    execute_on = final
  []
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/hcp_single_crystal/update_method_hcp_no_substructure.i)
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 2
  ny = 2
  nz = 2
  elem_type = HEX8
[]
[AuxVariables]
  [temperature]
    initial_condition = 300
  []
  [pk2]
    order = CONSTANT
    family = MONOMIAL
  []
  [resolved_shear_stress_3]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_resistance_3]
    order = CONSTANT
    family = MONOMIAL
  []
  [substructure_density]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  incremental = true
  add_variables = true
[]
[AuxKernels]
  [pk2]
    type = RankTwoAux
    variable = pk2
    rank_two_tensor = second_piola_kirchhoff_stress
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [tau_3]
    type = MaterialStdVectorAux
    variable = resolved_shear_stress_3
    property = applied_shear_stress
    index = 3
    execute_on = timestep_end
  []
  [slip_resistance_3]
    type = MaterialStdVectorAux
    variable = slip_resistance_3
    property = slip_resistance
    index = 3
    execute_on = timestep_end
  []
  [substructure_density]
    type = MaterialRealAux
    variable = substructure_density
    property = total_substructure_density
    execute_on = timestep_end
  []
[]
[BCs]
  [symmy]
    type = DirichletBC
    variable = disp_y
    preset = true
    boundary = bottom
    value = 0
  []
  [symmx]
    type = DirichletBC
    variable = disp_x
    boundary = left
    value = 0
  []
  [symmz]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0
  []
  [tdisp]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = '0.001*t'
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensorCP
    C_ijkl = '1.622e5 9.18e4 6.88e4 1.622e5 6.88e4 1.805e5 4.67e4 4.67e4 4.67e4' #alpha Ti, Alankar et al. Acta Materialia 59 (2011) 7003-7009
    fill_method = symmetric9
  []
  [stress]
    type = ComputeMultipleCrystalPlasticityStress
    crystal_plasticity_models = 'trial_xtalpl'
    tan_mod_type = exact
  []
  [trial_xtalpl]
    type = CrystalPlasticityHCPDislocationSlipBeyerleinUpdate
    number_slip_systems = 15
    slip_sys_file_name = hcp_aprismatic_capyramidal_slip_sys.txt
    unit_cell_dimension = '2.934e-7 2.934e-7 4.657e-7'
    temperature = temperature
    initial_forest_dislocation_density = 15.0e5
    initial_substructure_density = 1.0 #artifically low for specific test
    slip_system_modes = 2
    number_slip_systems_per_mode = '3 12'
    lattice_friction_per_mode = '100 200'
    effective_shear_modulus_per_mode = '5e4 5e4'
    burgers_vector_per_mode = '2.934e-7 6.586e-7' #Ti, in mm, https://materialsproject.org/materials/mp-46/
    slip_generation_coefficient_per_mode = '1e5 2e7'
    normalized_slip_activiation_energy_per_mode = '4e-3 3e-2'
    slip_energy_proportionality_factor_per_mode = '300 100'
    substructure_rate_coefficient_per_mode = '-355 -0.4' #artifical, non-physical values for testing purposes
    applied_strain_rate = 0.001
    gamma_o = 1.0e-3
    Hall_Petch_like_constant_per_mode = '1 1'
    grain_size = 20.0e-3 #20 microns
  []
[]
[Postprocessors]
  [pk2]
    type = ElementAverageValue
    variable = pk2
  []
  [tau_3]
    type = ElementAverageValue
    variable = resolved_shear_stress_3
  []
  [slip_resistance_3]
    type = ElementAverageValue
    variable = slip_resistance_3
  []
  [substructure_density]
    type = ElementAverageValue
    variable = substructure_density
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
  petsc_options_value = ' asm      2              lu            gmres     200'
  nl_abs_tol = 1e-10
  nl_rel_tol = 1e-10
  nl_abs_step_tol = 1e-10
  dt = 0.5
  dtmin = 1.0e-2
  dtmax = 10.0
  end_time = 2.5
[]
[Outputs]
  csv = true
[]
(modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform21.i)
# Mohr-Coulomb only
# apply repeated stretches in x, y and z directions, so that mean_stress = 0
# This maps out the yield surface in the octahedral plane for zero mean stress
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'max_principal_stress mid_principal_stress min_principal_stress stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '2E-6*x*sin(t)'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '2E-6*y*sin(2*t)'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '-2E-6*z*(sin(t)+sin(2*t))'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 6
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 10
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 20
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 1E-12
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./mc]
    type = CappedMohrCoulombStressUpdate
    tensile_strength = ts
    compressive_strength = ts
    cohesion = mc_coh
    friction_angle = mc_phi
    dilation_angle = mc_psi
    smoothing_tol = 1
    yield_function_tol = 1.0E-9
  [../]
  [./stress]
    type = ComputeMultipleInelasticStress
    inelastic_models = mc
    perform_finite_strain_rotations = false
  [../]
[]
[Executioner]
  end_time = 100
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform21
  csv = true
[]
(modules/solid_mechanics/test/tests/jacobian/cto17.i)
# Jacobian check for nonlinear, multi-surface plasticity.
# Returns to the plane of the tensile yield surface
#
# Plasticity models:
# Tensile with strength = 1MPa softening to 0.5MPa in 2E-2 strain
#
# Lame lambda = 0.5GPa.  Lame mu = 1GPa
#
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./linesearch]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./ld]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./constr_added]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int0]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./linesearch]
    type = MaterialRealAux
    property = plastic_linesearch_needed
    variable = linesearch
  [../]
  [./ld]
    type = MaterialRealAux
    property = plastic_linear_dependence_encountered
    variable = ld
  [../]
  [./constr_added]
    type = MaterialRealAux
    property = plastic_constraints_added
    variable = constr_added
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./int0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    variable = int0
    index = 0
  [../]
  [./int1]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    variable = int1
    index = 1
  [../]
  [./int2]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    variable = int2
    index = 2
  [../]
[]
[Postprocessors]
  [./max_int0]
    type = ElementExtremeValue
    variable = int0
    outputs = console
  [../]
  [./max_int1]
    type = ElementExtremeValue
    variable = int1
    outputs = console
  [../]
  [./max_int2]
    type = ElementExtremeValue
    variable = int2
    outputs = console
  [../]
  [./max_iter]
    type = ElementExtremeValue
    variable = iter
    outputs = console
  [../]
  [./av_linesearch]
    type = ElementAverageValue
    variable = linesearch
    outputs = 'console'  [../]
  [./av_ld]
    type = ElementAverageValue
    variable = ld
    outputs = 'console'  [../]
  [./av_constr_added]
    type = ElementAverageValue
    variable = constr_added
    outputs = 'console'  [../]
  [./av_iter]
    type = ElementAverageValue
    variable = iter
    outputs = 'console'  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningCubic
    value_0 = 1
    value_residual = 0.5
    internal_limit = 2E-2
  [../]
  [./tensile]
    type = SolidMechanicsPlasticTensileMulti
    tensile_strength = ts
    yield_function_tolerance = 1.0E-6  # Note larger value
    shift = 1.0E-6                     # Note larger value
    internal_constraint_tolerance = 1.0E-7
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0.5E3 1E3'
  [../]
  [./strain]
    type = ComputeIncrementalStrain
    displacements = 'disp_x disp_y disp_z'
    eigenstrain_names = ini_stress
  [../]
  [./ini_stress]
    type = ComputeEigenstrainFromInitialStress
    initial_stress = '-1 0.1 0.2  0.1 15 -0.3  0.2 -0.3 0'
    eigenstrain_name = ini_stress
  [../]
  [./multi]
    type = ComputeMultiPlasticityStress
    ep_plastic_tolerance = 1E-7
    plastic_models = 'tensile'
    max_NR_iterations = 5
    deactivation_scheme = 'safe'
    min_stepsize = 1
    tangent_operator = nonlinear
  [../]
[]
[Preconditioning]
  [./andy]
    type = SMP
    full = true
    #petsc_options = '-snes_test_display'
    petsc_options_iname = '-ksp_type -pc_type -snes_atol -snes_rtol -snes_max_it -snes_type'
    petsc_options_value = 'bcgs bjacobi 1E-15 1E-10 10000 test'
  [../]
[]
[Executioner]
  type = Transient
  solve_type = Newton
[]
[Outputs]
  file_base = cto17
  exodus = false
[]
(modules/solid_mechanics/test/tests/drucker_prager/small_deform2_lode_zero.i)
# apply repeated stretches in x, y and z directions, so that mean_stress = 0
# This maps out the yield surface in the octahedral plane for zero mean stress
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '-1.5E-6*x+2E-6*x*sin(t)'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '2E-6*y*sin(2*t)'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '-2E-6*z*(sin(t)+sin(2*t))'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 10
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 20
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 0
  [../]
  [./mc]
    type = SolidMechanicsPlasticDruckerPragerHyperbolic
    mc_cohesion = mc_coh
    mc_friction_angle = mc_phi
    mc_dilation_angle = mc_psi
    smoother = 4
    mc_interpolation_scheme = lode_zero
    yield_function_tolerance = 1E-5
    internal_constraint_tolerance = 1E-11
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./strain]
    type = ComputeIncrementalStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-12
    plastic_models = mc
    debug_fspb = crash
  [../]
[]
[Executioner]
  end_time = 100
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform2_lode_zero
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/multi/three_surface10.i)
# Plasticit models:
# SimpleTester0 with a = 0 and b = 1 and strength = 1
# SimpleTester1 with a = 1 and b = 0 and strength = 1
# SimpleTester2 with a = 1 and b = 1 and strength = 1.5
#
# Lame lambda = 0 (Poisson=0).  Lame mu = 0.5E6
#
# A single element is stretched by 1.5E-6m in y direction and 0.0E-6 in z direction.
# trial stress_yy = 1.5 and stress_zz = 0.0
#
# Then SimpleTester1 should activate and the algorithm will return to
# stress_yy=1
# internal1 should be 0.5
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '1.5E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '0.0E-6*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int2]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./int0]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 0
    variable = int0
  [../]
  [./int1]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 1
    variable = int1
  [../]
  [./int2]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 2
    variable = int2
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./f2]
    type = PointValue
    point = '0 0 0'
    variable = f2
  [../]
  [./int0]
    type = PointValue
    point = '0 0 0'
    variable = int0
  [../]
  [./int1]
    type = PointValue
    point = '0 0 0'
    variable = int1
  [../]
  [./int2]
    type = PointValue
    point = '0 0 0'
    variable = int2
  [../]
[]
[UserObjects]
  [./simple0]
    type = SolidMechanicsPlasticSimpleTester
    a = 0
    b = 1
    strength = 1
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
  [./simple1]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 0
    strength = 1
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
  [./simple2]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 1
    strength = 1.5
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 0.5E6'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./multi]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = 'simple0 simple1 simple2'
    max_NR_iterations = 2
    min_stepsize = 1
    debug_fspb = crash
    debug_jac_at_stress = '10 0 0 0 10 0 0 0 10'
    debug_jac_at_pm = '1 1'
    debug_jac_at_intnl = '1 1'
    debug_stress_change = 1E-5
    debug_pm_change = '1E-6 1E-6'
    debug_intnl_change = '1E-6 1E-6'
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = three_surface10
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/capped_drucker_prager/small_deform3_lode_zero.i)
# apply repeated stretches in x z directions, and smaller stretches along the y direction,
# so that sigma_I = sigma_II,
# which means that lode angle = 30deg.
# The allows yield surface in meridional plane to be mapped out
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '1E-6*x*t'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '-1.7E-6*y*t'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1E-6*z*t'
  [../]
[]
[AuxVariables]
  [./mc_int]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./mc_int_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = mc_int
  [../]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./internal]
    type = PointValue
    point = '0 0 0'
    variable = mc_int
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1E5
  [../]
  [./cs]
    type = SolidMechanicsHardeningConstant
    value = 1E5
  [../]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 10
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 35
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 5
    convert_to_radians = true
  [../]
  [./dp]
    type = SolidMechanicsPlasticDruckerPrager
    mc_cohesion = mc_coh
    mc_friction_angle = mc_phi
    mc_dilation_angle = mc_psi
    mc_interpolation_scheme = lode_zero
    yield_function_tolerance = 1      # irrelevant here
    internal_constraint_tolerance = 1 # irrelevant here
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./admissible]
    type = ComputeMultipleInelasticStress
    inelastic_models = mc
    perform_finite_strain_rotations = false
  [../]
  [./mc]
    type = CappedDruckerPragerStressUpdate
    DP_model = dp
    tensile_strength = ts
    compressive_strength = cs
    yield_function_tol = 1E-8
    tip_smoother = 8
    smoothing_tol = 1E-7
  [../]
[]
[Executioner]
  end_time = 10
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform3_lode_zero
  exodus = false
  [./csv]
    type = CSV
  [../]
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/user_object_based/user_object_011orientation.i)
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
  type = GeneratedMesh
  dim = 3
  elem_type = HEX8
[]
[AuxVariables]
  [./pk2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./fp_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./lagrangian_strain_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./lagrangian_strain_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./gss]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./slip_increment]
   order = CONSTANT
   family = MONOMIAL
  [../]
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  add_variables = true
  generate_output = stress_zz
[]
[AuxKernels]
  [./pk2]
   type = RankTwoAux
   variable = pk2
   rank_two_tensor = pk2
   index_j = 2
   index_i = 2
   execute_on = timestep_end
  [../]
  [./fp_zz]
    type = RankTwoAux
    variable = fp_zz
    rank_two_tensor = fp
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  [../]
  [./lagrangian_strain_zz]
    type = RankTwoAux
    variable = lagrangian_strain_zz
    rank_two_tensor = lage
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  [../]
  [./lagrangian_strain_yy]
    type = RankTwoAux
    rank_two_tensor = lage
    variable = lagrangian_strain_yy
    index_i = 1
    index_j = 1
    execute_on = timestep_end
  [../]
  [./slip_inc]
   type = MaterialStdVectorAux
   variable = slip_increment
   property = slip_rate_gss
   index = 0
   execute_on = timestep_end
  [../]
  [./gss]
    type = MaterialStdVectorAux
    variable = gss
    property = state_var_gss
    index = 0
    execute_on = timestep_end
  [../]
[]
[BCs]
  [./symmy]
    type = DirichletBC
    variable = disp_y
    boundary = bottom
    value = 0
  [../]
  [./symmx]
    type = DirichletBC
    variable = disp_x
    boundary = left
    value = 0
  [../]
  [./symmz]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0
  [../]
  [./tdisp]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = '0.01*t'
  [../]
[]
[UserObjects]
  [./slip_rate_gss]
    type = CrystalPlasticitySlipRateGSS
    variable_size = 12
    slip_sys_file_name = input_slip_sys.txt
    num_slip_sys_flowrate_props = 2
    flowprops = '1 4 0.001 0.1 5 8 0.001 0.1 9 12 0.001 0.1'
    uo_state_var_name = state_var_gss
  [../]
  [./slip_resistance_gss]
    type = CrystalPlasticitySlipResistanceGSS
    variable_size = 12
    uo_state_var_name = state_var_gss
  [../]
  [./state_var_gss]
    type = CrystalPlasticityStateVariable
    variable_size = 12
    groups = '0 4 8 12'
    group_values = '60.8 60.8 60.8'
    uo_state_var_evol_rate_comp_name = state_var_evol_rate_comp_gss
    scale_factor = 1.0
  [../]
  [./state_var_evol_rate_comp_gss]
    type = CrystalPlasticityStateVarRateComponentGSS
    variable_size = 12
    hprops = '1.0 541.5 109.8 2.5'
    uo_slip_rate_name = slip_rate_gss
    uo_state_var_name = state_var_gss
  [../]
[]
[Materials]
  [./crysp]
    type = FiniteStrainUObasedCP
    stol = 1e-2
    tan_mod_type = exact
    uo_slip_rates = 'slip_rate_gss'
    uo_slip_resistances = 'slip_resistance_gss'
    uo_state_vars = 'state_var_gss'
    uo_state_var_evol_rate_comps = 'state_var_evol_rate_comp_gss'
  [../]
  [./elasticity_tensor]
    type = ComputeElasticityTensorCP
    C_ijkl = '1.684e5 1.214e5 1.214e5 1.684e5 1.214e5 1.684e5 0.754e5 0.754e5 0.754e5'
    fill_method = symmetric9
    euler_angle_1 = 120.0
    euler_angle_2 = 125.264
    euler_angle_3 =  45.0
  [../]
[]
[Postprocessors]
  [./stress_zz]
    type = ElementAverageValue
    variable = stress_zz
  [../]
  [./pk2]
   type = ElementAverageValue
   variable = pk2
  [../]
  [./fp_zz]
    type = ElementAverageValue
    variable = fp_zz
  [../]
  [./lagrangian_strain_yy]
    type = ElementAverageValue
    variable = lagrangian_strain_yy
  [../]
  [./lagrangian_strain_zz]
    type = ElementAverageValue
    variable = lagrangian_strain_zz
  [../]
  [./gss]
    type = ElementAverageValue
    variable = gss
  [../]
  [./slip_increment]
   type = ElementAverageValue
   variable = slip_increment
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  dt = 0.05
  solve_type = 'PJFNK'
  petsc_options_iname = -pc_hypre_type
  petsc_options_value = boomerang
  nl_abs_tol = 1e-10
  nl_rel_step_tol = 1e-10
  dtmax = 10.0
  nl_rel_tol = 1e-10
  dtmin = 0.05
  num_steps = 10
  nl_abs_step_tol = 1e-10
[]
[Outputs]
  csv = true
[]
(modules/solid_mechanics/test/tests/capped_weak_plane/small_deform9.i)
# apply a shear deformation to observe shear hardening.
# Shear gives q_trial = 2*Sqrt(20), p_trial=0
# The solution given by MOOSE correctly satisfies the equations
# 0 = f = q + p*tan(phi) - coh
# 0 = p - p_trial + ga * Ezzzz * dg/dp
# 0 = q - q_trial + ga * Ezxzx * dg/dq
# Here dg/dp = tan(psi), and dg/dq = 1
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz plastic_strain_xx plastic_strain_xy plastic_strain_xz plastic_strain_yy plastic_strain_yz plastic_strain_zz strain_xx strain_xy strain_xz strain_yy strain_yz strain_zz'
  [../]
[]
[BCs]
  [./bottomx]
    type = DirichletBC
    variable = disp_x
    boundary = back
    value = 0.0
  [../]
  [./bottomy]
    type = DirichletBC
    variable = disp_y
    boundary = back
    value = 0.0
  [../]
  [./bottomz]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0.0
  [../]
  [./topx]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = front
    function = 't'
  [../]
  [./topy]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = front
    function = '2*t'
  [../]
  [./topz]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = '0'
  [../]
[]
[AuxVariables]
  [./f_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_compressive]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./ls]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./f_shear]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f_shear
  [../]
  [./f_tensile]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f_tensile
  [../]
  [./f_compressive]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f_compressive
  [../]
  [./intnl_shear]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl_shear
  [../]
  [./intnl_tensile]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 1
    variable = intnl_tensile
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./ls]
    type = MaterialRealAux
    property = plastic_linesearch_needed
    variable = ls
  [../]
[]
[Postprocessors]
  [./stress_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./stress_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./stress_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./stress_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./stress_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./stress_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./strainp_xx]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_xx
  [../]
  [./strainp_xy]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_xy
  [../]
  [./strainp_xz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_xz
  [../]
  [./strainp_yy]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_yy
  [../]
  [./strainp_yz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_yz
  [../]
  [./strainp_zz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_zz
  [../]
  [./straint_xx]
    type = PointValue
    point = '0 0 0'
    variable = strain_xx
  [../]
  [./straint_xy]
    type = PointValue
    point = '0 0 0'
    variable = strain_xy
  [../]
  [./straint_xz]
    type = PointValue
    point = '0 0 0'
    variable = strain_xz
  [../]
  [./straint_yy]
    type = PointValue
    point = '0 0 0'
    variable = strain_yy
  [../]
  [./straint_yz]
    type = PointValue
    point = '0 0 0'
    variable = strain_yz
  [../]
  [./straint_zz]
    type = PointValue
    point = '0 0 0'
    variable = strain_zz
  [../]
  [./f_shear]
    type = PointValue
    point = '0 0 0'
    variable = f_shear
  [../]
  [./f_tensile]
    type = PointValue
    point = '0 0 0'
    variable = f_tensile
  [../]
  [./f_compressive]
    type = PointValue
    point = '0 0 0'
    variable = f_compressive
  [../]
  [./intnl_shear]
    type = PointValue
    point = '0 0 0'
    variable = intnl_shear
  [../]
  [./intnl_tensile]
    type = PointValue
    point = '0 0 0'
    variable = intnl_tensile
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
  [./ls]
    type = PointValue
    point = '0 0 0'
    variable = ls
  [../]
[]
[UserObjects]
  [./coh]
    type = SolidMechanicsHardeningExponential
    value_0 = 1
    value_residual = 2
    rate = 1
  [../]
  [./tanphi]
    type = SolidMechanicsHardeningExponential
    value_0 = 1.0
    value_residual = 0.5
    rate = 2
  [../]
  [./tanpsi]
    type = SolidMechanicsHardeningExponential
    value_0 = 0.1
    value_residual = 0.05
    rate = 1
  [../]
  [./t_strength]
    type = SolidMechanicsHardeningConstant
    value = 1E8
  [../]
  [./c_strength]
    type = SolidMechanicsHardeningConstant
    value = 1E8
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '4 4'
  [../]
  [./admissible]
    type = ComputeMultipleInelasticStress
    inelastic_models = stress
    perform_finite_strain_rotations = false
  [../]
  [./stress]
    type = CappedWeakPlaneStressUpdate
    cohesion = coh
    tan_friction_angle = tanphi
    tan_dilation_angle = tanpsi
    tensile_strength = t_strength
    compressive_strength = c_strength
    max_NR_iterations = 20
    tip_smoother = 0
    smoothing_tol = 1
    yield_function_tol = 1E-3
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform9
  [./csv]
    type = CSV
  [../]
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/stress_update_material_based/linesearch.i)
[GlobalParams]
  displacements = 'ux uy uz'
[]
[Mesh]
  type = GeneratedMesh
  dim = 3
  elem_type = HEX8
[]
[AuxVariables]
  [fp_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [e_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [gss]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[Functions]
  [tdisp]
    type = ParsedFunction
    expression = 0.01*t
  []
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  add_variables = true
  generate_output = stress_zz
[]
[AuxKernels]
  [fp_zz]
    type = RankTwoAux
    variable = fp_zz
    rank_two_tensor = plastic_deformation_gradient
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [e_zz]
    type = RankTwoAux
    variable = e_zz
    rank_two_tensor = total_lagrangian_strain
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [gss1]
    type = MaterialStdVectorAux
    variable = gss
    property = slip_resistance
    index = 0
    execute_on = timestep_end
  []
[]
[BCs]
  [symmy]
    type = DirichletBC
    variable = uy
    boundary = bottom
    value = 0
  []
  [symmx]
    type = DirichletBC
    variable = ux
    boundary = left
    value = 0
  []
  [symmz]
    type = DirichletBC
    variable = uz
    boundary = back
    value = 0
  []
  [tdisp]
    type = FunctionDirichletBC
    variable = uz
    boundary = front
    function = tdisp
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensorCP
    C_ijkl = '1.684e5 1.214e5 1.214e5 1.684e5 1.214e5 1.684e5 0.754e5 0.754e5 0.754e5'
    fill_method = symmetric9
  []
  [stress]
    type = ComputeMultipleCrystalPlasticityStress
    crystal_plasticity_models = 'trial_xtalpl'
    tan_mod_type = exact
    maximum_substep_iteration = 200
    use_line_search = true
    min_line_search_step_size = 0.01
  []
  [trial_xtalpl]
    type = CrystalPlasticityKalidindiUpdate
    number_slip_systems = 12
    slip_sys_file_name = input_slip_sys.txt
    resistance_tol = 0.01
  []
[]
[Postprocessors]
  [stress_zz]
    type = ElementAverageValue
    variable = stress_zz
  []
  [fp_zz]
    type = ElementAverageValue
    variable = fp_zz
  []
  [e_zz]
    type = ElementAverageValue
    variable = e_zz
  []
  [gss]
    type = ElementAverageValue
    variable = gss
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  dt = 0.05
  solve_type = 'PJFNK'
  petsc_options_iname = -pc_hypre_type
  petsc_options_value = boomerang
  nl_abs_tol = 1e-10
  nl_rel_step_tol = 1e-10
  dtmax = 10.0
  nl_rel_tol = 1e-10
  end_time = 1
  dtmin = 0.02
  num_steps = 10
  nl_abs_step_tol = 1e-10
[]
[Outputs]
  exodus = true
[]
(modules/solid_mechanics/test/tests/tensile/small_deform_hard3_update_version.i)
# checking for small deformation, with cubic hardening
# A single element is repeatedly stretched by in z direction
# tensile_strength is set to 1Pa, tensile_strength_residual = 0.5Pa, and limit value = 1E-5
# This allows the hardening of the tensile strength to be observed
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    strain = finite
    generate_output = 'max_principal_stress mid_principal_stress min_principal_stress'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1E-6*z*t'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  [../]
  [./iter_auxk]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./intnl_auxk]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl
  [../]
[]
[Postprocessors]
  [./s_I]
    type = PointValue
    point = '0 0 0'
    variable = max_principal_stress
  [../]
  [./s_II]
    type = PointValue
    point = '0 0 0'
    variable = mid_principal_stress
  [../]
  [./s_III]
    type = PointValue
    point = '0 0 0'
    variable = min_principal_stress
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
  [./intnl]
    type = PointValue
    point = '0 0 0'
    variable = intnl
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningCubic
    value_0 = 1.0
    value_residual = 0.5
    internal_0 = 0
    internal_limit = 1E-5
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '0 2.0E6'
  [../]
  [./tensile]
    type = TensileStressUpdate
    tensile_strength = ts
    smoothing_tol = 0.0
    yield_function_tol = 1.0E-12
  [../]
  [./stress]
    type = ComputeMultipleInelasticStress
    inelastic_models = tensile
    perform_finite_strain_rotations = false
  [../]
[]
[Executioner]
  end_time = 10
  dt = 1.0
  type = Transient
[]
[Outputs]
  file_base = small_deform_hard3_update_version
  exodus = false
  [./csv]
    type = CSV
  [../]
[]
(modules/solid_mechanics/test/tests/drucker_prager/small_deform3_inner_edge.i)
# apply repeated stretches in x z directions, and smaller stretches along the y direction,
# so that sigma_I = sigma_II,
# which means that lode angle = 30deg.
# The allows yield surface in meridional plane to be mapped out
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '1E-6*x*t'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '-1.7E-6*y*t'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1E-6*z*t'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_int]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./mc_int_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = mc_int
  [../]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./internal]
    type = PointValue
    point = '0 0 0'
    variable = mc_int
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 10
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 35
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 5
    convert_to_radians = true
  [../]
  [./mc]
    type = SolidMechanicsPlasticDruckerPragerHyperbolic
    mc_cohesion = mc_coh
    mc_friction_angle = mc_phi
    mc_dilation_angle = mc_psi
    smoother = 8
    mc_interpolation_scheme = inner_edge
    yield_function_tolerance = 1E-7
    internal_constraint_tolerance = 1E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./strain]
    type = ComputeIncrementalStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-13
    plastic_models = mc
    debug_fspb = crash
  [../]
[]
[Executioner]
  end_time = 10
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform3_inner_edge
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform13.i)
# Using CappedMohrCoulomb with compressive failure only
# checking for small deformation
# A single element is compressed by "ep" in the z and x directions
# This causes the return direction to be along the hypersurface sigma_I = sigma_II
# where sigma_I = (E_2222 + E_2200) * ep
# compressive_strength is set to 1Pa, smoothing_tol = 0.1Pa
# The smoothed yield function is
# yf = -sigma_I + ismoother(0) - compressive_strength
#    = -sigma_I + (0.5 * smoothing_tol - smoothing_tol / Pi) - compressive_strength
#    = -sigma_I - 0.98183
#
# With zero Poisson's ratio, the return stress will be
# stress_00 = stress_22 = 0.98183
# with all other stress components being zero
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'max_principal_stress mid_principal_stress min_principal_stress stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '-0.25E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '-0.25E-6*z'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1
  [../]
  [./cs]
    type = SolidMechanicsHardeningConstant
    value = 1
  [../]
  [./coh]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./ang]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 2.0E6'
  [../]
  [./tensile]
    type = CappedMohrCoulombStressUpdate
    tensile_strength = ts
    compressive_strength = cs
    cohesion = coh
    friction_angle = ang
    dilation_angle = ang
    smoothing_tol = 0.1
    yield_function_tol = 1.0E-12
  [../]
  [./stress]
    type = ComputeMultipleInelasticStress
    inelastic_models = tensile
    perform_finite_strain_rotations = false
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform13
  csv = true
[]
(modules/porous_flow/test/tests/infiltration_and_drainage/wli01.i)
[Mesh]
  type = GeneratedMesh
  dim = 2
  nx = 1000
  ny = 1
  xmin = -10000
  xmax = 0
  ymin = 0
  ymax = 0.05
[]
[GlobalParams]
  PorousFlowDictator = dictator
[]
[UserObjects]
  [dictator]
    type = PorousFlowDictator
    porous_flow_vars = pressure
    number_fluid_phases = 1
    number_fluid_components = 1
  []
  [pc]
    type = PorousFlowCapillaryPressureBW
    Sn = 0.0
    Ss = 1.0
    C = 1.5
    las = 2
  []
[]
[FluidProperties]
  [simple_fluid]
    type = SimpleFluidProperties
    bulk_modulus = 2e9
    viscosity = 4
    density0 = 10
    thermal_expansion = 0
  []
[]
[Materials]
  [massfrac]
    type = PorousFlowMassFraction
  []
  [temperature]
    type = PorousFlowTemperature
  []
  [simple_fluid]
    type = PorousFlowSingleComponentFluid
    fp = simple_fluid
    phase = 0
  []
  [ppss]
    type = PorousFlow1PhaseP
    porepressure = pressure
    capillary_pressure = pc
  []
  [relperm]
    type = PorousFlowRelativePermeabilityBW
    Sn = 0.0
    Ss = 1.0
    Kn = 0
    Ks = 1
    C = 1.5
    phase = 0
  []
  [porosity]
    type = PorousFlowPorosityConst
    porosity = 0.25
  []
  [permeability]
    type = PorousFlowPermeabilityConst
    permeability = '1 0 0  0 1 0  0 0 1'
  []
[]
[Variables]
  [pressure]
    initial_condition = -1E-4
  []
[]
[Kernels]
  [mass0]
    type = PorousFlowMassTimeDerivative
    fluid_component = 0
    variable = pressure
  []
  [flux0]
    type = PorousFlowAdvectiveFlux
    fluid_component = 0
    variable = pressure
    gravity = '-0.1 0 0'
  []
[]
[AuxVariables]
  [SWater]
    family = MONOMIAL
    order = CONSTANT
  []
[]
[AuxKernels]
  [SWater]
    type = MaterialStdVectorAux
    property = PorousFlow_saturation_qp
    index = 0
    variable = SWater
  []
[]
[BCs]
  [base]
    type = DirichletBC
    boundary = 'left'
    value = -1E-4
    variable = pressure
  []
[]
[Preconditioning]
  [andy]
    type = SMP
    full = true
    petsc_options = '-snes_converged_reason -ksp_diagonal_scale -ksp_diagonal_scale_fix -ksp_gmres_modifiedgramschmidt -snes_linesearch_monitor'
    petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap -snes_atol -snes_rtol -snes_max_it'
    petsc_options_value = 'gmres      asm      lu           NONZERO                   2               1E-10      1E-10      10000'
  []
[]
[VectorPostprocessors]
  [swater]
    type = LineValueSampler
    warn_discontinuous_face_values = false
    variable = SWater
    start_point = '-5000 0 0'
    end_point = '0 0 0'
    sort_by = x
    num_points = 71
    execute_on = timestep_end
  []
[]
[Executioner]
  type = Transient
  solve_type = Newton
  petsc_options = '-snes_converged_reason'
  end_time = 1000
  dt = 1
[]
[Outputs]
  file_base = wli01
  sync_times = '100 500 1000'
  [exodus]
    type = Exodus
    sync_only = true
  []
  [along_line]
    type = CSV
    sync_only = true
  []
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/user_object_based/substep.i)
[Mesh]
  type = GeneratedMesh
  dim = 3
  elem_type = HEX8
  displacements = 'ux uy uz'
[]
[Variables]
  [./ux]
    block = 0
  [../]
  [./uy]
    block = 0
  [../]
  [./uz]
    block = 0
  [../]
[]
[AuxVariables]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./fp_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./e_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./gss]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[Functions]
  [./tdisp]
    type = ParsedFunction
    expression = 0.01*t
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'ux uy uz'
    use_displaced_mesh = true
  [../]
[]
[AuxKernels]
  [./stress_zz]
    type = RankTwoAux
    variable = stress_zz
    rank_two_tensor = stress
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  [../]
  [./fp_zz]
    type = RankTwoAux
    variable = fp_zz
    rank_two_tensor = fp
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  [../]
  [./e_zz]
    type = RankTwoAux
    variable = e_zz
    rank_two_tensor = lage
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  [../]
  [./gss]
    type = MaterialStdVectorAux
    variable = gss
    property = state_var_gss
    index = 0
    execute_on = timestep_end
  [../]
[]
[BCs]
  [./symmy]
    type = DirichletBC
    variable = uy
    boundary = bottom
    value = 0
  [../]
  [./symmx]
    type = DirichletBC
    variable = ux
    boundary = left
    value = 0
  [../]
  [./symmz]
    type = DirichletBC
    variable = uz
    boundary = back
    value = 0
  [../]
  [./tdisp]
    type = FunctionDirichletBC
    variable = uz
    boundary = front
    function = tdisp
  [../]
[]
[UserObjects]
  [./slip_rate_gss]
    type = CrystalPlasticitySlipRateGSS
    variable_size = 12
    slip_sys_file_name = input_slip_sys.txt
    num_slip_sys_flowrate_props = 2
    flowprops = '1 4 0.001 0.1 5 8 0.001 0.1 9 12 0.001 0.1'
    uo_state_var_name = state_var_gss
  [../]
  [./slip_resistance_gss]
    type = CrystalPlasticitySlipResistanceGSS
    variable_size = 12
    uo_state_var_name = state_var_gss
  [../]
  [./state_var_gss]
    type = CrystalPlasticityStateVariable
    variable_size = 12
    groups = '0 4 8 12'
    group_values = '60.8 60.8 60.8'
    uo_state_var_evol_rate_comp_name = state_var_evol_rate_comp_gss
    scale_factor = 1.0
  [../]
  [./state_var_evol_rate_comp_gss]
    type = CrystalPlasticityStateVarRateComponentGSS
    variable_size = 12
    hprops = '1.0 541.5 109.8 2.5'
    uo_slip_rate_name = slip_rate_gss
    uo_state_var_name = state_var_gss
  [../]
[]
[Materials]
  [./crysp]
    type = FiniteStrainUObasedCP
    block = 0
    stol = 1e-2
    tan_mod_type = exact
    maximum_substep_iteration = 10
    uo_slip_rates = 'slip_rate_gss'
    uo_slip_resistances = 'slip_resistance_gss'
    uo_state_vars = 'state_var_gss'
    uo_state_var_evol_rate_comps = 'state_var_evol_rate_comp_gss'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'ux uy uz'
  [../]
  [./elasticity_tensor]
    type = ComputeElasticityTensorCP
    block = 0
    C_ijkl = '1.684e5 1.214e5 1.214e5 1.684e5 1.214e5 1.684e5 0.754e5 0.754e5 0.754e5'
    fill_method = symmetric9
  [../]
[]
[Postprocessors]
  [./stress_zz]
    type = ElementAverageValue
    variable = stress_zz
    block = 'ANY_BLOCK_ID 0'
  [../]
  [./fp_zz]
    type = ElementAverageValue
    variable = fp_zz
    block = 'ANY_BLOCK_ID 0'
  [../]
  [./e_zz]
    type = ElementAverageValue
    variable = e_zz
    block = 'ANY_BLOCK_ID 0'
  [../]
  [./gss]
    type = ElementAverageValue
    variable = gss
    block = 'ANY_BLOCK_ID 0'
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  dt = 2.0
  solve_type = 'PJFNK'
  petsc_options_iname = -pc_hypre_type
  petsc_options_value = boomerang
  nl_abs_tol = 1e-10
  nl_rel_step_tol = 1e-10
  dtmax = 10.0
  nl_rel_tol = 1e-10
  end_time = 30.0
  dtmin = 0.5
  num_steps = 10
  nl_abs_step_tol = 1e-10
[]
[Outputs]
  exodus = true
  csv = true
  gnuplot = true
[]
(modules/solid_mechanics/test/tests/mohr_coulomb/small_deform6.i)
# apply repeated stretches in z direction, and smaller stretches in the x and y directions
# so that sigma_II = sigma_III,
# which means that lode angle = -30deg.
# The allows yield surface in meridional plane to be mapped out
# Using cap smoothing
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0.9E-6*x*sin(t)'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0.9E-6*y*sin(t)'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1E-6*z*t'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_int]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./mc_int_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = mc_int
  [../]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
  [./iter_auxk]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./internal]
    type = PointValue
    point = '0 0 0'
    variable = mc_int
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
[]
[UserObjects]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 10
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 50
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningExponential
    value_0 = 0
    value_residual = 0.8726646 # 50deg
    rate = 3000.0
  [../]
  [./mc]
    type = SolidMechanicsPlasticMohrCoulomb
    cohesion = mc_coh
    friction_angle = mc_phi
    dilation_angle = mc_psi
    tip_scheme = cap
    mc_tip_smoother = 0
    cap_start = 3
    cap_rate = 0.8
    mc_edge_smoother = 20
    yield_function_tolerance = 1E-8
    internal_constraint_tolerance = 1E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = mc
    debug_fspb = crash
  [../]
[]
[Executioner]
  end_time = 30
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform6
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/mean_cap_TC/random01.i)
# apply many random large deformations, checking that the algorithm returns correctly to
# the yield surface each time.
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1000
  ny = 125
  nz = 1
  xmin = 0
  xmax = 1000
  ymin = 0
  ymax = 125
  zmin = 0
  zmax = 1
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[ICs]
  [./x]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_x
  [../]
  [./y]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_y
  [../]
  [./z]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_z
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '0'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
[]
[Postprocessors]
  [./max_yield_fcn]
    type = ElementExtremeValue
    variable = yield_fcn
    outputs = 'console'
  [../]
  [./should_be_zero]
    type = FunctionValuePostprocessor
    function = should_be_zero_fcn
  [../]
  [./av_iter]
    type = ElementAverageValue
    variable = iter
    outputs = 'console'
  [../]
[]
[Functions]
  [./should_be_zero_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-3,0,a)'
    symbol_names = 'a'
    symbol_values = 'max_yield_fcn'
  [../]
[]
[UserObjects]
  [./tensile_strength]
    type = SolidMechanicsHardeningConstant
    value = 1
  [../]
  [./compressive_strength]
    type = SolidMechanicsHardeningConstant
    value = -1.5
  [../]
  [./cap]
    type = SolidMechanicsPlasticMeanCapTC
    tensile_strength = tensile_strength
    compressive_strength = compressive_strength
    yield_function_tolerance = 1E-3
    internal_constraint_tolerance = 1E-9
    use_custom_returnMap = false
    use_custom_cto = false
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0.7E7 1E7'
  [../]
  [./strain]
    type = ComputeIncrementalStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    max_NR_iterations = 2
    ep_plastic_tolerance = 1E-6
    plastic_models = cap
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = random01
  exodus = false
  [./csv]
    type = CSV
  [../]
[]
(modules/solid_mechanics/test/tests/multi/eight_surface14.i)
# Plasticit models:
# SimpleTester0 with a = 0 and b = 1 and strength = 1
# SimpleTester1 with a = 1 and b = 0 and strength = 1
# SimpleTester2 with a = 1 and b = 1 and strength = 3
# SimpleTester3 with a = 0 and b = 1 and strength = 1.1
# SimpleTester4 with a = 1 and b = 0 and strength = 1.1
# SimpleTester5 with a = 1 and b = 1 and strength = 3.1
# SimpleTester6 with a = 1 and b = 2 and strength = 3.1
# SimpleTester7 with a = 2 and b = 1 and strength = 3.1
#
# Lame lambda = 0 (Poisson=0).  Lame mu = 0.5E6
#
# A single element is stretched by 2.1E-6m in y direction and 3E-6 in z direction.
# trial stress_yy = 2.1 and stress_zz = 3.0
#
# This is similar to three_surface14.i, and a description is found there.
# The result should be stress_zz=1=stress_yy, with internal0=2
# and internal1=1.1
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '2.1E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '3.0E-6*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f3]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f4]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f5]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f6]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f7]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int3]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int4]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int5]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int6]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int7]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./f3]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 3
    variable = f3
  [../]
  [./f4]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 4
    variable = f4
  [../]
  [./f5]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 5
    variable = f5
  [../]
  [./f6]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 6
    variable = f6
  [../]
  [./f7]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 7
    variable = f7
  [../]
  [./int0]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 0
    variable = int0
  [../]
  [./int1]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 1
    variable = int1
  [../]
  [./int2]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 2
    variable = int2
  [../]
  [./int3]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 3
    variable = int3
  [../]
  [./int4]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 4
    variable = int4
  [../]
  [./int5]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 5
    variable = int5
  [../]
  [./int6]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 6
    variable = int6
  [../]
  [./int7]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 7
    variable = int7
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./f2]
    type = PointValue
    point = '0 0 0'
    variable = f2
  [../]
  [./f3]
    type = PointValue
    point = '0 0 0'
    variable = f3
  [../]
  [./f4]
    type = PointValue
    point = '0 0 0'
    variable = f4
  [../]
  [./f5]
    type = PointValue
    point = '0 0 0'
    variable = f5
  [../]
  [./f6]
    type = PointValue
    point = '0 0 0'
    variable = f6
  [../]
  [./f7]
    type = PointValue
    point = '0 0 0'
    variable = f7
  [../]
  [./int0]
    type = PointValue
    point = '0 0 0'
    variable = int0
  [../]
  [./int1]
    type = PointValue
    point = '0 0 0'
    variable = int1
  [../]
  [./int2]
    type = PointValue
    point = '0 0 0'
    variable = int2
  [../]
  [./int3]
    type = PointValue
    point = '0 0 0'
    variable = int3
  [../]
  [./int4]
    type = PointValue
    point = '0 0 0'
    variable = int4
  [../]
  [./int5]
    type = PointValue
    point = '0 0 0'
    variable = int5
  [../]
  [./int6]
    type = PointValue
    point = '0 0 0'
    variable = int6
  [../]
  [./int7]
    type = PointValue
    point = '0 0 0'
    variable = int7
  [../]
[]
[UserObjects]
  [./simple0]
    type = SolidMechanicsPlasticSimpleTester
    a = 0
    b = 1
    strength = 1
    yield_function_tolerance = 1.0E-6
    internal_constraint_tolerance = 1.0E-6
  [../]
  [./simple1]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 0
    strength = 1
    yield_function_tolerance = 1.0E-6
    internal_constraint_tolerance = 1.0E-6
  [../]
  [./simple2]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 1
    strength = 3
    yield_function_tolerance = 1.0E-6
    internal_constraint_tolerance = 1.0E-6
  [../]
  [./simple3]
    type = SolidMechanicsPlasticSimpleTester
    a = 0
    b = 1
    strength = 1.1
    yield_function_tolerance = 1.0E-6
    internal_constraint_tolerance = 1.0E-6
  [../]
  [./simple4]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 0
    strength = 1.1
    yield_function_tolerance = 1.0E-6
    internal_constraint_tolerance = 1.0E-6
  [../]
  [./simple5]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 1
    strength = 3.1
    yield_function_tolerance = 1.0E-6
    internal_constraint_tolerance = 1.0E-6
  [../]
  [./simple6]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 2
    strength = 3.1
    yield_function_tolerance = 1.0E-6
    internal_constraint_tolerance = 1.0E-6
  [../]
  [./simple7]
    type = SolidMechanicsPlasticSimpleTester
    a = 2
    b = 1
    strength = 3.1
    yield_function_tolerance = 1.0E-6
    internal_constraint_tolerance = 1.0E-6
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 0.5E6'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./multi]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = 'simple0 simple1 simple2 simple3 simple4 simple5 simple6 simple7'
    deactivation_scheme = optimized_to_safe
    max_NR_iterations = 4
    min_stepsize = 1
    debug_fspb = crash
    debug_jac_at_stress = '10 0 0 0 10 0 0 0 10'
    debug_jac_at_pm = '1 1 1'
    debug_jac_at_intnl = '1 1 1'
    debug_stress_change = 1E-5
    debug_pm_change = '1E-6 1E-6 1E-6'
    debug_intnl_change = '1E-6 1E-6 1E-6'
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = eight_surface14
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform3.i)
# Using CappedMohrCoulomb with tensile failure only
# checking for small deformation
# A single element is stretched by "ep" in the z and x directions
# This causes the return direction to be along the hypersurface sigma_I = sigma_II
# where sigma_I = (E_2222 + E_2200) * ep
# tensile_strength is set to 1Pa, smoothing_tol = 0.1Pa
# The smoothed yield function is
# yf = sigma_I + ismoother(0) - tensile_strength
#    = sigma_I + (0.5 * smoothing_tol - smoothing_tol / Pi) - tensile_strength
#    = sigma_I - 0.98183
#
# With zero Poisson's ratio, the return stress will be
# stress_00 = stress_22 = 0.98183
# with all other stress components being zero
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'max_principal_stress mid_principal_stress min_principal_stress stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0.25E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '0.25E-6*z'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1
  [../]
  [./coh]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./ang]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 2.0E6'
  [../]
  [./tensile]
    type = CappedMohrCoulombStressUpdate
    tensile_strength = ts
    compressive_strength = ts
    cohesion = coh
    friction_angle = ang
    dilation_angle = ang
    smoothing_tol = 0.1
    yield_function_tol = 1.0E-12
  [../]
  [./stress]
    type = ComputeMultipleInelasticStress
    inelastic_models = tensile
    perform_finite_strain_rotations = false
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform3
  csv = true
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/stress_update_material_based/update_method_011orientation.i)
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
  type = GeneratedMesh
  dim = 3
  elem_type = HEX8
[]
[AuxVariables]
  [pk2]
    order = CONSTANT
    family = MONOMIAL
  []
  [fp_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [lagrangian_strain_yy]
    order = CONSTANT
    family = MONOMIAL
  []
  [lagrangian_strain_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [gss]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment]
   order = CONSTANT
   family = MONOMIAL
  []
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  add_variables = true
  generate_output = stress_zz
[]
[AuxKernels]
  [pk2]
   type = RankTwoAux
   variable = pk2
   rank_two_tensor = second_piola_kirchhoff_stress
   index_j = 2
   index_i = 2
   execute_on = timestep_end
  []
  [fp_zz]
    type = RankTwoAux
    variable = fp_zz
    rank_two_tensor = plastic_deformation_gradient
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [lagrangian_strain_zz]
    type = RankTwoAux
    variable = lagrangian_strain_zz
    rank_two_tensor = total_lagrangian_strain
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [lagrangian_strain_yy]
    type = RankTwoAux
    rank_two_tensor = total_lagrangian_strain
    variable = lagrangian_strain_yy
    index_i = 1
    index_j = 1
    execute_on = timestep_end
  []
  [gss]
   type = MaterialStdVectorAux
   variable = gss
   property = slip_resistance
   index = 0
   execute_on = timestep_end
  []
  [slip_inc]
   type = MaterialStdVectorAux
   variable = slip_increment
   property = slip_increment
   index = 0
   execute_on = timestep_end
  []
[]
[BCs]
  [symmy]
    type = DirichletBC
    variable = disp_y
    boundary = bottom
    value = 0
  []
  [symmx]
    type = DirichletBC
    variable = disp_x
    boundary = left
    value = 0
  []
  [symmz]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0
  []
  [tdisp]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = '0.01*t'
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensorCP
    C_ijkl = '1.684e5 1.214e5 1.214e5 1.684e5 1.214e5 1.684e5 0.754e5 0.754e5 0.754e5'
    fill_method = symmetric9
    euler_angle_1 = 120.0
    euler_angle_2 = 125.264
    euler_angle_3 =  45.0
  []
  [stress]
    type = ComputeMultipleCrystalPlasticityStress
    crystal_plasticity_models = 'trial_xtalpl'
    tan_mod_type = exact
  []
  [trial_xtalpl]
    type = CrystalPlasticityKalidindiUpdate
    number_slip_systems = 12
    slip_sys_file_name = input_slip_sys.txt
  []
[]
[Postprocessors]
  [stress_zz]
    type = ElementAverageValue
    variable = stress_zz
  []
  [pk2]
   type = ElementAverageValue
   variable = pk2
  []
  [fp_zz]
    type = ElementAverageValue
    variable = fp_zz
  []
  [lagrangian_strain_yy]
    type = ElementAverageValue
    variable = lagrangian_strain_yy
  []
  [lagrangian_strain_zz]
    type = ElementAverageValue
    variable = lagrangian_strain_zz
  []
  [gss]
    type = ElementAverageValue
    variable = gss
  []
  [slip_increment]
   type = ElementAverageValue
   variable = slip_increment
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
  petsc_options_value = ' asm      2              lu            gmres     200'
  nl_abs_tol = 1e-10
  nl_rel_tol = 1e-10
  nl_abs_step_tol = 1e-10
  dt = 0.05
  dtmin = 0.01
  dtmax = 10.0
  num_steps = 10
[]
[Outputs]
  csv = true
[]
(modules/solid_mechanics/test/tests/weak_plane_tensile/small_deform_hard1.i)
# Checking internal-parameter evolution
# A single element is stretched by 1E-6*t in z directions.
#
# Young's modulus = 20 MPa.  Tensile strength = 10 Pa
#
# There are two time steps.
# In the first
# trial stress_zz = Youngs Modulus*Strain = 2E7*1E-6 = 20 Pa
# so this returns to stress_zz = 10 Pa, and half of the deformation
# goes to plastic strain, yielding ep_zz_plastic = 0.5E-6
# In the second
# trial stress_zz = 10 + Youngs Modulus*(Strain increment) = 10 + 2E7*1E-6 = 30 Pa
# so this returns to stress_zz = 10 Pa, and all of the deformation
# goes to plastic strain, yielding ep_zz_plastic increment = 1E-6,
# so total plastic strain_zz = 1.5E-6.
[GlobalParams]
  displacements = 'x_disp y_disp z_disp'
[]
[Mesh]
  type = GeneratedMesh
  dim = 3
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  add_variables = true
  generate_output = 'stress_zz'
[]
[BCs]
  [bottomx]
    type = DirichletBC
    variable = x_disp
    boundary = back
    value = 0.0
  []
  [bottomy]
    type = DirichletBC
    variable = y_disp
    boundary = back
    value = 0.0
  []
  [bottomz]
    type = DirichletBC
    variable = z_disp
    boundary = back
    value = 0.0
  []
  [topx]
    type = DirichletBC
    variable = x_disp
    boundary = front
    value = 0
  []
  [topy]
    type = DirichletBC
    variable = y_disp
    boundary = front
    value = 0
  []
  [topz]
    type = FunctionDirichletBC
    variable = z_disp
    boundary = front
    function = 1E-6*t
  []
[]
[AuxVariables]
  [wpt_internal]
    order = CONSTANT
    family = MONOMIAL
  []
  [yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[AuxKernels]
  [wpt_internal]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = wpt_internal
  []
  [yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  []
[]
[Postprocessors]
  [wpt_internal]
    type = PointValue
    point = '0 0 0'
    variable = wpt_internal
  []
  [s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  []
  [f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  []
[]
[UserObjects]
  [str]
    type = SolidMechanicsHardeningConstant
    value = 10
  []
  [wpt]
    type = SolidMechanicsPlasticWeakPlaneTensile
    tensile_strength = str
    yield_function_tolerance = 1E-6
    internal_constraint_tolerance = 1E-11
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  []
  [mc]
    type = ComputeMultiPlasticityStress
    plastic_models = wpt
    transverse_direction = '0 0 1'
    ep_plastic_tolerance = 1E-11
  []
[]
[Executioner]
  end_time = 2
  dt = 1
  type = Transient
[]
[Outputs]
  csv = true
[]
(modules/solid_mechanics/test/tests/notched_plastic_block/biaxial_abbo.i)
# Uses an Abbo et al smoothed version of Mohr-Coulomb (via SolidMechanicsPlasticMohrCoulomb and ComputeMultiPlasticityStress) to simulate the following problem.
# A cubical block is notched around its equator.
# All of its outer surfaces have roller BCs, but the notched region is free to move as needed
# The block is initialised with a high hydrostatic tensile stress
# Without the notch, the BCs do not allow contraction of the block, and this stress configuration is admissible
# With the notch, however, the interior parts of the block are free to move in order to relieve stress, and this causes plastic failure
# The top surface is then pulled upwards (the bottom is fixed because of the roller BCs)
# This causes more failure
[Mesh]
  [generated_mesh]
    type = GeneratedMeshGenerator
    dim = 3
    nx = 9
    ny = 9
    nz = 9
    xmin = 0
    xmax = 0.1
    ymin = 0
    ymax = 0.1
    zmin = 0
    zmax = 0.1
  []
  [block_to_remove_xmin]
    type = SubdomainBoundingBoxGenerator
    bottom_left = '-0.01 -0.01 0.045'
    top_right = '0.01 0.11 0.055'
    location = INSIDE
    block_id = 1
    input = generated_mesh
  []
  [block_to_remove_xmax]
    type = SubdomainBoundingBoxGenerator
    bottom_left = '0.09 -0.01 0.045'
    top_right = '0.11 0.11 0.055'
    location = INSIDE
    block_id = 1
    input = block_to_remove_xmin
  []
  [block_to_remove_ymin]
    type = SubdomainBoundingBoxGenerator
    bottom_left = '-0.01 -0.01 0.045'
    top_right = '0.11 0.01 0.055'
    location = INSIDE
    block_id = 1
    input = block_to_remove_xmax
  []
  [block_to_remove_ymax]
    type = SubdomainBoundingBoxGenerator
    bottom_left = '-0.01 0.09 0.045'
    top_right = '0.11 0.11 0.055'
    location = INSIDE
    block_id = 1
    input = block_to_remove_ymin
  []
  [remove_block]
    type = BlockDeletionGenerator
    block = 1
    input = block_to_remove_ymax
  []
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'max_principal_stress mid_principal_stress min_principal_stress stress_zz'
    eigenstrain_names = ini_stress
  [../]
[]
[Postprocessors]
  [./uz]
    type = PointValue
    point = '0 0 0.1'
    use_displaced_mesh = false
    variable = disp_z
  [../]
  [./s_zz]
    type = ElementAverageValue
    use_displaced_mesh = false
    variable = stress_zz
  [../]
  [./num_res]
    type = NumResidualEvaluations
  [../]
  [./nr_its] # num_iters is the average number of NR iterations encountered per element in this timestep
    type = ElementAverageValue
    variable = num_iters
  [../]
  [./max_nr_its] # num_iters is the average number of NR iterations encountered in the element in this timestep, so we must get max(max_nr_its) to obtain the max number of iterations
    type = ElementExtremeValue
    variable = num_iters
  [../]
  [./runtime]
    type = PerfGraphData
    data_type = TOTAL
    section_name = 'Root'
  [../]
[]
[BCs]
  # back=zmin, front=zmax, bottom=ymin, top=ymax, left=xmin, right=xmax
  [./xmin_xzero]
    type = DirichletBC
    variable = disp_x
    boundary = left
    value = 0.0
  [../]
  [./xmax_xzero]
    type = DirichletBC
    variable = disp_x
    boundary = right
    value = 0.0
  [../]
  [./ymin_yzero]
    type = DirichletBC
    variable = disp_y
    boundary = bottom
    value = 0.0
  [../]
  [./ymax_yzero]
    type = DirichletBC
    variable = disp_y
    boundary = top
    value = 0.0
  [../]
  [./zmin_zzero]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = '0'
  [../]
  [./zmax_disp]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = '1E-6*max(t,0)'
  [../]
[]
[AuxVariables]
  [./mc_int]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./num_iters]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./mc_int_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = mc_int
  [../]
  [./num_iters_auxk]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = num_iters
  [../]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 5E6
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 35
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 10
    convert_to_radians = true
  [../]
  [./mc]
    type = SolidMechanicsPlasticMohrCoulomb
    cohesion = mc_coh
    friction_angle = mc_phi
    dilation_angle = mc_psi
    mc_tip_smoother = 0.02E6
    mc_edge_smoother = 29
    yield_function_tolerance = 1E-5
    internal_constraint_tolerance = 1E-11
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 16E9
    poissons_ratio = 0.25
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    ep_plastic_tolerance = 1E-11
    plastic_models = mc
    max_NR_iterations = 1000
    debug_fspb = crash
  [../]
  [./strain_from_initial_stress]
    type = ComputeEigenstrainFromInitialStress
    initial_stress = '6E6 0 0  0 6E6 0  0 0 6E6'
    eigenstrain_name = ini_stress
  [../]
[]
[Preconditioning]
  [./andy]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  start_time = -1
  end_time = 10
  dt = 1
  solve_type = NEWTON
  type = Transient
  l_tol = 1E-2
  nl_abs_tol = 1E-5
  nl_rel_tol = 1E-7
  l_max_its = 200
  nl_max_its = 400
  petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
  petsc_options_value = ' asm      2              lu            gmres     200'
[]
[Outputs]
  file_base = biaxial_abbo
  perf_graph = true
  exodus = false
  csv = true
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/user_object_based/user_object.i)
[Mesh]
  type = GeneratedMesh
  dim = 2
  elem_type = QUAD4
  displacements = 'disp_x disp_y'
  nx = 2
  ny = 2
[]
[GlobalParams]
  volumetric_locking_correction = true
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y'
    use_displaced_mesh = true
  [../]
[]
[AuxVariables]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./e_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./fp_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./rotout]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./gss]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[Functions]
  [./tdisp]
    type = ParsedFunction
    expression = 0.01*t
  [../]
[]
[UserObjects]
  [./prop_read]
    type = PropertyReadFile
    prop_file_name = 'euler_ang_file.txt'
    # Enter file data as prop#1, prop#2, .., prop#nprop
    nprop = 3
    read_type = element
  [../]
[]
[AuxKernels]
  [./stress_yy]
    type = RankTwoAux
    variable = stress_yy
    rank_two_tensor = stress
    index_j = 1
    index_i = 1
    execute_on = timestep_end
  [../]
  [./e_yy]
    type = RankTwoAux
    variable = e_yy
    rank_two_tensor = lage
    index_j = 1
    index_i = 1
    execute_on = timestep_end
  [../]
  [./fp_yy]
    type = RankTwoAux
    variable = fp_yy
    rank_two_tensor = fp
    index_j = 1
    index_i = 1
    execute_on = timestep_end
  [../]
  [./gss]
    type = MaterialStdVectorAux
    variable = gss
    property = state_var_gss
    index = 0
    execute_on = timestep_end
  [../]
[]
[BCs]
  [./fix_x]
    type = DirichletBC
    variable = disp_x
    boundary = 'left'
    value = 0
  [../]
  [./fix_y]
    type = DirichletBC
    variable = disp_y
    boundary = 'bottom'
    value = 0
  [../]
  [./tdisp]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = top
    function = tdisp
  [../]
[]
[UserObjects]
  [./slip_rate_gss]
    type = CrystalPlasticitySlipRateGSS
    variable_size = 12
    slip_sys_file_name = input_slip_sys.txt
    num_slip_sys_flowrate_props = 2
    flowprops = '1 4 0.001 0.1 5 8 0.001 0.1 9 12 0.001 0.1'
    uo_state_var_name = state_var_gss
  [../]
  [./slip_resistance_gss]
    type = CrystalPlasticitySlipResistanceGSS
    variable_size = 12
    uo_state_var_name = state_var_gss
  [../]
  [./state_var_gss]
    type = CrystalPlasticityStateVariable
    variable_size = 12
    groups = '0 4 8 12'
    group_values = '60.8 60.8 60.8'
    uo_state_var_evol_rate_comp_name = state_var_evol_rate_comp_gss
    scale_factor = 1.0
  [../]
  [./state_var_evol_rate_comp_gss]
    type = CrystalPlasticityStateVarRateComponentGSS
    variable_size = 12
    hprops = '1.0 541.5 109.8 2.5'
    uo_slip_rate_name = slip_rate_gss
    uo_state_var_name = state_var_gss
  [../]
[]
[Materials]
  [./crysp]
    type = FiniteStrainUObasedCP
    stol = 1e-2
    tan_mod_type = exact
    uo_slip_rates = 'slip_rate_gss'
    uo_slip_resistances = 'slip_resistance_gss'
    uo_state_vars = 'state_var_gss'
    uo_state_var_evol_rate_comps = 'state_var_evol_rate_comp_gss'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    displacements = 'disp_x disp_y'
  [../]
  [./elasticity_tensor]
    type = ComputeElasticityTensorCP
    C_ijkl = '1.684e5 1.214e5 1.214e5 1.684e5 1.214e5 1.684e5 0.754e5 0.754e5 0.754e5'
    fill_method = symmetric9
    read_prop_user_object = prop_read
  [../]
[]
[Postprocessors]
  [./stress_yy]
    type = ElementAverageValue
    variable = stress_yy
  [../]
  [./e_yy]
    type = ElementAverageValue
    variable = e_yy
  [../]
  [./fp_yy]
    type = ElementAverageValue
    variable = fp_yy
  [../]
  [./gss]
    type = ElementAverageValue
    variable = gss
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  dt = 0.01
  solve_type = 'PJFNK'
  petsc_options_iname = -pc_hypre_type
  petsc_options_value = boomerang
  nl_abs_tol = 1e-10
  nl_rel_step_tol = 1e-10
  dtmax = 10.0
  nl_rel_tol = 1e-10
  end_time = 1
  dtmin = 0.01
  num_steps = 10
  nl_abs_step_tol = 1e-10
[]
[Outputs]
  exodus = true
[]
(modules/solid_mechanics/test/tests/capped_weak_plane/small_deform10.i)
# apply a shear deformation and tensile stretch to observe all hardening.
# Here p_trial=12, q_trial=2*Sqrt(20)
# MOOSE yields:
# q_returned = 1.696
# p_returned = 0.100
# intnl_shear = 1.81
# intnl_tens = 0.886
# These give, at the returned point
# cohesion = 1.84
# tanphi = 0.513
# tanpsi = 0.058
# tensile = 0.412
# This means that
# f_shear = -0.0895
# f_tensile = -0.312
# Note that these are within smoothing_tol (=1) of each other
# Hence, smoothing must be used:
# ismoother = 0.0895
# (which gives the yield function value = 0)
# smoother = 0.328
# This latter gives dg/dq = 0.671, dg/dp = 0.368
# for the flow directions.  Finally ga = 2.70, and
# the returned point satisfies the normality conditions.
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz plastic_strain_xx plastic_strain_xy plastic_strain_xz plastic_strain_yy plastic_strain_yz plastic_strain_zz strain_xx strain_xy strain_xz strain_yy strain_yz strain_zz'
  [../]
[]
[BCs]
  [./bottomx]
    type = DirichletBC
    variable = disp_x
    boundary = back
    value = 0.0
  [../]
  [./bottomy]
    type = DirichletBC
    variable = disp_y
    boundary = back
    value = 0.0
  [../]
  [./bottomz]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0.0
  [../]
  [./topx]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = front
    function = 't'
  [../]
  [./topy]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = front
    function = '2*t'
  [../]
  [./topz]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = 't'
  [../]
[]
[AuxVariables]
  [./f_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_compressive]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./ls]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./f_shear]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f_shear
  [../]
  [./f_tensile]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f_tensile
  [../]
  [./f_compressive]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f_compressive
  [../]
  [./intnl_shear]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl_shear
  [../]
  [./intnl_tensile]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 1
    variable = intnl_tensile
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./ls]
    type = MaterialRealAux
    property = plastic_linesearch_needed
    variable = ls
  [../]
[]
[Postprocessors]
  [./stress_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./stress_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./stress_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./stress_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./stress_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./stress_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./strainp_xx]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_xx
  [../]
  [./strainp_xy]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_xy
  [../]
  [./strainp_xz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_xz
  [../]
  [./strainp_yy]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_yy
  [../]
  [./strainp_yz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_yz
  [../]
  [./strainp_zz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_zz
  [../]
  [./straint_xx]
    type = PointValue
    point = '0 0 0'
    variable = strain_xx
  [../]
  [./straint_xy]
    type = PointValue
    point = '0 0 0'
    variable = strain_xy
  [../]
  [./straint_xz]
    type = PointValue
    point = '0 0 0'
    variable = strain_xz
  [../]
  [./straint_yy]
    type = PointValue
    point = '0 0 0'
    variable = strain_yy
  [../]
  [./straint_yz]
    type = PointValue
    point = '0 0 0'
    variable = strain_yz
  [../]
  [./straint_zz]
    type = PointValue
    point = '0 0 0'
    variable = strain_zz
  [../]
  [./f_shear]
    type = PointValue
    point = '0 0 0'
    variable = f_shear
  [../]
  [./f_tensile]
    type = PointValue
    point = '0 0 0'
    variable = f_tensile
  [../]
  [./f_compressive]
    type = PointValue
    point = '0 0 0'
    variable = f_compressive
  [../]
  [./intnl_shear]
    type = PointValue
    point = '0 0 0'
    variable = intnl_shear
  [../]
  [./intnl_tensile]
    type = PointValue
    point = '0 0 0'
    variable = intnl_tensile
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
  [./ls]
    type = PointValue
    point = '0 0 0'
    variable = ls
  [../]
[]
[UserObjects]
  [./coh]
    type = SolidMechanicsHardeningExponential
    value_0 = 1
    value_residual = 2
    rate = 1
  [../]
  [./tanphi]
    type = SolidMechanicsHardeningExponential
    value_0 = 1.0
    value_residual = 0.5
    rate = 2
  [../]
  [./tanpsi]
    type = SolidMechanicsHardeningExponential
    value_0 = 0.1
    value_residual = 0.05
    rate = 1
  [../]
  [./t_strength]
    type = SolidMechanicsHardeningExponential
    value_0 = 1
    value_residual = 0
    rate = 1
  [../]
  [./c_strength]
    type = SolidMechanicsHardeningConstant
    value = 1E8
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '4 4'
  [../]
  [./admissible]
    type = ComputeMultipleInelasticStress
    inelastic_models = stress
    perform_finite_strain_rotations = false
  [../]
  [./stress]
    type = CappedWeakPlaneStressUpdate
    cohesion = coh
    tan_friction_angle = tanphi
    tan_dilation_angle = tanpsi
    tensile_strength = t_strength
    compressive_strength = c_strength
    max_NR_iterations = 20
    tip_smoother = 0
    smoothing_tol = 1
    yield_function_tol = 1E-3
    perfect_guess = false
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform10
  [./csv]
    type = CSV
  [../]
[]
(modules/solid_mechanics/test/tests/tensile/small_deform5.i)
# checking for small deformation
# A single element is incrementally stretched in the in the z and x directions
# This causes the return direction to be along the hypersurface sigma_I = sigma_II,
# and the resulting stresses are checked to lie on the expected yield surface
#
# tensile_strength is set to 1Pa, tip_smoother = 0.5, edge_smoother = 25degrees
# Then A + B + C = 0.609965
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
  [GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    strain = finite
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0.25E-6*x*t*t'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '0.25E-6*z*t*t'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningCubic
    value_0 = 1
  [../]
  [./mc]
    type = SolidMechanicsPlasticTensile
    tensile_strength = ts
    yield_function_tolerance = 1E-6
    tensile_tip_smoother = 0.5
    internal_constraint_tolerance = 1E-5
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 2.0E6'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-5
    plastic_models = mc
    debug_fspb = crash
  [../]
[]
[Executioner]
  end_time = 10
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform5
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform_hard3.i)
# Using CappedMohrCoulomb with tensile failure only
# checking for small deformation, with cubic hardening
# A single element is repeatedly stretched in z direction
# tensile_strength is set to 1Pa, tensile_strength_residual = 0.5Pa, and limit value = 1E-5
# This allows the hardening of the tensile strength to be observed
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'max_principal_stress mid_principal_stress min_principal_stress'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '2E-6*z*t'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  [../]
  [./iter_auxk]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./intnl_auxk]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 1
    variable = intnl
  [../]
[]
[Postprocessors]
  [./s_I]
    type = PointValue
    point = '0 0 0'
    variable = max_principal_stress
  [../]
  [./s_II]
    type = PointValue
    point = '0 0 0'
    variable = mid_principal_stress
  [../]
  [./s_III]
    type = PointValue
    point = '0 0 0'
    variable = min_principal_stress
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
  [./intnl]
    type = PointValue
    point = '0 0 0'
    variable = intnl
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningCubic
    value_0 = 1.0
    value_residual = 0.5
    internal_0 = 0
    internal_limit = 1E-5
  [../]
  [./cs]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./coh]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./ang]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '0 2.0E6'
  [../]
  [./tensile]
    type = CappedMohrCoulombStressUpdate
    tensile_strength = ts
    compressive_strength = cs
    cohesion = coh
    friction_angle = ang
    dilation_angle = ang
    smoothing_tol = 0.0
    yield_function_tol = 1.0E-12
  [../]
  [./stress]
    type = ComputeMultipleInelasticStress
    inelastic_models = tensile
    perform_finite_strain_rotations = false
  [../]
[]
[Executioner]
  end_time = 10
  dt = 1.0
  type = Transient
[]
[Outputs]
  file_base = small_deform_hard3
  csv = true
[]
(modules/solid_mechanics/test/tests/weak_plane_tensile/small_deform_hard2.i)
# Checking solution of hardening
# A single element is stretched by 1E-6 in z direction.
#
# Young's modulus = 20 MPa.  Tensile strength = 10 Exp(-1E6*q) Pa
#
# The trial stress is
# trial_stress_zz = Youngs Modulus*Strain = 2E7*1E-6 = 20 Pa
#
# Therefore the equations we have to solve are
# 0 = f = stress_zz - 10 Exp(-1E6*q)
# 0 = epp = ga - (20 - stress_zz)/2E7
# 0 = intnl = q - ga
#
# The result is
# q = 0.76803905E-6
# stress_zz = 4.6392191 Pa
[GlobalParams]
  displacements = 'x_disp y_disp z_disp'
[]
[Mesh]
  type = GeneratedMesh
  dim = 3
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  add_variables = true
  generate_output = 'stress_zz'
[]
[BCs]
  [bottomx]
    type = DirichletBC
    variable = x_disp
    boundary = back
    value = 0.0
  []
  [bottomy]
    type = DirichletBC
    variable = y_disp
    boundary = back
    value = 0.0
  []
  [bottomz]
    type = DirichletBC
    variable = z_disp
    boundary = back
    value = 0.0
  []
  [topx]
    type = DirichletBC
    variable = x_disp
    boundary = front
    value = 0
  []
  [topy]
    type = DirichletBC
    variable = y_disp
    boundary = front
    value = 0
  []
  [topz]
    type = FunctionDirichletBC
    variable = z_disp
    boundary = front
    function = 1E-6*t
  []
[]
[AuxVariables]
  [wpt_internal]
    order = CONSTANT
    family = MONOMIAL
  []
  [yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[AuxKernels]
  [wpt_internal]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = wpt_internal
  []
  [yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  []
[]
[Postprocessors]
  [wpt_internal]
    type = PointValue
    point = '0 0 0'
    variable = wpt_internal
  []
  [s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  []
  [f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  []
[]
[UserObjects]
  [str]
    type = SolidMechanicsHardeningExponential
    value_0 = 10
    value_residual = 0
    rate = 1E6
  []
  [wpt]
    type = SolidMechanicsPlasticWeakPlaneTensile
    tensile_strength = str
    yield_function_tolerance = 1E-6
    internal_constraint_tolerance = 1E-11
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  []
  [mc]
    type = ComputeMultiPlasticityStress
    plastic_models = wpt
    transverse_direction = '0 0 1'
    ep_plastic_tolerance = 1E-11
  []
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  csv = true
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/twinning/combined_twinning_slip_100compression.i)
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
  [cube]
    type = GeneratedMeshGenerator
    dim = 3
    nx = 2
    ny = 2
    nz = 2
    elem_type = HEX8
  []
[]
[AuxVariables]
  [fp_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [total_twin_volume_fraction]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_0]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_1]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_2]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_3]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_4]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_5]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_6]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_7]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_8]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_9]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_10]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_11]
    order = CONSTANT
    family = MONOMIAL
  []
  [twin_volume_fraction_0]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_1]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_2]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_3]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_4]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_5]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_6]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_7]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_8]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_9]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_10]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_11]
   order = CONSTANT
   family = MONOMIAL
  []
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  add_variables = true
[]
[AuxKernels]
  [fp_zz]
    type = RankTwoAux
    variable = fp_zz
    rank_two_tensor = plastic_deformation_gradient
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [total_twin_volume_fraction]
    type = MaterialRealAux
    variable = total_twin_volume_fraction
    property = twin_total_volume_fraction_twins
    execute_on = timestep_end
  []
  [slip_increment_0]
   type = MaterialStdVectorAux
   variable = slip_increment_0
   property = slip_increment
   index = 0
   execute_on = timestep_end
  []
  [slip_increment_1]
   type = MaterialStdVectorAux
   variable = slip_increment_1
   property = slip_increment
   index = 1
   execute_on = timestep_end
  []
  [slip_increment_2]
   type = MaterialStdVectorAux
   variable = slip_increment_2
   property = slip_increment
   index = 2
   execute_on = timestep_end
  []
  [slip_increment_3]
   type = MaterialStdVectorAux
   variable = slip_increment_3
   property = slip_increment
   index = 3
   execute_on = timestep_end
  []
  [slip_increment_4]
   type = MaterialStdVectorAux
   variable = slip_increment_4
   property = slip_increment
   index = 4
   execute_on = timestep_end
  []
  [slip_increment_5]
   type = MaterialStdVectorAux
   variable = slip_increment_5
   property = slip_increment
   index = 5
   execute_on = timestep_end
  []
  [slip_increment_6]
   type = MaterialStdVectorAux
   variable = slip_increment_6
   property = slip_increment
   index = 6
   execute_on = timestep_end
  []
  [slip_increment_7]
   type = MaterialStdVectorAux
   variable = slip_increment_7
   property = slip_increment
   index = 7
   execute_on = timestep_end
  []
  [slip_increment_8]
   type = MaterialStdVectorAux
   variable = slip_increment_8
   property = slip_increment
   index = 8
   execute_on = timestep_end
  []
  [slip_increment_9]
   type = MaterialStdVectorAux
   variable = slip_increment_9
   property = slip_increment
   index = 9
   execute_on = timestep_end
  []
  [slip_increment_10]
   type = MaterialStdVectorAux
   variable = slip_increment_10
   property = slip_increment
   index = 10
   execute_on = timestep_end
  []
  [slip_increment_11]
   type = MaterialStdVectorAux
   variable = slip_increment_11
   property = slip_increment
   index = 11
   execute_on = timestep_end
  []
  [twin_volume_fraction_0]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_0
   property = twin_twin_system_volume_fraction
   index = 0
   execute_on = timestep_end
  []
  [twin_volume_fraction_1]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_1
   property = twin_twin_system_volume_fraction
   index = 1
   execute_on = timestep_end
  []
  [twin_volume_fraction_2]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_2
   property = twin_twin_system_volume_fraction
   index = 2
   execute_on = timestep_end
  []
  [twin_volume_fraction_3]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_3
   property = twin_twin_system_volume_fraction
   index = 3
   execute_on = timestep_end
  []
  [twin_volume_fraction_4]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_4
   property = twin_twin_system_volume_fraction
   index = 4
   execute_on = timestep_end
  []
  [twin_volume_fraction_5]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_5
   property = twin_twin_system_volume_fraction
   index = 5
   execute_on = timestep_end
  []
  [twin_volume_fraction_6]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_6
   property = twin_twin_system_volume_fraction
   index = 6
   execute_on = timestep_end
  []
  [twin_volume_fraction_7]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_7
   property = twin_twin_system_volume_fraction
   index = 7
   execute_on = timestep_end
  []
  [twin_volume_fraction_8]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_8
   property = twin_twin_system_volume_fraction
   index = 8
   execute_on = timestep_end
  []
  [twin_volume_fraction_9]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_9
   property = twin_twin_system_volume_fraction
   index = 9
   execute_on = timestep_end
  []
  [twin_volume_fraction_10]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_10
   property = twin_twin_system_volume_fraction
   index = 10
   execute_on = timestep_end
  []
  [twin_volume_fraction_11]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_11
   property = twin_twin_system_volume_fraction
   index = 11
   execute_on = timestep_end
  []
[]
[BCs]
  [fix_y]
    type = DirichletBC
    variable = disp_y
    preset = true
    boundary = 'bottom'
    value = 0
  []
  [fix_x]
    type = DirichletBC
    variable = disp_x
    boundary = 'left'
    value = 0
  []
  [fix_z]
    type = DirichletBC
    variable = disp_z
    boundary = 'back'
    value = 0
  []
  [tdisp]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = '-0.025*t'
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensorCP
    C_ijkl = '1.684e5 1.214e5 1.214e5 1.684e5 1.214e5 1.684e5 0.754e5 0.754e5 0.754e5' # roughly copper
    fill_method = symmetric9
  []
  [stress]
    type = ComputeMultipleCrystalPlasticityStress
    crystal_plasticity_models = 'twin_xtalpl slip_xtalpl'
    tan_mod_type = exact
  []
  [twin_xtalpl]
    type = CrystalPlasticityTwinningKalidindiUpdate
    base_name = twin
    number_slip_systems = 12
    slip_sys_file_name = 'fcc_input_twinning_systems.txt'
    initial_twin_lattice_friction = 60.0
  []
  [slip_xtalpl]
    type = CrystalPlasticityKalidindiUpdate
    number_slip_systems = 12
    slip_sys_file_name = input_slip_sys.txt
    total_twin_volume_fraction = 'twin_total_volume_fraction_twins'
  []
[]
[Postprocessors]
  [fp_zz]
    type = ElementAverageValue
    variable = fp_zz
  []
  [total_twin_volume_fraction]
    type = ElementAverageValue
    variable = total_twin_volume_fraction
  []
  [slip_increment_0]
    type = ElementAverageValue
    variable = slip_increment_0
  []
  [slip_increment_1]
    type = ElementAverageValue
    variable = slip_increment_1
  []
  [slip_increment_2]
    type = ElementAverageValue
    variable = slip_increment_2
  []
  [slip_increment_3]
    type = ElementAverageValue
    variable = slip_increment_3
  []
  [slip_increment_4]
    type = ElementAverageValue
    variable = slip_increment_4
  []
  [slip_increment_5]
    type = ElementAverageValue
    variable = slip_increment_5
  []
  [slip_increment_6]
    type = ElementAverageValue
    variable = slip_increment_6
  []
  [slip_increment_7]
    type = ElementAverageValue
    variable = slip_increment_7
  []
  [slip_increment_8]
    type = ElementAverageValue
    variable = slip_increment_8
  []
  [slip_increment_9]
    type = ElementAverageValue
    variable = slip_increment_9
  []
  [slip_increment_10]
    type = ElementAverageValue
    variable = slip_increment_10
  []
  [slip_increment_11]
    type = ElementAverageValue
    variable = slip_increment_11
  []
  [twin_volume_fraction_0]
    type = ElementAverageValue
    variable = twin_volume_fraction_0
  []
  [twin_volume_fraction_1]
    type = ElementAverageValue
    variable = twin_volume_fraction_1
  []
  [twin_volume_fraction_2]
    type = ElementAverageValue
    variable = twin_volume_fraction_2
  []
  [twin_volume_fraction_3]
    type = ElementAverageValue
    variable = twin_volume_fraction_3
  []
  [twin_volume_fraction_4]
    type = ElementAverageValue
    variable = twin_volume_fraction_4
  []
  [twin_volume_fraction_5]
    type = ElementAverageValue
    variable = twin_volume_fraction_5
  []
  [twin_volume_fraction_6]
    type = ElementAverageValue
    variable = twin_volume_fraction_6
  []
  [twin_volume_fraction_7]
    type = ElementAverageValue
    variable = twin_volume_fraction_7
  []
  [twin_volume_fraction_8]
    type = ElementAverageValue
    variable = twin_volume_fraction_8
  []
  [twin_volume_fraction_9]
    type = ElementAverageValue
    variable = twin_volume_fraction_9
  []
  [twin_volume_fraction_10]
    type = ElementAverageValue
    variable = twin_volume_fraction_10
  []
  [twin_volume_fraction_11]
    type = ElementAverageValue
    variable = twin_volume_fraction_11
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
  petsc_options_value = ' asm      2              lu            gmres     200'
  nl_abs_tol = 1e-10
  nl_rel_tol = 1e-10
  nl_abs_step_tol = 1e-10
  dt = 0.005
  dtmin = 0.01
  num_steps = 10
[]
[Outputs]
  csv = true
  perf_graph = true
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/hcp_single_crystal/update_method_hcp_representative_slip_systems.i)
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
  type = GeneratedMesh
  dim = 3
  elem_type = HEX8
[]
[AuxVariables]
  [temperature]
    initial_condition = 300
  []
  [pk2]
    order = CONSTANT
    family = MONOMIAL
  []
  [fp_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [e_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [resolved_shear_stress_0]
    order = CONSTANT
    family = MONOMIAL
  []
  [resolved_shear_stress_1]
    order = CONSTANT
    family = MONOMIAL
  []
  [resolved_shear_stress_2]
    order = CONSTANT
    family = MONOMIAL
  []
  [resolved_shear_stress_3]
    order = CONSTANT
    family = MONOMIAL
  []
  [resolved_shear_stress_4]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  incremental = true
  add_variables = true
  generate_output = stress_zz
[]
[AuxKernels]
  [pk2]
    type = RankTwoAux
    variable = pk2
    rank_two_tensor = second_piola_kirchhoff_stress
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [fp_zz]
    type = RankTwoAux
    variable = fp_zz
    rank_two_tensor = plastic_deformation_gradient
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [e_zz]
    type = RankTwoAux
    variable = e_zz
    rank_two_tensor = total_lagrangian_strain
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [tau_0]
    type = MaterialStdVectorAux
    variable = resolved_shear_stress_0
    property = applied_shear_stress
    index = 0
    execute_on = timestep_end
  []
  [tau_1]
    type = MaterialStdVectorAux
    variable = resolved_shear_stress_1
    property = applied_shear_stress
    index = 1
    execute_on = timestep_end
  []
  [tau_2]
    type = MaterialStdVectorAux
    variable = resolved_shear_stress_2
    property = applied_shear_stress
    index = 2
    execute_on = timestep_end
  []
  [tau_3]
    type = MaterialStdVectorAux
    variable = resolved_shear_stress_3
    property = applied_shear_stress
    index = 3
    execute_on = timestep_end
  []
  [tau_4]
    type = MaterialStdVectorAux
    variable = resolved_shear_stress_4
    property = applied_shear_stress
    index = 4
    execute_on = timestep_end
  []
[]
[BCs]
  [symmy]
    type = DirichletBC
    variable = disp_y
    boundary = bottom
    value = 0
  []
  [symmx]
    type = DirichletBC
    variable = disp_x
    boundary = left
    value = 0
  []
  [symmz]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0
  []
  [tdisp]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = '0.1*t'
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensorCP
    C_ijkl = '1.622e5 9.18e4 6.88e4 1.622e5 6.88e4 1.805e5 4.67e4 4.67e4 4.67e4' #alpha Ti, Alankar et al. Acta Materialia 59 (2011) 7003-7009
    fill_method = symmetric9
    euler_angle_1 = 45
    euler_angle_2 = 60
    euler_angle_3 = 30
  []
  [stress]
    type = ComputeMultipleCrystalPlasticityStress
    crystal_plasticity_models = 'trial_xtalpl'
    tan_mod_type = exact
  []
  [trial_xtalpl]
    type = CrystalPlasticityHCPDislocationSlipBeyerleinUpdate
    number_slip_systems = 5
    slip_sys_file_name = select_input_slip_sys_hcp.txt
    unit_cell_dimension = '2.934e-7 2.934e-7 4.657e-7' #Ti, in mm, https://materialsproject.org/materials/mp-46/
    temperature = temperature
    initial_forest_dislocation_density = 15.0e5
    initial_substructure_density = 1.0e3
    slip_system_modes = 4
    number_slip_systems_per_mode = '1 1 2 1'
    lattice_friction_per_mode = '10 10 15 30'
    effective_shear_modulus_per_mode = '47e3 47e3 47e3 47e3'
    burgers_vector_per_mode = '2.934e-7 2.934e-7 2.934e-7 6.586e-7' #Ti, in mm, https://materialsproject.org/materials/mp-46/
    slip_generation_coefficient_per_mode = '2e7 1e5 2e7 2e7'
    normalized_slip_activiation_energy_per_mode = '3e-2 4e-3 3e-2 3e-2'
    slip_energy_proportionality_factor_per_mode = '100 330 100 100'
    substructure_rate_coefficient_per_mode = '100 400 1 1'
    applied_strain_rate = 0.001
    gamma_o = 1.0e-3
    strain_rate_sensitivity_exponent = 0.05
    Hall_Petch_like_constant_per_mode = '10 10 10 10'
    grain_size = 20.0e-3 #20 microns,
  []
[]
[Postprocessors]
  [stress_zz]
    type = ElementAverageValue
    variable = stress_zz
  []
  [pk2]
    type = ElementAverageValue
    variable = pk2
  []
  [fp_zz]
    type = ElementAverageValue
    variable = fp_zz
  []
  [e_zz]
    type = ElementAverageValue
    variable = e_zz
  []
  [tau_0]
    type = ElementAverageValue
    variable = resolved_shear_stress_0
  []
  [tau_1]
    type = ElementAverageValue
    variable = resolved_shear_stress_1
  []
  [tau_2]
    type = ElementAverageValue
    variable = resolved_shear_stress_2
  []
  [tau_3]
    type = ElementAverageValue
    variable = resolved_shear_stress_3
  []
  [tau_4]
    type = ElementAverageValue
    variable = resolved_shear_stress_4
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
  petsc_options_value = ' asm      2              lu            gmres     200'
  nl_abs_tol = 1e-10
  nl_rel_tol = 1e-10
  nl_abs_step_tol = 1e-10
  dt = 0.05
  dtmin = 0.01
  dtmax = 0.1
  end_time = 0.4
[]
[Outputs]
  csv = true
[]
(modules/solid_mechanics/test/tests/tensile/planar8.i)
# A single unit element is stretched by (0.5, 0.4, 0.3)E-6m
# with Lame lambda = 0.6E6 and Lame mu (shear) = 1E6
# stress_xx = 1.72 Pa
# stress_yy = 1.52 Pa
# stress_zz = 1.32 Pa
# tensile_strength is set to 1.3Pa hardening to 2Pa over intnl=1E-6
#
# The return should be to the edge (the algorithm will first try the tip) with
# according to mathematica
# internal = 1.67234152669E-7
# stress_xx = stress_yy = 1.3522482794
# stress_zz = 1.2195929084
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    strain = finite
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0.5E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0.4E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '0.3E-6*z'
  [../]
[]
[AuxVariables]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./f0_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./intnl_auxk]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./f2]
    type = PointValue
    point = '0 0 0'
    variable = f2
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
  [./intnl]
    type = PointValue
    point = '0 0 0'
    variable = intnl
  [../]
[]
[UserObjects]
  [./hard]
    type = SolidMechanicsHardeningCubic
    value_0 = 1.3
    value_residual = 2
    internal_limit = 1E-6
  [../]
  [./tens]
    type = SolidMechanicsPlasticTensileMulti
    tensile_strength = hard
    shift = 1E-6
    yield_function_tolerance = 1E-6
    internal_constraint_tolerance = 1E-5
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0.6E6 1E6'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-12
    plastic_models = tens
    debug_fspb = none
    debug_jac_at_stress = '1 2 3 2 -4 -5 3 -5 10'
    debug_jac_at_pm = '0.1 0.2 0.3'
    debug_jac_at_intnl = 1E-6
    debug_stress_change = 1E-6
    debug_pm_change = '1E-6 1E-6 1E-6'
    debug_intnl_change = 1E-6
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = planar8
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform_hard13.i)
# Using CappedMohrCoulomb with compressive failure only
# checking for small deformation, with cubic hardening
# A single element is repeatedly compressed in z direction
# compressive_strength is set to 0.9Pa, compressive_strength_residual = 0.5Pa, and limit value = 1E-5
# This allows the hardening of the compressive strength to be observed
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'max_principal_stress mid_principal_stress min_principal_stress stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '-0.5E-6*z*t'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 3
    variable = yield_fcn
  [../]
  [./iter_auxk]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./intnl_auxk]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 1
    variable = intnl
  [../]
[]
[Postprocessors]
  [./s_I]
    type = PointValue
    point = '0 0 0'
    variable = max_principal_stress
  [../]
  [./s_II]
    type = PointValue
    point = '0 0 0'
    variable = mid_principal_stress
  [../]
  [./s_III]
    type = PointValue
    point = '0 0 0'
    variable = min_principal_stress
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
  [./intnl]
    type = PointValue
    point = '0 0 0'
    variable = intnl
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./cs]
    type = SolidMechanicsHardeningCubic
    value_0 = 0.9
    value_residual = 0.5
    internal_0 = -1E-5
    internal_limit = 0
  [../]
  [./coh]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./ang]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '0 2.0E6'
  [../]
  [./compressive]
    type = CappedMohrCoulombStressUpdate
    tensile_strength = ts
    compressive_strength = cs
    cohesion = coh
    friction_angle = ang
    dilation_angle = ang
    smoothing_tol = 0.0
    yield_function_tol = 1.0E-12
  [../]
  [./stress]
    type = ComputeMultipleInelasticStress
    inelastic_models = compressive
    perform_finite_strain_rotations = false
  [../]
[]
[Executioner]
  end_time = 10
  dt = 1.0
  type = Transient
[]
[Outputs]
  file_base = small_deform_hard13
  csv = true
[]
(modules/solid_mechanics/test/tests/orthotropic_plasticity/orthotropic.i)
# UserObject Orthotropic test, with constant hardening.
# Linear strain is applied in the x and y direction.
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin =  -.5
  xmax = .5
  ymin = -.5
  ymax = .5
  zmin = -.5
  zmax = .5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    strain = FINITE
    add_variables = true
    generate_output = 'stress_xx stress_yy stress_zz stress_xy stress_yz stress_xz'
  [../]
[]
[BCs]
  [./xdisp]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'right'
    function = '0.005*t'
  [../]
  [./ydisp]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'top'
    function = '0.005*t'
  [../]
  [./yfix]
    type = DirichletBC
    variable = disp_y
    #boundary = 'bottom top'
    boundary = 'bottom'
    value = 0
  [../]
  [./xfix]
    type = DirichletBC
    variable = disp_x
    boundary = 'left'
    value = 0
  [../]
  [./zfix]
    type = DirichletBC
    variable = disp_z
    #boundary = 'front back'
    boundary = 'back'
    value = 0
  [../]
[]
[AuxVariables]
  [./plastic_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./plastic_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./plastic_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./plastic_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./plastic_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./plastic_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./sdev]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./sdet]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./plastic_xx]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = plastic_xx
    index_i = 0
    index_j = 0
  [../]
  [./plastic_xy]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = plastic_xy
    index_i = 0
    index_j = 1
  [../]
  [./plastic_xz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = plastic_xz
    index_i = 0
    index_j = 2
  [../]
  [./plastic_yy]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = plastic_yy
    index_i = 1
    index_j = 1
  [../]
  [./plastic_yz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = plastic_yz
    index_i = 1
    index_j = 2
  [../]
  [./plastic_zz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = plastic_zz
    index_i = 2
    index_j = 2
  [../]
  [./f]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = f
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./intnl]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = intnl
  [../]
  [./sdev]
    type = RankTwoScalarAux
    variable = sdev
    rank_two_tensor = stress
    scalar_type = VonMisesStress
  [../]
[]
[Postprocessors]
  [./sdev]
    type = PointValue
    point = '0 0 0'
    variable = sdev
  [../]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./p_xx]
    type = PointValue
    point = '0 0 0'
    variable = plastic_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./p_xy]
    type = PointValue
    point = '0 0 0'
    variable = plastic_xy
  [../]
  [./p_xz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_xz
  [../]
  [./p_yz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_yz
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./p_yy]
    type = PointValue
    point = '0 0 0'
    variable = plastic_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./p_zz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_zz
  [../]
  [./intnl]
    type = PointValue
    point = '0 0 0'
    variable = intnl
  [../]
[]
[UserObjects]
  [./str]
    type = SolidMechanicsHardeningConstant
    value = 300
  [../]
  [./Orthotropic]
    type = SolidMechanicsPlasticOrthotropic
    b = -0.2
    c1 = '1 1 1 1 1 1'
    c2 = '1 1 1 1 1 1'
    associative = true
    yield_strength = str
    yield_function_tolerance = 1e-5
    internal_constraint_tolerance = 1e-9
    use_custom_returnMap = false
    use_custom_cto = false
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '121e3 80e3'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    ep_plastic_tolerance = 1e-9
    plastic_models = Orthotropic
    debug_fspb = crash
    tangent_operator = elastic
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  num_steps = 3
  dt = .5
  type = Transient
  nl_rel_tol = 1e-6
  nl_max_its = 10
  l_tol = 1e-4
  l_max_its = 50
  solve_type = PJFNK
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
[]
[Outputs]
  perf_graph = false
  csv = true
[]
(modules/combined/test/tests/j2_plasticity_vs_LSH/j2_hard1_mod_small_strain.i)
# Test designed to compare results and active time between SH/LinearStrainHardening
# material vs TM j2 plastic user object. As number of elements increases, TM
# active time increases at a much higher rate than SM. Testing at 4x4x4
# (64 elements).
#
# plot vm_stress vs intnl to see constant hardening
#
# Original test located at:
# solid_mechanics/tests/j2_plasticity/hard1.i
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 4
  ny = 4
  nz = 4
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
  displacements = 'disp_x disp_y disp_z'
[]
[Variables]
  [disp_x]
    order = FIRST
    family = LAGRANGE
  []
  [disp_y]
    order = FIRST
    family = LAGRANGE
  []
  [disp_z]
    order = FIRST
    family = LAGRANGE
  []
[]
[Kernels]
  [TensorMechanics]
    displacements = 'disp_x disp_y disp_z'
  []
[]
[AuxVariables]
  [stress_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [intnl]
    order = CONSTANT
    family = MONOMIAL
  []
  [vm_stress]
    order = CONSTANT
    family = MONOMIAL
  []
  [eq_pl_strain]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[AuxKernels]
  [stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  []
  [intnl]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = intnl
  []
  [eq_pl_strain]
    type = RankTwoScalarAux
    rank_two_tensor = plastic_strain
    scalar_type = EffectiveStrain
    variable = eq_pl_strain
  []
  [vm_stress]
    type = RankTwoScalarAux
    rank_two_tensor = stress
    scalar_type = VonMisesStress
    variable = vm_stress
  []
[]
[BCs]
  [left]
    type = DirichletBC
    variable = disp_x
    boundary = left
    value = 0.0
  []
  [bottom]
    type = DirichletBC
    variable = disp_y
    boundary = bottom
    value = 0.0
  []
  [back]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0.0
  []
  [z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = 't/60'
  []
[]
[UserObjects]
  [str]
    type = TensorMechanicsHardeningConstant
    value = 2.4e2
  []
  [j2]
    type = TensorMechanicsPlasticJ2
    yield_strength = str
    yield_function_tolerance = 1E-3
    internal_constraint_tolerance = 1E-9
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    #with E = 2.1e5 and nu = 0.3
    #Hooke's law: E-nu to Lambda-G
    C_ijkl = '121154 80769.2'
  []
  [strain]
    type = ComputeIncrementalStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  []
  [mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = j2
    tangent_operator = elastic
    perform_finite_strain_rotations = false
  []
[]
[Executioner]
  type = Transient
  #Preconditioned JFNK (default)
  solve_type = 'PJFNK'
  petsc_options = '-snes_ksp_ew'
  petsc_options_iname = '-ksp_gmres_restart'
  petsc_options_value = '101'
  line_search = 'none'
  l_max_its = 100
  nl_max_its = 100
  nl_rel_tol = 1e-6
  nl_abs_tol = 1e-10
  l_tol = 1e-4
  start_time = 0.0
  end_time = 0.5
  dt = 0.01
[]
[Postprocessors]
  [stress_zz]
    type = ElementAverageValue
    variable = stress_zz
  []
  [intnl]
    type = ElementAverageValue
    variable = intnl
  []
  [eq_pl_strain]
    type = PointValue
    point = '0 0 0'
    variable = eq_pl_strain
  []
  [vm_stress]
    type = PointValue
    point = '0 0 0'
    variable = vm_stress
  []
[]
[Outputs]
  csv = true
  print_linear_residuals = false
  perf_graph = true
[]
(modules/solid_mechanics/test/tests/mohr_coulomb/planar_hard2.i)
# apply uniform stretches in x, y and z directions.
# let friction_angle = 60deg, friction_angle_residual=10deg, friction_angle_rate = 0.5E4
# With cohesion = C, friction_angle = phi, the
# algorithm should return to
# sigma_m = C*Cos(phi)/Sin(phi)
# Or, when T=C,
# phi = arctan(C/sigma_m)
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '1E-6*x*t'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '1E-6*y*t'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1E-6*z*t'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_int]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./mc_int_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = mc_int
  [../]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./internal]
    type = PointValue
    point = '0 0 0'
    variable = mc_int
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 10
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningExponential
    value_0 = 1.04719755 # 60deg
    value_residual = 0.17453293 # 10deg
    rate = 0.5E4
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 5
    convert_to_radians = true
  [../]
  [./mc]
    type = SolidMechanicsPlasticMohrCoulombMulti
    cohesion = mc_coh
    friction_angle = mc_phi
    dilation_angle = mc_psi
    shift = 1E-12
    use_custom_returnMap = true
    yield_function_tolerance = 1E-5
    internal_constraint_tolerance = 1E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0.0E7 1E7'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-12
    plastic_models = mc
  [../]
[]
[Executioner]
  end_time = 10
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = planar_hard2
  exodus = false
  [./csv]
    type = CSV
    execute_on = timestep_end
    [../]
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/twinning/only_twinning_fcc.i)
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
  [cube]
    type = GeneratedMeshGenerator
    dim = 3
    nx = 1
    ny = 1
    nz = 2
    elem_type = HEX8
  []
[]
[AuxVariables]
  [fp_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [total_twin_volume_fraction]
    order = CONSTANT
    family = MONOMIAL
  []
  [twin_resistance_4]
    order = CONSTANT
    family = MONOMIAL
  []
  [twin_resistance_10]
    order = CONSTANT
    family = MONOMIAL
  []
  [twin_volume_fraction_0]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_1]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_2]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_3]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_4]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_5]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_6]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_7]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_8]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_9]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_10]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_11]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_tau_4]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_tau_10]
   order = CONSTANT
   family = MONOMIAL
  []
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  add_variables = true
[]
[AuxKernels]
  [fp_zz]
    type = RankTwoAux
    variable = fp_zz
    rank_two_tensor = plastic_deformation_gradient
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [total_twin_volume_fraction]
    type = MaterialRealAux
    variable = total_twin_volume_fraction
    property = total_volume_fraction_twins
    execute_on = timestep_end
  []
  [twin_resistance_4]
   type = MaterialStdVectorAux
   variable = twin_resistance_4
   property = slip_resistance
   index = 4
   execute_on = timestep_end
  []
  [twin_resistance_10]
   type = MaterialStdVectorAux
   variable = twin_resistance_10
   property = slip_resistance
   index = 10
   execute_on = timestep_end
  []
  [twin_volume_fraction_0]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_0
   property = twin_system_volume_fraction
   index = 0
   execute_on = timestep_end
  []
  [twin_volume_fraction_1]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_1
   property = twin_system_volume_fraction
   index = 1
   execute_on = timestep_end
  []
  [twin_volume_fraction_2]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_2
   property = twin_system_volume_fraction
   index = 2
   execute_on = timestep_end
  []
  [twin_volume_fraction_3]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_3
   property = twin_system_volume_fraction
   index = 3
   execute_on = timestep_end
  []
  [twin_volume_fraction_4]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_4
   property = twin_system_volume_fraction
   index = 4
   execute_on = timestep_end
  []
  [twin_volume_fraction_5]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_5
   property = twin_system_volume_fraction
   index = 5
   execute_on = timestep_end
  []
  [twin_volume_fraction_6]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_6
   property = twin_system_volume_fraction
   index = 6
   execute_on = timestep_end
  []
  [twin_volume_fraction_7]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_7
   property = twin_system_volume_fraction
   index = 7
   execute_on = timestep_end
  []
  [twin_volume_fraction_8]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_8
   property = twin_system_volume_fraction
   index = 8
   execute_on = timestep_end
  []
  [twin_volume_fraction_9]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_9
   property = twin_system_volume_fraction
   index = 9
   execute_on = timestep_end
  []
  [twin_volume_fraction_10]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_10
   property = twin_system_volume_fraction
   index = 10
   execute_on = timestep_end
  []
  [twin_volume_fraction_11]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_11
   property = twin_system_volume_fraction
   index = 11
   execute_on = timestep_end
  []
  [twin_tau_4]
    type = MaterialStdVectorAux
    variable = twin_tau_4
    property = applied_shear_stress
    index = 4
    execute_on = timestep_end
  []
  [twin_tau_10]
    type = MaterialStdVectorAux
    variable = twin_tau_10
    property = applied_shear_stress
    index = 10
    execute_on = timestep_end
  []
[]
[BCs]
  [fix_y]
    type = DirichletBC
    variable = disp_y
    preset = true
    boundary = 'bottom'
    value = 0
  []
  [fix_x]
    type = DirichletBC
    variable = disp_x
    boundary = 'left'
    value = 0
  []
  [fix_z]
    type = DirichletBC
    variable = disp_z
    boundary = 'back'
    value = 0
  []
  [tdisp]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = '5.0e-4*t'
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensorCP
    C_ijkl = '1.08e5 6.034e4 6.034e4 1.08e5 6.03e4 1.08e5 2.86e4 2.86e4 2.86e4' #Tallon and Wolfenden. J. Phys. Chem. Solids (1979)
    fill_method = symmetric9
    euler_angle_1 = 54.74
    euler_angle_2 = 45.0
    euler_angle_3 = 270.0
  []
  [stress]
    type = ComputeMultipleCrystalPlasticityStress
    crystal_plasticity_models = 'twin_only_xtalpl'
    tan_mod_type = exact
    maximum_substep_iteration = 2
  []
  [twin_only_xtalpl]
    type = CrystalPlasticityTwinningKalidindiUpdate
    number_slip_systems = 12
    slip_sys_file_name = 'fcc_input_twinning_systems.txt'
    initial_twin_lattice_friction = 3.0
    non_coplanar_coefficient_twin_hardening = 8e5
    coplanar_coefficient_twin_hardening = 8e4
  []
[]
[Postprocessors]
  [fp_zz]
    type = ElementAverageValue
    variable = fp_zz
  []
  [total_twin_volume_fraction]
    type = ElementAverageValue
    variable = total_twin_volume_fraction
  []
  [twin_resistance_4]
    type = ElementAverageValue
    variable = twin_resistance_4
  []
  [twin_resistance_10]
    type = ElementAverageValue
    variable = twin_resistance_10
  []
  [twin_volume_fraction_0]
    type = ElementAverageValue
    variable = twin_volume_fraction_0
  []
  [twin_volume_fraction_1]
    type = ElementAverageValue
    variable = twin_volume_fraction_1
  []
  [twin_volume_fraction_2]
    type = ElementAverageValue
    variable = twin_volume_fraction_2
  []
  [twin_volume_fraction_3]
    type = ElementAverageValue
    variable = twin_volume_fraction_3
  []
  [twin_volume_fraction_4]
    type = ElementAverageValue
    variable = twin_volume_fraction_4
  []
  [twin_volume_fraction_5]
    type = ElementAverageValue
    variable = twin_volume_fraction_5
  []
  [twin_volume_fraction_6]
    type = ElementAverageValue
    variable = twin_volume_fraction_6
  []
  [twin_volume_fraction_7]
    type = ElementAverageValue
    variable = twin_volume_fraction_7
  []
  [twin_volume_fraction_8]
    type = ElementAverageValue
    variable = twin_volume_fraction_8
  []
  [twin_volume_fraction_9]
    type = ElementAverageValue
    variable = twin_volume_fraction_9
  []
  [twin_volume_fraction_10]
    type = ElementAverageValue
    variable = twin_volume_fraction_10
  []
  [twin_volume_fraction_11]
    type = ElementAverageValue
    variable = twin_volume_fraction_11
  []
  [twin_tau_4]
    type = ElementAverageValue
    variable = twin_tau_4
  []
  [twin_tau_10]
    type = ElementAverageValue
    variable = twin_tau_10
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
  petsc_options_value = ' asm      2              lu            gmres     200'
  nl_abs_tol = 1e-10
  nl_rel_tol = 1e-10
  nl_abs_step_tol = 1e-10
  dt = 0.025
  dtmin = 0.0125
  num_steps = 8
[]
[Outputs]
  csv = true
  perf_graph = true
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/stress_update_material_based/bicrystal_test.i)
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
  [copper]
    type = GeneratedMeshGenerator
    dim = 3
    elem_type = HEX8
  []
  [copper_id]
    type = SubdomainIDGenerator
    input = copper
    subdomain_id = 0
  []
  [brass]
    type = GeneratedMeshGenerator
    dim = 3
    zmax = 2
    zmin = 1
    elem_type = HEX8
  []
  [brass_id]
    type = SubdomainIDGenerator
    input = brass
    subdomain_id = 1
  []
  [sticher]
    type = StitchedMeshGenerator
    inputs = 'copper_id brass_id'
    stitch_boundaries_pairs = 'front back'
    prevent_boundary_ids_overlap = false
  []
[]
[AuxVariables]
  [pk2]
    order = CONSTANT
    family = MONOMIAL
  []
  [fp_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [e_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [copper_gss]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  []
  [copper_slip_increment]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  []
  [brass_gss]
    order = CONSTANT
    family = MONOMIAL
    block = 1
  []
  [brass_slip_increment]
    order = CONSTANT
    family = MONOMIAL
    block = 1
  []
[]
[Physics/SolidMechanics/QuasiStatic]
  [copper]
    strain = FINITE
    incremental = true
    add_variables = true
    generate_output = stress_zz
    block = 0
    base_name = copper
  []
  [brass]
    strain = FINITE
    incremental = true
    add_variables = true
    generate_output = stress_zz
    block = 1
    base_name = brass
  []
[]
[AuxKernels]
  [pk2]
    type = RankTwoAux
    variable = pk2
    rank_two_tensor = second_piola_kirchhoff_stress
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [fp_zz]
    type = RankTwoAux
    variable = fp_zz
    rank_two_tensor = plastic_deformation_gradient
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [e_zz]
    type = RankTwoAux
    variable = e_zz
    rank_two_tensor = total_lagrangian_strain
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [gss_copper]
    type = MaterialStdVectorAux
    variable = copper_gss
    property = copper_slip_resistance
    index = 0
    block = 0
    execute_on = timestep_end
  []
  [slip_inc_copper]
    type = MaterialStdVectorAux
    variable = copper_slip_increment
    property = copper_slip_increment
    index = 0
    block = 0
    execute_on = timestep_end
  []
  [gss_brass]
    type = MaterialStdVectorAux
    variable = brass_gss
    property = brass_slip_resistance
    index = 0
    block = 1
    execute_on = timestep_end
  []
  [slip_inc_brass]
    type = MaterialStdVectorAux
    variable = brass_slip_increment
    property = brass_slip_increment
    index = 0
    block = 1
    execute_on = timestep_end
  []
[]
[BCs]
  [symmy]
    type = DirichletBC
    variable = disp_y
    boundary = bottom
    value = 0
  []
  [symmx]
    type = DirichletBC
    variable = disp_x
    boundary = left
    value = 0
  []
  [symmz]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0
  []
  [tdisp]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = '0.01*t'
  []
[]
[Materials]
  [elasticity_tensor_copper]
    type = ComputeElasticityTensorCP
    C_ijkl = '1.684e5 1.214e5 1.214e5 1.684e5 1.214e5 1.684e5 0.754e5 0.754e5 0.754e5'
    fill_method = symmetric9
    base_name = copper
    block = 0
  []
  [stress_copper]
    type = ComputeMultipleCrystalPlasticityStress
    crystal_plasticity_models = 'trial_xtalpl_copper'
    tan_mod_type = exact
    base_name = copper
    block = 0
  []
  [trial_xtalpl_copper]
    type = CrystalPlasticityKalidindiUpdate
    number_slip_systems = 12
    slip_sys_file_name = input_slip_sys.txt
    base_name = copper
    block = 0
  []
  [elasticity_tensor_brass]
    type = ComputeElasticityTensorCP
    C_ijkl = '1.684e5 1.214e5 1.214e5 1.684e5 1.214e5 1.684e5 0.754e5 0.754e5 0.754e5'
    fill_method = symmetric9
    euler_angle_1 = 0.0
    euler_angle_2 = 45.0
    euler_angle_3 = 0.9
    base_name = brass
    block = 1
  []
  [stress_brass]
    type = ComputeMultipleCrystalPlasticityStress
    crystal_plasticity_models = 'trial_xtalpl_brass'
    tan_mod_type = exact
    base_name = brass
    block = 1
  []
  [trial_xtalpl_brass]
    type = CrystalPlasticityKalidindiUpdate
    number_slip_systems = 12
    slip_sys_file_name = input_slip_sys.txt
    base_name = brass
    block = 1
  []
[]
[Postprocessors]
  [copper_stress_zz]
    type = ElementAverageValue
    variable = copper_stress_zz
    block = 0
  []
  [brass_stress_zz]
    type = ElementAverageValue
    variable = brass_stress_zz
    block = 1
  []
  [pk2]
    type = ElementAverageValue
    variable = pk2
  []
  [fp_zz]
    type = ElementAverageValue
    variable = fp_zz
  []
  [e_zz]
    type = ElementAverageValue
    variable = e_zz
  []
  [copper_gss]
    type = ElementAverageValue
    variable = copper_gss
    block = 0
  []
  [copper_slip_increment]
    type = ElementAverageValue
    variable = copper_slip_increment
    block = 0
  []
  [brass_gss]
    type = ElementAverageValue
    variable = brass_gss
    block = 1
  []
  [brass_slip_increment]
    type = ElementAverageValue
    variable = brass_slip_increment
    block = 1
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
  petsc_options_value = ' asm      2              lu            gmres     200'
  nl_abs_tol = 1e-10
  nl_rel_tol = 1e-10
  nl_abs_step_tol = 1e-10
  dt = 0.05
  dtmin = 0.01
  dtmax = 10.0
  num_steps = 10
[]
[Outputs]
  csv = true
  perf_graph = true
[]
(modules/solid_mechanics/test/tests/multi/three_surface09.i)
# Plasticit models:
# SimpleTester0 with a = 0 and b = 1 and strength = 1
# SimpleTester1 with a = 1 and b = 0 and strength = 1
# SimpleTester2 with a = 1 and b = 1 and strength = 1.5
#
# Lame lambda = 0 (Poisson=0).  Lame mu = 0.5E6
#
# A single element is stretched by 2.0E-6m in y direction and 0.0E-6 in z direction.
# trial stress_yy = 2.0 and stress_zz = 0.0
#
# Then SimpleTester1 and SimpleTester2 should activate and the algorithm will return to
# the corner stress_yy=1.0, stress_zz=0.5
# However, this will mean that internal2<0, so SimpleTester2 will be deactivated
# and the algorithm will return to stress_yy=1
# internal1 should be 1.0, and internal2 should be 0
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '2.0E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '0.0E-6*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int2]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./int0]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 0
    variable = int0
  [../]
  [./int1]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 1
    variable = int1
  [../]
  [./int2]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 2
    variable = int2
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./f2]
    type = PointValue
    point = '0 0 0'
    variable = f2
  [../]
  [./int0]
    type = PointValue
    point = '0 0 0'
    variable = int0
  [../]
  [./int1]
    type = PointValue
    point = '0 0 0'
    variable = int1
  [../]
  [./int2]
    type = PointValue
    point = '0 0 0'
    variable = int2
  [../]
[]
[UserObjects]
  [./simple0]
    type = SolidMechanicsPlasticSimpleTester
    a = 0
    b = 1
    strength = 1
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
  [./simple1]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 0
    strength = 1
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
  [./simple2]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 1
    strength = 1.5
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 0.5E6'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./multi]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = 'simple0 simple1 simple2'
    max_NR_iterations = 2
    min_stepsize = 1
    debug_fspb = crash
    debug_jac_at_stress = '10 0 0 0 10 0 0 0 10'
    debug_jac_at_pm = '1 1'
    debug_jac_at_intnl = '1 1'
    debug_stress_change = 1E-5
    debug_pm_change = '1E-6 1E-6'
    debug_intnl_change = '1E-6 1E-6'
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = three_surface09
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/capped_weak_plane/small_deform_cosserat2.i)
# Plastic deformation.  Layered Cosserat with parameters:
# Young = 1.0
# Poisson = 0.2
# layer_thickness = 0.1
# joint_normal_stiffness = 0.25
# joint_shear_stiffness = 0.2
# These give the following nonzero components of the elasticity tensor:
# E_0000 = E_1111 = 1.043195
# E_0011 = E_1100 = 0.260799
# E_2222 = 0.02445
# E_0022 = E_1122 = E_2200 = E_2211 = 0.006112
# G = E_0101 = E_0110 = E_1001 = E_1010 = 0.416667
# Gt = E_0202 = E_0220 = E_2002 = E_1212 = E_1221 = E_2112 = 0.019084
# E_2020 = E_2121 = 0.217875
# They give the following nonzero components of the bending rigidity tensor:
# D = 8.68056E-5
# B_0101 = B_1010 = 7.92021E-4
# B_0110 = B_1001 = -1.584E-4
#
# Applying the following deformation to the zmax surface of a unit cube:
# disp_x = 8*t
# disp_y = 6*t
# disp_z = -t
# omega_x = omega_y = omega_z = 0
# yields the following strains:
# strain_xz = 8*t
# strain_yz = 6*t
# strain_zz = -t
# and all other components, and the curvature, are zero.
# The nonzero components of stress are therefore:
# stress_xx = stress_yy = -0.006112*t
# stress_xz = stress_zx = 0.152671*t
# stress_yz = stress_zy = 0.114504*t
# stress_zz = -0.0244499*t
# The moment stress is zero.
# So q = 0.19084*t and p = -0.0244*t.
#
# With large cohesion, but compressive strength = 0.0244499, the
# system is elastic up to t=1.  After that time
# stress_zz = -0.0244499 (for t>=1)
# and
# stress_xx = stress_yy = -0.006112 (for t>=1), since the
# elastic trial increment is exactly canelled by the Poisson's
# contribution from the return to the yield surface.
# The plastic strains are zero for t<=1, but for larger times:
# plastic_strain_zz = - (t - 1)  (for t>=1)
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
  Cosserat_rotations = 'wc_x wc_y wc_z'
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
  [./wc_x]
  [../]
  [./wc_y]
  [../]
[]
[Kernels]
  [./cx_elastic]
    type = CosseratStressDivergenceTensors
    variable = disp_x
    component = 0
  [../]
  [./cy_elastic]
    type = CosseratStressDivergenceTensors
    variable = disp_y
    component = 1
  [../]
  [./cz_elastic]
    type = CosseratStressDivergenceTensors
    variable = disp_z
    component = 2
  [../]
  [./x_couple]
    type = StressDivergenceTensors
    variable = wc_x
    displacements = 'wc_x wc_y wc_z'
    component = 0
    base_name = couple
  [../]
  [./y_couple]
    type = StressDivergenceTensors
    variable = wc_y
    displacements = 'wc_x wc_y wc_z'
    component = 1
    base_name = couple
  [../]
  [./x_moment]
    type = MomentBalancing
    variable = wc_x
    component = 0
  [../]
  [./y_moment]
    type = MomentBalancing
    variable = wc_y
    component = 1
  [../]
[]
[BCs]
  [./bottomx]
    type = DirichletBC
    variable = disp_x
    boundary = back
    value = 0.0
  [../]
  [./bottomy]
    type = DirichletBC
    variable = disp_y
    boundary = back
    value = 0.0
  [../]
  [./bottomz]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0.0
  [../]
  [./topx]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = front
    function = 8*t
  [../]
  [./topy]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = front
    function = 6*t
  [../]
  [./topz]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = -t
  [../]
[]
[AuxVariables]
  [./wc_z]
  [../]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./couple_stress_xx]
    family = MONOMIAL
    order = CONSTANT
  [../]
  [./couple_stress_xy]
    family = MONOMIAL
    order = CONSTANT
  [../]
  [./couple_stress_xz]
    family = MONOMIAL
    order = CONSTANT
  [../]
  [./couple_stress_yx]
    family = MONOMIAL
    order = CONSTANT
  [../]
  [./couple_stress_yy]
    family = MONOMIAL
    order = CONSTANT
  [../]
  [./couple_stress_yz]
    family = MONOMIAL
    order = CONSTANT
  [../]
  [./couple_stress_zx]
    family = MONOMIAL
    order = CONSTANT
  [../]
  [./couple_stress_zy]
    family = MONOMIAL
    order = CONSTANT
  [../]
  [./couple_stress_zz]
    family = MONOMIAL
    order = CONSTANT
  [../]
  [./strainp_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_yx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_zx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_zy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_yx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_zx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_zy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_compressive]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./ls]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yx
    index_i = 1
    index_j = 0
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zx
    index_i = 2
    index_j = 0
  [../]
  [./stress_zy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zy
    index_i = 2
    index_j = 1
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./couple_stress_xx]
    type = RankTwoAux
    rank_two_tensor = couple_stress
    variable = couple_stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./couple_stress_xy]
    type = RankTwoAux
    rank_two_tensor = couple_stress
    variable = couple_stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./couple_stress_xz]
    type = RankTwoAux
    rank_two_tensor = couple_stress
    variable = couple_stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./couple_stress_yx]
    type = RankTwoAux
    rank_two_tensor = couple_stress
    variable = couple_stress_yx
    index_i = 1
    index_j = 0
  [../]
  [./couple_stress_yy]
    type = RankTwoAux
    rank_two_tensor = couple_stress
    variable = couple_stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./couple_stress_yz]
    type = RankTwoAux
    rank_two_tensor = couple_stress
    variable = couple_stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./couple_stress_zx]
    type = RankTwoAux
    rank_two_tensor = couple_stress
    variable = couple_stress_zx
    index_i = 2
    index_j = 0
  [../]
  [./couple_stress_zy]
    type = RankTwoAux
    rank_two_tensor = couple_stress
    variable = couple_stress_zy
    index_i = 2
    index_j = 1
  [../]
  [./couple_stress_zz]
    type = RankTwoAux
    rank_two_tensor = couple_stress
    variable = couple_stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./strainp_xx]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_xx
    index_i = 0
    index_j = 0
  [../]
  [./strainp_xy]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_xy
    index_i = 0
    index_j = 1
  [../]
  [./strainp_xz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_xz
    index_i = 0
    index_j = 2
  [../]
  [./strainp_yx]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_yx
    index_i = 1
    index_j = 0
  [../]
  [./strainp_yy]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_yy
    index_i = 1
    index_j = 1
  [../]
  [./strainp_yz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_yz
    index_i = 1
    index_j = 2
  [../]
  [./strainp_zx]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_zx
    index_i = 2
    index_j = 0
  [../]
  [./strainp_zy]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_zy
    index_i = 2
    index_j = 1
  [../]
  [./strainp_zz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_zz
    index_i = 2
    index_j = 2
  [../]
  [./straint_xx]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_xx
    index_i = 0
    index_j = 0
  [../]
  [./straint_xy]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_xy
    index_i = 0
    index_j = 1
  [../]
  [./straint_xz]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_xz
    index_i = 0
    index_j = 2
  [../]
  [./straint_yx]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_yx
    index_i = 1
    index_j = 0
  [../]
  [./straint_yy]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_yy
    index_i = 1
    index_j = 1
  [../]
  [./straint_yz]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_yz
    index_i = 1
    index_j = 2
  [../]
  [./straint_zx]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_zx
    index_i = 2
    index_j = 0
  [../]
  [./straint_zy]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_zy
    index_i = 2
    index_j = 1
  [../]
  [./straint_zz]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_zz
    index_i = 2
    index_j = 2
  [../]
  [./f_shear]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f_shear
  [../]
  [./f_tensile]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f_tensile
  [../]
  [./f_compressive]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f_compressive
  [../]
  [./intnl_shear]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl_shear
  [../]
  [./intnl_tensile]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 1
    variable = intnl_tensile
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./ls]
    type = MaterialRealAux
    property = plastic_linesearch_needed
    variable = ls
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yx]
    type = PointValue
    point = '0 0 0'
    variable = stress_yx
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zx]
    type = PointValue
    point = '0 0 0'
    variable = stress_zx
  [../]
  [./s_zy]
    type = PointValue
    point = '0 0 0'
    variable = stress_zy
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./c_s_xx]
    type = PointValue
    point = '0 0 0'
    variable = couple_stress_xx
  [../]
  [./c_s_xy]
    type = PointValue
    point = '0 0 0'
    variable = couple_stress_xy
  [../]
  [./c_s_xz]
    type = PointValue
    point = '0 0 0'
    variable = couple_stress_xz
  [../]
  [./c_s_yx]
    type = PointValue
    point = '0 0 0'
    variable = couple_stress_yx
  [../]
  [./c_s_yy]
    type = PointValue
    point = '0 0 0'
    variable = couple_stress_yy
  [../]
  [./c_s_yz]
    type = PointValue
    point = '0 0 0'
    variable = couple_stress_yz
  [../]
  [./c_s_zx]
    type = PointValue
    point = '0 0 0'
    variable = couple_stress_zx
  [../]
  [./c_s_zy]
    type = PointValue
    point = '0 0 0'
    variable = couple_stress_zy
  [../]
  [./c_s_zz]
    type = PointValue
    point = '0 0 0'
    variable = couple_stress_zz
  [../]
  [./strainp_xx]
    type = PointValue
    point = '0 0 0'
    variable = strainp_xx
  [../]
  [./strainp_xy]
    type = PointValue
    point = '0 0 0'
    variable = strainp_xy
  [../]
  [./strainp_xz]
    type = PointValue
    point = '0 0 0'
    variable = strainp_xz
  [../]
  [./strainp_yx]
    type = PointValue
    point = '0 0 0'
    variable = strainp_yx
  [../]
  [./strainp_yy]
    type = PointValue
    point = '0 0 0'
    variable = strainp_yy
  [../]
  [./strainp_yz]
    type = PointValue
    point = '0 0 0'
    variable = strainp_yz
  [../]
  [./strainp_zx]
    type = PointValue
    point = '0 0 0'
    variable = strainp_zx
  [../]
  [./strainp_zy]
    type = PointValue
    point = '0 0 0'
    variable = strainp_zy
  [../]
  [./strainp_zz]
    type = PointValue
    point = '0 0 0'
    variable = strainp_zz
  [../]
  [./straint_xx]
    type = PointValue
    point = '0 0 0'
    variable = straint_xx
  [../]
  [./straint_xy]
    type = PointValue
    point = '0 0 0'
    variable = straint_xy
  [../]
  [./straint_xz]
    type = PointValue
    point = '0 0 0'
    variable = straint_xz
  [../]
  [./straint_yx]
    type = PointValue
    point = '0 0 0'
    variable = straint_yx
  [../]
  [./straint_yy]
    type = PointValue
    point = '0 0 0'
    variable = straint_yy
  [../]
  [./straint_yz]
    type = PointValue
    point = '0 0 0'
    variable = straint_yz
  [../]
  [./straint_zx]
    type = PointValue
    point = '0 0 0'
    variable = straint_zx
  [../]
  [./straint_zy]
    type = PointValue
    point = '0 0 0'
    variable = straint_zy
  [../]
  [./straint_zz]
    type = PointValue
    point = '0 0 0'
    variable = straint_zz
  [../]
  [./f_shear]
    type = PointValue
    point = '0 0 0'
    variable = f_shear
  [../]
  [./f_tensile]
    type = PointValue
    point = '0 0 0'
    variable = f_tensile
  [../]
  [./f_compressive]
    type = PointValue
    point = '0 0 0'
    variable = f_compressive
  [../]
  [./intnl_shear]
    type = PointValue
    point = '0 0 0'
    variable = intnl_shear
  [../]
  [./intnl_tensile]
    type = PointValue
    point = '0 0 0'
    variable = intnl_tensile
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
  [./ls]
    type = PointValue
    point = '0 0 0'
    variable = ls
  [../]
[]
[UserObjects]
  [./coh]
    type = SolidMechanicsHardeningConstant
    value = 30
  [../]
  [./tanphi]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
  [./tanpsi]
    type = SolidMechanicsHardeningConstant
    value = 0.1111077
  [../]
  [./t_strength]
    type = SolidMechanicsHardeningConstant
    value = 40
  [../]
  [./c_strength]
    type = SolidMechanicsHardeningConstant
    value = 0.024449878
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeLayeredCosseratElasticityTensor
    young = 1.0
    poisson = 0.2
    layer_thickness = 0.1
    joint_normal_stiffness = 0.25
    joint_shear_stiffness = 0.2
  [../]
  [./strain]
    type = ComputeCosseratIncrementalSmallStrain
  [../]
  [./admissible]
    type = ComputeMultipleInelasticCosseratStress
    inelastic_models = stress
    perform_finite_strain_rotations = false
  [../]
  [./stress]
    type = CappedWeakPlaneCosseratStressUpdate
    cohesion = coh
    tan_friction_angle = tanphi
    tan_dilation_angle = tanpsi
    tensile_strength = t_strength
    compressive_strength = c_strength
    tip_smoother = 0
    smoothing_tol = 1
    yield_function_tol = 1E-5
  [../]
[]
[Executioner]
  nl_abs_tol = 1E-14
  end_time = 3
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform_cosserat2
  csv = true
[]
(modules/solid_mechanics/test/tests/weak_plane_shear/except1.i)
# checking for exception error messages
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
  type = GeneratedMesh
  dim = 3
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  add_variables = true
  generate_output = 'stress_xz stress_zx stress_yz stress_zz'
[]
[BCs]
  [bottomx]
    type = DirichletBC
    variable = x_disp
    boundary = back
    value = 0.0
  []
  [bottomy]
    type = DirichletBC
    variable = y_disp
    boundary = back
    value = 0.0
  []
  [bottomz]
    type = DirichletBC
    variable = z_disp
    boundary = back
    value = 0.0
  []
  [topx]
    type = DirichletBC
    variable = x_disp
    boundary = front
    value = 8E-6
  []
  [topy]
    type = DirichletBC
    variable = y_disp
    boundary = front
    value = 6E-6
  []
  [topz]
    type = DirichletBC
    variable = z_disp
    boundary = front
    value = 1E-6
  []
[]
[AuxVariables]
  [yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[AuxKernels]
  [yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  []
[]
[Postprocessors]
  [s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  []
  [s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  []
  [s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  []
  [f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  []
[]
[UserObjects]
  [coh]
    type = SolidMechanicsHardeningConstant
    value = 1
  []
  [tanphi]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  []
  [tanpsi]
    type = SolidMechanicsHardeningConstant
    value = 0.55
  []
  [wps]
    type = SolidMechanicsPlasticWeakPlaneShear
    cohesion = coh
    tan_friction_angle = tanphi
    tan_dilation_angle = tanpsi
    smoother = 0
    yield_function_tolerance = 1E-3
    internal_constraint_tolerance = 1E-3
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E6'
  []
  [mc]
    type = ComputeMultiPlasticityStress
    plastic_models = wps
    transverse_direction = '0 0 1'
    ep_plastic_tolerance = 1E-3
  []
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
(modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform_hard22.i)
# Mohr-Coulomb only
# apply stretches in x direction and smaller stretches in the y direction
# to observe return to the MC plane
# This tests uses hardening of the friction and dilation angles.  The returned configuration
# should obey
# 0 = 0.5 * (Smax - Smin) + 0.5 * (Smax + Smin) * sin(phi) - C cos(phi)
# which allows inference of phi.
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'max_principal_stress mid_principal_stress min_principal_stress'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0.4E-6*x*t'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0.17E-6*y*t'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '0'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 6
    property = plastic_yield_function
    variable = yield_fcn
  [../]
  [./iter_auxk]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./intnl_auxk]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl
  [../]
  [./intnl_tensile]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 1
    variable = intnl_tensile
  [../]
[]
[Postprocessors]
  [./s_max]
    type = PointValue
    point = '0 0 0'
    variable = max_principal_stress
  [../]
  [./s_mid]
    type = PointValue
    point = '0 0 0'
    variable = mid_principal_stress
  [../]
  [./s_min]
    type = PointValue
    point = '0 0 0'
    variable = min_principal_stress
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
  [./intnl]
    type = PointValue
    point = '0 0 0'
    variable = intnl
  [../]
  [./intnl_tensile]
    type = PointValue
    point = '0 0 0'
    variable = intnl_tensile
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 10
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningCubic
    value_residual = 0.524 # 30deg
    value_0 = 0.174 # 10deg
    internal_limit = 4E-6
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 1E7
    poissons_ratio = 0.0
  [../]
  [./mc]
    type = CappedMohrCoulombStressUpdate
    tensile_strength = ts
    compressive_strength = ts
    cohesion = mc_coh
    friction_angle = mc_phi
    dilation_angle = mc_phi
    smoothing_tol = 0
    yield_function_tol = 1.0E-9
  [../]
  [./stress]
    type = ComputeMultipleInelasticStress
    inelastic_models = mc
    perform_finite_strain_rotations = false
  [../]
[]
[Executioner]
  end_time = 9
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform_hard22
  csv = true
[]
(modules/solid_mechanics/test/tests/mohr_coulomb/random.i)
# apply many random large deformations, checking that the algorithm returns correctly to
# the yield surface each time.
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1000
  ny = 125
  nz = 1
  xmin = 0
  xmax = 1000
  ymin = 0
  ymax = 125
  zmin = 0
  zmax = 1
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[ICs]
  [./x]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_x
  [../]
  [./y]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_y
  [../]
  [./z]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_z
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '0'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
[]
[Postprocessors]
  [./yield_fcn_at_zero]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
    outputs = 'console'
  [../]
  [./should_be_zero]
    type = FunctionValuePostprocessor
    function = should_be_zero_fcn
  [../]
  [./av_iter]
    type = ElementAverageValue
    variable = iter
    outputs = 'console'
  [../]
[]
[Functions]
  [./should_be_zero_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-3,0,a)'
    symbol_names = 'a'
    symbol_values = 'yield_fcn_at_zero'
  [../]
[]
[UserObjects]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 1E3
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 30
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 5
    convert_to_radians = true
  [../]
  [./mc]
    type = SolidMechanicsPlasticMohrCoulomb
    cohesion = mc_coh
    friction_angle = mc_phi
    dilation_angle = mc_psi
    mc_tip_smoother = 0.1E3
    mc_edge_smoother = 25
    yield_function_tolerance = 1E-3
    internal_constraint_tolerance = 1E-6
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0.7E7 1E7'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    max_NR_iterations = 1000
    ep_plastic_tolerance = 1E-6
    min_stepsize = 1E-3
    plastic_models = mc
    debug_fspb = crash
    deactivation_scheme = safe
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = random
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/monolithic_material_based/crysp_linesearch.i)
[Mesh]
  type = GeneratedMesh
  dim = 3
  elem_type = HEX8
  displacements = 'ux uy uz'
[]
[Variables]
  [./ux]
    block = 0
  [../]
  [./uy]
    block = 0
  [../]
  [./uz]
    block = 0
  [../]
[]
[AuxVariables]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
  [./fp_zz]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
  [./e_zz]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
  [./gss1]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
[]
[Functions]
  [./tdisp]
    type = ParsedFunction
    expression = 0.01*t
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'ux uy uz'
    use_displaced_mesh = true
  [../]
[]
[AuxKernels]
  [./stress_zz]
    type = RankTwoAux
    variable = stress_zz
    rank_two_tensor = stress
    index_j = 2
    index_i = 2
    execute_on = timestep_end
    block = 0
  [../]
  [./fp_zz]
    type = RankTwoAux
    variable = fp_zz
    rank_two_tensor = fp
    index_j = 2
    index_i = 2
    execute_on = timestep_end
    block = 0
  [../]
  [./e_zz]
    type = RankTwoAux
    variable = e_zz
    rank_two_tensor = lage
    index_j = 2
    index_i = 2
    execute_on = timestep_end
    block = 0
  [../]
  [./gss1]
    type = MaterialStdVectorAux
    variable = gss1
    property = gss
    index = 0
    execute_on = timestep_end
    block = 0
  [../]
[]
[BCs]
  [./symmy]
    type = DirichletBC
    variable = uy
    boundary = bottom
    value = 0
  [../]
  [./symmx]
    type = DirichletBC
    variable = ux
    boundary = left
    value = 0
  [../]
  [./symmz]
    type = DirichletBC
    variable = uz
    boundary = back
    value = 0
  [../]
  [./tdisp]
    type = FunctionDirichletBC
    variable = uz
    boundary = front
    function = tdisp
  [../]
[]
[Materials]
  [./crysp]
    type = FiniteStrainCrystalPlasticity
    block = 0
    rtol = 1e-6
    abs_tol = 1e-8
    gtol = 1e-2
    slip_sys_file_name = input_slip_sys.txt
    nss = 12
    num_slip_sys_flowrate_props = 2 #Number of properties in a slip system
    flowprops = '1 4 0.001 0.1 5 8 0.001 0.1 9 12 0.001 0.1'
    hprops = '1.0 541.5 60.8 109.8 2.5'
    gprops = '1 4 60.8 5 8 60.8 9 12 60.8'
    tan_mod_type = exact
    use_line_search = true
    min_line_search_step_size = 0.01
  [../]
  [./elasticity_tensor]
    type = ComputeElasticityTensorCP
    block = 0
    C_ijkl = '1.684e5 1.214e5 1.214e5 1.684e5 1.214e5 1.684e5 0.754e5 0.754e5 0.754e5'
    fill_method = symmetric9
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'ux uy uz'
  [../]
[]
[Postprocessors]
  [./stress_zz]
    type = ElementAverageValue
    variable = stress_zz
    block = 'ANY_BLOCK_ID 0'
  [../]
  [./fp_zz]
    type = ElementAverageValue
    variable = fp_zz
    block = 'ANY_BLOCK_ID 0'
  [../]
  [./e_zz]
    type = ElementAverageValue
    variable = e_zz
    block = 'ANY_BLOCK_ID 0'
  [../]
  [./gss1]
    type = ElementAverageValue
    variable = gss1
    block = 'ANY_BLOCK_ID 0'
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  #Preconditioned JFNK (default)
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  nl_rel_tol = 1e-10
  nl_abs_tol = 1e-10
  dt = 0.025
  dtmax = 10.0
  dtmin = 0.02
  num_steps = 10
[]
[Outputs]
  file_base = crysp_lsearch_out
  exodus = true
[]
(modules/solid_mechanics/test/tests/mohr_coulomb/uni_axial2_planar.i)
# same as uni_axial2 but with planar mohr-coulomb
[Mesh]
  type = FileMesh
  file = quarter_hole.e
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./zmin_zzero]
    type = DirichletBC
    variable = disp_z
    boundary = 'zmin'
    value = '0'
  [../]
  [./xmin_xzero]
    type = DirichletBC
    variable = disp_x
    boundary = 'xmin'
    value = '0'
  [../]
  [./ymin_yzero]
    type = DirichletBC
    variable = disp_y
    boundary = 'ymin'
    value = '0'
  [../]
  [./ymax_disp]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'ymax'
    function = '-1E-4*t'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_int]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./mc_int_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = mc_int
  [../]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0.005 0.02 0.002'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0.005 0.02 0.002'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0.005 0.02 0.002'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0.005 0.02 0.002'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0.005 0.02 0.002'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0.005 0.02 0.002'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0.005 0.02 0.002'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./coh]
    type = SolidMechanicsHardeningConstant
    value = 1E7
  [../]
  [./fric]
    type = SolidMechanicsHardeningConstant
    value = 2
    convert_to_radians = true
  [../]
  [./dil]
    type = SolidMechanicsHardeningConstant
    value = 2
    convert_to_radians = true
  [../]
  [./mc]
    type = SolidMechanicsPlasticMohrCoulombMulti
    cohesion = coh
    friction_angle = fric
    dilation_angle = dil
    yield_function_tolerance = 1.0 # THIS IS HIGHER THAN THE SMOOTH CASE TO AVOID PRECISION-LOSS PROBLEMS!
    shift = 1.0
    internal_constraint_tolerance = 1E-9
    use_custom_returnMap = false
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 1
    fill_method = symmetric_isotropic
    C_ijkl = '0 5E9' # young = 10Gpa, poisson = 0.0
  [../]
  [./strain]
    type = ComputeIncrementalStrain
    block = 1
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 1
    ep_plastic_tolerance = 1E-9
    plastic_models = mc
    max_NR_iterations = 100
    deactivation_scheme = 'safe'
    min_stepsize = 1
    max_stepsize_for_dumb = 1
    debug_fspb = crash
  [../]
[]
# Preconditioning and Executioner options kindly provided by Andrea
[Preconditioning]
  [./andy]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  end_time = 0.5
  dt = 0.1
  solve_type = NEWTON
  type = Transient
[]
[Outputs]
  file_base = uni_axial2_planar
  [./exodus]
    type = Exodus
    hide = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz yield_fcn s_xx s_xy s_xz s_yy s_yz s_zz f'
  [../]
  [./csv]
    type = CSV
    time_step_interval = 1
  [../]
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/monolithic_material_based/crysp_save_euler.i)
[Mesh]
  type = GeneratedMesh
  dim = 2
  elem_type = QUAD4
  displacements = 'disp_x disp_y'
  nx = 2
  ny = 2
[]
[Variables]
  [./disp_x]
    block = 0
  [../]
  [./disp_y]
    block = 0
  [../]
[]
[GlobalParams]
  volumetric_locking_correction = true
[]
[AuxVariables]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
  [./e_yy]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
  [./fp_yy]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
  [./rotout]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
  [./gss1]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
  [./euler1]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
  [./euler2]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
  [./euler3]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
[]
[Functions]
  [./tdisp]
    type = ParsedFunction
    expression = 0.01*t
  [../]
[]
[UserObjects]
  [./prop_read]
    type = PropertyReadFile
    prop_file_name = 'euler_ang_file.txt'
    # Enter file data as prop#1, prop#2, .., prop#nprop
    nprop = 3
    read_type = element
  [../]
[]
[AuxKernels]
  [./stress_yy]
    type = RankTwoAux
    variable = stress_yy
    rank_two_tensor = stress
    index_j = 1
    index_i = 1
    execute_on = timestep_end
    block = 0
  [../]
  [./e_yy]
    type = RankTwoAux
    variable = e_yy
    rank_two_tensor = lage
    index_j = 1
    index_i = 1
    execute_on = timestep_end
    block = 0
  [../]
  [./fp_yy]
    type = RankTwoAux
    variable = fp_yy
    rank_two_tensor = fp
    index_j = 1
    index_i = 1
    execute_on = timestep_end
    block = 0
  [../]
  [./gss1]
    type = MaterialStdVectorAux
    variable = gss1
    property = gss
    index = 0
    execute_on = timestep_end
    block = 0
  [../]
  [./euler1]
    type = MaterialRealVectorValueAux
    variable = euler1
    property = Euler_angles
    component = 0
    execute_on = timestep_end
    block = 0
  [../]
  [./euler2]
    type = MaterialRealVectorValueAux
    variable = euler2
    property = Euler_angles
    component = 1
    execute_on = timestep_end
    block = 0
  [../]
  [./euler3]
    type = MaterialRealVectorValueAux
    variable = euler3
    property = Euler_angles
    component = 2
    execute_on = timestep_end
    block = 0
  [../]
[]
[BCs]
  [./fix_x]
    type = DirichletBC
    variable = disp_x
    boundary = 'left'
    value = 0
  [../]
  [./fix_y]
    type = DirichletBC
    variable = disp_y
    boundary = 'bottom'
    value = 0
  [../]
  [./tdisp]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = top
    function = tdisp
  [../]
[]
[Materials]
  [./crysp]
    type = FiniteStrainCrystalPlasticity
    block = 0
    gtol = 1e-2
    slip_sys_file_name = input_slip_sys.txt
    nss = 12
    num_slip_sys_flowrate_props = 2 #Number of properties in a slip system
    flowprops = '1 4 0.001 0.1 5 8 0.001 0.1 9 12 0.001 0.1'
    hprops = '1.0 541.5 60.8 109.8 2.5'
    gprops = '1 4 60.8 5 8 60.8 9 12 60.8'
    tan_mod_type = exact
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y'
  [../]
  [./elasticity_tensor]
    type = ComputeElasticityTensorCP
    block = 0
    C_ijkl = '1.684e5 1.214e5 1.214e5 1.684e5 1.214e5 1.684e5 0.754e5 0.754e5 0.754e5'
    fill_method = symmetric9
    read_prop_user_object = prop_read
  [../]
[]
[Postprocessors]
  [./stress_yy]
    type = ElementAverageValue
    variable = stress_yy
    block = 'ANY_BLOCK_ID 0'
  [../]
  [./e_yy]
    type = ElementAverageValue
    variable = e_yy
    block = 'ANY_BLOCK_ID 0'
  [../]
  [./fp_yy]
    type = ElementAverageValue
    variable = fp_yy
    block = 'ANY_BLOCK_ID 0'
  [../]
  [./gss1]
    type = ElementAverageValue
    variable = gss1
    block = 'ANY_BLOCK_ID 0'
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  #Preconditioned JFNK (default)
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  nl_rel_tol = 1e-10
  nl_abs_tol = 1e-10
  dt = 0.01
  dtmax = 10.0
  dtmin = 0.01
  num_steps = 10
[]
[Outputs]
  file_base = crysp_save_euler_out
  exodus = true
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y'
    use_displaced_mesh = true
  [../]
[]
(modules/solid_mechanics/test/tests/multi/four_surface24.i)
# Plasticit models:
# SimpleTester0 with a = 0 and b = 1 and strength = 1
# SimpleTester1 with a = 1 and b = 0 and strength = 1
# SimpleTester2 with a = 1 and b = 2 and strength = 3.1
# SimpleTester3 with a = 2 and b = 1 and strength = 3.1
#
# Lame lambda = 0 (Poisson=0).  Lame mu = 0.5E6
#
# A single element is stretched by 2.1E-6m in y direction and 3E-6 in z direction.
# trial stress_yy = 2.1 and stress_zz = 3.0
#
# This is similar to four_surface14.i, and a description is found there.
# The result should be stress_zz=1=stress_yy, with internal0=2
# and internal1=1.1
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '2.1E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '3.0E-6*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f3]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int3]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./f3]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 3
    variable = f3
  [../]
  [./int0]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 0
    variable = int0
  [../]
  [./int1]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 1
    variable = int1
  [../]
  [./int2]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 2
    variable = int2
  [../]
  [./int3]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 3
    variable = int3
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./f2]
    type = PointValue
    point = '0 0 0'
    variable = f2
  [../]
  [./f3]
    type = PointValue
    point = '0 0 0'
    variable = f3
  [../]
  [./int0]
    type = PointValue
    point = '0 0 0'
    variable = int0
  [../]
  [./int1]
    type = PointValue
    point = '0 0 0'
    variable = int1
  [../]
  [./int2]
    type = PointValue
    point = '0 0 0'
    variable = int2
  [../]
  [./int3]
    type = PointValue
    point = '0 0 0'
    variable = int3
  [../]
[]
[UserObjects]
  [./simple0]
    type = SolidMechanicsPlasticSimpleTester
    a = 0
    b = 1
    strength = 1
    yield_function_tolerance = 1.0E-6
    internal_constraint_tolerance = 1.0E-6
  [../]
  [./simple1]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 0
    strength = 1
    yield_function_tolerance = 1.0E-6
    internal_constraint_tolerance = 1.0E-6
  [../]
  [./simple2]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 2
    strength = 3.1
    yield_function_tolerance = 1.0E-6
    internal_constraint_tolerance = 1.0E-6
  [../]
  [./simple3]
    type = SolidMechanicsPlasticSimpleTester
    a = 2
    b = 1
    strength = 3.1
    yield_function_tolerance = 1.0E-6
    internal_constraint_tolerance = 1.0E-6
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 0.5E6'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./multi]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = 'simple0 simple1 simple2 simple3'
    deactivation_scheme = 'optimized_to_safe'
    max_NR_iterations = 4
    min_stepsize = 1
    debug_fspb = crash
    debug_jac_at_stress = '10 0 0 0 10 0 0 0 10'
    debug_jac_at_pm = '1 1 1'
    debug_jac_at_intnl = '1 1 1'
    debug_stress_change = 1E-5
    debug_pm_change = '1E-6 1E-6 1E-6'
    debug_intnl_change = '1E-6 1E-6 1E-6'
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = four_surface24
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/multi/three_surface02.i)
# Plasticit models:
# SimpleTester0 with a = 0 and b = 1 and strength = 1
# SimpleTester1 with a = 1 and b = 0 and strength = 1
# SimpleTester2 with a = 1 and b = 1 and strength = 1.5
#
# Lame lambda = 0 (Poisson=0).  Lame mu = 0.5E6
#
# A single element is stretched by 0E-6m in y direction and 2.0E-6 in z direction.
# trial stress_yy = 0 and stress_zz = 2.0
#
# Then SimpleTester0 and SimpleTester2 should activate and the algorithm will return to
# the corner stress_yy=0.5, stress_zz=1, but this will require a negative plasticity
# multiplier for SimpleTester2, so it will be deactivated, and the algorithm will return to
# stress_yy = 0, stress_zz = 1
# internal0 should be 1.0, and others zero
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '2.0E-6*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int2]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./int0]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 0
    variable = int0
  [../]
  [./int1]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 1
    variable = int1
  [../]
  [./int2]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 2
    variable = int2
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./f2]
    type = PointValue
    point = '0 0 0'
    variable = f2
  [../]
  [./int0]
    type = PointValue
    point = '0 0 0'
    variable = int0
  [../]
  [./int1]
    type = PointValue
    point = '0 0 0'
    variable = int1
  [../]
  [./int2]
    type = PointValue
    point = '0 0 0'
    variable = int2
  [../]
[]
[UserObjects]
  [./simple0]
    type = SolidMechanicsPlasticSimpleTester
    a = 0
    b = 1
    strength = 1
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
  [./simple1]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 0
    strength = 1
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
  [./simple2]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 1
    strength = 1.5
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 0.5E6'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./multi]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = 'simple0 simple1 simple2'
    max_NR_iterations = 2
    min_stepsize = 1
    debug_fspb = crash
    debug_jac_at_stress = '10 0 0 0 10 0 0 0 10'
    debug_jac_at_pm = '1 1'
    debug_jac_at_intnl = '1 1'
    debug_stress_change = 1E-5
    debug_pm_change = '1E-6 1E-6'
    debug_intnl_change = '1E-6 1E-6'
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = three_surface02
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/weak_plane_shear/large_deform_harden3.i)
# apply a number of "random" configurations and
# check that the algorithm returns to the yield surface
#
# must be careful here - we cannot put in arbitrary values of C_ijkl, otherwise the condition
# df/dsigma * C * flow_dirn < 0 for some stresses
# The important features that must be obeyed are:
# 0 = C_0222 = C_1222  (holds for transversely isotropic, for instance)
# C_0212 < C_0202 = C_1212 (holds for transversely isotropic)
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
  type = GeneratedMesh
  dim = 3
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  add_variables = true
[]
[BCs]
  [bottomx]
    type = DirichletBC
    variable = disp_x
    boundary = back
    value = 0.0
  []
  [bottomy]
    type = DirichletBC
    variable = disp_y
    boundary = back
    value = 0.0
  []
  [bottomz]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0.0
  []
  # the following are "random" deformations
  # each is O(1E-5) to keep deformations small
  [topx]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = front
    function = '(sin(0.1*t)+x)/1E1'
  []
  [topy]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = front
    function = '(cos(t)+x*y)/1E1'
  []
  [topz]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = 'sin(0.4321*t)*x*y*z/1E1'
  []
[]
[AuxVariables]
  [wps_internal]
    order = CONSTANT
    family = MONOMIAL
  []
  [yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[AuxKernels]
  [wps_internal_auxk]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = wps_internal
  []
  [yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  []
[]
[Postprocessors]
  [int]
    type = PointValue
    point = '0 0 0'
    variable = wps_internal
    outputs = 'console'
  []
  [yield_fcn_at_zero]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
    outputs = 'console'
  []
  [should_be_zero]
    type = FunctionValuePostprocessor
    function = should_be_zero_fcn
  []
[]
[Functions]
  [should_be_zero_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-3,0,a)'
    symbol_names = 'a'
    symbol_values = 'yield_fcn_at_zero'
  []
[]
[UserObjects]
  [coh]
    type = SolidMechanicsHardeningExponential
    value_0 = 1E3
    value_residual = 0
    rate = 0.01
  []
  [tanphi]
    type = SolidMechanicsHardeningExponential
    value_0 = 1
    value_residual = 0.577350269
    rate = 0.01
  []
  [tanpsi]
    type = SolidMechanicsHardeningExponential
    value_0 = 0.08748866
    value_residual = 0.03492077
    rate = 0.01
  []
  [wps]
    type = SolidMechanicsPlasticWeakPlaneShear
    cohesion = coh
    tan_friction_angle = tanphi
    tan_dilation_angle = tanpsi
    smoother = 100
    yield_function_tolerance = 1E-3
    internal_constraint_tolerance = 1E-3
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensor
    # the following is transversely isotropic, i think.
    fill_method = symmetric9
    C_ijkl = '3E9 1E9 3E9 3E9 3E9 6E9 1E9 1E9 9E9'
  []
  [mc]
    type = ComputeMultiPlasticityStress
    plastic_models = wps
    transverse_direction = '0 0 1'
    max_NR_iterations = 1000
    ep_plastic_tolerance = 1E-3
    debug_fspb = crash
  []
[]
[Executioner]
  end_time = 1E4
  dt = 1
  type = Transient
[]
[Outputs]
  csv = true
[]
(modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform7.i)
# Using CappedMohrCoulomb with tensile failure only
# A single element is incrementally stretched in the in the z and x directions
# This causes the return direction to be along the hypersurface sigma_I = sigma_II
# and the resulting stresses are checked to lie on the expected yield surface
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    strain = finite
    incremental = true
    generate_output = 'max_principal_stress mid_principal_stress min_principal_stress stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '4*x*t'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '1*y*t'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '4*z*t'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_I]
    type = PointValue
    point = '0 0 0'
    variable = max_principal_stress
  [../]
  [./s_II]
    type = PointValue
    point = '0 0 0'
    variable = mid_principal_stress
  [../]
  [./s_III]
    type = PointValue
    point = '0 0 0'
    variable = min_principal_stress
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1
  [../]
  [./cs]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./coh]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./ang]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '0 2.0'
  [../]
  [./tensile]
    type = CappedMohrCoulombStressUpdate
    tensile_strength = ts
    compressive_strength = cs
    cohesion = coh
    friction_angle = ang
    dilation_angle = ang
    smoothing_tol = 0.5
    yield_function_tol = 1.0E-12
  [../]
  [./stress]
    type = ComputeMultipleInelasticStress
    inelastic_models = tensile
    perform_finite_strain_rotations = false
  [../]
[]
[Executioner]
  end_time = 1
  dt = 0.1
  type = Transient
[]
[Outputs]
  file_base = small_deform7
  csv = true
[]
(modules/solid_mechanics/test/tests/mohr_coulomb/small_deform3.i)
# apply repeated stretches in x z directions, and smaller stretches along the y direction,
# so that sigma_I = sigma_II,
# which means that lode angle = 30deg.
# The allows yield surface in meridional plane to be mapped out
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '1E-6*x*t'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0.25E-6*y*sin(t)'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1E-6*z*t'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_int]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./mc_int_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = mc_int
  [../]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./internal]
    type = PointValue
    point = '0 0 0'
    variable = mc_int
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 10
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 50
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningExponential
    value_0 = 0
    value_residual = 0.8726646 # 50deg
    rate = 3000.0
  [../]
  [./mc]
    type = SolidMechanicsPlasticMohrCoulomb
    cohesion = mc_coh
    friction_angle = mc_phi
    dilation_angle = mc_psi
    mc_tip_smoother = 4
    mc_edge_smoother = 20
    yield_function_tolerance = 1E-8
    internal_constraint_tolerance = 1E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = mc
    debug_fspb = crash
  [../]
[]
[Executioner]
  end_time = 30
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform3
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform15.i)
# Using CappedMohrCoulomb with compressive failure only
# A single element is incrementally compressed in the z and x directions
# This causes the return direction to be along the hypersurface sigma_I = 0
# and the resulting stresses are checked to lie on the expected yield surface
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'max_principal_stress mid_principal_stress min_principal_stress stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '-2*x*t'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '-0.5*z*(t+1.5*t*t)'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 3
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_I]
    type = PointValue
    point = '0 0 0'
    variable = max_principal_stress
  [../]
  [./s_II]
    type = PointValue
    point = '0 0 0'
    variable = mid_principal_stress
  [../]
  [./s_III]
    type = PointValue
    point = '0 0 0'
    variable = min_principal_stress
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./cs]
    type = SolidMechanicsHardeningConstant
    value = 1
  [../]
  [./coh]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./ang]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '0 2.0'
  [../]
  [./tensile]
    type = CappedMohrCoulombStressUpdate
    tensile_strength = ts
    compressive_strength = cs
    cohesion = coh
    friction_angle = ang
    dilation_angle = ang
    smoothing_tol = 0.5
    yield_function_tol = 1.0E-12
  [../]
  [./stress]
    type = ComputeMultipleInelasticStress
    inelastic_models = tensile
    perform_finite_strain_rotations = false
  [../]
[]
[Executioner]
  end_time = 1
  dt = 0.1
  type = Transient
[]
[Outputs]
  file_base = small_deform15
  csv = true
[]
(modules/solid_mechanics/test/tests/weak_plane_shear/large_deform4.i)
# apply a number of "random" configurations and
# check that the algorithm returns to the yield surface
# using the 'cap' tip_scheme
#
# must be careful here - we cannot put in arbitrary values of C_ijkl, otherwise the condition
# df/dsigma * C * flow_dirn < 0 for some stresses
# The important features that must be obeyed are:
# 0 = C_0222 = C_1222  (holds for transversely isotropic, for instance)
# C_0212 < C_0202 = C_1212 (holds for transversely isotropic)
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
  type = GeneratedMesh
  dim = 3
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  add_variables = true
[]
[BCs]
  [bottomx]
    type = DirichletBC
    variable = disp_x
    boundary = back
    value = 0.0
  []
  [bottomy]
    type = DirichletBC
    variable = disp_y
    boundary = back
    value = 0.0
  []
  [bottomz]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0.0
  []
  # the following are "random" deformations
  # each is O(1E-1) to provide large deformations
  [topx]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = front
    function = '(sin(0.1*t)+x)/1E1'
  []
  [topy]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = front
    function = '(cos(t)+x*y)/1E1'
  []
  [topz]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = 'sin(0.4321*t)*x*y*z/1E1'
  []
[]
[AuxVariables]
  [yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[AuxKernels]
  [yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  []
[]
[Postprocessors]
  [yield_fcn_at_zero]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
    outputs = 'console'
  []
  [should_be_zero]
    type = FunctionValuePostprocessor
    function = should_be_zero_fcn
  []
[]
[Functions]
  [should_be_zero_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-3,0,a)'
    symbol_names = 'a'
    symbol_values = 'yield_fcn_at_zero'
  []
[]
[UserObjects]
  [coh]
    type = SolidMechanicsHardeningConstant
    value = 1E3
  []
  [tanphi]
    type = SolidMechanicsHardeningConstant
    value = 0.577350269
  []
  [tanpsi]
    type = SolidMechanicsHardeningConstant
    value = 0.08748866
  []
  [wps]
    type = SolidMechanicsPlasticWeakPlaneShear
    cohesion = coh
    tan_friction_angle = tanphi
    tan_dilation_angle = tanpsi
    tip_scheme = cap
    smoother = 100
    cap_rate = 0.001
    cap_start = 0.0
    yield_function_tolerance = 1E-3
    internal_constraint_tolerance = 1E-3
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensor
    # the following is transversely isotropic, i think.
    fill_method = symmetric9
    C_ijkl = '3E9 1E9 3E9 3E9 3E9 6E9 1E9 1E9 9E9'
  []
  [mc]
    type = ComputeMultiPlasticityStress
    plastic_models = wps
    transverse_direction = '0 0 1'
    max_NR_iterations = 100
    ep_plastic_tolerance = 1E-3
    debug_fspb = crash
  []
[]
[Executioner]
  end_time = 1E4
  dt = 1
  type = Transient
[]
[Outputs]
  csv = true
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/twinning/coplanar_twin_hardening.i)
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
  [cube]
    type = GeneratedMeshGenerator
    dim = 3
    nx = 2
    ny = 2
    nz = 2
    elem_type = HEX8
  []
[]
[AuxVariables]
  [total_twin_volume_fraction]
    order = CONSTANT
    family = MONOMIAL
  []
  [twin_resistance_0]
    order = CONSTANT
    family = MONOMIAL
  []
  [twin_resistance_1]
    order = CONSTANT
    family = MONOMIAL
  []
  [twin_resistance_2]
    order = CONSTANT
    family = MONOMIAL
  []
  [twin_resistance_3]
    order = CONSTANT
    family = MONOMIAL
  []
  [twin_volume_fraction_0]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_1]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_2]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_3]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_tau_0]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_tau_1]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_tau_2]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_tau_3]
   order = CONSTANT
   family = MONOMIAL
  []
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  add_variables = true
  generate_output = stress_zz
[]
[AuxKernels]
  [total_twin_volume_fraction]
    type = MaterialRealAux
    variable = total_twin_volume_fraction
    property = total_volume_fraction_twins
    execute_on = timestep_end
  []
  [twin_resistance_0]
   type = MaterialStdVectorAux
   variable = twin_resistance_0
   property = slip_resistance
   index = 0
   execute_on = timestep_end
  []
  [twin_resistance_1]
   type = MaterialStdVectorAux
   variable = twin_resistance_1
   property = slip_resistance
   index = 1
   execute_on = timestep_end
  []
  [twin_resistance_2]
   type = MaterialStdVectorAux
   variable = twin_resistance_2
   property = slip_resistance
   index = 2
   execute_on = timestep_end
  []
  [twin_resistance_3]
   type = MaterialStdVectorAux
   variable = twin_resistance_3
   property = slip_resistance
   index = 3
   execute_on = timestep_end
  []
  [twin_volume_fraction_0]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_0
   property = twin_system_volume_fraction
   index = 0
   execute_on = timestep_end
  []
  [twin_volume_fraction_1]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_1
   property = twin_system_volume_fraction
   index = 1
   execute_on = timestep_end
  []
  [twin_volume_fraction_2]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_2
   property = twin_system_volume_fraction
   index = 2
   execute_on = timestep_end
  []
  [twin_volume_fraction_3]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_3
   property = twin_system_volume_fraction
   index = 3
   execute_on = timestep_end
  []
  [twin_tau_0]
    type = MaterialStdVectorAux
    variable = twin_tau_0
    property = applied_shear_stress
    index = 0
    execute_on = timestep_end
  []
  [twin_tau_1]
    type = MaterialStdVectorAux
    variable = twin_tau_1
    property = applied_shear_stress
    index = 1
    execute_on = timestep_end
  []
  [twin_tau_2]
    type = MaterialStdVectorAux
    variable = twin_tau_2
    property = applied_shear_stress
    index = 2
    execute_on = timestep_end
  []
  [twin_tau_3]
    type = MaterialStdVectorAux
    variable = twin_tau_3
    property = applied_shear_stress
    index = 3
    execute_on = timestep_end
  []
[]
[BCs]
  [fix_y]
    type = DirichletBC
    variable = disp_y
    preset = true
    boundary = 'bottom'
    value = 0
  []
  [fix_x]
    type = DirichletBC
    variable = disp_x
    boundary = 'left'
    value = 0
  []
  [fix_z]
    type = DirichletBC
    variable = disp_z
    boundary = 'back'
    value = 0
  []
  [tdisp]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = '-1.0e-3*t'
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensorCP
    C_ijkl = '1.08e5 6.034e4 6.034e4 1.08e5 6.03e4 1.08e5 2.86e4 2.86e4 2.86e4' #Tallon and Wolfenden. J. Phys. Chem. Solids (1979)
    fill_method = symmetric9
  []
  [stress]
    type = ComputeMultipleCrystalPlasticityStress
    crystal_plasticity_models = 'twin_only_xtalpl'
    tan_mod_type = exact
  []
  [twin_only_xtalpl]
    type = CrystalPlasticityTwinningKalidindiUpdate
    number_slip_systems = 4
    slip_sys_file_name = 'select_twin_systems_verify_hardening.txt'
    initial_twin_lattice_friction = 6.0
    non_coplanar_coefficient_twin_hardening = 0
    non_coplanar_twin_hardening_exponent = 0
    coplanar_coefficient_twin_hardening = 8e8
  []
[]
[Postprocessors]
  [stress_zz]
    type = ElementAverageValue
    variable = stress_zz
  []
  [total_twin_volume_fraction]
    type = ElementAverageValue
    variable = total_twin_volume_fraction
  []
  [twin_resistance_0]
    type = ElementAverageValue
    variable = twin_resistance_0
  []
  [twin_resistance_1]
    type = ElementAverageValue
    variable = twin_resistance_1
  []
  [twin_resistance_2]
    type = ElementAverageValue
    variable = twin_resistance_2
  []
  [twin_resistance_3]
    type = ElementAverageValue
    variable = twin_resistance_3
  []
  [twin_volume_fraction_0]
    type = ElementAverageValue
    variable = twin_volume_fraction_0
  []
  [twin_volume_fraction_1]
    type = ElementAverageValue
    variable = twin_volume_fraction_1
  []
  [twin_volume_fraction_2]
    type = ElementAverageValue
    variable = twin_volume_fraction_2
  []
  [twin_volume_fraction_3]
    type = ElementAverageValue
    variable = twin_volume_fraction_3
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
  petsc_options_value = ' asm      2              lu            gmres     200'
  nl_abs_tol = 1e-10
  nl_rel_tol = 1e-10
  nl_abs_step_tol = 1e-10
  dt = 0.05
  dtmin = 1e-6
  dtmax = 10.0
  num_steps = 4
[]
[Outputs]
  csv = true
  perf_graph = true
[]
(modules/solid_mechanics/test/tests/weak_plane_shear/except2.i)
# checking for exception error messages
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
  type = GeneratedMesh
  dim = 3
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  add_variables = true
  generate_output = 'stress_xz stress_zx stress_yz stress_zz'
[]
[BCs]
  [bottomx]
    type = DirichletBC
    variable = x_disp
    boundary = back
    value = 0.0
  []
  [bottomy]
    type = DirichletBC
    variable = y_disp
    boundary = back
    value = 0.0
  []
  [bottomz]
    type = DirichletBC
    variable = z_disp
    boundary = back
    value = 0.0
  []
  [topx]
    type = DirichletBC
    variable = x_disp
    boundary = front
    value = 8E-6
  []
  [topy]
    type = DirichletBC
    variable = y_disp
    boundary = front
    value = 6E-6
  []
  [topz]
    type = DirichletBC
    variable = z_disp
    boundary = front
    value = 1E-6
  []
[]
[AuxVariables]
  [yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[AuxKernels]
  [yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  []
[]
[Postprocessors]
  [s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  []
  [s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  []
  [s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  []
  [f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  []
[]
[UserObjects]
  [coh]
    type = SolidMechanicsHardeningConstant
    value = 1
  []
  [tanphi]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  []
  [tanpsi]
    type = SolidMechanicsHardeningConstant
    value = 0.1111077
  []
  [wps]
    type = SolidMechanicsPlasticWeakPlaneShear
    cohesion = coh
    tan_friction_angle = tanphi
    tan_dilation_angle = tanpsi
    smoother = 0
    yield_function_tolerance = 1E-3
    internal_constraint_tolerance = 1E-3
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E6'
  []
  [mc]
    type = ComputeMultiPlasticityStress
    plastic_models = wps
    transverse_direction = '0 0 0'
    ep_plastic_tolerance = 1E-3
  []
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
(modules/porous_flow/test/tests/infiltration_and_drainage/rd03.i)
[Mesh]
  file = gold/rd02.e
[]
[GlobalParams]
  PorousFlowDictator = dictator
[]
[Functions]
  [dts]
    type = PiecewiseLinear
    y = '2E4 1E6'
    x = '0 1E6'
  []
[]
[UserObjects]
  [dictator]
    type = PorousFlowDictator
    porous_flow_vars = pressure
    number_fluid_phases = 1
    number_fluid_components = 1
  []
  [pc]
    type = PorousFlowCapillaryPressureVG
    m = 0.336
    alpha = 1.43e-4
  []
[]
[FluidProperties]
  [simple_fluid]
    type = SimpleFluidProperties
    bulk_modulus = 2e7
    viscosity = 1.01e-3
    density0 = 1000
    thermal_expansion = 0
  []
[]
[Materials]
  [massfrac]
    type = PorousFlowMassFraction
  []
  [temperature]
    type = PorousFlowTemperature
  []
  [simple_fluid]
    type = PorousFlowSingleComponentFluid
    fp = simple_fluid
    phase = 0
  []
  [ppss]
    type = PorousFlow1PhaseP
    porepressure = pressure
    capillary_pressure = pc
  []
  [relperm]
    type = PorousFlowRelativePermeabilityVG
    m = 0.336
    seff_turnover = 0.99
    phase = 0
  []
  [porosity]
    type = PorousFlowPorosityConst
    porosity = 0.33
  []
  [permeability]
    type = PorousFlowPermeabilityConst
    permeability = '0.295E-12 0 0  0 0.295E-12 0  0 0 0.295E-12'
  []
[]
[Variables]
  [pressure]
    initial_from_file_timestep = LATEST
    initial_from_file_var = pressure
  []
[]
[Kernels]
  [mass0]
    type = PorousFlowMassTimeDerivative
    fluid_component = 0
    variable = pressure
  []
  [flux0]
    type = PorousFlowAdvectiveFlux
    fluid_component = 0
    variable = pressure
    gravity = '-10 0 0'
  []
[]
[AuxVariables]
  [SWater]
    family = MONOMIAL
    order = CONSTANT
  []
[]
[AuxKernels]
  [SWater]
    type = MaterialStdVectorAux
    property = PorousFlow_saturation_qp
    index = 0
    variable = SWater
  []
[]
[BCs]
  [base]
    type = DirichletBC
    boundary = left
    value = 0.0
    variable = pressure
  []
[]
[Preconditioning]
  [andy]
    type = SMP
    full = true
    petsc_options = '-snes_converged_reason -ksp_diagonal_scale -ksp_diagonal_scale_fix -ksp_gmres_modifiedgramschmidt -snes_linesearch_monitor'
    petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap -snes_atol -snes_rtol -snes_max_it'
    petsc_options_value = 'gmres      asm      lu           NONZERO                   2               1E-10      1E-10      10'
  []
[]
[VectorPostprocessors]
  [swater]
    type = LineValueSampler
    warn_discontinuous_face_values = false
    variable = SWater
    start_point = '0 0 0'
    end_point = '6 0 0'
    sort_by = x
    num_points = 121
    execute_on = timestep_end
  []
[]
[Executioner]
  type = Transient
  solve_type = Newton
  petsc_options = '-snes_converged_reason'
  end_time = 8.2944E6
  [TimeStepper]
    type = FunctionDT
    function = dts
  []
[]
[Outputs]
  file_base = rd03
  [exodus]
    type = Exodus
    execute_on = 'initial final'
  []
  [along_line]
    type = CSV
    execute_on = final
  []
[]
(modules/solid_mechanics/test/tests/mohr_coulomb/uni_axial3_planar.i)
# same as uni_axial2 but with planar mohr-coulomb
[Mesh]
  type = FileMesh
  file = quarter_hole.e
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./zmin_zzero]
    type = DirichletBC
    variable = disp_z
    boundary = 'zmin'
    value = '0'
  [../]
  [./xmin_xzero]
    type = DirichletBC
    variable = disp_x
    boundary = 'xmin'
    value = '0'
  [../]
  [./ymin_yzero]
    type = DirichletBC
    variable = disp_y
    boundary = 'ymin'
    value = '0'
  [../]
  [./ymax_disp]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'ymax'
    function = '-1E-4*t'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_int]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./mc_int_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = mc_int
  [../]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0.005 0.02 0.002'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0.005 0.02 0.002'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0.005 0.02 0.002'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0.005 0.02 0.002'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0.005 0.02 0.002'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0.005 0.02 0.002'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0.005 0.02 0.002'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./coh]
    type = SolidMechanicsHardeningConstant
    value = 1E7
  [../]
  [./fric]
    type = SolidMechanicsHardeningConstant
    value = 40
    convert_to_radians = true
  [../]
  [./dil]
    type = SolidMechanicsHardeningConstant
    value = 40
    convert_to_radians = true
  [../]
  [./mc]
    type = SolidMechanicsPlasticMohrCoulombMulti
    cohesion = coh
    friction_angle = fric
    dilation_angle = dil
    yield_function_tolerance = 1.0 # THIS IS HIGHER THAN THE SMOOTH CASE TO AVOID PRECISION-LOSS PROBLEMS!
    shift =  1.0
    use_custom_returnMap = false
    internal_constraint_tolerance = 1E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 1
    fill_method = symmetric_isotropic
    C_ijkl = '0 5E9' # young = 10Gpa, poisson = 0.0
  [../]
  [./strain]
    type = ComputeIncrementalStrain
    block = 1
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 1
    ep_plastic_tolerance = 1E-9
    plastic_models = mc
    max_NR_iterations = 100
    deactivation_scheme = 'safe'
    min_stepsize = 1
    max_stepsize_for_dumb = 1
    debug_fspb = crash
  [../]
[]
# Preconditioning and Executioner options kindly provided by Andrea
[Preconditioning]
  [./andy]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  end_time = 1.05
  dt = 0.1
  solve_type = NEWTON
  type = Transient
[]
[Outputs]
  file_base = uni_axial3_planar
  [./exodus]
    type = Exodus
    hide = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz yield_fcn s_xx s_xy s_xz s_yy s_yz s_zz f'
  [../]
  [./csv]
    type = CSV
    time_step_interval = 1
  [../]
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/twinning/upper_twin_fraction_limit.i)
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
  [cube]
    type = GeneratedMeshGenerator
    dim = 3
    elem_type = HEX8
  []
[]
[AuxVariables]
  [fp_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [total_twin_volume_fraction]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_4]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_10]
    order = CONSTANT
    family = MONOMIAL
  []
  [twin_volume_fraction_4]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_10]
   order = CONSTANT
   family = MONOMIAL
  []
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  add_variables = true
[]
[AuxKernels]
  [fp_zz]
    type = RankTwoAux
    variable = fp_zz
    rank_two_tensor = plastic_deformation_gradient
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [total_twin_volume_fraction]
    type = MaterialRealAux
    variable = total_twin_volume_fraction
    property = total_volume_fraction_twins
    execute_on = timestep_end
  []
  [slip_increment_4]
   type = MaterialStdVectorAux
   variable = slip_increment_4
   property = slip_increment
   index = 4
   execute_on = timestep_end
  []
  [slip_increment_10]
   type = MaterialStdVectorAux
   variable = slip_increment_10
   property = slip_increment
   index = 10
   execute_on = timestep_end
  []
  [twin_volume_fraction_4]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_4
   property = twin_system_volume_fraction
   index = 4
   execute_on = timestep_end
  []
  [twin_volume_fraction_10]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_10
   property = twin_system_volume_fraction
   index = 10
   execute_on = timestep_end
  []
[]
[BCs]
  [fix_y]
    type = DirichletBC
    variable = disp_y
    preset = true
    boundary = 'bottom'
    value = 0
  []
  [fix_x]
    type = DirichletBC
    variable = disp_x
    boundary = 'left'
    value = 0
  []
  [fix_z]
    type = DirichletBC
    variable = disp_z
    boundary = 'back'
    value = 0
  []
  [tdisp]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = '5.0e-4*t'
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensorCP
    C_ijkl = '1.08e5 6.034e4 6.034e4 1.08e5 6.03e4 1.08e5 2.86e4 2.86e4 2.86e4' #Tallon and Wolfenden. J. Phys. Chem. Solids (1979)
    fill_method = symmetric9
    euler_angle_1 = 54.74
    euler_angle_2 = 45.0
    euler_angle_3 = 270.0
  []
  [stress]
    type = ComputeMultipleCrystalPlasticityStress
    crystal_plasticity_models = 'twin_only_xtalpl'
    tan_mod_type = exact
  []
  [twin_only_xtalpl]
    type = CrystalPlasticityTwinningKalidindiUpdate
    number_slip_systems = 12
    slip_sys_file_name = 'fcc_input_twinning_systems.txt'
    initial_twin_lattice_friction = 1.5
    upper_limit_twin_volume_fraction = 1e-7
    stol = 0.01
    print_state_variable_convergence_error_messages = true
  []
[]
[Postprocessors]
  [fp_zz]
    type = ElementAverageValue
    variable = fp_zz
  []
  [total_twin_volume_fraction]
    type = ElementAverageValue
    variable = total_twin_volume_fraction
  []
  [slip_increment_4]
    type = ElementAverageValue
    variable = slip_increment_4
  []
  [slip_increment_10]
    type = ElementAverageValue
    variable = slip_increment_10
  []
  [twin_volume_fraction_4]
    type = ElementAverageValue
    variable = twin_volume_fraction_4
  []
  [twin_volume_fraction_10]
    type = ElementAverageValue
    variable = twin_volume_fraction_10
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
  petsc_options_value = ' asm      2              lu            gmres     200'
  nl_abs_tol = 1e-10
  nl_rel_tol = 1e-10
  nl_abs_step_tol = 1e-10
  dt = 0.05
  dtmin = 1e-5
  end_time = 0.18
[]
[Outputs]
  csv = true
  perf_graph = true
[]
(modules/solid_mechanics/test/tests/weak_plane_tensile/small_deform1N.i)
# checking for small deformation
# A single element is stretched by 1E-6m in x,y and z directions.
# stress_zz = Youngs Modulus*Strain = 2E6*1E-6 = 2 Pa
# wpt_tensile_strength is set to 1Pa
# Then the final stress should return to the yeild surface and its value should be 1pa.
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
  type = GeneratedMesh
  dim = 3
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  add_variables = true
  generate_output = 'stress_xz stress_yz stress_zz'
[]
[BCs]
  [bottomx]
    type = DirichletBC
    variable = disp_x
    boundary = back
    value = 0.0
  []
  [bottomy]
    type = DirichletBC
    variable = disp_y
    boundary = back
    value = 0.0
  []
  [bottomz]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0.0
  []
  [topx]
    type = DirichletBC
    variable = disp_x
    boundary = front
    value = 0E-6
  []
  [topy]
    type = DirichletBC
    variable = disp_y
    boundary = front
    value = 0E-6
  []
  [topz]
    type = DirichletBC
    variable = disp_z
    boundary = front
    value = 1E-6
  []
[]
[AuxVariables]
  [yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  []
  [iter]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[AuxKernels]
  [yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  []
  [iter_auxk]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  []
[]
[Postprocessors]
  [s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  []
  [s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  []
  [s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  []
  [f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  []
  [iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  []
[]
[UserObjects]
  [str]
    type = SolidMechanicsHardeningConstant
    value = 1
  []
  [wpt]
    type = SolidMechanicsPlasticWeakPlaneTensileN
    tensile_strength = str
    yield_function_tolerance = 1E-6
    internal_constraint_tolerance = 1E-5
    normal_vector = '0 0 1'
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E6'
  []
  [mc]
    type = ComputeMultiPlasticityStress
    plastic_models = wpt
    ep_plastic_tolerance = 1E-5
  []
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  csv = true
[]
(modules/solid_mechanics/test/tests/multi/three_surface03.i)
# Plasticit models:
# SimpleTester0 with a = 0 and b = 1 and strength = 1
# SimpleTester1 with a = 1 and b = 0 and strength = 1
# SimpleTester2 with a = 1 and b = 1 and strength = 1.5
#
# Lame lambda = 0 (Poisson=0).  Lame mu = 0.5E6
#
# A single element is stretched by 0.5E-6m in y direction and 2.0E-6 in z direction.
# trial stress_yy = 0.5 and stress_zz = 2.0
#
# Then SimpleTester0 and SimpleTester2 should activate and the algorithm will return to
# the corner stress_yy=0.5, stress_zz=1
# internal0 should be 1.0, and others zero
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0.5E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '2.0E-6*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int2]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./int0]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 0
    variable = int0
  [../]
  [./int1]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 1
    variable = int1
  [../]
  [./int2]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 2
    variable = int2
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./f2]
    type = PointValue
    point = '0 0 0'
    variable = f2
  [../]
  [./int0]
    type = PointValue
    point = '0 0 0'
    variable = int0
  [../]
  [./int1]
    type = PointValue
    point = '0 0 0'
    variable = int1
  [../]
  [./int2]
    type = PointValue
    point = '0 0 0'
    variable = int2
  [../]
[]
[UserObjects]
  [./simple0]
    type = SolidMechanicsPlasticSimpleTester
    a = 0
    b = 1
    strength = 1
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
  [./simple1]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 0
    strength = 1
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
  [./simple2]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 1
    strength = 1.5
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 0.5E6'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./multi]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = 'simple0 simple1 simple2'
    max_NR_iterations = 2
    min_stepsize = 1
    debug_fspb = crash
    debug_jac_at_stress = '10 0 0 0 10 0 0 0 10'
    debug_jac_at_pm = '1 1'
    debug_jac_at_intnl = '1 1'
    debug_stress_change = 1E-5
    debug_pm_change = '1E-6 1E-6'
    debug_intnl_change = '1E-6 1E-6'
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = three_surface03
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/monolithic_material_based/cp_slip_rate_integ/crysp.i)
[Mesh]
  type = GeneratedMesh
  dim = 3
  elem_type = HEX8
  displacements = 'disp_x disp_y disp_z'
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[AuxVariables]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./fp_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./e_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./gss1]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[Functions]
  [./tdisp]
    type = ParsedFunction
    expression = 0.01*t
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
    use_displaced_mesh = true
  [../]
[]
[AuxKernels]
  [./stress_zz]
    type = RankTwoAux
    variable = stress_zz
    rank_two_tensor = stress
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  [../]
  [./fp_zz]
    type = RankTwoAux
    variable = fp_zz
    rank_two_tensor = fp
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  [../]
  [./e_zz]
    type = RankTwoAux
    variable = e_zz
    rank_two_tensor = lage
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  [../]
  [./gss1]
    type = MaterialStdVectorAux
    variable = gss1
    property = gss
    index = 0
    execute_on = timestep_end
  [../]
[]
[BCs]
  [./symmy]
    type = DirichletBC
    variable = disp_y
    boundary = bottom
    value = 0
  [../]
  [./symmx]
    type = DirichletBC
    variable = disp_x
    boundary = left
    value = 0
  [../]
  [./symmz]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0
  [../]
  [./tdisp]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = tdisp
  [../]
[]
[Materials]
  [./crysp]
    type = FiniteStrainCPSlipRateRes
    gtol = 1e-2
    rtol = 1e-8
    abs_tol = 1e-15
    slip_sys_file_name = input_slip_sys.txt
    nss = 12
    num_slip_sys_flowrate_props = 2 #Number of properties in a slip system
    flowprops = '1 4 0.001 0.1 5 8 0.001 0.1 9 12 0.001 0.1'
    hprops = '1.0 541.5 60.8 109.8 2.5'
    gprops = '1 4 60.8 5 8 60.8 9 12 60.8'
    tan_mod_type = exact
    slip_incr_tol = 1
  [../]
  [./elasticity_tensor]
    type = ComputeElasticityTensorCP
    C_ijkl = '1.684e5 1.214e5 1.214e5 1.684e5 1.214e5 1.684e5 0.754e5 0.754e5 0.754e5'
    fill_method = symmetric9
  [../]
  [./strain]
    type = ComputeFiniteStrain
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[Postprocessors]
  [./stress_zz]
    type = ElementAverageValue
    variable = stress_zz
  [../]
  [./fp_zz]
    type = ElementAverageValue
    variable = fp_zz
  [../]
  [./e_zz]
    type = ElementAverageValue
    variable = e_zz
  [../]
  [./gss1]
    type = ElementAverageValue
    variable = gss1
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  dt = 0.2
  dtmin = 0.05
  dtmax = 10.0
  nl_rel_tol = 1e-10
  nl_abs_tol = 1e-10
  end_time = 1
[]
[Outputs]
  file_base = out
  exodus = true
  print_linear_residuals = true
  perf_graph = true
[]
(modules/solid_mechanics/test/tests/weak_plane_shear/small_deform4.i)
# apply a pure tension, then some shear
# the BCs are designed to map out the yield function, showing
# the affect of 'cap' smoothing
[GlobalParams]
  displacements = 'x_disp y_disp z_disp'
[]
[Mesh]
  type = GeneratedMesh
  dim = 3
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  add_variables = true
  generate_output = 'stress_xz stress_zx stress_yz stress_zz'
[]
[BCs]
  [bottomx]
    type = DirichletBC
    variable = x_disp
    boundary = back
    value = 0.0
  []
  [bottomy]
    type = DirichletBC
    variable = y_disp
    boundary = back
    value = 0.0
  []
  [bottomz]
    type = DirichletBC
    variable = z_disp
    boundary = back
    value = 0.0
  []
  [topx]
    type = FunctionDirichletBC
    variable = x_disp
    boundary = front
    function = 'if(t<1E-6,0,3*(t-1E-6)*(t-1E-6)*1E6)'
  []
  [topy]
    type = FunctionDirichletBC
    variable = y_disp
    boundary = front
    function = 'if(t<1E-6,0,5*(t-1E-6)*(t-1E-6)*1E6)'
  []
  [topz]
    type = FunctionDirichletBC
    variable = z_disp
    boundary = front
    function = 'if(t<1E-6,t,1E-6)'
  []
[]
[AuxVariables]
  [yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  []
  [iter]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[AuxKernels]
  [yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  []
  [iter_auxk]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  []
[]
[Postprocessors]
  [s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  []
  [s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  []
  [s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  []
  [f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  []
  [iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  []
[]
[UserObjects]
  [coh]
    type = SolidMechanicsHardeningConstant
    value = 1E3
  []
  [tanphi]
    type = SolidMechanicsHardeningConstant
    value = 1
  []
  [tanpsi]
    type = SolidMechanicsHardeningConstant
    value = 0.08748866
  []
  [wps]
    type = SolidMechanicsPlasticWeakPlaneShear
    cohesion = coh
    tan_friction_angle = tanphi
    tan_dilation_angle = tanpsi
    tip_scheme = cap
    smoother = 0
    cap_rate = 0.001
    cap_start = -1000.0
    yield_function_tolerance = 1E-3
    internal_constraint_tolerance = 1E-6
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '1E9 0.5E9'
  []
  [mc]
    type = ComputeMultiPlasticityStress
    ep_plastic_tolerance = 1E-4
    plastic_models = wps
    transverse_direction = '0 0 1'
    debug_fspb = crash
    debug_jac_at_stress = '1E4 2E4 3E4 2E4 -4E4 5E4 3E4 5E4 6E8'
    debug_jac_at_pm = 1
    debug_jac_at_intnl = 1
    debug_stress_change = 1E-3
    debug_pm_change = 1E-5
    debug_intnl_change = 1E-5
  []
[]
[Executioner]
  end_time = 2E-6
  dt = 1E-7
  type = Transient
[]
[Outputs]
  csv = true
[]
(modules/solid_mechanics/test/tests/multi/three_surface22.i)
# Plasticit models:
# SimpleTester0 with a = 0 and b = 1 and strength = 1
# SimpleTester1 with a = 1 and b = 0 and strength = 1
# SimpleTester2 with a = 1 and b = 1 and strength = 1.5
#
# Lame lambda = 0 (Poisson=0).  Lame mu = 0.5E6
#
# A single element is stretched by 1.7E-6m in y direction and 1.1E-6 in z direction.
# trial stress_yy = 1.7 and stress_zz = 1.1
#
# Then all yield functions will activate
# However, there is linear dependence.  SimpleTester0 will be rutned off.
# The algorithm will return to
# stress_yy=1.0 and stress_zz=0.5
# internal1=0.1, internal2=0.6
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '1.7E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1.1E-6*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int2]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./int0]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 0
    variable = int0
  [../]
  [./int1]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 1
    variable = int1
  [../]
  [./int2]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 2
    variable = int2
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./f2]
    type = PointValue
    point = '0 0 0'
    variable = f2
  [../]
  [./int0]
    type = PointValue
    point = '0 0 0'
    variable = int0
  [../]
  [./int1]
    type = PointValue
    point = '0 0 0'
    variable = int1
  [../]
  [./int2]
    type = PointValue
    point = '0 0 0'
    variable = int2
  [../]
[]
[UserObjects]
  [./simple0]
    type = SolidMechanicsPlasticSimpleTester
    a = 0
    b = 1
    strength = 1
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
  [./simple1]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 0
    strength = 1
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
  [./simple2]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 1
    strength = 1.5
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 0.5E6'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./multi]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = 'simple0 simple1 simple2'
    max_NR_iterations = 2
    min_stepsize = 1
    debug_fspb = crash
    debug_jac_at_stress = '10 0 0 0 10 0 0 0 10'
    debug_jac_at_pm = '1 1'
    debug_jac_at_intnl = '1 1'
    debug_stress_change = 1E-5
    debug_pm_change = '1E-6 1E-6'
    debug_intnl_change = '1E-6 1E-6'
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = three_surface22
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/mohr_coulomb/small_deform_hard3.i)
# apply repeated stretches in x z directions, and smaller stretches along the y direction,
# so that sigma_I = sigma_II,
# which means that lode angle = 30deg.
# The allows yield surface in meridional plane to be mapped out
#
# friction_angle = 50deg, friction_angle_residual=51deg, friction_angle_rate = 1E7 (huge)
# cohesion = 10, cohesion_residual = 9.9, cohesion_rate = 1E7 (huge)
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '1E-6*x*t'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0.25E-6*y*sin(t)'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1E-6*z*t'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_int]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./mc_int_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = mc_int
  [../]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./internal]
    type = PointValue
    point = '0 0 0'
    variable = mc_int
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./mc_coh]
    type = SolidMechanicsHardeningExponential
    value_0 = 10
    value_residual = 9.9
    rate = 1E7
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningExponential
    value_0 = 0.8726646 # 50deg
    value_residual = 0.8901179 # 51deg
    rate = 1E7
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningExponential
    value_0 = 0
    value_residual = 0.8726646 # 50deg
    rate = 3000
  [../]
  [./mc]
    type = SolidMechanicsPlasticMohrCoulomb
    cohesion = mc_coh
    friction_angle = mc_phi
    dilation_angle = mc_psi
    mc_tip_smoother = 4
    mc_edge_smoother = 20
    yield_function_tolerance = 1E-6
    internal_constraint_tolerance = 1E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = mc
    debug_fspb = crash
    debug_jac_at_stress = '10 1 2 1 11 -3 2 -3 8'
    debug_jac_at_pm = 1
    debug_jac_at_intnl = 1
    debug_stress_change = 1E-5
    debug_pm_change = 1E-6
    debug_intnl_change = 1E-6
  [../]
[]
[Executioner]
  end_time = 30
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform_hard3
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/tensile/planar1.i)
# checking for small deformation
# A single element is stretched by 1E-6m in z direction, and by small amounts in x and y directions
# stress_zz = Youngs Modulus*Strain = 2E6*1E-6 = 2 Pa
# tensile_strength is set to 1Pa
# Then the final stress should return to the yeild surface and the maximum principal stress value should be 1pa, and value of plastic strain should be 0.5E-6
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    strain = finite
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0.1E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0.2E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1.0E-6*z'
  [../]
[]
[AuxVariables]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./f0_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./intnl_auxk]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./f2]
    type = PointValue
    point = '0 0 0'
    variable = f2
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
  [./intnl]
    type = PointValue
    point = '0 0 0'
    variable = intnl
  [../]
[]
[UserObjects]
  [./hard]
    type = SolidMechanicsHardeningConstant
    value = 1
  [../]
  [./tens]
    type = SolidMechanicsPlasticTensileMulti
    tensile_strength = hard
    shift = 1E-6
    yield_function_tolerance = 1E-6
    internal_constraint_tolerance = 1E-5
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E6'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-5
    plastic_models = tens
    debug_fspb = crash
    debug_jac_at_stress = '1 2 3 2 -4 -5 3 -5 10'
    debug_jac_at_pm = '0.1 0.2 0.3'
    debug_jac_at_intnl = 1E-6
    debug_stress_change = 1E-6
    debug_pm_change = '1E-6 1E-6 1E-6'
    debug_intnl_change = 1E-6
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = planar1
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/multi/three_surface21.i)
# Plasticit models:
# SimpleTester0 with a = 0 and b = 1 and strength = 1
# SimpleTester1 with a = 1 and b = 0 and strength = 1
# SimpleTester2 with a = 1 and b = 1 and strength = 1.5
#
# Lame lambda = 0 (Poisson=0).  Lame mu = 0.5E6
#
# A single element is stretched by 2.0E-6m in y direction and 2.0E-6 in z direction.
# trial stress_yy = 2.0 and stress_zz = 2.0
#
# Then all yield functions will activate
# However, there is linear dependence.  SimpleTester1 or SimpleTester0 will be rutned off (they are equi-distant).
# The algorithm will return to one corner point, but there will be negative plastic multipliers
# so the other SimpleTester0 or SimpleTester1 will turn off, and the algorithm will return to
# stress_yy=0.75 and stress_zz=0.75
# internal2=1.25
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '2.0E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '2.0E-6*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int2]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./int0]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 0
    variable = int0
  [../]
  [./int1]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 1
    variable = int1
  [../]
  [./int2]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 2
    variable = int2
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./f2]
    type = PointValue
    point = '0 0 0'
    variable = f2
  [../]
  [./int0]
    type = PointValue
    point = '0 0 0'
    variable = int0
  [../]
  [./int1]
    type = PointValue
    point = '0 0 0'
    variable = int1
  [../]
  [./int2]
    type = PointValue
    point = '0 0 0'
    variable = int2
  [../]
[]
[UserObjects]
  [./simple0]
    type = SolidMechanicsPlasticSimpleTester
    a = 0
    b = 1
    strength = 1
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
  [./simple1]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 0
    strength = 1
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
  [./simple2]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 1
    strength = 1.5
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 0.5E6'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./multi]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = 'simple0 simple1 simple2'
    max_NR_iterations = 2
    min_stepsize = 1
    debug_fspb = crash
    debug_jac_at_stress = '10 0 0 0 10 0 0 0 10'
    debug_jac_at_pm = '1 1'
    debug_jac_at_intnl = '1 1'
    debug_stress_change = 1E-5
    debug_pm_change = '1E-6 1E-6'
    debug_intnl_change = '1E-6 1E-6'
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = three_surface21
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/monolithic_material_based/crysp_user_object.i)
[Mesh]
  type = GeneratedMesh
  dim = 2
  elem_type = QUAD4
  displacements = 'disp_x disp_y'
  nx = 2
  ny = 2
[]
[Variables]
  [./disp_x]
    block = 0
  [../]
  [./disp_y]
    block = 0
  [../]
[]
[GlobalParams]
  volumetric_locking_correction=true
[]
[AuxVariables]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
  [./e_yy]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
  [./fp_yy]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
  [./rotout]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
  [./gss1]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
[]
[Functions]
  [./tdisp]
    type = ParsedFunction
    expression = 0.01*t
  [../]
[]
[UserObjects]
  [./prop_read]
    type = PropertyReadFile
    prop_file_name = 'euler_ang_file.txt'
    # Enter file data as prop#1, prop#2, .., prop#nprop
    nprop = 3
    read_type = element
  [../]
[]
[AuxKernels]
  [./stress_yy]
    type = RankTwoAux
    variable = stress_yy
    rank_two_tensor = stress
    index_j = 1
    index_i = 1
    execute_on = timestep_end
    block = 0
  [../]
  [./e_yy]
    type = RankTwoAux
    variable = e_yy
    rank_two_tensor = lage
    index_j = 1
    index_i = 1
    execute_on = timestep_end
    block = 0
  [../]
  [./fp_yy]
    type = RankTwoAux
    variable = fp_yy
    rank_two_tensor = fp
    index_j = 1
    index_i = 1
    execute_on = timestep_end
    block = 0
  [../]
  [./gss1]
    type = MaterialStdVectorAux
    variable = gss1
    property = gss
    index = 0
    execute_on = timestep_end
    block = 0
  [../]
[]
[BCs]
  [./fix_x]
    type = DirichletBC
    variable = disp_x
    boundary = 'left'
    value = 0
  [../]
  [./fix_y]
    type = DirichletBC
    variable = disp_y
    boundary = 'bottom'
    value = 0
  [../]
  [./tdisp]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = top
    function = tdisp
  [../]
[]
[Materials]
  [./crysp]
    type = FiniteStrainCrystalPlasticity
    block = 0
    gtol = 1e-2
    slip_sys_file_name = input_slip_sys.txt
    nss = 12
    num_slip_sys_flowrate_props = 2 #Number of properties in a slip system
    flowprops = '1 4 0.001 0.1 5 8 0.001 0.1 9 12 0.001 0.1'
    hprops = '1.0 541.5 60.8 109.8 2.5'
    gprops = '1 4 60.8 5 8 60.8 9 12 60.8'
    tan_mod_type = exact
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y'
  [../]
  [./elasticity_tensor]
    type = ComputeElasticityTensorCP
    block = 0
    C_ijkl = '1.684e5 1.214e5 1.214e5 1.684e5 1.214e5 1.684e5 0.754e5 0.754e5 0.754e5'
    fill_method = symmetric9
    read_prop_user_object = prop_read
  [../]
[]
[Postprocessors]
  [./stress_yy]
    type = ElementAverageValue
    variable = stress_yy
    block = 'ANY_BLOCK_ID 0'
  [../]
  [./e_yy]
    type = ElementAverageValue
    variable = e_yy
    block = 'ANY_BLOCK_ID 0'
  [../]
  [./fp_yy]
    type = ElementAverageValue
    variable = fp_yy
    block = 'ANY_BLOCK_ID 0'
  [../]
  [./gss1]
    type = ElementAverageValue
    variable = gss1
    block = 'ANY_BLOCK_ID 0'
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  #Preconditioned JFNK (default)
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  nl_rel_tol = 1e-10
  nl_abs_tol = 1e-10
  dt = 0.01
  dtmax = 10.0
  dtmin = 0.01
  num_steps = 10
[]
[Outputs]
  file_base = crysp_user_object_out
  exodus = true
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y'
    use_displaced_mesh = true
  [../]
[]
(modules/solid_mechanics/test/tests/weak_plane_shear/small_deform_harden3.i)
# apply repeated stretches to observe cohesion hardening
[GlobalParams]
  displacements = 'x_disp y_disp z_disp'
[]
[Mesh]
  type = GeneratedMesh
  dim = 3
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  add_variables = true
  generate_output = 'stress_xz stress_zx stress_yz stress_zz'
[]
[BCs]
  [bottomx]
    type = DirichletBC
    variable = x_disp
    boundary = back
    value = 0.0
  []
  [bottomy]
    type = DirichletBC
    variable = y_disp
    boundary = back
    value = 0.0
  []
  [bottomz]
    type = DirichletBC
    variable = z_disp
    boundary = back
    value = 0.0
  []
  [topx]
    type = FunctionDirichletBC
    variable = x_disp
    boundary = front
    function = '0'
  []
  [topy]
    type = FunctionDirichletBC
    variable = y_disp
    boundary = front
    function = '0'
  []
  [topz]
    type = FunctionDirichletBC
    variable = z_disp
    boundary = front
    function = '2*t'
  []
[]
[AuxVariables]
  [wps_internal]
    order = CONSTANT
    family = MONOMIAL
  []
  [yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[AuxKernels]
  [wps_internal_auxk]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = wps_internal
  []
  [yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  []
[]
[Postprocessors]
  [s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  []
  [s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  []
  [s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  []
  [f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  []
  [int]
    type = PointValue
    point = '0 0 0'
    variable = wps_internal
  []
[]
[UserObjects]
  [coh]
    type = SolidMechanicsHardeningExponential
    value_0 = 1E3
    value_residual = 2E3
    rate = 0
  []
  [tanphi]
    type = SolidMechanicsHardeningExponential
    value_0 = 1
    value_residual = 0.577350269
    rate = 4E4
  []
  [tanpsi]
    type = SolidMechanicsHardeningExponential
    value_0 = 0.01745506
    value_residual = 0.01745506
    rate = 1E8
  []
  [wps]
    type = SolidMechanicsPlasticWeakPlaneShear
    cohesion = coh
    tan_friction_angle = tanphi
    tan_dilation_angle = tanpsi
    smoother = 500
    yield_function_tolerance = 1E-3
    internal_constraint_tolerance = 1E-3
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '1E9 0.5E9'
  []
  [mc]
    type = ComputeMultiPlasticityStress
    plastic_models = wps
    transverse_direction = '0 0 1'
    ep_plastic_tolerance = 1E-3
    debug_fspb = crash
  []
[]
[Executioner]
  end_time = 1E-6
  dt = 1E-7
  type = Transient
[]
[Outputs]
  csv = true
[]
(modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform17.i)
# Using CappedMohrCoulomb with compressive failure only
# A single element is incrementally compressed
# This causes the return direction to be along the hypersurface sigma_II = sigma_III
# and the resulting stresses are checked to lie on the expected yield surface
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'max_principal_stress mid_principal_stress min_principal_stress stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '-2*x*t'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '-2*y*t'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '-0.4*z*(t+2*t*t)'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 3
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_I]
    type = PointValue
    point = '0 0 0'
    variable = max_principal_stress
  [../]
  [./s_II]
    type = PointValue
    point = '0 0 0'
    variable = mid_principal_stress
  [../]
  [./s_III]
    type = PointValue
    point = '0 0 0'
    variable = min_principal_stress
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./cs]
    type = SolidMechanicsHardeningConstant
    value = 1
  [../]
  [./coh]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./ang]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '0 2.0'
  [../]
  [./tensile]
    type = CappedMohrCoulombStressUpdate
    tensile_strength = ts
    compressive_strength = cs
    cohesion = coh
    friction_angle = ang
    dilation_angle = ang
    smoothing_tol = 0.5
    yield_function_tol = 1.0E-12
  [../]
  [./stress]
    type = ComputeMultipleInelasticStress
    inelastic_models = tensile
    perform_finite_strain_rotations = false
  [../]
[]
[Executioner]
  end_time = 1
  dt = 0.1
  type = Transient
[]
[Outputs]
  file_base = small_deform17
  csv = true
[]
(modules/solid_mechanics/test/tests/mean_cap/random.i)
# apply many random large deformations, checking that the algorithm returns correctly to
# the yield surface each time.  Two yield surfaces are used: one for compression and one for tension.
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1000
  ny = 125
  nz = 1
  xmin = 0
  xmax = 1000
  ymin = 0
  ymax = 125
  zmin = 0
  zmax = 1
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[ICs]
  [./x]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_x
  [../]
  [./y]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_y
  [../]
  [./z]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_z
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '0'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
[]
[Postprocessors]
  [./max_yield_fcn]
    type = ElementExtremeValue
    variable = yield_fcn
    outputs = 'console'
  [../]
  [./should_be_zero]
    type = FunctionValuePostprocessor
    function = should_be_zero_fcn
  [../]
  [./av_iter]
    type = ElementAverageValue
    variable = iter
    outputs = 'console'
  [../]
[]
[Functions]
  [./should_be_zero_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-3,0,a)'
    symbol_names = 'a'
    symbol_values = 'max_yield_fcn'
  [../]
[]
[UserObjects]
  [./strength]
    type = SolidMechanicsHardeningConstant
    value = 1
  [../]
  [./cap1]
    type = SolidMechanicsPlasticMeanCap
    a = -1
    strength = strength
    yield_function_tolerance = 1E-3
    internal_constraint_tolerance = 1E-9
  [../]
  [./cap2]
    type = SolidMechanicsPlasticMeanCap
    a = 1
    strength = strength
    yield_function_tolerance = 1E-3
    internal_constraint_tolerance = 1E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0.7E7 1E7'
  [../]
  [./strain]
    type = ComputeIncrementalStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    max_NR_iterations = 2
    ep_plastic_tolerance = 1E-6
    plastic_models = 'cap1 cap2'
    debug_fspb = crash
    deactivation_scheme = optimized
    min_stepsize = 1
    max_stepsize_for_dumb = 1
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = random
  exodus = false
  [./csv]
    type = CSV
  [../]
[]
(modules/solid_mechanics/test/tests/mohr_coulomb/uni_axial3.i)
[Mesh]
  type = FileMesh
  file = quarter_hole.e
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./zmin_zzero]
    type = DirichletBC
    variable = disp_z
    boundary = 'zmin'
    value = '0'
  [../]
  [./xmin_xzero]
    type = DirichletBC
    variable = disp_x
    boundary = 'xmin'
    value = '0'
  [../]
  [./ymin_yzero]
    type = DirichletBC
    variable = disp_y
    boundary = 'ymin'
    value = '0'
  [../]
  [./ymax_disp]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'ymax'
    function = '-1E-4*t'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_int]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./mc_int_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = mc_int
  [../]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0.005 0.02 0.002'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0.005 0.02 0.002'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0.005 0.02 0.002'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0.005 0.02 0.002'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0.005 0.02 0.002'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0.005 0.02 0.002'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0.005 0.02 0.002'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 10E6
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 40
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 40
    convert_to_radians = true
  [../]
  [./mc]
    type = SolidMechanicsPlasticMohrCoulomb
    cohesion = mc_coh
    friction_angle = mc_phi
    dilation_angle = mc_psi
    mc_tip_smoother = 0.01E6
    mc_edge_smoother = 29
    yield_function_tolerance = 1E-5
    internal_constraint_tolerance = 1E-11
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 1
    fill_method = symmetric_isotropic
    C_ijkl = '0 5E9' # young = 10Gpa, poisson = 0.0
  [../]
  [./strain]
    type = ComputeIncrementalStrain
    block = 1
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 1
    ep_plastic_tolerance = 1E-11
    plastic_models = mc
    max_NR_iterations = 1000
    debug_fspb = crash
  [../]
[]
# Preconditioning and Executioner options kindly provided by Andrea
[Preconditioning]
  [./andy]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  end_time = 1.05
  dt = 0.1
  solve_type = NEWTON
  type = Transient
  nl_abs_tol = 1E-10
  nl_rel_tol = 1E-12
  l_tol = 1E-2
  l_max_its = 50
  nl_max_its = 400
  petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
  petsc_options_value = ' asm      2              lu            gmres     200'
[]
[Outputs]
  file_base = uni_axial3
  exodus = true
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/jacobian/cto14.i)
# Jacobian check for nonlinear, multi-surface plasticity.
# Returns to an edge of the tensile yield surface
# This is a very nonlinear test and a delicate test because it perturbs around
# an edge of the yield function where some derivatives are not well defined
#
# Plasticity models:
# Mohr-Coulomb with cohesion = 40MPa, friction angle = 35deg, dilation angle = 5deg
# Tensile with strength = 1MPa
#
# Lame lambda = 1GPa.  Lame mu = 1.3GPa
#
# NOTE: The yield function tolerances here are set at 100-times what i would usually use
# This is because otherwise the test fails on the 'pearcey' architecture.
# This is because identical stress tensors yield slightly different eigenvalues
# (and hence return-map residuals) on 'pearcey' than elsewhere, which results in
# a different number of NR iterations are needed to return to the yield surface.
# This is presumably because of compiler internals, or the BLAS routines being
# optimised differently or something similar.
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./linesearch]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./ld]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./constr_added]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int3]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int4]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int5]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int6]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int7]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int8]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int0]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./linesearch]
    type = MaterialRealAux
    property = plastic_linesearch_needed
    variable = linesearch
  [../]
  [./ld]
    type = MaterialRealAux
    property = plastic_linear_dependence_encountered
    variable = ld
  [../]
  [./constr_added]
    type = MaterialRealAux
    property = plastic_constraints_added
    variable = constr_added
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./int0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    variable = int0
    index = 0
  [../]
  [./int1]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    variable = int1
    index = 1
  [../]
  [./int2]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    variable = int2
    index = 2
  [../]
  [./int3]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    variable = int3
    index = 3
  [../]
  [./int4]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    variable = int4
    index = 4
  [../]
  [./int5]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    variable = int5
    index = 5
  [../]
  [./int6]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    variable = int6
    index = 6
  [../]
  [./int7]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    variable = int7
    index = 7
  [../]
  [./int8]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    variable = int8
    index = 8
  [../]
[]
[Postprocessors]
  [./max_int0]
    type = ElementExtremeValue
    variable = int0
    outputs = console
  [../]
  [./max_int1]
    type = ElementExtremeValue
    variable = int1
    outputs = console
  [../]
  [./max_int2]
    type = ElementExtremeValue
    variable = int2
    outputs = console
  [../]
  [./max_int3]
    type = ElementExtremeValue
    variable = int3
    outputs = console
  [../]
  [./max_int4]
    type = ElementExtremeValue
    variable = int4
    outputs = console
  [../]
  [./max_int5]
    type = ElementExtremeValue
    variable = int5
    outputs = console
  [../]
  [./max_int6]
    type = ElementExtremeValue
    variable = int6
    outputs = console
  [../]
  [./max_int7]
    type = ElementExtremeValue
    variable = int7
    outputs = console
  [../]
  [./max_int8]
    type = ElementExtremeValue
    variable = int8
    outputs = console
  [../]
  [./max_iter]
    type = ElementExtremeValue
    variable = iter
    outputs = console
  [../]
  [./av_linesearch]
    type = ElementAverageValue
    variable = linesearch
    outputs = 'console'  [../]
  [./av_ld]
    type = ElementAverageValue
    variable = ld
    outputs = 'console'  [../]
  [./av_constr_added]
    type = ElementAverageValue
    variable = constr_added
    outputs = 'console'  [../]
  [./av_iter]
    type = ElementAverageValue
    variable = iter
    outputs = 'console'  [../]
[]
[UserObjects]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 4E1
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 35
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 5
    convert_to_radians = true
  [../]
  [./mc]
    type = SolidMechanicsPlasticMohrCoulombMulti
    cohesion = mc_coh
    friction_angle = mc_phi
    dilation_angle = mc_psi
    yield_function_tolerance = 1.0E-4  # Note larger value
    shift = 1.0E-4                     # Note larger value
    internal_constraint_tolerance = 1.0E-7
  [../]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1E0
  [../]
  [./tensile]
    type = SolidMechanicsPlasticTensileMulti
    tensile_strength = ts
    yield_function_tolerance = 1.0E-4  # Note larger value
    shift = 1.0E-4                     # Note larger value
    internal_constraint_tolerance = 1.0E-7
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '1.0E3 1.3E3'
  [../]
  [./strain]
    type = ComputeIncrementalStrain
    displacements = 'disp_x disp_y disp_z'
    eigenstrain_names = ini_stress
  [../]
  [./ini_stress]
    type = ComputeEigenstrainFromInitialStress
    initial_stress = '10 12 -14  12 5 20  -14 20 8'
    eigenstrain_name = ini_stress
  [../]
  [./multi]
    type = ComputeMultiPlasticityStress
    ep_plastic_tolerance = 1E-7
    plastic_models = 'tensile mc'
    max_NR_iterations = 5
    specialIC = 'rock'
    deactivation_scheme = 'safe'
    min_stepsize = 1
    tangent_operator = nonlinear
  [../]
[]
[Preconditioning]
  [./andy]
    type = SMP
    full = true
    petsc_options_iname = '-ksp_type -pc_type -snes_atol -snes_rtol -snes_max_it -snes_type'
    petsc_options_value = 'bcgs bjacobi 1E-15 1E-10 10000 test'
  [../]
[]
[Executioner]
  type = Transient
  solve_type = Newton
[]
[Outputs]
  file_base = cto14
  exodus = false
[]
(modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform23.i)
# apply repeated stretches in x z directions, and smaller stretches along the y direction,
# so that sigma_max = sigma_mid (approximately),
# which means that lode angle = 30deg.
# The allows yield surface in meridional plane to be mapped out
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'max_principal_stress mid_principal_stress min_principal_stress stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '1E-6*x*t'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0.25E-6*y*sin(t)'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1E-6*z*t'
  [../]
[]
[AuxVariables]
  [./mc_int]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./mc_int_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = mc_int
  [../]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 6
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./internal]
    type = PointValue
    point = '0 0 0'
    variable = mc_int
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 10
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 30
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./mc]
    type = CappedMohrCoulombStressUpdate
    tensile_strength = ts
    compressive_strength = ts
    cohesion = mc_coh
    friction_angle = mc_phi
    dilation_angle = mc_psi
    smoothing_tol = 5.0
    yield_function_tol = 1.0E-12
  [../]
  [./stress]
    type = ComputeMultipleInelasticStress
    inelastic_models = mc
    perform_finite_strain_rotations = false
  [../]
[]
[Executioner]
  end_time = 30
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform23
  csv = true
[]
(modules/solid_mechanics/test/tests/mohr_coulomb/planar1.i)
# apply uniform stretch in x, y and z directions.
# With cohesion = 10, friction_angle = 60deg, the
# algorithm should return to
# sigma_m = 10*Cos(60)/Sin(60) = 5.773503
# using planar surfaces (not smoothed)
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '1E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '1.1E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1.2E-6*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = f
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = f
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
[]
[UserObjects]
  [./coh]
    type = SolidMechanicsHardeningConstant
    value = 10
  [../]
  [./phi]
    type = SolidMechanicsHardeningConstant
    value = 1.04719756
  [../]
  [./psi]
    type = SolidMechanicsHardeningConstant
    value = 0.1
  [../]
  [./mc]
    type = SolidMechanicsPlasticMohrCoulombMulti
    cohesion = coh
    friction_angle = phi
    dilation_angle = psi
    yield_function_tolerance = 1E-3
    shift = 1E-12
    internal_constraint_tolerance = 1E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-10
    deactivation_scheme = safe
    plastic_models = mc
    debug_fspb = crash
    debug_jac_at_stress = '10 0 0 0 10 0 0 0 10'
    debug_jac_at_pm = 1
    debug_jac_at_intnl = 1
    debug_stress_change = 1E-5
    debug_pm_change = 1E-6
    debug_intnl_change = 1E-6
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = planar1
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/combined/test/tests/j2_plasticity_vs_LSH/j2_hard1_mod_optimised.i)
# Test designed to compare results and active time between SH/LinearStrainHardening
# material vs TM j2 plastic user object. As number of elements increases, TM
# active time increases at a much higher rate than SM. Testing at 4x4x4
# (64 elements).
#
# plot vm_stress vs intnl to see constant hardening
#
# Original test located at:
# solid_mechanics/tests/j2_plasticity/hard1.i
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 4
  ny = 4
  nz = 4
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
  displacements = 'disp_x disp_y disp_z'
[]
[Variables]
  [disp_x]
    order = FIRST
    family = LAGRANGE
  []
  [disp_y]
    order = FIRST
    family = LAGRANGE
  []
  [disp_z]
    order = FIRST
    family = LAGRANGE
  []
[]
[Kernels]
  [TensorMechanics]
    displacements = 'disp_x disp_y disp_z'
  []
[]
[AuxVariables]
  [stress_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [intnl]
    order = CONSTANT
    family = MONOMIAL
  []
  [vm_stress]
    order = CONSTANT
    family = MONOMIAL
  []
  [eq_pl_strain]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[AuxKernels]
  [stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  []
  [intnl]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = intnl
  []
  [eq_pl_strain]
    type = RankTwoScalarAux
    rank_two_tensor = plastic_strain
    scalar_type = EffectiveStrain
    variable = eq_pl_strain
  []
  [vm_stress]
    type = RankTwoScalarAux
    rank_two_tensor = stress
    scalar_type = VonMisesStress
    variable = vm_stress
  []
[]
[BCs]
  [left]
    type = DirichletBC
    variable = disp_x
    boundary = left
    value = 0.0
  []
  [bottom]
    type = DirichletBC
    variable = disp_y
    boundary = bottom
    value = 0.0
  []
  [back]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0.0
  []
  [z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = 't/60'
  []
[]
[UserObjects]
  [str]
    type = TensorMechanicsHardeningConstant
    value = 2.4e2
  []
  [j2]
    type = TensorMechanicsPlasticJ2
    yield_strength = str
    yield_function_tolerance = 1E-3
    internal_constraint_tolerance = 1E-9
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    #with E = 2.1e5 and nu = 0.3
    #Hooke's law: E-nu to Lambda-G
    C_ijkl = '121154 80769.2'
  []
  [strain]
    type = ComputeIncrementalStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  []
  [mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = j2
    perform_finite_strain_rotations = false
  []
[]
[Preconditioning]
  [andy]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  #Preconditioned JFNK (default)
  solve_type = NEWTON
  petsc_options = '-snes_ksp_ew'
  petsc_options_iname = '-ksp_gmres_restart'
  petsc_options_value = '101'
  #line_search = 'none'
  l_max_its = 100
  nl_max_its = 100
  nl_rel_tol = 1e-6
  nl_abs_tol = 1e-10
  l_tol = 1e-4
  start_time = 0.0
  end_time = 0.5
  dt = 0.5
[]
[Postprocessors]
  [stress_zz]
    type = ElementAverageValue
    variable = stress_zz
  []
  [intnl]
    type = ElementAverageValue
    variable = intnl
  []
  [eq_pl_strain]
    type = PointValue
    point = '0 0 0'
    variable = eq_pl_strain
  []
  [vm_stress]
    type = PointValue
    point = '0 0 0'
    variable = vm_stress
  []
[]
[Outputs]
  csv = true
  print_linear_residuals = false
  perf_graph = true
[]
(modules/solid_mechanics/test/tests/mohr_coulomb/small_deform_hard_cubic.i)
# apply uniform stretches in x, y and z directions.
# let cohesion = 10, cohesion_residual = 2, cohesion_limit = 0.0003
# With cohesion = C, friction_angle = 60deg, tip_smoother = 4, the
# algorithm should return to
# sigma_m = (C*Cos(60) - 4)/Sin(60)
# This allows checking of the relationship for C
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '1E-6*x*t'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '1E-6*y*t'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1E-6*z*t'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_int]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./mc_int_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = mc_int
  [../]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./internal]
    type = PointValue
    point = '0 0 0'
    variable = mc_int
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./mc_coh]
    type = SolidMechanicsHardeningCubic
    value_0 = 10
    value_residual = 2
    internal_limit = 0.0003
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 60
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 5
    convert_to_radians = true
  [../]
  [./mc]
    type = SolidMechanicsPlasticMohrCoulomb
    cohesion = mc_coh
    friction_angle = mc_phi
    dilation_angle = mc_psi
    mc_tip_smoother = 4
    mc_edge_smoother = 25
    yield_function_tolerance = 1E-3
    internal_constraint_tolerance = 1E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = mc
    debug_fspb = crash
    debug_jac_at_stress = '10 1 2 1 10 3 2 3 10'
    debug_jac_at_pm = 1
    debug_jac_at_intnl = 1E-4
    debug_stress_change = 1E-5
    debug_pm_change = 1E-6
    debug_intnl_change = 1E-8
  [../]
[]
[Executioner]
  end_time = 10
  dt = 0.25
  type = Transient
[]
[Outputs]
  file_base = small_deform_hard_cubic
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/mean_cap/small_deform2.i)
# apply compression in x, y and z directions such that strain = diag(-1E-6, -2E-6, 3E-6).
# With lame_lambda=0 and lame_mu=1E7, this gives
# trial_Stress = diag(-20, -40, -60), so trial_mean_Stress = -40.
# with a = -1 and strength = 30, the algorithm should return to
# stress = diag(-10, -30, -50)
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '-1E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '-2E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '-3E-6*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = f
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = f
  [../]
[]
[UserObjects]
  [./strength]
    type = SolidMechanicsHardeningConstant
    value = 30
  [../]
  [./cap]
    type = SolidMechanicsPlasticMeanCap
    a = -1
    strength = strength
    yield_function_tolerance = 1E-3
    internal_constraint_tolerance = 1E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./strain]
    type = ComputeIncrementalStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mean_cap]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = cap
    debug_fspb = crash
    debug_jac_at_stress = '10 0 0 0 10 0 0 0 10'
    debug_jac_at_pm = 1
    debug_jac_at_intnl = 1
    debug_stress_change = 1E-5
    debug_pm_change = 1E-6
    debug_intnl_change = 1E-6
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform2
  exodus = false
  [./csv]
    type = CSV
  [../]
[]
(modules/solid_mechanics/test/tests/tensile/planar4.i)
# A single unit element is stretched by 1E-6m in z direction.
# with Lame lambda = 0.6E6 and Lame mu (shear) = 1E6
# stress_zz = 2.6 Pa
# stress_xx = 0.6 Pa
# stress_yy = 0.6 Pa
# tensile_strength is set to 0.5Pa
#
# The return should be to a plane (but the algorithm
# will try tip-return first), with
# stress_zz = 0.5
# plastic multiplier = 2.1/2.6 E-6
# stress_xx = 0.6 - (2.1/2.6*0.6) = 0.115
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    strain = finite
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1.0E-6*z'
  [../]
[]
[AuxVariables]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./f0_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./intnl_auxk]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./f2]
    type = PointValue
    point = '0 0 0'
    variable = f2
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
  [./intnl]
    type = PointValue
    point = '0 0 0'
    variable = intnl
  [../]
[]
[UserObjects]
  [./hard]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
  [./tens]
    type = SolidMechanicsPlasticTensileMulti
    tensile_strength = hard
    shift = 1E-6
    yield_function_tolerance = 1E-6
    internal_constraint_tolerance = 1E-5
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0.6E6 1E6'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-12
    plastic_models = tens
    debug_fspb = none
    debug_jac_at_stress = '1 2 3 2 -4 -5 3 -5 10'
    debug_jac_at_pm = '0.1 0.2 0.3'
    debug_jac_at_intnl = 1E-6
    debug_stress_change = 1E-6
    debug_pm_change = '1E-6 1E-6 1E-6'
    debug_intnl_change = 1E-6
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = planar4
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/examples/coal_mining/cosserat_wp_only.i)
# Strata deformation and fracturing around a coal mine
#
# A 2D geometry is used that simulates a transverse section of
# the coal mine.  The model is actually 3D, but the "x"
# dimension is only 10m long, meshed with 1 element, and
# there is no "x" displacement.  The mine is 300m deep
# and just the roof is studied (0<=z<=300).  The model sits
# between 0<=y<=450.  The excavation sits in 0<=y<=150.  This
# is a "half model": the boundary conditions are such that
# the model simulates an excavation sitting in -150<=y<=150
# inside a model of the region -450<=y<=450.  The
# excavation height is 3m (ie, the excavation lies within
# 0<=z<=3).  Mining is simulated by moving the excavation's
# roof down, until disp_z=-3 at t=1.
# Time is meaningless in this example
# as quasi-static solutions are sought at each timestep, but
# the number of timesteps controls the resolution of the
# process.
#
# The boundary conditions are:
#  - disp_x = 0 everywhere
#  - disp_y = 0 at y=0 and y=450
#  - disp_z = 0 for y>150
#  - disp_z = -3 at maximum, for 0<=y<=150.  See excav function.
# That is, rollers on the sides, free at top, and prescribed at bottom.
#
# The small strain formulation is used.
#
# All stresses are measured in MPa.  The initial stress is consistent with
# the weight force from density 2500 kg/m^3, ie, stress_zz = -0.025*(300-z) MPa
# where gravity = 10 m.s^-2 = 1E-5 MPa m^2/kg.  The maximum and minimum
# principal horizontal stresses are assumed to be equal to 0.8*stress_zz.
#
# Below you will see Drucker-Prager parameters and AuxVariables, etc.
# These are not actally used in this example.
#
# Material properties:
# Young's modulus = 8 GPa
# Poisson's ratio = 0.25
# Cosserat layer thickness = 1 m
# Cosserat-joint normal stiffness = large
# Cosserat-joint shear stiffness = 1 GPa
# Weak-plane cohesion = 0.1 MPa
# Weak-plane friction angle = 20 deg
# Weak-plane dilation angle = 10 deg
# Weak-plane tensile strength = 0.1 MPa
# Weak-plane compressive strength = 100 MPa, varying down to 1 MPa when tensile strain = 1
#
[Mesh]
  [generated_mesh]
    type = GeneratedMeshGenerator
    dim = 3
    nx = 1
    xmin = -5
    xmax = 5
    nz = 40
    zmin = 0
    zmax = 400
    bias_z = 1.1
    ny = 30 # make this a multiple of 3, so y=150 is at a node
    ymin = 0
    ymax = 450
  []
  [left]
    type = SideSetsAroundSubdomainGenerator
    new_boundary = 11
    normal = '0 -1 0'
    input = generated_mesh
  []
  [right]
    type = SideSetsAroundSubdomainGenerator
    new_boundary = 12
    normal = '0 1 0'
    input = left
  []
  [front]
    type = SideSetsAroundSubdomainGenerator
    new_boundary = 13
    normal = '-1 0 0'
    input = right
  []
  [back]
    type = SideSetsAroundSubdomainGenerator
    new_boundary = 14
    normal = '1 0 0'
    input = front
  []
  [top]
    type = SideSetsAroundSubdomainGenerator
    new_boundary = 15
    normal = '0 0 1'
    input = back
  []
  [bottom]
    type = SideSetsAroundSubdomainGenerator
    new_boundary = 16
    normal = '0 0 -1'
    input = top
  []
  [excav]
    type = SubdomainBoundingBoxGenerator
    block_id = 1
    bottom_left = '-5 0 0'
    top_right = '5 150 3'
    input = bottom
  []
  [roof]
    type = SideSetsBetweenSubdomainsGenerator
    new_boundary = 21
    primary_block = 0
    paired_block = 1
    input = excav
  []
  [hole]
    type = BlockDeletionGenerator
    block = 1
    input = roof
  []
[]
[GlobalParams]
  block = 0
  perform_finite_strain_rotations = false
  displacements = 'disp_x disp_y disp_z'
  Cosserat_rotations = 'wc_x wc_y wc_z'
[]
[Variables]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
  [./wc_x]
  [../]
[]
[Kernels]
  [./cy_elastic]
    type = CosseratStressDivergenceTensors
    use_displaced_mesh = false
    variable = disp_y
    component = 1
  [../]
  [./cz_elastic]
    type = CosseratStressDivergenceTensors
    use_displaced_mesh = false
    variable = disp_z
    component = 2
  [../]
  [./x_couple]
    type = StressDivergenceTensors
    use_displaced_mesh = false
    variable = wc_x
    displacements = 'wc_x wc_y wc_z'
    component = 0
    base_name = couple
  [../]
  [./x_moment]
    type = MomentBalancing
    use_displaced_mesh = false
    variable = wc_x
    component = 0
  [../]
  [./gravity]
    type = Gravity
    use_displaced_mesh = false
    variable = disp_z
    value = -10E-6
  [../]
[]
[AuxVariables]
  [./disp_x]
  [../]
  [./wc_y]
  [../]
  [./wc_z]
  [../]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./dp_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./dp_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./wp_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./wp_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./wp_shear_f]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./wp_tensile_f]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./dp_shear_f]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./dp_tensile_f]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./dp_shear]
    type = MaterialStdVectorAux
    index = 0
    property = dp_plastic_internal_parameter
    variable = dp_shear
  [../]
  [./dp_tensile]
    type = MaterialStdVectorAux
    index = 1
    property = dp_plastic_internal_parameter
    variable = dp_tensile
  [../]
  [./wp_shear]
    type = MaterialStdVectorAux
    index = 0
    property = wp_plastic_internal_parameter
    variable = wp_shear
  [../]
  [./wp_tensile]
    type = MaterialStdVectorAux
    index = 1
    property = wp_plastic_internal_parameter
    variable = wp_tensile
  [../]
  [./dp_shear_f]
    type = MaterialStdVectorAux
    index = 0
    property = dp_plastic_yield_function
    variable = dp_shear_f
  [../]
  [./dp_tensile_f]
    type = MaterialStdVectorAux
    index = 1
    property = dp_plastic_yield_function
    variable = dp_tensile_f
  [../]
  [./wp_shear_f]
    type = MaterialStdVectorAux
    index = 0
    property = wp_plastic_yield_function
    variable = wp_shear_f
  [../]
  [./wp_tensile_f]
    type = MaterialStdVectorAux
    index = 1
    property = wp_plastic_yield_function
    variable = wp_tensile_f
  [../]
[]
[BCs]
  [./no_y]
    type = DirichletBC
    variable = disp_y
    boundary = '11 12 16 21' # note addition of 16 and 21
    value = 0.0
  [../]
  [./no_z]
    type = DirichletBC
    variable = disp_z
    boundary = '16'
    value = 0.0
  [../]
  [./no_wc_x]
    type = DirichletBC
    variable = wc_x
    boundary = '11 12'
    value = 0.0
  [../]
  [./roof]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 21
    function = excav_sideways
  [../]
[]
[Functions]
  [./ini_xx]
    type = ParsedFunction
    expression = '-0.8*2500*10E-6*(400-z)'
  [../]
  [./ini_zz]
    type = ParsedFunction
    expression = '-2500*10E-6*(400-z)'
  [../]
  [./excav_sideways]
    type = ParsedFunction
    symbol_names = 'end_t ymin ymax  e_h  closure_dist'
    symbol_values = '1.0   0    150.0 -3.0 15.0'
    expression = 'e_h*max(min((t/end_t*(ymax-ymin)+ymin-y)/closure_dist,1),0)'
  [../]
  [./excav_downwards]
    type = ParsedFunction
    symbol_names = 'end_t ymin ymax  e_h  closure_dist'
    symbol_values = '1.0   0    150.0 -3.0 15.0'
    expression = 'e_h*t/end_t*max(min(((ymax-ymin)+ymin-y)/closure_dist,1),0)'
  [../]
[]
[UserObjects]
  [./dp_coh_strong_harden]
    type = SolidMechanicsHardeningExponential
    value_0 = 2.9 # MPa
    value_residual = 3.1 # MPa
    rate = 1.0
  [../]
  [./dp_fric]
    type = SolidMechanicsHardeningConstant
    value = 0.65 # 37deg
  [../]
  [./dp_dil]
    type = SolidMechanicsHardeningConstant
    value = 0.65
  [../]
  [./dp_tensile_str_strong_harden]
    type = SolidMechanicsHardeningExponential
    value_0 = 1.0 # MPa
    value_residual = 1.4 # MPa
    rate = 1.0
  [../]
  [./dp_compressive_str]
    type = SolidMechanicsHardeningConstant
    value = 1.0E3 # Large!
  [../]
  [./drucker_prager_model]
    type = SolidMechanicsPlasticDruckerPrager
    mc_cohesion = dp_coh_strong_harden
    mc_friction_angle = dp_fric
    mc_dilation_angle = dp_dil
    internal_constraint_tolerance = 1 # irrelevant here
    yield_function_tolerance = 1      # irrelevant here
  [../]
  [./wp_coh_harden]
    type = SolidMechanicsHardeningCubic
    value_0 = 0.1
    value_residual = 0.1
    internal_limit = 10
  [../]
  [./wp_tan_fric]
    type = SolidMechanicsHardeningConstant
    value = 0.36 # 20deg
  [../]
  [./wp_tan_dil]
    type = SolidMechanicsHardeningConstant
    value = 0.18 # 10deg
  [../]
  [./wp_tensile_str_harden]
    type = SolidMechanicsHardeningCubic
    value_0 = 0.1
    value_residual = 0.1
    internal_limit = 10
  [../]
  [./wp_compressive_str_soften]
    type = SolidMechanicsHardeningCubic
    value_0 = 100
    value_residual = 1.0
    internal_limit = 1.0
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeLayeredCosseratElasticityTensor
    young = 8E3 # MPa
    poisson = 0.25
    layer_thickness = 1.0
    joint_normal_stiffness = 1E9 # huge
    joint_shear_stiffness = 1E3
  [../]
  [./strain]
    type = ComputeCosseratIncrementalSmallStrain
    eigenstrain_names = ini_stress
  [../]
  [./ini_stress]
    type = ComputeEigenstrainFromInitialStress
    initial_stress = 'ini_xx 0 0  0 ini_xx 0  0 0 ini_zz'
    eigenstrain_name = ini_stress
  [../]
  [./stress]
    type = ComputeMultipleInelasticCosseratStress
    block = 0
    inelastic_models = 'wp'
    relative_tolerance = 2.0
    absolute_tolerance = 1E6
    max_iterations = 1
    tangent_operator = nonlinear
    perform_finite_strain_rotations = false
  [../]
  [./dp]
    type = CappedDruckerPragerCosseratStressUpdate
    block = 0
    warn_about_precision_loss = false
    host_youngs_modulus = 8E3
    host_poissons_ratio = 0.25
    base_name = dp
    DP_model = drucker_prager_model
    tensile_strength = dp_tensile_str_strong_harden
    compressive_strength = dp_compressive_str
    max_NR_iterations = 100000
    tip_smoother = 0.1E1
    smoothing_tol = 0.1E1 # MPa  # Must be linked to cohesion
    yield_function_tol = 1E-11 # MPa.  this is essentially the lowest possible without lots of precision loss
    perfect_guess = true
    min_step_size = 1.0
  [../]
  [./wp]
    type = CappedWeakPlaneCosseratStressUpdate
    block = 0
    warn_about_precision_loss = false
    base_name = wp
    cohesion = wp_coh_harden
    tan_friction_angle = wp_tan_fric
    tan_dilation_angle = wp_tan_dil
    tensile_strength = wp_tensile_str_harden
    compressive_strength = wp_compressive_str_soften
    max_NR_iterations = 10000
    tip_smoother = 0.1
    smoothing_tol = 0.1 # MPa  # Note, this must be tied to cohesion, otherwise get no possible return at cone apex
    yield_function_tol = 1E-11 # MPa.  this is essentially the lowest possible without lots of precision loss
    perfect_guess = true
    min_step_size = 1.0E-3
  [../]
  [./density]
    type = GenericConstantMaterial
    prop_names = density
    prop_values = 2500
  [../]
[]
[Postprocessors]
  [./subsidence]
    type = PointValue
    point = '0 0 400'
    variable = disp_z
    use_displaced_mesh = false
  [../]
[]
[Preconditioning]
  [./SMP]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  solve_type = 'NEWTON'
  petsc_options = '-snes_converged_reason'
  petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
  petsc_options_value = ' asm      2              lu            gmres     200'
  line_search = bt
  nl_abs_tol = 1e-3
  nl_rel_tol = 1e-5
  l_max_its = 30
  nl_max_its = 1000
  start_time = 0.0
  dt = 0.2
  end_time = 0.2
[]
[Outputs]
  file_base = cosserat_wp_only
  time_step_interval = 1
  print_linear_residuals = false
  csv = true
  exodus = true
  [./console]
    type = Console
    output_linear = false
  [../]
[]
(modules/solid_mechanics/test/tests/weak_plane_shear/small_deform2.i)
# apply a pure tension, then some shear with compression
# the BCs are designed to map out the yield function, showing
# the affect of the small_smoother parameter
[GlobalParams]
  displacements = 'x_disp y_disp z_disp'
[]
[Mesh]
  type = GeneratedMesh
  dim = 3
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  add_variables = true
  generate_output = 'stress_xz stress_zx stress_yz stress_zz'
[]
[BCs]
  [bottomx]
    type = DirichletBC
    variable = x_disp
    boundary = back
    value = 0.0
  []
  [bottomy]
    type = DirichletBC
    variable = y_disp
    boundary = back
    value = 0.0
  []
  [bottomz]
    type = DirichletBC
    variable = z_disp
    boundary = back
    value = 0.0
  []
  [topx]
    type = FunctionDirichletBC
    variable = x_disp
    boundary = front
    function = 'if(t<1E-6,0,3*t)'
  []
  [topy]
    type = FunctionDirichletBC
    variable = y_disp
    boundary = front
    function = 'if(t<1E-6,0,5*(t-0.01E-6))'
  []
  [topz]
    type = FunctionDirichletBC
    variable = z_disp
    boundary = front
    function = 'if(t<1E-6,t,2E-6-t)'
  []
[]
[AuxVariables]
  [yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[AuxKernels]
  [yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  []
[]
[Postprocessors]
  [s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  []
  [s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  []
  [s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  []
  [f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  []
[]
[UserObjects]
  [coh]
    type = SolidMechanicsHardeningConstant
    value = 1E3
  []
  [tanphi]
    type = SolidMechanicsHardeningConstant
    value = 1
  []
  [tanpsi]
    type = SolidMechanicsHardeningConstant
    value = 0.01745506
  []
  [wps]
    type = SolidMechanicsPlasticWeakPlaneShear
    cohesion = coh
    tan_friction_angle = tanphi
    tan_dilation_angle = tanpsi
    smoother = 500
    yield_function_tolerance = 1E-3
    internal_constraint_tolerance = 1E-6
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '1E9 0.5E9'
  []
  [mc]
    type = ComputeMultiPlasticityStress
    ep_plastic_tolerance = 1E-4
    plastic_models = wps
    transverse_direction = '0 0 1'
    debug_fspb = crash
  []
[]
[Executioner]
  end_time = 2E-6
  dt = 1E-7
  type = Transient
[]
[Outputs]
  csv = true
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/monolithic_material_based/crysp.i)
[Mesh]
  type = GeneratedMesh
  dim = 3
  elem_type = HEX8
  displacements = 'ux uy uz'
[]
[Variables]
  [./ux]
    block = 0
  [../]
  [./uy]
    block = 0
  [../]
  [./uz]
    block = 0
  [../]
[]
[AuxVariables]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
  [./fp_zz]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
  [./rotout]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
  [./e_zz]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
  [./gss1]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
[]
[Functions]
  [./tdisp]
    type = ParsedFunction
    expression = 0.01*t
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'ux uy uz'
    use_displaced_mesh = true
  [../]
[]
[AuxKernels]
  [./stress_zz]
    type = RankTwoAux
    variable = stress_zz
    rank_two_tensor = stress
    index_j = 2
    index_i = 2
    execute_on = timestep_end
    block = 0
  [../]
  [./fp_zz]
    type = RankTwoAux
    variable = fp_zz
    rank_two_tensor = fp
    index_j = 2
    index_i = 2
    execute_on = timestep_end
    block = 0
  [../]
  [./e_zz]
    type = RankTwoAux
    variable = e_zz
    rank_two_tensor = lage
    index_j = 2
    index_i = 2
    execute_on = timestep_end
    block = 0
  [../]
  [./gss1]
    type = MaterialStdVectorAux
    variable = gss1
    property = gss
    index = 0
    execute_on = timestep_end
    block = 0
  [../]
[]
[BCs]
  [./symmy]
    type = DirichletBC
    variable = uy
    boundary = bottom
    value = 0
  [../]
  [./symmx]
    type = DirichletBC
    variable = ux
    boundary = left
    value = 0
  [../]
  [./symmz]
    type = DirichletBC
    variable = uz
    boundary = back
    value = 0
  [../]
  [./tdisp]
    type = FunctionDirichletBC
    variable = uz
    boundary = front
    function = tdisp
  [../]
[]
[Materials]
  [./crysp]
    type = FiniteStrainCrystalPlasticity
    block = 0
    gtol = 1e-2
    slip_sys_file_name = input_slip_sys.txt
    nss = 12
    num_slip_sys_flowrate_props = 2 #Number of properties in a slip system
    flowprops = '1 4 0.001 0.1 5 8 0.001 0.1 9 12 0.001 0.1'
    hprops = '1.0 541.5 60.8 109.8 2.5'
    gprops = '1 4 60.8 5 8 60.8 9 12 60.8'
    tan_mod_type = exact
  [../]
  [./elasticity_tensor]
    type = ComputeElasticityTensorCP
    block = 0
    C_ijkl = '1.684e5 1.214e5 1.214e5 1.684e5 1.214e5 1.684e5 0.754e5 0.754e5 0.754e5'
    fill_method = symmetric9
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'ux uy uz'
  [../]
[]
[Postprocessors]
  [./stress_zz]
    type = ElementAverageValue
    variable = stress_zz
    block = 'ANY_BLOCK_ID 0'
  [../]
  [./fp_zz]
    type = ElementAverageValue
    variable = fp_zz
    block = 'ANY_BLOCK_ID 0'
  [../]
  [./e_zz]
    type = ElementAverageValue
    variable = e_zz
    block = 'ANY_BLOCK_ID 0'
  [../]
  [./gss1]
    type = ElementAverageValue
    variable = gss1
    block = 'ANY_BLOCK_ID 0'
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  #Preconditioned JFNK (default)
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  nl_rel_tol = 1e-10
  nl_abs_tol = 1e-10
  dt = 0.05
  dtmax = 10.0
  dtmin = 0.05
  num_steps = 10
[]
[Outputs]
  file_base = out
  exodus = true
[]
(modules/solid_mechanics/test/tests/capped_weak_plane/small_deform_cosserat1.i)
# Plastic deformation.  Layered Cosserat with parameters:
# Young = 1.0
# Poisson = 0.2
# layer_thickness = 0.1
# joint_normal_stiffness = 0.25
# joint_shear_stiffness = 0.2
# These give the following nonzero components of the elasticity tensor:
# E_0000 = E_1111 = 1.043195
# E_0011 = E_1100 = 0.260799
# E_2222 = 0.02445
# E_0022 = E_1122 = E_2200 = E_2211 = 0.006112
# G = E_0101 = E_0110 = E_1001 = E_1010 = 0.416667
# Gt = E_0202 = E_0220 = E_2002 = E_1212 = E_1221 = E_2112 = 0.019084
# E_2020 = E_2121 = 0.217875
# They give the following nonzero components of the bending rigidity tensor:
# D = 8.68056E-5
# B_0101 = B_1010 = 7.92021E-4
# B_0110 = B_1001 = -1.584E-4
#
# Applying the following deformation to the zmax surface of a unit cube:
# disp_x = 8*t
# disp_y = 6*t
# disp_z = t
# omega_x = omega_y = omega_z = 0
# yields the following strains:
# strain_xz = 8*t
# strain_yz = 6*t
# strain_zz = t
# and all other components, and the curvature, are zero.
# The nonzero components of stress are therefore:
# stress_xx = stress_yy = 0.006112*t
# stress_xz = stress_zx = 0.152671*t
# stress_yz = stress_zy = 0.114504*t
# stress_zz = 0.0244499*t
# The moment stress is zero.
# So q = 0.19084*t and p = 0.0244*t.
#
# With large cohesion, but tensile strength = 0.0244499, the
# system is elastic up to t=1.  After that time
# stress_zz = 0.0244499 (for t>=1)
# and
# stress_xx = stress_yy = 0.006112 (for t>=1), since the
# elastic trial increment is exactly canelled by the Poisson's
# contribution from the return to the yield surface.
# The plastic strains are zero for t<=1, but for larger times:
# plastic_strain_zz = (t - 1)  (for t>=1)
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
  Cosserat_rotations = 'wc_x wc_y wc_z'
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
  [./wc_x]
  [../]
  [./wc_y]
  [../]
[]
[Kernels]
  [./cx_elastic]
    type = CosseratStressDivergenceTensors
    variable = disp_x
    component = 0
  [../]
  [./cy_elastic]
    type = CosseratStressDivergenceTensors
    variable = disp_y
    component = 1
  [../]
  [./cz_elastic]
    type = CosseratStressDivergenceTensors
    variable = disp_z
    component = 2
  [../]
  [./x_couple]
    type = StressDivergenceTensors
    variable = wc_x
    displacements = 'wc_x wc_y wc_z'
    component = 0
    base_name = couple
  [../]
  [./y_couple]
    type = StressDivergenceTensors
    variable = wc_y
    displacements = 'wc_x wc_y wc_z'
    component = 1
    base_name = couple
  [../]
  [./x_moment]
    type = MomentBalancing
    variable = wc_x
    component = 0
  [../]
  [./y_moment]
    type = MomentBalancing
    variable = wc_y
    component = 1
  [../]
[]
[BCs]
  [./bottomx]
    type = DirichletBC
    variable = disp_x
    boundary = back
    value = 0.0
  [../]
  [./bottomy]
    type = DirichletBC
    variable = disp_y
    boundary = back
    value = 0.0
  [../]
  [./bottomz]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0.0
  [../]
  [./topx]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = front
    function = 8*t
  [../]
  [./topy]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = front
    function = 6*t
  [../]
  [./topz]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = t
  [../]
[]
[AuxVariables]
  [./wc_z]
  [../]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./couple_stress_xx]
    family = MONOMIAL
    order = CONSTANT
  [../]
  [./couple_stress_xy]
    family = MONOMIAL
    order = CONSTANT
  [../]
  [./couple_stress_xz]
    family = MONOMIAL
    order = CONSTANT
  [../]
  [./couple_stress_yx]
    family = MONOMIAL
    order = CONSTANT
  [../]
  [./couple_stress_yy]
    family = MONOMIAL
    order = CONSTANT
  [../]
  [./couple_stress_yz]
    family = MONOMIAL
    order = CONSTANT
  [../]
  [./couple_stress_zx]
    family = MONOMIAL
    order = CONSTANT
  [../]
  [./couple_stress_zy]
    family = MONOMIAL
    order = CONSTANT
  [../]
  [./couple_stress_zz]
    family = MONOMIAL
    order = CONSTANT
  [../]
  [./strainp_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_yx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_zx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_zy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_yx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_zx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_zy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_compressive]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./ls]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yx
    index_i = 1
    index_j = 0
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zx
    index_i = 2
    index_j = 0
  [../]
  [./stress_zy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zy
    index_i = 2
    index_j = 1
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./couple_stress_xx]
    type = RankTwoAux
    rank_two_tensor = couple_stress
    variable = couple_stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./couple_stress_xy]
    type = RankTwoAux
    rank_two_tensor = couple_stress
    variable = couple_stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./couple_stress_xz]
    type = RankTwoAux
    rank_two_tensor = couple_stress
    variable = couple_stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./couple_stress_yx]
    type = RankTwoAux
    rank_two_tensor = couple_stress
    variable = couple_stress_yx
    index_i = 1
    index_j = 0
  [../]
  [./couple_stress_yy]
    type = RankTwoAux
    rank_two_tensor = couple_stress
    variable = couple_stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./couple_stress_yz]
    type = RankTwoAux
    rank_two_tensor = couple_stress
    variable = couple_stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./couple_stress_zx]
    type = RankTwoAux
    rank_two_tensor = couple_stress
    variable = couple_stress_zx
    index_i = 2
    index_j = 0
  [../]
  [./couple_stress_zy]
    type = RankTwoAux
    rank_two_tensor = couple_stress
    variable = couple_stress_zy
    index_i = 2
    index_j = 1
  [../]
  [./couple_stress_zz]
    type = RankTwoAux
    rank_two_tensor = couple_stress
    variable = couple_stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./strainp_xx]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_xx
    index_i = 0
    index_j = 0
  [../]
  [./strainp_xy]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_xy
    index_i = 0
    index_j = 1
  [../]
  [./strainp_xz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_xz
    index_i = 0
    index_j = 2
  [../]
  [./strainp_yx]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_yx
    index_i = 1
    index_j = 0
  [../]
  [./strainp_yy]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_yy
    index_i = 1
    index_j = 1
  [../]
  [./strainp_yz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_yz
    index_i = 1
    index_j = 2
  [../]
  [./strainp_zx]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_zx
    index_i = 2
    index_j = 0
  [../]
  [./strainp_zy]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_zy
    index_i = 2
    index_j = 1
  [../]
  [./strainp_zz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_zz
    index_i = 2
    index_j = 2
  [../]
  [./straint_xx]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_xx
    index_i = 0
    index_j = 0
  [../]
  [./straint_xy]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_xy
    index_i = 0
    index_j = 1
  [../]
  [./straint_xz]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_xz
    index_i = 0
    index_j = 2
  [../]
  [./straint_yx]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_yx
    index_i = 1
    index_j = 0
  [../]
  [./straint_yy]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_yy
    index_i = 1
    index_j = 1
  [../]
  [./straint_yz]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_yz
    index_i = 1
    index_j = 2
  [../]
  [./straint_zx]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_zx
    index_i = 2
    index_j = 0
  [../]
  [./straint_zy]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_zy
    index_i = 2
    index_j = 1
  [../]
  [./straint_zz]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_zz
    index_i = 2
    index_j = 2
  [../]
  [./f_shear]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f_shear
  [../]
  [./f_tensile]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f_tensile
  [../]
  [./f_compressive]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f_compressive
  [../]
  [./intnl_shear]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl_shear
  [../]
  [./intnl_tensile]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 1
    variable = intnl_tensile
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./ls]
    type = MaterialRealAux
    property = plastic_linesearch_needed
    variable = ls
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yx]
    type = PointValue
    point = '0 0 0'
    variable = stress_yx
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zx]
    type = PointValue
    point = '0 0 0'
    variable = stress_zx
  [../]
  [./s_zy]
    type = PointValue
    point = '0 0 0'
    variable = stress_zy
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./c_s_xx]
    type = PointValue
    point = '0 0 0'
    variable = couple_stress_xx
  [../]
  [./c_s_xy]
    type = PointValue
    point = '0 0 0'
    variable = couple_stress_xy
  [../]
  [./c_s_xz]
    type = PointValue
    point = '0 0 0'
    variable = couple_stress_xz
  [../]
  [./c_s_yx]
    type = PointValue
    point = '0 0 0'
    variable = couple_stress_yx
  [../]
  [./c_s_yy]
    type = PointValue
    point = '0 0 0'
    variable = couple_stress_yy
  [../]
  [./c_s_yz]
    type = PointValue
    point = '0 0 0'
    variable = couple_stress_yz
  [../]
  [./c_s_zx]
    type = PointValue
    point = '0 0 0'
    variable = couple_stress_zx
  [../]
  [./c_s_zy]
    type = PointValue
    point = '0 0 0'
    variable = couple_stress_zy
  [../]
  [./c_s_zz]
    type = PointValue
    point = '0 0 0'
    variable = couple_stress_zz
  [../]
  [./strainp_xx]
    type = PointValue
    point = '0 0 0'
    variable = strainp_xx
  [../]
  [./strainp_xy]
    type = PointValue
    point = '0 0 0'
    variable = strainp_xy
  [../]
  [./strainp_xz]
    type = PointValue
    point = '0 0 0'
    variable = strainp_xz
  [../]
  [./strainp_yx]
    type = PointValue
    point = '0 0 0'
    variable = strainp_yx
  [../]
  [./strainp_yy]
    type = PointValue
    point = '0 0 0'
    variable = strainp_yy
  [../]
  [./strainp_yz]
    type = PointValue
    point = '0 0 0'
    variable = strainp_yz
  [../]
  [./strainp_zx]
    type = PointValue
    point = '0 0 0'
    variable = strainp_zx
  [../]
  [./strainp_zy]
    type = PointValue
    point = '0 0 0'
    variable = strainp_zy
  [../]
  [./strainp_zz]
    type = PointValue
    point = '0 0 0'
    variable = strainp_zz
  [../]
  [./straint_xx]
    type = PointValue
    point = '0 0 0'
    variable = straint_xx
  [../]
  [./straint_xy]
    type = PointValue
    point = '0 0 0'
    variable = straint_xy
  [../]
  [./straint_xz]
    type = PointValue
    point = '0 0 0'
    variable = straint_xz
  [../]
  [./straint_yx]
    type = PointValue
    point = '0 0 0'
    variable = straint_yx
  [../]
  [./straint_yy]
    type = PointValue
    point = '0 0 0'
    variable = straint_yy
  [../]
  [./straint_yz]
    type = PointValue
    point = '0 0 0'
    variable = straint_yz
  [../]
  [./straint_zx]
    type = PointValue
    point = '0 0 0'
    variable = straint_zx
  [../]
  [./straint_zy]
    type = PointValue
    point = '0 0 0'
    variable = straint_zy
  [../]
  [./straint_zz]
    type = PointValue
    point = '0 0 0'
    variable = straint_zz
  [../]
  [./f_shear]
    type = PointValue
    point = '0 0 0'
    variable = f_shear
  [../]
  [./f_tensile]
    type = PointValue
    point = '0 0 0'
    variable = f_tensile
  [../]
  [./f_compressive]
    type = PointValue
    point = '0 0 0'
    variable = f_compressive
  [../]
  [./intnl_shear]
    type = PointValue
    point = '0 0 0'
    variable = intnl_shear
  [../]
  [./intnl_tensile]
    type = PointValue
    point = '0 0 0'
    variable = intnl_tensile
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
  [./ls]
    type = PointValue
    point = '0 0 0'
    variable = ls
  [../]
[]
[UserObjects]
  [./coh]
    type = SolidMechanicsHardeningConstant
    value = 30
  [../]
  [./tanphi]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
  [./tanpsi]
    type = SolidMechanicsHardeningConstant
    value = 0.1111077
  [../]
  [./t_strength]
    type = SolidMechanicsHardeningConstant
    value = 0.024449878
  [../]
  [./c_strength]
    type = SolidMechanicsHardeningConstant
    value = 40
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeLayeredCosseratElasticityTensor
    young = 1.0
    poisson = 0.2
    layer_thickness = 0.1
    joint_normal_stiffness = 0.25
    joint_shear_stiffness = 0.2
  [../]
  [./strain]
    type = ComputeCosseratIncrementalSmallStrain
  [../]
  [./admissible]
    type = ComputeMultipleInelasticCosseratStress
    inelastic_models = stress
    perform_finite_strain_rotations = false
  [../]
  [./stress]
    type = CappedWeakPlaneCosseratStressUpdate
    cohesion = coh
    tan_friction_angle = tanphi
    tan_dilation_angle = tanpsi
    tensile_strength = t_strength
    compressive_strength = c_strength
    tip_smoother = 0
    smoothing_tol = 1
    yield_function_tol = 1E-5
  [../]
[]
[Executioner]
  nl_abs_tol = 1E-14
  end_time = 3
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform_cosserat1
  csv = true
[]
(modules/solid_mechanics/test/tests/weak_plane_tensile/small_deform2.i)
# checking for small deformation
# A single element is stretched by 1E-6m in x,y and z directions.
# stress_zz = Youngs Modulus*Strain = 2E6*1E-6 = 2 Pa
# wpt_tensile_strength is set to 5Pa
# Since maximum stress which is 2Pa is less than tension cutoff, plastic yeilding shoud not be observed.
[GlobalParams]
  displacements = 'x_disp y_disp z_disp'
[]
[Mesh]
  type = GeneratedMesh
  dim = 3
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  add_variables = true
  generate_output = 'stress_xz stress_zx stress_yz stress_zz'
[]
[BCs]
  [bottomx]
    type = DirichletBC
    variable = x_disp
    boundary = back
    value = 0.0
  []
  [bottomy]
    type = DirichletBC
    variable = y_disp
    boundary = back
    value = 0.0
  []
  [bottomz]
    type = DirichletBC
    variable = z_disp
    boundary = back
    value = 0.0
  []
  [topx]
    type = DirichletBC
    variable = x_disp
    boundary = front
    value = 1E-6
  []
  [topy]
    type = DirichletBC
    variable = y_disp
    boundary = front
    value = 1E-6
  []
  [topz]
    type = DirichletBC
    variable = z_disp
    boundary = front
    value = 1E-6
  []
[]
[AuxVariables]
  [yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[AuxKernels]
  [yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  []
[]
[Postprocessors]
  [s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  []
  [s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  []
  [s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  []
  [f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  []
[]
[UserObjects]
  [str]
    type = SolidMechanicsHardeningConstant
    value = 5
  []
  [wpt]
    type = SolidMechanicsPlasticWeakPlaneTensile
    tensile_strength = str
    yield_function_tolerance = 1E-6
    internal_constraint_tolerance = 1E-5
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E6'
  []
  [mc]
    type = ComputeMultiPlasticityStress
    plastic_models = wpt
    transverse_direction = '0 0 1'
    ep_plastic_tolerance = 1E-5
  []
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  csv = true
[]
(modules/solid_mechanics/test/tests/mohr_coulomb/small_deform2_small_strain.i)
# apply repeated stretches in x, y and z directions, so that mean_stress = 0
# This maps out the yield surface in the octahedral plane for zero mean stress
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '2E-6*x*sin(t)'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '2E-6*y*sin(2*t)'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '-2E-6*z*(sin(t)+sin(2*t))'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 10
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 20
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 0
  [../]
  [./mc]
    type = SolidMechanicsPlasticMohrCoulomb
    cohesion = mc_coh
    friction_angle = mc_phi
    dilation_angle = mc_psi
    mc_tip_smoother = 4
    mc_edge_smoother = 20
    yield_function_tolerance = 1E-3
    internal_constraint_tolerance = 1E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./strain]
    type = ComputeIncrementalStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = mc
    debug_fspb = crash
  [../]
[]
[Executioner]
  end_time = 100
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform2_small_strain
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/mohr_coulomb/small_deform_hard2.i)
# apply uniform stretches in x, y and z directions.
# let friction_angle = 60deg, friction_angle_residual=10deg, friction_angle_rate = 0.5E4
# With cohesion = C, friction_angle = phi, tip_smoother = T, the
# algorithm should return to
# sigma_m = (C*Cos(phi) - T)/Sin(phi)
# Or, when T=C,
# phi = 2*pi*n - 2*arctan(sigma_m/C)
# This allows checking of the relationship for phi
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '1E-6*x*t'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '1E-6*y*t'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1E-6*z*t'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_int]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./mc_int_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = mc_int
  [../]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./internal]
    type = PointValue
    point = '0 0 0'
    variable = mc_int
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 10
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningExponential
    value_0 = 1.04719755 # 60deg
    value_residual = 0.17453293 # 10deg
    rate = 0.5E4
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 5
    convert_to_radians = true
  [../]
  [./mc]
    type = SolidMechanicsPlasticMohrCoulomb
    cohesion = mc_coh
    friction_angle = mc_phi
    dilation_angle = mc_psi
    mc_tip_smoother = 10
    mc_edge_smoother = 25
    yield_function_tolerance = 1E-3
    internal_constraint_tolerance = 1E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = mc
    debug_fspb = crash
    debug_jac_at_stress = '10 1 2 1 10 3 2 3 10'
    debug_jac_at_pm = 1
    debug_jac_at_intnl = 1E-3
    debug_stress_change = 1E-5
    debug_pm_change = 1E-6
    debug_intnl_change = 1E-6
  [../]
[]
[Executioner]
  end_time = 10
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform_hard2
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/capped_drucker_prager/small_deform3_inner_tip.i)
# apply repeated stretches in x z directions, and smaller stretches along the y direction,
# so that sigma_I = sigma_II,
# which means that lode angle = 30deg.
# The allows yield surface in meridional plane to be mapped out
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '1E-6*x*t'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '-1.7E-6*y*t'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1E-6*z*t'
  [../]
[]
[AuxVariables]
  [./mc_int]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./mc_int_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = mc_int
  [../]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./internal]
    type = PointValue
    point = '0 0 0'
    variable = mc_int
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1E5
  [../]
  [./cs]
    type = SolidMechanicsHardeningConstant
    value = 1E5
  [../]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 10
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 35
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 5
    convert_to_radians = true
  [../]
  [./dp]
    type = SolidMechanicsPlasticDruckerPrager
    mc_cohesion = mc_coh
    mc_friction_angle = mc_phi
    mc_dilation_angle = mc_psi
    mc_interpolation_scheme = inner_tip
    yield_function_tolerance = 1      # irrelevant here
    internal_constraint_tolerance = 1 # irrelevant here
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./admissible]
    type = ComputeMultipleInelasticStress
    inelastic_models = mc
    perform_finite_strain_rotations = false
  [../]
  [./mc]
    type = CappedDruckerPragerStressUpdate
    DP_model = dp
    tensile_strength = ts
    compressive_strength = cs
    yield_function_tol = 1E-8
    tip_smoother = 8
    smoothing_tol = 1E-7
  [../]
[]
[Executioner]
  end_time = 10
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform3_inner_tip
  exodus = false
  [./csv]
    type = CSV
  [../]
[]
(modules/solid_mechanics/test/tests/tensile/small_deform2.i)
# checking for small deformation
# A single element is stretched by 1E-6m in all directions.
# tensile_strength is set to 1Pa, and smoother = 0.5
# Then the final stress should return to the yield surface and all principal stresses should be 0.5
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    strain = finite
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '1E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '1E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1E-6*z'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1
  [../]
  [./mc]
    type = SolidMechanicsPlasticTensile
    tensile_strength = ts
    yield_function_tolerance = 1E-6
    tensile_tip_smoother = 0.5
    internal_constraint_tolerance = 1E-5
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 2.0E6'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-5
    plastic_models = mc
    debug_fspb = crash
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform2
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/multi/three_surface20.i)
# Plasticit models:
# SimpleTester0 with a = 0 and b = 1 and strength = 1
# SimpleTester1 with a = 1 and b = 0 and strength = 1
# SimpleTester2 with a = 1 and b = 1 and strength = 1.5
#
# Lame lambda = 0 (Poisson=0).  Lame mu = 0.5E6
#
# A single element is stretched by 1.1E-6m in y direction and 1.7E-6 in z direction.
# trial stress_yy = 1.1 and stress_zz = 1.7
#
# Then all yield functions will activate
# However, there is linear dependence.  SimpleTester1 will be rutned off.
# The algorithm will return to
# stress_yy=0.5 and stress_zz=1
# internal0=0.1, internal2=0.6
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '1.1E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1.7E-6*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int2]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./int0]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 0
    variable = int0
  [../]
  [./int1]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 1
    variable = int1
  [../]
  [./int2]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 2
    variable = int2
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./f2]
    type = PointValue
    point = '0 0 0'
    variable = f2
  [../]
  [./int0]
    type = PointValue
    point = '0 0 0'
    variable = int0
  [../]
  [./int1]
    type = PointValue
    point = '0 0 0'
    variable = int1
  [../]
  [./int2]
    type = PointValue
    point = '0 0 0'
    variable = int2
  [../]
[]
[UserObjects]
  [./simple0]
    type = SolidMechanicsPlasticSimpleTester
    a = 0
    b = 1
    strength = 1
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
  [./simple1]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 0
    strength = 1
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
  [./simple2]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 1
    strength = 1.5
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 0.5E6'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./multi]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = 'simple0 simple1 simple2'
    max_NR_iterations = 2
    min_stepsize = 1
    debug_fspb = crash
    debug_jac_at_stress = '10 0 0 0 10 0 0 0 10'
    debug_jac_at_pm = '1 1'
    debug_jac_at_intnl = '1 1'
    debug_stress_change = 1E-5
    debug_pm_change = '1E-6 1E-6'
    debug_intnl_change = '1E-6 1E-6'
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = three_surface20
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/capped_weak_plane/small_deform2.i)
# Plastic deformation, tensile failure
# With Lame lambda=0 and Lame mu=1, applying the following
# deformation to the zmax surface of a unit cube:
# disp_z = t
# should yield trial stress:
# stress_zz = 2*t
# Use tensile strength = 1, we should return to stress_zz = 1
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz plastic_strain_xx plastic_strain_xy plastic_strain_xz plastic_strain_yy plastic_strain_yz plastic_strain_zz strain_xx strain_xy strain_xz strain_yy strain_yz strain_zz'
  [../]
[]
[BCs]
  [./bottomx]
    type = DirichletBC
    variable = disp_x
    boundary = back
    value = 0.0
  [../]
  [./bottomy]
    type = DirichletBC
    variable = disp_y
    boundary = back
    value = 0.0
  [../]
  [./bottomz]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0.0
  [../]
  [./topx]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = front
    function = 0
  [../]
  [./topy]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = front
    function = 0
  [../]
  [./topz]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = t
  [../]
[]
[AuxVariables]
  [./f_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_compressive]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./ls]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./f_shear]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f_shear
  [../]
  [./f_tensile]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f_tensile
  [../]
  [./f_compressive]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f_compressive
  [../]
  [./intnl_shear]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl_shear
  [../]
  [./intnl_tensile]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 1
    variable = intnl_tensile
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./ls]
    type = MaterialRealAux
    property = plastic_linesearch_needed
    variable = ls
  [../]
[]
[Postprocessors]
  [./stress_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./stress_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./stress_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./stress_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./stress_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./stress_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./strainp_xx]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_xx
  [../]
  [./strainp_xy]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_xy
  [../]
  [./strainp_xz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_xz
  [../]
  [./strainp_yy]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_yy
  [../]
  [./strainp_yz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_yz
  [../]
  [./strainp_zz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_zz
  [../]
  [./straint_xx]
    type = PointValue
    point = '0 0 0'
    variable = strain_xx
  [../]
  [./straint_xy]
    type = PointValue
    point = '0 0 0'
    variable = strain_xy
  [../]
  [./straint_xz]
    type = PointValue
    point = '0 0 0'
    variable = strain_xz
  [../]
  [./straint_yy]
    type = PointValue
    point = '0 0 0'
    variable = strain_yy
  [../]
  [./straint_yz]
    type = PointValue
    point = '0 0 0'
    variable = strain_yz
  [../]
  [./straint_zz]
    type = PointValue
    point = '0 0 0'
    variable = strain_zz
  [../]
  [./f_shear]
    type = PointValue
    point = '0 0 0'
    variable = f_shear
  [../]
  [./f_tensile]
    type = PointValue
    point = '0 0 0'
    variable = f_tensile
  [../]
  [./f_compressive]
    type = PointValue
    point = '0 0 0'
    variable = f_compressive
  [../]
  [./intnl_shear]
    type = PointValue
    point = '0 0 0'
    variable = intnl_shear
  [../]
  [./intnl_tensile]
    type = PointValue
    point = '0 0 0'
    variable = intnl_tensile
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
  [./ls]
    type = PointValue
    point = '0 0 0'
    variable = ls
  [../]
[]
[UserObjects]
  [./coh]
    type = SolidMechanicsHardeningConstant
    value = 30
  [../]
  [./tanphi]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
  [./tanpsi]
    type = SolidMechanicsHardeningConstant
    value = 0.1111077
  [../]
  [./t_strength]
    type = SolidMechanicsHardeningConstant
    value = 1
  [../]
  [./c_strength]
    type = SolidMechanicsHardeningConstant
    value = 40
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '0 1'
  [../]
  [./admissible]
    type = ComputeMultipleInelasticStress
    inelastic_models = stress
    perform_finite_strain_rotations = false
  [../]
  [./stress]
    type = CappedWeakPlaneStressUpdate
    cohesion = coh
    tan_friction_angle = tanphi
    tan_dilation_angle = tanpsi
    tensile_strength = t_strength
    compressive_strength = c_strength
    tip_smoother = 0
    smoothing_tol = 0
    yield_function_tol = 1E-5
  [../]
[]
[Executioner]
  end_time = 2
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform2
  csv = true
[]
(modules/solid_mechanics/test/tests/mohr_coulomb/small_deform_hard1.i)
# apply uniform stretches in x, y and z directions.
# let mc_cohesion = 10, mc_cohesion_residual = 2, mc_cohesion_rate =
# With cohesion = C, friction_angle = 60deg, tip_smoother = 4, the
# algorithm should return to
# sigma_m = (C*Cos(60) - 4)/Sin(60)
# This allows checking of the relationship for C
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '1E-6*x*t'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '1E-6*y*t'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1E-6*z*t'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_int]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./mc_int_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = mc_int
  [../]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./internal]
    type = PointValue
    point = '0 0 0'
    variable = mc_int
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./mc_coh]
    type = SolidMechanicsHardeningExponential
    value_0 = 10
    value_residual = 2
    rate = 1E4
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 60
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 5
    convert_to_radians = true
  [../]
  [./mc]
    type = SolidMechanicsPlasticMohrCoulomb
    cohesion = mc_coh
    friction_angle = mc_phi
    dilation_angle = mc_psi
    mc_tip_smoother = 4
    mc_edge_smoother = 25
    yield_function_tolerance = 1E-3
    internal_constraint_tolerance = 1E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = mc
    debug_fspb = crash
    debug_jac_at_stress = '10 1 2 1 10 3 2 3 10'
    debug_jac_at_pm = 1
    debug_jac_at_intnl = 1E-4
    debug_stress_change = 1E-5
    debug_pm_change = 1E-6
    debug_intnl_change = 1E-8
  [../]
[]
[Executioner]
  end_time = 10
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform_hard1
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/mohr_coulomb/small_deform1_uo.i)
# apply uniform stretch in x, y and z directions.
# With cohesion = 10, friction_angle = 60deg, tip_smoother = 4, the
# algorithm should return to
# sigma_m = (10*Cos(60) - 4)/Sin(60) = 1.1547
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '1E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '1E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1E-6*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = f
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = f
  [../]
[]
[UserObjects]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 10
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 60
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 5
    convert_to_radians = true
  [../]
  [./mc]
    type = SolidMechanicsPlasticMohrCoulomb
    cohesion = mc_coh
    friction_angle = mc_phi
    dilation_angle = mc_psi
    mc_tip_smoother = 4
    mc_edge_smoother = 25
    yield_function_tolerance = 1E-3
    internal_constraint_tolerance = 1E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = mc
    debug_fspb = crash
    debug_jac_at_stress = '10 0 0 0 10 0 0 0 10'
    debug_jac_at_pm = 1
    debug_jac_at_intnl = 1
    debug_stress_change = 1E-5
    debug_pm_change = 1E-6
    debug_intnl_change = 1E-6
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform1_uo
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/tensile/random_update.i)
# Plasticity models:
# Planar tensile with strength = 1MPa
#
# Lame lambda = 1GPa.  Lame mu = 1.3GPa
#
# A line of elements is perturbed randomly, and return to the yield surface at each quadpoint is checked
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1000
  ny = 1234
  nz = 1
  xmin = 0
  xmax = 1000
  ymin = 0
  ymax = 1234
  zmin = 0
  zmax = 1
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    strain = finite
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[ICs]
  [./x]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_x
  [../]
  [./y]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_y
  [../]
  [./z]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_z
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '0'
  [../]
[]
[AuxVariables]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./f0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./int0]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 0
    variable = int0
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
[]
[Postprocessors]
  [./tot_iters]
    type = ElementIntegralMaterialProperty
    mat_prop = plastic_NR_iterations
    outputs = console
  [../]
  [./raw_f0]
    type = ElementExtremeValue
    variable = f0
    outputs = console
  [../]
  [./raw_f1]
    type = ElementExtremeValue
    variable = f1
    outputs = console
  [../]
  [./raw_f2]
    type = ElementExtremeValue
    variable = f2
    outputs = console
  [../]
  [./iter]
    type = ElementExtremeValue
    variable = iter
    outputs = console
  [../]
  [./f0]
    type = FunctionValuePostprocessor
    function = should_be_zero0_fcn
  [../]
  [./f1]
    type = FunctionValuePostprocessor
    function = should_be_zero1_fcn
  [../]
  [./f2]
    type = FunctionValuePostprocessor
    function = should_be_zero2_fcn
  [../]
[]
[Functions]
  [./should_be_zero0_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-1,0,a)'
    symbol_names = 'a'
    symbol_values = 'raw_f0'
  [../]
  [./should_be_zero1_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-1,0,a)'
    symbol_names = 'a'
    symbol_values = 'raw_f1'
  [../]
  [./should_be_zero2_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-1,0,a)'
    symbol_names = 'a'
    symbol_values = 'raw_f2'
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningCubic
    value_0 = 1E6
    value_residual = 0
    internal_limit = 1
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '1E9 1.3E9'
  [../]
  [./tensile]
    type = TensileStressUpdate
    tensile_strength = ts
    smoothing_tol = 1E5
    max_NR_iterations = 100
    yield_function_tol = 1.0E-1
  [../]
  [./stress]
    type = ComputeMultipleInelasticStress
    inelastic_models = tensile
    perform_finite_strain_rotations = false
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = random_update
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/mean_cap_TC/small_deform5.i)
# apply nonuniform stretch in x, y and z directions using
# Lame lambda = 0.7E7, Lame mu = 1.0E7,
# trial_stress(0, 0) = 2.9
# trial_stress(1, 1) = 10.9
# trial_stress(2, 2) = 14.9
# With tensile_strength = 2, decaying to zero at internal parameter = 4E-7
# via a Cubic, the algorithm should return to:
# internal parameter = 2.26829E-7
# trace(stress) = 0.799989 = tensile_strength
# stress(0, 0) = -6.4
# stress(1, 1) = 1.6
# stress(2, 2) = 5.6
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '-1E-7*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '3E-7*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '5E-7*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = f
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = f
  [../]
[]
[UserObjects]
  [./tensile_strength]
    type = SolidMechanicsHardeningCubic
    value_0 = 2
    value_residual = 0
    internal_limit = 4E-7
  [../]
  [./compressive_strength]
    type = SolidMechanicsHardeningCubic
    value_0 = -1
    value_residual = 0
    internal_limit = 1E-8
  [../]
  [./cap]
    type = SolidMechanicsPlasticMeanCapTC
    tensile_strength = tensile_strength
    compressive_strength = compressive_strength
    yield_function_tolerance = 1E-5
    internal_constraint_tolerance = 1E-11
    use_custom_returnMap = false
    use_custom_cto = false
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0.7E7 1E7'
  [../]
  [./strain]
    type = ComputeIncrementalStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mean_cap]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-11
    plastic_models = cap
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform5
  exodus = false
  [./csv]
    type = CSV
  [../]
[]
(modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform5.i)
# Using CappedMohrCoulomb with tensile failure only
# A single element is incrementally stretched in the in the z and x directions
# This causes the return direction to be along the hypersurface sigma_III = 0
# and the resulting stresses are checked to lie on the expected yield surface
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    strain = finite
    incremental = true
    generate_output = 'max_principal_stress mid_principal_stress min_principal_stress stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '4*x*t'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = 'z*(t-0.5)'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_I]
    type = PointValue
    point = '0 0 0'
    variable = max_principal_stress
  [../]
  [./s_II]
    type = PointValue
    point = '0 0 0'
    variable = mid_principal_stress
  [../]
  [./s_III]
    type = PointValue
    point = '0 0 0'
    variable = min_principal_stress
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1
  [../]
  [./cs]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./coh]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./ang]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '0 2.0'
  [../]
  [./tensile]
    type = CappedMohrCoulombStressUpdate
    tensile_strength = ts
    compressive_strength = cs
    cohesion = coh
    friction_angle = ang
    dilation_angle = ang
    smoothing_tol = 0.5
    yield_function_tol = 1.0E-12
  [../]
  [./stress]
    type = ComputeMultipleInelasticStress
    inelastic_models = tensile
    perform_finite_strain_rotations = false
  [../]
[]
[Executioner]
  end_time = 1
  dt = 0.1
  type = Transient
[]
[Outputs]
  file_base = small_deform5
  csv = true
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/monolithic_material_based/crysp_fileread.i)
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx=1
  ny=1
  nz=1
  xmin=0.0
  xmax=1.0
  ymin=0.0
  ymax=1.0
  zmin=0.0
  zmax=1.0
  elem_type = HEX8
  displacements = 'disp_x disp_y disp_z'
[]
[Variables]
  [./disp_x]
    block = 0
  [../]
  [./disp_y]
    block = 0
  [../]
  [./disp_z]
    block = 0
  [../]
[]
[AuxVariables]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
  [./fp_zz]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
  [./rotout]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
  [./e_zz]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
  [./gss1]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
[]
[Functions]
  [./tdisp]
    type = ParsedFunction
    expression = 0.01*t
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
    use_displaced_mesh = true
  [../]
[]
[AuxKernels]
  [./stress_zz]
    type = RankTwoAux
    variable = stress_zz
    rank_two_tensor = stress
    index_j = 2
    index_i = 2
    execute_on = timestep_end
    block = 0
  [../]
  [./fp_zz]
    type = RankTwoAux
    variable = fp_zz
    rank_two_tensor = fp
    index_j = 2
    index_i = 2
    execute_on = 'initial timestep_end'
    block = 0
  [../]
  [./e_zz]
    type = RankTwoAux
    variable = e_zz
    rank_two_tensor = lage
    index_j = 2
    index_i = 2
    execute_on = timestep_end
    block = 0
  [../]
  [./gss1]
    type = MaterialStdVectorAux
    variable = gss1
    property = gss
    index = 0
    execute_on = 'initial timestep_end'
    block = 0
  [../]
[]
[BCs]
  [./symmy]
    type = DirichletBC
    variable = disp_y
    boundary = bottom
    value = 0
  [../]
  [./symmx]
    type = DirichletBC
    variable = disp_x
    boundary = left
    value = 0
  [../]
  [./symmz]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0
  [../]
  [./tdisp]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = tdisp
  [../]
[]
[Materials]
  [./crysp]
    type = FiniteStrainCrystalPlasticity
    block = 0
    gtol = 1e-2
    slip_sys_file_name = input_slip_sys.txt
    slip_sys_res_prop_file_name = input_slip_sys_res.txt
    slip_sys_flow_prop_file_name = input_slip_sys_flow_prop.txt
    hprops = '1.0 541.5 60.8 109.8 2.5'
    nss = 12
    intvar_read_type = slip_sys_res_file
  [../]
  [./elasticity_tensor]
    type = ComputeElasticityTensorCP
    block = 0
    C_ijkl = '1.684e5 1.214e5 1.214e5 1.684e5 1.214e5 1.684e5 0.754e5 0.754e5 0.754e5'
    fill_method = symmetric9
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[Postprocessors]
  [./stress_zz]
    type = ElementAverageValue
    variable = stress_zz
    execute_on = 'initial timestep_end'
  [../]
  [./fp_zz]
    type = ElementAverageValue
    variable = fp_zz
    execute_on = 'initial timestep_end'
  [../]
  [./e_zz]
    type = ElementAverageValue
    variable = e_zz
    execute_on = 'initial timestep_end'
  [../]
  [./gss1]
    type = ElementAverageValue
    variable = gss1
    execute_on = 'initial timestep_end'
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  #Preconditioned JFNK (default)
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  nl_rel_tol = 1e-10
  nl_abs_tol = 1e-10
  dt = 0.05
  dtmax = 10.0
  dtmin = 0.05
  num_steps = 10
[]
[Outputs]
  file_base = crysp_fileread_out
  exodus = true
[]
(modules/solid_mechanics/test/tests/capped_drucker_prager/small_deform2_native.i)
# apply repeated stretches in x, y and z directions, so that mean_stress = 0
# This maps out the yield surface in the octahedral plane for zero mean stress
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '-1.5E-6*x+2E-6*x*sin(t)'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '2E-6*y*sin(2*t)'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '-2E-6*z*(sin(t)+sin(2*t))'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1000
  [../]
  [./cs]
    type = SolidMechanicsHardeningConstant
    value = 1000
  [../]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 10
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 20
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 0
  [../]
  [./dp]
    type = SolidMechanicsPlasticDruckerPrager
    mc_cohesion = mc_coh
    mc_friction_angle = mc_phi
    mc_dilation_angle = mc_psi
    mc_interpolation_scheme = native
    internal_constraint_tolerance = 1 # irrelevant here
    yield_function_tolerance = 1      # irrelevant here
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./admissible]
    type = ComputeMultipleInelasticStress
    inelastic_models = cdp
    perform_finite_strain_rotations = false
  [../]
  [./cdp]
    type = CappedDruckerPragerStressUpdate
    DP_model = dp
    tensile_strength = ts
    compressive_strength = cs
    yield_function_tol = 1E-8
    tip_smoother = 4
    smoothing_tol = 1E-5
  [../]
[]
[Executioner]
  end_time = 100
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform2_native
  exodus = false
  [./csv]
    type = CSV
  [../]
[]
(modules/solid_mechanics/test/tests/tensile/random_smoothed.i)
# Plasticity models:
# Smoothed tensile with strength = 1MPa
#
# Lame lambda = 1GPa.  Lame mu = 1.3GPa
#
# A line of elements is perturbed randomly, and return to the yield surface at each quadpoint is checked
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1000
  ny = 1234
  nz = 1
  xmin = 0
  xmax = 1000
  ymin = 0
  ymax = 1234
  zmin = 0
  zmax = 1
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    strain = finite
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[ICs]
  [./x]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_x
  [../]
  [./y]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_y
  [../]
  [./z]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_z
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '0'
  [../]
[]
[AuxVariables]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./f0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./int0]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 0
    variable = int0
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
[]
[Postprocessors]
  [./tot_iters]
    type = ElementIntegralMaterialProperty
    mat_prop = plastic_NR_iterations
    outputs = console
  [../]
  [./raw_f0]
    type = ElementExtremeValue
    variable = f0
    outputs = console
  [../]
  [./iter]
    type = ElementExtremeValue
    variable = iter
    outputs = console
  [../]
  [./f0]
    type = FunctionValuePostprocessor
    function = should_be_zero0_fcn
  [../]
[]
[Functions]
  [./should_be_zero0_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-1,0,a)'
    symbol_names = 'a'
    symbol_values = 'raw_f0'
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./tensile]
    type = SolidMechanicsPlasticTensile
    tensile_strength = ts
    tensile_tip_smoother = 1E5
    yield_function_tolerance = 1.0E-1
    internal_constraint_tolerance = 1.0E-7
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '1E9 1.3E9'
  [../]
  [./multi]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-7
    plastic_models = 'tensile'
    max_NR_iterations = 20
    min_stepsize = 1E-4
    max_stepsize_for_dumb = 1E-3
    debug_fspb = crash
    debug_jac_at_stress = '10 0 0 0 10 0 0 0 10'
    debug_jac_at_pm = '1 1 1 1'
    debug_jac_at_intnl = '1 1 1 1'
    debug_stress_change = 1E1
    debug_pm_change = '1E-6 1E-6 1E-6 1E-6'
    debug_intnl_change = '1E-6 1E-6 1E-6 1E-6'
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = random_smoothed
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/monolithic_material_based/cp_slip_rate_integ/crysp_substep.i)
[Mesh]
  type = GeneratedMesh
  dim = 3
  elem_type = HEX8
  displacements = 'disp_x disp_y disp_z'
[]
[Variables]
  [./disp_x]
    block = 0
  [../]
  [./disp_y]
    block = 0
  [../]
  [./disp_z]
    block = 0
  [../]
[]
[AuxVariables]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
  [./fp_zz]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
  [./e_zz]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
  [./gss1]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
[]
[Functions]
  [./tdisp]
    type = ParsedFunction
    expression = 0.01*t
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
    use_displaced_mesh = true
  [../]
[]
[AuxKernels]
  [./stress_zz]
    type = RankTwoAux
    variable = stress_zz
    rank_two_tensor = stress
    index_j = 2
    index_i = 2
    execute_on = timestep_end
    block = 0
  [../]
  [./fp_zz]
    type = RankTwoAux
    variable = fp_zz
    rank_two_tensor = fp
    index_j = 2
    index_i = 2
    execute_on = timestep_end
    block = 0
  [../]
  [./e_zz]
    type = RankTwoAux
    variable = e_zz
    rank_two_tensor = lage
    index_j = 2
    index_i = 2
    execute_on = timestep_end
    block = 0
  [../]
  [./gss1]
    type = MaterialStdVectorAux
    variable = gss1
    property = gss
    index = 0
    execute_on = timestep_end
    block = 0
  [../]
[]
[BCs]
  [./symmy]
    type = DirichletBC
    variable = disp_y
    boundary = bottom
    value = 0
  [../]
  [./symmx]
    type = DirichletBC
    variable = disp_x
    boundary = left
    value = 0
  [../]
  [./symmz]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0
  [../]
  [./tdisp]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = tdisp
  [../]
[]
[Materials]
  [./crysp]
    type = FiniteStrainCPSlipRateRes
    block = 0
    gtol = 1e-2
    slip_sys_file_name = input_slip_sys.txt
    nss = 12
    num_slip_sys_flowrate_props = 2 #Number of properties in a slip system
    flowprops = '1 4 0.001 0.01 5 8 0.001 0.01 9 12 0.001 0.01'
    hprops = '1.0 541.5 60.8 109.8 2.5'
    gprops = '1 4 60.8 5 8 60.8 9 12 60.8'
    tan_mod_type = exact
    slip_incr_tol = 1
    maximum_substep_iteration = 8
  [../]
  [./elasticity_tensor]
    type = ComputeElasticityTensorCP
    block = 0
    C_ijkl = '1.684e5 1.214e5 1.214e5 1.684e5 1.214e5 1.684e5 0.754e5 0.754e5 0.754e5'
    fill_method = symmetric9
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[Postprocessors]
  [./stress_zz]
    type = ElementAverageValue
    variable = stress_zz
    block = 'ANY_BLOCK_ID 0'
  [../]
  [./fp_zz]
    type = ElementAverageValue
    variable = fp_zz
    block = 'ANY_BLOCK_ID 0'
  [../]
  [./e_zz]
    type = ElementAverageValue
    variable = e_zz
    block = 'ANY_BLOCK_ID 0'
  [../]
  [./gss1]
    type = ElementAverageValue
    variable = gss1
    block = 'ANY_BLOCK_ID 0'
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  #Preconditioned JFNK (default)
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  nl_rel_tol = 1e-10
  nl_abs_tol = 1e-10
  dt = 0.2
  dtmax = 10.0
  dtmin = 0.05
  end_time = 1
[]
[Outputs]
  file_base = crysp_substep_out
  exodus = true
  print_linear_residuals = true
  perf_graph = true
[]
(modules/solid_mechanics/test/tests/weak_plane_tensile/large_deform2.i)
# large strain with weak-plane normal rotating with mesh
# First rotate mesh 45deg about x axis
# Then apply stretch in the y=z direction.
# This should create a pure tensile load (no shear), which
# should return to the yield surface.
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
  type = GeneratedMesh
  dim = 3
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  add_variables = true
  generate_output = 'stress_xx stress_yy stress_yz stress_zz'
[]
[BCs]
  # rotate:
  # ynew = c*y + s*z.  znew = -s*y + c*z
  [bottomx]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = back
    function = '0'
  []
  [bottomy]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = back
    function = '0.70710678*y+0.70710678*z-y'
  []
  [bottomz]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = back
    function = '-0.70710678*y+0.70710678*z-z'
  []
  [topx]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = front
    function = '0'
  []
  [topy]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = front
    function = '0.70710678*y+0.70710678*z-y+if(t>0,1,0)'
  []
  [topz]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = '-0.70710678*y+0.70710678*z-z+if(t>0,1,0)'
  []
[]
[AuxVariables]
  [yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[AuxKernels]
  [yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  []
[]
[Postprocessors]
  [s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  []
  [s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  []
  [s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  []
  [s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  []
  [f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  []
[]
[UserObjects]
  [str]
    type = SolidMechanicsHardeningConstant
    value = 1.0E6
  []
  [wpt]
    type = SolidMechanicsPlasticWeakPlaneTensile
    tensile_strength = str
    yield_function_tolerance = 1E-7
    internal_constraint_tolerance = 1E-5
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  []
  [mc]
    type = ComputeMultiPlasticityStress
    plastic_models = wpt
    transverse_direction = '0 0 1'
    ep_plastic_tolerance = 1E-9
  []
[]
[Executioner]
  start_time = -1
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  exodus = true
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/stress_update_material_based/substep.i)
[GlobalParams]
  displacements = 'ux uy uz'
[]
[Mesh]
  type = GeneratedMesh
  dim = 3
  elem_type = HEX8
[]
[AuxVariables]
  [fp_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [e_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [gss]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  add_variables = true
  generate_output = stress_zz
[]
[AuxKernels]
  [fp_zz]
    type = RankTwoAux
    variable = fp_zz
    rank_two_tensor = plastic_deformation_gradient
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [e_zz]
    type = RankTwoAux
    variable = e_zz
    rank_two_tensor = total_lagrangian_strain
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [gss]
    type = MaterialStdVectorAux
    variable = gss
    property = slip_resistance
    index = 0
    execute_on = timestep_end
  []
[]
[BCs]
  [symmy]
    type = DirichletBC
    variable = uy
    boundary = bottom
    value = 0
  []
  [symmx]
    type = DirichletBC
    variable = ux
    boundary = left
    value = 0
  []
  [symmz]
    type = DirichletBC
    variable = uz
    boundary = back
    value = 0
  []
  [tdisp]
    type = FunctionDirichletBC
    variable = uz
    boundary = front
    function = 0.01*t
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensorCP
    C_ijkl = '1.684e5 1.214e5 1.214e5 1.684e5 1.214e5 1.684e5 0.754e5 0.754e5 0.754e5'
    fill_method = symmetric9
  []
  [stress]
    type = ComputeMultipleCrystalPlasticityStress
    crystal_plasticity_models = 'trial_xtalpl'
    tan_mod_type = exact
    maximum_substep_iteration = 10
  []
  [trial_xtalpl]
    type = CrystalPlasticityKalidindiUpdate
    number_slip_systems = 12
    slip_sys_file_name = input_slip_sys.txt
    resistance_tol = 1.0e-2
  []
[]
[Postprocessors]
  [stress_zz]
    type = ElementAverageValue
    variable = stress_zz
  []
  [fp_zz]
    type = ElementAverageValue
    variable = fp_zz
  []
  [e_zz]
    type = ElementAverageValue
    variable = e_zz
  []
  [gss]
    type = ElementAverageValue
    variable = gss
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  dt = 2.0
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
  petsc_options_value = ' asm      2              lu            gmres     200'
  nl_abs_tol = 1e-10
  nl_rel_step_tol = 1e-10
  dtmax = 10.0
  nl_rel_tol = 1e-10
  dtmin = 0.5
  num_steps = 10
  nl_abs_step_tol = 1e-10
[]
[Outputs]
  exodus = true
  csv = true
  gnuplot = true
[]
(modules/solid_mechanics/test/tests/tensile/planar2.i)
# checking for small deformation
# A single element is stretched by 1E-6m in all directions, with lame mu = 1E6, so trial stress is 2Pa in principal directions
# tensile_strength is set to 1Pa
# Then the final stress should return to the all principal stresses being 1.0 (up to tolerance), and internal parameter = (0.5+0.5+0.5)E-6 = 1.5E-6
# Using 'planar' Tensile plasticity
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    strain = finite
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '1E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '1E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1E-6*z'
  [../]
[]
[AuxVariables]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./f0_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./intnl_auxk]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./f2]
    type = PointValue
    point = '0 0 0'
    variable = f2
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
    outputs = console
  [../]
  [./intnl]
    type = PointValue
    point = '0 0 0'
    variable = intnl
  [../]
[]
[UserObjects]
  [./hard]
    type = SolidMechanicsHardeningConstant
    value = 1
  [../]
  [./tens]
    type = SolidMechanicsPlasticTensileMulti
    tensile_strength = hard
    shift = 1E-6
    yield_function_tolerance = 1E-6
    internal_constraint_tolerance = 1E-5
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E6'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-5
    plastic_models = tens
    debug_fspb = crash
    debug_jac_at_stress = '1 2 3 2 -4 -5 3 -5 10'
    debug_jac_at_pm = '0.1 0.2 0.3'
    debug_jac_at_intnl = 1E-6
    debug_stress_change = 1E-6
    debug_pm_change = '1E-6 1E-6 1E-6'
    debug_intnl_change = 1E-6
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = planar2
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/capped_drucker_prager/small_deform2_inner_tip.i)
# apply repeated stretches in x, y and z directions, so that mean_stress = 0
# This maps out the yield surface in the octahedral plane for zero mean stress
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '-1.5E-6*x+2E-6*x*sin(t)'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '2E-6*y*sin(2*t)'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '-2E-6*z*(sin(t)+sin(2*t))'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1000
  [../]
  [./cs]
    type = SolidMechanicsHardeningConstant
    value = 1000
  [../]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 10
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 20
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 0
  [../]
  [./dp]
    type = SolidMechanicsPlasticDruckerPrager
    mc_cohesion = mc_coh
    mc_friction_angle = mc_phi
    mc_dilation_angle = mc_psi
    mc_interpolation_scheme = inner_tip
    internal_constraint_tolerance = 1 # irrelevant here
    yield_function_tolerance = 1      # irrelevant here
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./admissible]
    type = ComputeMultipleInelasticStress
    inelastic_models = cdp
    perform_finite_strain_rotations = false
  [../]
  [./cdp]
    type = CappedDruckerPragerStressUpdate
    DP_model = dp
    tensile_strength = ts
    compressive_strength = cs
    yield_function_tol = 1E-8
    tip_smoother = 4
    smoothing_tol = 1E-5
  [../]
[]
[Executioner]
  end_time = 100
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform2_inner_tip
  exodus = false
  [./csv]
    type = CSV
  [../]
[]
(modules/solid_mechanics/test/tests/capped_weak_plane/small_deform8.i)
# Plastic deformation, compression with hardening
# With Lame lambda=0 and Lame mu=1, applying the following
# deformation to the zmax surface of a unit cube:
# disp_z = -t
# should yield trial stress:
# stress_zz = -2*t
# The compressive strength varies as a cubic between 1 (at intnl=0)
# and 2 (at intnl=1).  The equation to solve is
# 2 - Ezzzz * ga = -2 * (ga - 1/2)^3 + (3/2) (ga - 1/2) + 3/2
# where the left-hand side comes from p = p_trial + ga * Ezzzz
# and the right-hand side is the cubic compressive strength
# The solution is ga = 0.355416 ( = intnl[1]), and the cubic
# is 1.289168 ( = -p) at that point
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz plastic_strain_xx plastic_strain_xy plastic_strain_xz plastic_strain_yy plastic_strain_yz plastic_strain_zz strain_xx strain_xy strain_xz strain_yy strain_yz strain_zz'
  [../]
[]
[BCs]
  [./bottomx]
    type = DirichletBC
    variable = disp_x
    boundary = back
    value = 0.0
  [../]
  [./bottomy]
    type = DirichletBC
    variable = disp_y
    boundary = back
    value = 0.0
  [../]
  [./bottomz]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0.0
  [../]
  [./topx]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = front
    function = 0
  [../]
  [./topy]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = front
    function = 0
  [../]
  [./topz]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = -t
  [../]
[]
[AuxVariables]
  [./f_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_compressive]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./ls]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./f_shear]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f_shear
  [../]
  [./f_tensile]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f_tensile
  [../]
  [./f_compressive]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f_compressive
  [../]
  [./intnl_shear]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl_shear
  [../]
  [./intnl_tensile]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 1
    variable = intnl_tensile
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./ls]
    type = MaterialRealAux
    property = plastic_linesearch_needed
    variable = ls
  [../]
[]
[Postprocessors]
  [./stress_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./stress_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./stress_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./stress_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./stress_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./stress_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./strainp_xx]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_xx
  [../]
  [./strainp_xy]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_xy
  [../]
  [./strainp_xz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_xz
  [../]
  [./strainp_yy]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_yy
  [../]
  [./strainp_yz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_yz
  [../]
  [./strainp_zz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_zz
  [../]
  [./straint_xx]
    type = PointValue
    point = '0 0 0'
    variable = strain_xx
  [../]
  [./straint_xy]
    type = PointValue
    point = '0 0 0'
    variable = strain_xy
  [../]
  [./straint_xz]
    type = PointValue
    point = '0 0 0'
    variable = strain_xz
  [../]
  [./straint_yy]
    type = PointValue
    point = '0 0 0'
    variable = strain_yy
  [../]
  [./straint_yz]
    type = PointValue
    point = '0 0 0'
    variable = strain_yz
  [../]
  [./straint_zz]
    type = PointValue
    point = '0 0 0'
    variable = strain_zz
  [../]
  [./f_shear]
    type = PointValue
    point = '0 0 0'
    variable = f_shear
  [../]
  [./f_tensile]
    type = PointValue
    point = '0 0 0'
    variable = f_tensile
  [../]
  [./f_compressive]
    type = PointValue
    point = '0 0 0'
    variable = f_compressive
  [../]
  [./intnl_shear]
    type = PointValue
    point = '0 0 0'
    variable = intnl_shear
  [../]
  [./intnl_tensile]
    type = PointValue
    point = '0 0 0'
    variable = intnl_tensile
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
  [./ls]
    type = PointValue
    point = '0 0 0'
    variable = ls
  [../]
[]
[UserObjects]
  [./coh]
    type = SolidMechanicsHardeningConstant
    value = 20
  [../]
  [./tanphi]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
  [./tanpsi]
    type = SolidMechanicsHardeningConstant
    value = 0.1
  [../]
  [./t_strength]
    type = SolidMechanicsHardeningConstant
    value = 100
  [../]
  [./c_strength]
    type = SolidMechanicsHardeningCubic
    value_0 = 2
    value_residual = 1
    internal_0 = -1
    internal_limit = 0
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '0 1'
  [../]
  [./admissible]
    type = ComputeMultipleInelasticStress
    inelastic_models = stress
    perform_finite_strain_rotations = false
  [../]
  [./stress]
    type = CappedWeakPlaneStressUpdate
    cohesion = coh
    tan_friction_angle = tanphi
    tan_dilation_angle = tanpsi
    tensile_strength = t_strength
    compressive_strength = c_strength
    max_NR_iterations = 20
    tip_smoother = 5
    smoothing_tol = 5
    yield_function_tol = 1E-10
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform8
  csv = true
[]
(modules/solid_mechanics/test/tests/mohr_coulomb/uni_axial2.i)
[Mesh]
  type = FileMesh
  file = quarter_hole.e
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./zmin_zzero]
    type = DirichletBC
    variable = disp_z
    boundary = 'zmin'
    value = '0'
  [../]
  [./xmin_xzero]
    type = DirichletBC
    variable = disp_x
    boundary = 'xmin'
    value = '0'
  [../]
  [./ymin_yzero]
    type = DirichletBC
    variable = disp_y
    boundary = 'ymin'
    value = '0'
  [../]
  [./ymax_disp]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'ymax'
    function = '-1E-4*t'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_int]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./mc_int_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = mc_int
  [../]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0.005 0.02 0.002'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0.005 0.02 0.002'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0.005 0.02 0.002'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0.005 0.02 0.002'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0.005 0.02 0.002'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0.005 0.02 0.002'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0.005 0.02 0.002'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 10E6
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 2
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 2
    convert_to_radians = true
  [../]
  [./mc]
    type = SolidMechanicsPlasticMohrCoulomb
    cohesion = mc_coh
    friction_angle = mc_phi
    dilation_angle = mc_psi
    mc_tip_smoother = 0.01E6
    mc_edge_smoother = 29
    yield_function_tolerance = 1E-5
    internal_constraint_tolerance = 1E-11
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 1
    fill_method = symmetric_isotropic
    C_ijkl = '0 5E9' # young = 10Gpa, poisson = 0.0
  [../]
  [./strain]
    type = ComputeIncrementalStrain
    block = 1
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 1
    ep_plastic_tolerance = 1E-11
    plastic_models = mc
    max_NR_iterations = 1000
    debug_fspb = crash
  [../]
[]
# Preconditioning and Executioner options kindly provided by Andrea
[Preconditioning]
  [./andy]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  end_time = 0.5
  dt = 0.1
  solve_type = NEWTON
  type = Transient
  l_tol = 1E-2
  nl_abs_tol = 1E-9
  nl_rel_tol = 1E-11
  l_max_its = 200
  nl_max_its = 400
  petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
  petsc_options_value = ' asm      2              lu            gmres     200'
[]
[Outputs]
  file_base = uni_axial2
  exodus = true
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/notched_plastic_block/biaxial_smooth.i)
# Uses a multi-smooted version of Mohr-Coulomb (via CappedMohrCoulombStressUpdate and ComputeMultipleInelasticStress) to simulate the following problem.
# A cubical block is notched around its equator.
# All of its outer surfaces have roller BCs, but the notched region is free to move as needed
# The block is initialised with a high hydrostatic tensile stress
# Without the notch, the BCs do not allow contraction of the block, and this stress configuration is admissible
# With the notch, however, the interior parts of the block are free to move in order to relieve stress, and this causes plastic failure
# The top surface is then pulled upwards (the bottom is fixed because of the roller BCs)
# This causes more failure
[Mesh]
  [generated_mesh]
    type = GeneratedMeshGenerator
    dim = 3
    nx = 9
    ny = 9
    nz = 9
    xmin = 0
    xmax = 0.1
    ymin = 0
    ymax = 0.1
    zmin = 0
    zmax = 0.1
  []
  [block_to_remove_xmin]
    type = SubdomainBoundingBoxGenerator
    bottom_left = '-0.01 -0.01 0.045'
    top_right = '0.01 0.11 0.055'
    location = INSIDE
    block_id = 1
    input = generated_mesh
  []
  [block_to_remove_xmax]
    type = SubdomainBoundingBoxGenerator
    bottom_left = '0.09 -0.01 0.045'
    top_right = '0.11 0.11 0.055'
    location = INSIDE
    block_id = 1
    input = block_to_remove_xmin
  []
  [block_to_remove_ymin]
    type = SubdomainBoundingBoxGenerator
    bottom_left = '-0.01 -0.01 0.045'
    top_right = '0.11 0.01 0.055'
    location = INSIDE
    block_id = 1
    input = block_to_remove_xmax
  []
  [block_to_remove_ymax]
    type = SubdomainBoundingBoxGenerator
    bottom_left = '-0.01 0.09 0.045'
    top_right = '0.11 0.11 0.055'
    location = INSIDE
    block_id = 1
    input = block_to_remove_ymin
  []
  [remove_block]
    type = BlockDeletionGenerator
    block = 1
    input = block_to_remove_ymax
  []
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'max_principal_stress mid_principal_stress min_principal_stress stress_zz'
    eigenstrain_names = ini_stress
  [../]
[]
[Postprocessors]
  [./uz]
    type = PointValue
    point = '0 0 0.1'
    use_displaced_mesh = false
    variable = disp_z
  [../]
  [./s_zz]
    type = ElementAverageValue
    use_displaced_mesh = false
    variable = stress_zz
  [../]
  [./num_res]
    type = NumResidualEvaluations
  [../]
  [./nr_its] # num_iters is the average number of NR iterations encountered per element in this timestep
    type = ElementAverageValue
    variable = num_iters
  [../]
  [./max_nr_its] # max_num_iters is the maximum number of NR iterations encountered in the element during the whole simulation
    type = ElementExtremeValue
    variable = max_num_iters
  [../]
  [./runtime]
    type = PerfGraphData
    data_type = TOTAL
    section_name = 'Root'
  [../]
[]
[BCs]
  # back=zmin, front=zmax, bottom=ymin, top=ymax, left=xmin, right=xmax
  [./xmin_xzero]
    type = DirichletBC
    variable = disp_x
    boundary = left
    value = 0.0
  [../]
  [./xmax_xzero]
    type = DirichletBC
    variable = disp_x
    boundary = right
    value = 0.0
  [../]
  [./ymin_yzero]
    type = DirichletBC
    variable = disp_y
    boundary = bottom
    value = 0.0
  [../]
  [./ymax_yzero]
    type = DirichletBC
    variable = disp_y
    boundary = top
    value = 0.0
  [../]
  [./zmin_zzero]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = '0'
  [../]
  [./zmax_disp]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = '1E-6*max(t,0)'
  [../]
[]
[AuxVariables]
  [./mc_int]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./num_iters]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./max_num_iters]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./mc_int_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = mc_int
  [../]
  [./num_iters_auxk]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = num_iters
  [../]
  [./max_num_iters_auxk]
    type = MaterialRealAux
    property = max_plastic_NR_iterations
    variable = max_num_iters
  [../]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 6
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1E16
  [../]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 5E6
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 35
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 10
    convert_to_radians = true
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 16E9
    poissons_ratio = 0.25
  [../]
  [./mc]
    type = CappedMohrCoulombStressUpdate
    tensile_strength = ts
    compressive_strength = ts
    cohesion = mc_coh
    friction_angle = mc_phi
    dilation_angle = mc_psi
    smoothing_tol = 0.2E6
    yield_function_tol = 1E-5
  [../]
  [./stress]
    type = ComputeMultipleInelasticStress
    inelastic_models = mc
    perform_finite_strain_rotations = false
  [../]
  [./strain_from_initial_stress]
    type = ComputeEigenstrainFromInitialStress
    initial_stress = '6E6 0 0  0 6E6 0  0 0 6E6'
    eigenstrain_name = ini_stress
  [../]
[]
[Preconditioning]
  [./andy]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  start_time = -1
  end_time = 10
  dt = 1
  solve_type = NEWTON
  type = Transient
  l_tol = 1E-2
  nl_abs_tol = 1E-5
  nl_rel_tol = 1E-7
  l_max_its = 200
  nl_max_its = 400
  petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
  petsc_options_value = ' asm      2              lu            gmres     200'
[]
[Outputs]
  file_base = biaxial_smooth
  perf_graph = true
  exodus = false
  csv = true
[]
(modules/porous_flow/test/tests/infiltration_and_drainage/rsc02.i)
# RSC test with low-res time and spatial resolution
[Mesh]
  type = GeneratedMesh
  dim = 2
  nx = 200
  ny = 1
  xmin = 0
  xmax = 10 # x is the depth variable, called zeta in RSC
  ymin = 0
  ymax = 0.05
[]
[GlobalParams]
  PorousFlowDictator = dictator
  gravity = '0 0 0'
[]
[Functions]
  [dts]
    type = PiecewiseLinear
    y = '3E-2 5E-1 8E-1'
    x = '0 1 5'
  []
[]
[UserObjects]
  [dictator]
    type = PorousFlowDictator
    porous_flow_vars = 'pwater poil'
    number_fluid_phases = 2
    number_fluid_components = 2
  []
  [pc]
    type = PorousFlowCapillaryPressureRSC
    oil_viscosity = 2E-3
    scale_ratio = 2E3
    shift = 10
  []
[]
[FluidProperties]
  [water]
    type = SimpleFluidProperties
    bulk_modulus = 2e9
    density0 = 10
    thermal_expansion = 0
    viscosity = 1e-3
  []
  [oil]
    type = SimpleFluidProperties
    bulk_modulus = 2e9
    density0 = 20
    thermal_expansion = 0
    viscosity = 2e-3
  []
[]
[Materials]
  [temperature]
    type = PorousFlowTemperature
  []
  [ppss]
    type = PorousFlow2PhasePP
    phase0_porepressure = pwater
    phase1_porepressure = poil
    capillary_pressure = pc
  []
  [massfrac]
    type = PorousFlowMassFraction
    mass_fraction_vars = 'massfrac_ph0_sp0 massfrac_ph1_sp0'
  []
  [water]
    type = PorousFlowSingleComponentFluid
    fp = water
    phase = 0
    compute_enthalpy = false
    compute_internal_energy = false
  []
  [oil]
    type = PorousFlowSingleComponentFluid
    fp = oil
    phase = 1
    compute_enthalpy = false
    compute_internal_energy = false
  []
  [relperm_water]
    type = PorousFlowRelativePermeabilityCorey
    n = 1
    phase = 0
  []
  [relperm_oil]
    type = PorousFlowRelativePermeabilityCorey
    n = 1
    phase = 1
  []
  [porosity]
    type = PorousFlowPorosityConst
    porosity = 0.25
  []
  [permeability]
    type = PorousFlowPermeabilityConst
    permeability = '1E-5 0 0  0 1E-5 0  0 0 1E-5'
  []
[]
[Variables]
  [pwater]
  []
  [poil]
  []
[]
[ICs]
  [water_init]
    type = ConstantIC
    variable = pwater
    value = 0
  []
  [oil_init]
    type = ConstantIC
    variable = poil
    value = 15
  []
[]
[Kernels]
  [mass0]
    type = PorousFlowMassTimeDerivative
    fluid_component = 0
    variable = pwater
  []
  [flux0]
    type = PorousFlowAdvectiveFlux
    fluid_component = 0
    variable = pwater
  []
  [mass1]
    type = PorousFlowMassTimeDerivative
    fluid_component = 1
    variable = poil
  []
  [flux1]
    type = PorousFlowAdvectiveFlux
    fluid_component = 1
    variable = poil
  []
[]
[AuxVariables]
  [SWater]
    family = MONOMIAL
    order = CONSTANT
  []
  [SOil]
    family = MONOMIAL
    order = CONSTANT
  []
  [massfrac_ph0_sp0]
    initial_condition = 1
  []
  [massfrac_ph1_sp0]
    initial_condition = 0
  []
[]
[AuxKernels]
  [SWater]
    type = MaterialStdVectorAux
    property = PorousFlow_saturation_qp
    index = 0
    variable = SWater
  []
  [SOil]
    type = MaterialStdVectorAux
    property = PorousFlow_saturation_qp
    index = 1
    variable = SOil
  []
[]
[BCs]
# we are pumping water into a system that has virtually incompressible fluids, hence the pressures rise enormously.  this adversely affects convergence because of almost-overflows and precision-loss problems.  The fixed things help keep pressures low and so prevent these awful behaviours.   the movement of the saturation front is the same regardless of the fixed things.
  active = 'recharge fixedoil fixedwater'
  [recharge]
    type = PorousFlowSink
    variable = pwater
    boundary = 'left'
    flux_function = -1.0
  []
  [fixedwater]
    type = DirichletBC
    variable = pwater
    boundary = 'right'
    value = 0
  []
  [fixedoil]
    type = DirichletBC
    variable = poil
    boundary = 'right'
    value = 15
  []
[]
[Preconditioning]
  [andy]
    type = SMP
    full = true
    petsc_options = '-snes_converged_reason -ksp_diagonal_scale -ksp_diagonal_scale_fix -ksp_gmres_modifiedgramschmidt -snes_linesearch_monitor'
    petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap -snes_atol -snes_rtol -snes_max_it'
    petsc_options_value = 'gmres      asm      lu           NONZERO                   2               1E-10      1E-10      10000'
  []
[]
[VectorPostprocessors]
  [swater]
    type = LineValueSampler
    warn_discontinuous_face_values = false
    variable = SWater
    start_point = '0 0 0'
    end_point = '7 0 0'
    sort_by = x
    num_points = 21
    execute_on = timestep_end
  []
[]
[Executioner]
  type = Transient
  solve_type = Newton
  petsc_options = '-snes_converged_reason'
  end_time = 5
  [TimeStepper]
    type = FunctionDT
    function = dts
  []
[]
[Outputs]
  file_base = rsc02
  [along_line]
    type = CSV
    execute_vector_postprocessors_on = final
  []
  [exodus]
    type = Exodus
    execute_on = 'initial final'
  []
[]
(modules/solid_mechanics/test/tests/capped_weak_plane/pull_and_shear_1step.i)
# Part of the bottom (minimum z) is pulled down by a Preset displacement
# This causes tensile failure in the elements immediately above.
# Because only the bottom row of elements ever fail, and because these
# fail in the first nonlinear step, Moose correctly converges in
# 1 nonlinear step, despite this problem being inelastic.
# (If the problem had lower cohesion, then the top row would also
# fail, but in the second nonlinear step, and so the simulation
# would require at least two nonlinear steps.)
[Mesh]
  [generated_mesh]
    type = GeneratedMeshGenerator
    dim = 3
    nx = 2
    ny = 1
    nz = 2
    xmin = -10
    xmax = 10
    ymin = -10
    ymax = 10
    zmin = -100
    zmax = 0
  []
  [bottomz_middle]
    type = BoundingBoxNodeSetGenerator
    new_boundary = bottomz_middle
    bottom_left = '-1 -15 -105'
    top_right = '1 15 -95'
    input = generated_mesh
  []
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
  [../]
[]
[BCs]
  [./no_x2]
    type = DirichletBC
    variable = disp_x
    boundary = right
    value = 0.0
  [../]
  [./no_x1]
    type = DirichletBC
    variable = disp_x
    boundary = left
    value = 0.0
  [../]
  [./no_y1]
    type = DirichletBC
    variable = disp_y
    boundary = bottom
    value = 0.0
  [../]
  [./no_y2]
    type = DirichletBC
    variable = disp_y
    boundary = top
    value = 0.0
  [../]
  [./z_fixed_sides_xmin]
    type = DirichletBC
    variable = disp_z
    boundary = left
    value = 0
  [../]
  [./z_fixed_sides_xmax]
    type = DirichletBC
    variable = disp_z
    boundary = right
    value = 0
  [../]
  [./bottomz]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = bottomz_middle
    function = -1
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_compressive]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./ls]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./strainp_xx]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_xx
    index_i = 0
    index_j = 0
  [../]
  [./strainp_xy]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_xy
    index_i = 0
    index_j = 1
  [../]
  [./strainp_xz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_xz
    index_i = 0
    index_j = 2
  [../]
  [./strainp_yy]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_yy
    index_i = 1
    index_j = 1
  [../]
  [./strainp_yz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_yz
    index_i = 1
    index_j = 2
  [../]
  [./strainp_zz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_zz
    index_i = 2
    index_j = 2
  [../]
  [./straint_xx]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_xx
    index_i = 0
    index_j = 0
  [../]
  [./straint_xy]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_xy
    index_i = 0
    index_j = 1
  [../]
  [./straint_xz]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_xz
    index_i = 0
    index_j = 2
  [../]
  [./straint_yy]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_yy
    index_i = 1
    index_j = 1
  [../]
  [./straint_yz]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_yz
    index_i = 1
    index_j = 2
  [../]
  [./straint_zz]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_zz
    index_i = 2
    index_j = 2
  [../]
  [./f_shear]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f_shear
  [../]
  [./f_tensile]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f_tensile
  [../]
  [./f_compressive]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f_compressive
  [../]
  [./intnl_shear]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl_shear
  [../]
  [./intnl_tensile]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 1
    variable = intnl_tensile
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./ls]
    type = MaterialRealAux
    property = plastic_linesearch_needed
    variable = ls
  [../]
[]
[UserObjects]
  [./coh_irrelevant]
    type = SolidMechanicsHardeningCubic
    value_0 = 1E60
    value_residual = 1E60
    internal_limit = 0.01E8
  [../]
  [./tanphi]
    type = SolidMechanicsHardeningCubic
    value_0 = 0.5
    value_residual = 0.2
    internal_limit = 0.01E8
  [../]
  [./tanpsi]
    type = SolidMechanicsHardeningConstant
    value = 0.166666666667
  [../]
  [./t_strength]
    type = SolidMechanicsHardeningConstant
    value = 0
  [../]
  [./c_strength]
    type = SolidMechanicsHardeningCubic
    value_0 = 1E80
    value_residual = 1E80
    internal_limit = 0.01
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '6.4E9 6.4E9'  # young 16MPa, Poisson 0.25
  [../]
  [./strain]
    type = ComputeIncrementalStrain
  [../]
  [./admissible]
    type = ComputeMultipleInelasticStress
    inelastic_models = stress
    tangent_operator = nonlinear
    perform_finite_strain_rotations = false
  [../]
  [./stress]
    type = CappedWeakPlaneStressUpdate
    cohesion = coh_irrelevant
    tan_friction_angle = tanphi
    tan_dilation_angle = tanpsi
    tensile_strength = t_strength
    compressive_strength = c_strength
    max_NR_iterations = 1
    tip_smoother = 0
    smoothing_tol = 0
    yield_function_tol = 1E-2
    perfect_guess = true
    min_step_size = 1
  [../]
[]
[Preconditioning]
  [./andy]
    type = SMP
    full = true
    petsc_options = '-snes_converged_reason -snes_linesearch_monitor'
    petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
    petsc_options_value = ' asm      2              lu            gmres     200'
  [../]
[]
[Executioner]
  solve_type = 'NEWTON'
  petsc_options = '-snes_converged_reason'
  line_search = bt
  nl_abs_tol = 1E1
  nl_rel_tol = 1e-5
  l_tol = 1E-10
  l_max_its = 100
  nl_max_its = 100
  end_time = 1.0
  dt = 1.0
  type = Transient
[]
[Outputs]
  file_base = pull_and_shear_1step
  exodus = true
[]
(modules/solid_mechanics/test/tests/drucker_prager/small_deform3_outer_tip.i)
# apply repeated stretches in x z directions, and smaller stretches along the y direction,
# so that sigma_I = sigma_II,
# which means that lode angle = 30deg.
# The allows yield surface in meridional plane to be mapped out
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '1E-6*x*t'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '-1.7E-6*y*t'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1E-6*z*t'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_int]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./mc_int_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = mc_int
  [../]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./internal]
    type = PointValue
    point = '0 0 0'
    variable = mc_int
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 10
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 35
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 5
    convert_to_radians = true
  [../]
  [./mc]
    type = SolidMechanicsPlasticDruckerPragerHyperbolic
    mc_cohesion = mc_coh
    mc_friction_angle = mc_phi
    mc_dilation_angle = mc_psi
    smoother = 8
    mc_interpolation_scheme = outer_tip
    yield_function_tolerance = 1E-7
    internal_constraint_tolerance = 1E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./strain]
    type = ComputeIncrementalStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-13
    plastic_models = mc
    debug_fspb = crash
  [../]
[]
[Executioner]
  end_time = 10
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform3_outer_tip
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/tensile/small_deform6.i)
# checking for small deformation
# A single element is incrementally stretched in the in the z direction
# This causes the return direction to be along the hypersurface sigma_II = sigma_III,
# and the resulting stresses are checked to lie on the expected yield surface
#
# tensile_strength is set to 1Pa, tip_smoother = 0.5
# Lode angle = -30degrees
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    strain = finite
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '0.25E-6*z*t*t'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1
  [../]
  [./mc]
    type = SolidMechanicsPlasticTensile
    tensile_strength = ts
    yield_function_tolerance = 1E-6
    tensile_tip_smoother = 0.5
    internal_constraint_tolerance = 1E-5
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 2.0E6'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-5
    plastic_models = mc
    debug_fspb = crash
  [../]
[]
[Executioner]
  end_time = 10
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform6
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/stress_update_material_based/use_substep_dt.i)
[GlobalParams]
  displacements = 'ux uy uz'
[]
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 4
  ny = 4
  nz = 4
  elem_type = HEX8
  displacements = 'ux uy uz'
[]
[AuxVariables]
  [pk2]
    order = CONSTANT
    family = MONOMIAL
  []
  [fp_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [rotout]
    order = CONSTANT
    family = MONOMIAL
  []
  [e_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [gss]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  add_variables = true
  generate_output = stress_zz
[]
[AuxKernels]
  [stress_zz]
    type = RankTwoAux
    variable = stress_zz
    rank_two_tensor = stress
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [pk2]
    type = RankTwoAux
    variable = pk2
    rank_two_tensor = second_piola_kirchhoff_stress
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [fp_zz]
    type = RankTwoAux
    variable = fp_zz
    rank_two_tensor = plastic_deformation_gradient
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [e_zz]
    type = RankTwoAux
    variable = e_zz
    rank_two_tensor = total_lagrangian_strain
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [gss]
    type = MaterialStdVectorAux
    variable = gss
    property = slip_resistance
    index = 0
    execute_on = timestep_end
  []
  [slip_inc]
    type = MaterialStdVectorAux
    variable = slip_increment
    property = slip_increment
    index = 0
    execute_on = timestep_end
  []
[]
[BCs]
  [symmy]
    type = DirichletBC
    variable = uy
    boundary = bottom
    value = 0
  []
  [symmx]
    type = DirichletBC
    variable = ux
    boundary = left
    value = 0
  []
  [symmz]
    type = DirichletBC
    variable = uz
    boundary = back
    value = 0
  []
  [pushy]
    type = FunctionDirichletBC
    variable = uy
    boundary = top
    function = '-0.1*t'
  []
  [pullz]
    type = FunctionDirichletBC
    variable = uz
    boundary = front
    function = '0.1*t'
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensorCP
    C_ijkl = '1.684e5 1.214e5 1.214e5 1.684e5 1.214e5 1.684e5 0.754e5 0.754e5 0.754e5'
    fill_method = symmetric9
  []
  [stress]
    type = ComputeMultipleCrystalPlasticityStress
    crystal_plasticity_models = 'trial_xtalpl'
    tan_mod_type = exact
    maximum_substep_iteration = 1
  []
  [trial_xtalpl]
    type = CrystalPlasticityKalidindiUpdate
    number_slip_systems = 12
    slip_sys_file_name = input_slip_sys.txt
  []
[]
[Postprocessors]
  [stress_zz]
    type = ElementAverageValue
    variable = stress_zz
  []
  [pk2]
    type = ElementAverageValue
    variable = pk2
  []
  [fp_zz]
    type = ElementAverageValue
    variable = fp_zz
  []
  [e_zz]
    type = ElementAverageValue
    variable = e_zz
  []
  [gss]
    type = ElementAverageValue
    variable = gss
  []
  [slip_increment]
    type = ElementAverageValue
    variable = slip_increment
  []
  [uy_avg_top]
    type = SideAverageValue
    variable = uy
    boundary = top
  []
  [uz_avg_front]
    type = SideAverageValue
    variable = uz
    boundary = front
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  dt = 0.05
  solve_type = 'NEWTON'
  petsc_options = '-snes_ksp_ew'
  petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
  petsc_options_value = ' lu       superlu_dist'
  line_search = 'none'
  nl_abs_tol = 1e-10
  nl_rel_step_tol = 1e-10
  dtmax = 10.0
  nl_rel_tol = 1e-10
  end_time = 1.0
  num_steps = 5
  dtmin = 0.001
  nl_abs_step_tol = 1e-10
[]
[Outputs]
  csv = true
[]
(modules/solid_mechanics/test/tests/mohr_coulomb/planar_hard4.i)
# apply repeated stretches in x direction, and smaller stretches along the y and z directions,
# so that sigma_II = sigma_III,
# which means that lode angle = -30deg.
# Both return to the edge (at lode_angle=-30deg, ie 000101) and tip are experienced.
#
# It is checked that the yield functions are less than their tolerance values
# It is checked that the cohesion hardens correctly
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0.05E-6*x*t'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0.05E-6*y*t'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1E-6*z*t'
  [../]
[]
[Functions]
  [./should_be_zero_fcn]
    type = ParsedFunction
    expression = 'if((a<1E-5)&(b<1E-5)&(c<1E-5)&(d<1E-5)&(g<1E-5)&(h<1E-5),0,abs(a)+abs(b)+abs(c)+abs(d)+abs(g)+abs(h))'
    symbol_names = 'a b c d g h'
    symbol_values = 'f0 f1 f2 f3 f4 f5'
  [../]
  [./coh_analytic]
    type = ParsedFunction
    expression = '20-10*exp(-1E5*intnl)'
    symbol_names = intnl
    symbol_values = internal
  [../]
  [./coh_from_yieldfcns]
    type = ParsedFunction
    expression = '(f0+f1-(sxx+syy)*sin(phi))/(-2)/cos(phi)'
    symbol_names = 'f0 f1 sxx syy phi'
    symbol_values = 'f0 f1 s_xx s_yy 0.8726646'
  [../]
  [./should_be_zero_coh]
    type = ParsedFunction
    expression = 'if(abs(a-b)<1E-6,0,1E6*abs(a-b))'
    symbol_names = 'a b'
    symbol_values = 'Coh_analytic Coh_moose'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_int]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn3]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn4]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn5]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./mc_int_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = mc_int
  [../]
  [./yield_fcn0]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn0
  [../]
  [./yield_fcn1]
    type = MaterialStdVectorAux
    index = 1
    property = plastic_yield_function
    variable = yield_fcn1
  [../]
  [./yield_fcn2]
    type = MaterialStdVectorAux
    index = 2
    property = plastic_yield_function
    variable = yield_fcn2
  [../]
  [./yield_fcn3]
    type = MaterialStdVectorAux
    index = 3
    property = plastic_yield_function
    variable = yield_fcn3
  [../]
  [./yield_fcn4]
    type = MaterialStdVectorAux
    index = 4
    property = plastic_yield_function
    variable = yield_fcn4
  [../]
  [./yield_fcn5]
    type = MaterialStdVectorAux
    index = 5
    property = plastic_yield_function
    variable = yield_fcn5
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./internal]
    type = PointValue
    point = '0 0 0'
    variable = mc_int
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn1
  [../]
  [./f2]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn2
  [../]
  [./f3]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn3
  [../]
  [./f4]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn4
  [../]
  [./f5]
   type = PointValue
    point = '0 0 0'
    variable = yield_fcn5
  [../]
  [./yfcns_should_be_zero]
    type = FunctionValuePostprocessor
    function = should_be_zero_fcn
  [../]
  [./Coh_analytic]
    type = FunctionValuePostprocessor
    function = coh_analytic
  [../]
  [./Coh_moose]
    type = FunctionValuePostprocessor
    function = coh_from_yieldfcns
  [../]
  [./cohesion_difference_should_be_zero]
    type = FunctionValuePostprocessor
    function = should_be_zero_coh
  [../]
[]
[UserObjects]
  [./mc_coh]
    type = SolidMechanicsHardeningExponential
    value_0 = 10
    value_residual = 20
    rate = 1E5
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 0.8726646
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 1 #0.8726646 # 50deg
  [../]
  [./mc]
    type = SolidMechanicsPlasticMohrCoulombMulti
    cohesion = mc_coh
    friction_angle = mc_phi
    dilation_angle = mc_psi
    use_custom_returnMap = true
    yield_function_tolerance = 1E-5
    internal_constraint_tolerance = 1E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-12
    plastic_models = mc
  [../]
[]
[Executioner]
  end_time = 10
  dt = 2
  type = Transient
[]
[Outputs]
  file_base = planar_hard4
  exodus = false
  [./csv]
    type = CSV
    hide = 'f0 f1 f2 f3 f4 f5 s_xy s_xz s_yz Coh_analytic Coh_moose'
    execute_on = 'timestep_end'
  [../]
[]
(modules/porous_flow/test/tests/gravity/grav02f.i)
# Checking that gravity head is established in the transient situation when 0<=saturation<=1 (note the less-than-or-equal-to).
# 2phase (PS), 2components, van Genuchten capillary pressure, constant fluid bulk-moduli for each phase, constant viscosity,
# constant permeability, Corey relative permeabilities with residual saturation
[Mesh]
  type = GeneratedMesh
  dim = 2
  ny = 10
  ymax = 100
[]
[GlobalParams]
  PorousFlowDictator = dictator
  gravity = '0 -10 0'
[]
[Variables]
  [ppwater]
    initial_condition = 1.5e6
  []
  [sgas]
    initial_condition = 0.3
  []
[]
[AuxVariables]
  [massfrac_ph0_sp0]
    initial_condition = 1
  []
  [massfrac_ph1_sp0]
    initial_condition = 0
  []
  [ppgas]
    family = MONOMIAL
    order = CONSTANT
  []
  [swater]
    family = MONOMIAL
    order = CONSTANT
  []
  [relpermwater]
    family = MONOMIAL
    order = CONSTANT
  []
  [relpermgas]
    family = MONOMIAL
    order = CONSTANT
  []
[]
[Kernels]
  [mass0]
    type = PorousFlowMassTimeDerivative
    fluid_component = 0
    variable = ppwater
  []
  [flux0]
    type = PorousFlowAdvectiveFlux
    fluid_component = 0
    variable = ppwater
  []
  [mass1]
    type = PorousFlowMassTimeDerivative
    fluid_component = 1
    variable = sgas
  []
  [flux1]
    type = PorousFlowAdvectiveFlux
    fluid_component = 1
    variable = sgas
  []
[]
[AuxKernels]
  [ppgas]
    type = PorousFlowPropertyAux
    property = pressure
    phase = 1
    variable = ppgas
  []
  [swater]
    type = PorousFlowPropertyAux
    property = saturation
    phase = 0
    variable = swater
  []
  [relpermwater]
    type = MaterialStdVectorAux
    property = PorousFlow_relative_permeability_qp
    index = 0
    variable = relpermwater
  []
  [relpermgas]
    type = PorousFlowPropertyAux
    property = relperm
    phase = 1
    variable = relpermgas
  []
[]
[UserObjects]
  [dictator]
    type = PorousFlowDictator
    porous_flow_vars = 'ppwater sgas'
    number_fluid_phases = 2
    number_fluid_components = 2
  []
  [pc]
    type = PorousFlowCapillaryPressureVG
    m = 0.5
    alpha = 1e-4
    pc_max = 2e5
  []
[]
[FluidProperties]
  [simple_fluid0]
    type = SimpleFluidProperties
    bulk_modulus = 2e9
    density0 = 1000
    viscosity = 1e-3
    thermal_expansion = 0
  []
  [simple_fluid1]
    type = SimpleFluidProperties
    bulk_modulus = 2e9
    density0 = 10
    viscosity = 1e-5
    thermal_expansion = 0
  []
[]
[Materials]
  [temperature]
    type = PorousFlowTemperature
  []
  [ppss]
    type = PorousFlow2PhasePS
    phase0_porepressure = ppwater
    phase1_saturation = sgas
    capillary_pressure = pc
  []
  [massfrac]
    type = PorousFlowMassFraction
    mass_fraction_vars = 'massfrac_ph0_sp0 massfrac_ph1_sp0'
  []
  [simple_fluid0]
    type = PorousFlowSingleComponentFluid
    fp = simple_fluid0
    phase = 0
  []
  [simple_fluid1]
    type = PorousFlowSingleComponentFluid
    fp = simple_fluid1
    phase = 1
  []
  [porosity]
    type = PorousFlowPorosityConst
    porosity = 0.1
  []
  [permeability]
    type = PorousFlowPermeabilityConst
    permeability = '1e-11 0 0 0 1e-11 0  0 0 1e-11'
  []
  [relperm_water]
    type = PorousFlowRelativePermeabilityCorey
    n = 2
    phase = 0
    s_res = 0.25
    sum_s_res = 0.35
  []
  [relperm_gas]
    type = PorousFlowRelativePermeabilityCorey
    n = 2
    phase = 1
    s_res = 0.1
    sum_s_res = 0.35
  []
[]
[Postprocessors]
  [mass_ph0]
    type = PorousFlowFluidMass
    fluid_component = 0
    execute_on = 'initial timestep_end'
  []
  [mass_ph1]
    type = PorousFlowFluidMass
    fluid_component = 1
    execute_on = 'initial timestep_end'
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
    petsc_options_iname = '-ksp_type -pc_type -snes_stol -snes_max_it'
    petsc_options_value = 'bcgs bjacobi 1E-13 15'
  []
[]
[Executioner]
  type = Transient
  solve_type = Newton
  end_time = 1e5
  [TimeStepper]
    type = IterationAdaptiveDT
    dt = 1e4
  []
[]
[Outputs]
  execute_on = 'initial timestep_end'
  file_base = grav02f
  exodus = true
  perf_graph = true
  csv = false
[]
(modules/solid_mechanics/test/tests/tensile/planar5.i)
# A single unit element is stretched by 1E-6m in z direction.
# with Lame lambda = 0.6E6 and Lame mu (shear) = 1E6
# stress_zz = 2.6 Pa
# stress_xx = 0.6 Pa
# stress_yy = 0.6 Pa
# tensile_strength is set to 0.5Pa with cubic hardening to 1Pa at intnl=1E-6
#
# The return should be to a plane (but the algorithm
# will try tip-return first), with, according to mathematica
# plastic_multiplier = 6.655327991E-7
# stress_zz = 0.869613817289
# stress_xx = 0.20068032054
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    strain = finite
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1.0E-6*z'
  [../]
[]
[AuxVariables]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./f0_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./intnl_auxk]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./f2]
    type = PointValue
    point = '0 0 0'
    variable = f2
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
  [./intnl]
    type = PointValue
    point = '0 0 0'
    variable = intnl
  [../]
[]
[UserObjects]
  [./hard]
    type = SolidMechanicsHardeningCubic
    value_0 = 0.5
    value_residual = 1
    internal_limit = 1E-6
  [../]
  [./tens]
    type = SolidMechanicsPlasticTensileMulti
    tensile_strength = hard
    shift = 1E-6
    yield_function_tolerance = 1E-6
    internal_constraint_tolerance = 1E-5
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0.6E6 1E6'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-12
    plastic_models = tens
    debug_fspb = none
    debug_jac_at_stress = '1 2 3 2 -4 -5 3 -5 10'
    debug_jac_at_pm = '0.1 0.2 0.3'
    debug_jac_at_intnl = 1E-6
    debug_stress_change = 1E-6
    debug_pm_change = '1E-6 1E-6 1E-6'
    debug_intnl_change = 1E-6
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = planar5
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/weak_plane_shear/small_deform3.i)
# apply a number of "random" configurations and
# check that the algorithm returns to the yield surface
#
# must be careful here - we cannot put in arbitrary values of C_ijkl, otherwise the condition
# df/dsigma * C * flow_dirn < 0 for some stresses
# The important features that must be obeyed are:
# 0 = C_0222 = C_1222  (holds for transversely isotropic, for instance)
# C_0212 < C_0202 = C_1212 (holds for transversely isotropic)
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
  type = GeneratedMesh
  dim = 3
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  add_variables = true
[]
[BCs]
  [bottomx]
    type = DirichletBC
    variable = disp_x
    boundary = back
    value = 0.0
  []
  [bottomy]
    type = DirichletBC
    variable = disp_y
    boundary = back
    value = 0.0
  []
  [bottomz]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0.0
  []
  # the following are "random" deformations
  # each is O(1E-5) to keep deformations small
  [topx]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = front
    function = '(sin(0.1*t)+x)/1E5'
  []
  [topy]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = front
    function = '(cos(t)+x*y)/1E5'
  []
  [topz]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = 'sin(0.4321*t)*x*y*z/1E5'
  []
[]
[AuxVariables]
  [yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[AuxKernels]
  [yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  []
[]
[Postprocessors]
  [yield_fcn_at_zero]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
    outputs = 'console'
  []
  [should_be_zero]
    type = FunctionValuePostprocessor
    function = should_be_zero_fcn
  []
[]
[Functions]
  [should_be_zero_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-3,0,a)'
    symbol_names = 'a'
    symbol_values = 'yield_fcn_at_zero'
  []
[]
[UserObjects]
  [coh]
    type = SolidMechanicsHardeningConstant
    value = 1E3
  []
  [tanphi]
    type = SolidMechanicsHardeningConstant
    value = 0.5773503
  []
  [tanpsi]
    type = SolidMechanicsHardeningConstant
    value = 0.08748866
  []
  [wps]
    type = SolidMechanicsPlasticWeakPlaneShear
    cohesion = coh
    tan_friction_angle = tanphi
    tan_dilation_angle = tanpsi
    smoother = 100
    yield_function_tolerance = 1E-3
    internal_constraint_tolerance = 1E-3
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensor
    # the following is transversely isotropic, i think.
    fill_method = symmetric9
    C_ijkl = '3E9 1E9 3E9 3E9 3E9 6E9 1E9 1E9 9E9'
  []
  [mc]
    type = ComputeMultiPlasticityStress
    plastic_models = wps
    transverse_direction = '0 0 1'
    max_NR_iterations = 100
    ep_plastic_tolerance = 1E-3
    debug_fspb = crash
  []
[]
[Executioner]
  end_time = 1E4
  dt = 1
  type = Transient
[]
[Outputs]
  csv = true
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/twinning/combined_twinning_slip_error.i)
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
  [cube]
    type = GeneratedMeshGenerator
    dim = 3
    nx = 2
    ny = 2
    nz = 2
    elem_type = HEX8
  []
[]
[AuxVariables]
  [fp_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [total_twin_volume_fraction]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_0]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_1]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_2]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_3]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_4]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_5]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_6]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_7]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_8]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_9]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_10]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_11]
    order = CONSTANT
    family = MONOMIAL
  []
  [twin_volume_fraction_0]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_1]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_2]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_3]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_4]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_5]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_6]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_7]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_8]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_9]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_10]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_11]
   order = CONSTANT
   family = MONOMIAL
  []
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  add_variables = true
[]
[AuxKernels]
  [fp_zz]
    type = RankTwoAux
    variable = fp_zz
    rank_two_tensor = plastic_deformation_gradient
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [total_twin_volume_fraction]
    type = MaterialRealAux
    variable = total_twin_volume_fraction
    property = twin_total_volume_fraction_twins
    execute_on = timestep_end
  []
  [slip_increment_0]
   type = MaterialStdVectorAux
   variable = slip_increment_0
   property = slip_increment
   index = 0
   execute_on = timestep_end
  []
  [slip_increment_1]
   type = MaterialStdVectorAux
   variable = slip_increment_1
   property = slip_increment
   index = 1
   execute_on = timestep_end
  []
  [slip_increment_2]
   type = MaterialStdVectorAux
   variable = slip_increment_2
   property = slip_increment
   index = 2
   execute_on = timestep_end
  []
  [slip_increment_3]
   type = MaterialStdVectorAux
   variable = slip_increment_3
   property = slip_increment
   index = 3
   execute_on = timestep_end
  []
  [slip_increment_4]
   type = MaterialStdVectorAux
   variable = slip_increment_4
   property = slip_increment
   index = 4
   execute_on = timestep_end
  []
  [slip_increment_5]
   type = MaterialStdVectorAux
   variable = slip_increment_5
   property = slip_increment
   index = 5
   execute_on = timestep_end
  []
  [slip_increment_6]
   type = MaterialStdVectorAux
   variable = slip_increment_6
   property = slip_increment
   index = 6
   execute_on = timestep_end
  []
  [slip_increment_7]
   type = MaterialStdVectorAux
   variable = slip_increment_7
   property = slip_increment
   index = 7
   execute_on = timestep_end
  []
  [slip_increment_8]
   type = MaterialStdVectorAux
   variable = slip_increment_8
   property = slip_increment
   index = 8
   execute_on = timestep_end
  []
  [slip_increment_9]
   type = MaterialStdVectorAux
   variable = slip_increment_9
   property = slip_increment
   index = 9
   execute_on = timestep_end
  []
  [slip_increment_10]
   type = MaterialStdVectorAux
   variable = slip_increment_10
   property = slip_increment
   index = 10
   execute_on = timestep_end
  []
  [slip_increment_11]
   type = MaterialStdVectorAux
   variable = slip_increment_11
   property = slip_increment
   index = 11
   execute_on = timestep_end
  []
  [twin_volume_fraction_0]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_0
   property = twin_twin_system_volume_fraction
   index = 0
   execute_on = timestep_end
  []
  [twin_volume_fraction_1]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_1
   property = twin_twin_system_volume_fraction
   index = 1
   execute_on = timestep_end
  []
  [twin_volume_fraction_2]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_2
   property = twin_twin_system_volume_fraction
   index = 2
   execute_on = timestep_end
  []
  [twin_volume_fraction_3]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_3
   property = twin_twin_system_volume_fraction
   index = 3
   execute_on = timestep_end
  []
  [twin_volume_fraction_4]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_4
   property = twin_twin_system_volume_fraction
   index = 4
   execute_on = timestep_end
  []
  [twin_volume_fraction_5]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_5
   property = twin_twin_system_volume_fraction
   index = 5
   execute_on = timestep_end
  []
  [twin_volume_fraction_6]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_6
   property = twin_twin_system_volume_fraction
   index = 6
   execute_on = timestep_end
  []
  [twin_volume_fraction_7]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_7
   property = twin_twin_system_volume_fraction
   index = 7
   execute_on = timestep_end
  []
  [twin_volume_fraction_8]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_8
   property = twin_twin_system_volume_fraction
   index = 8
   execute_on = timestep_end
  []
  [twin_volume_fraction_9]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_9
   property = twin_twin_system_volume_fraction
   index = 9
   execute_on = timestep_end
  []
  [twin_volume_fraction_10]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_10
   property = twin_twin_system_volume_fraction
   index = 10
   execute_on = timestep_end
  []
  [twin_volume_fraction_11]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_11
   property = twin_twin_system_volume_fraction
   index = 11
   execute_on = timestep_end
  []
[]
[BCs]
  [fix_y]
    type = DirichletBC
    variable = disp_y
    preset = true
    boundary = 'bottom'
    value = 0
  []
  [fix_x]
    type = DirichletBC
    variable = disp_x
    boundary = 'left'
    value = 0
  []
  [fix_z]
    type = DirichletBC
    variable = disp_z
    boundary = 'back'
    value = 0
  []
  [tdisp]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = '0.02*t'
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensorCP
    C_ijkl = '1.684e5 1.214e5 1.214e5 1.684e5 1.214e5 1.684e5 0.754e5 0.754e5 0.754e5' # roughly copper
    fill_method = symmetric9
    euler_angle_1 = 54.74
    euler_angle_2 = 45.0
    euler_angle_3 = 270.0
  []
  [stress]
    type = ComputeMultipleCrystalPlasticityStress
    crystal_plasticity_models = 'twin_xtalpl slip_xtalpl'
    tan_mod_type = exact
  []
  [twin_xtalpl]
    type = CrystalPlasticityTwinningKalidindiUpdate
    base_name = twin
    number_slip_systems = 12
    slip_sys_file_name = 'fcc_input_twinning_systems.txt'
    initial_twin_lattice_friction = 60.0
  []
  [slip_xtalpl]
    type = CrystalPlasticityKalidindiUpdate
    number_slip_systems = 12
    slip_sys_file_name = input_slip_sys.txt
    total_twin_volume_fraction = 'total_volume_fraction_twins'
  []
[]
[Postprocessors]
  [fp_zz]
    type = ElementAverageValue
    variable = fp_zz
  []
  [total_twin_volume_fraction]
    type = ElementAverageValue
    variable = total_twin_volume_fraction
  []
  [slip_increment_0]
    type = ElementAverageValue
    variable = slip_increment_0
  []
  [slip_increment_1]
    type = ElementAverageValue
    variable = slip_increment_1
  []
  [slip_increment_2]
    type = ElementAverageValue
    variable = slip_increment_2
  []
  [slip_increment_3]
    type = ElementAverageValue
    variable = slip_increment_3
  []
  [slip_increment_4]
    type = ElementAverageValue
    variable = slip_increment_4
  []
  [slip_increment_5]
    type = ElementAverageValue
    variable = slip_increment_5
  []
  [slip_increment_6]
    type = ElementAverageValue
    variable = slip_increment_6
  []
  [slip_increment_7]
    type = ElementAverageValue
    variable = slip_increment_7
  []
  [slip_increment_8]
    type = ElementAverageValue
    variable = slip_increment_8
  []
  [slip_increment_9]
    type = ElementAverageValue
    variable = slip_increment_9
  []
  [slip_increment_10]
    type = ElementAverageValue
    variable = slip_increment_10
  []
  [slip_increment_11]
    type = ElementAverageValue
    variable = slip_increment_11
  []
  [twin_volume_fraction_0]
    type = ElementAverageValue
    variable = twin_volume_fraction_0
  []
  [twin_volume_fraction_1]
    type = ElementAverageValue
    variable = twin_volume_fraction_1
  []
  [twin_volume_fraction_2]
    type = ElementAverageValue
    variable = twin_volume_fraction_2
  []
  [twin_volume_fraction_3]
    type = ElementAverageValue
    variable = twin_volume_fraction_3
  []
  [twin_volume_fraction_4]
    type = ElementAverageValue
    variable = twin_volume_fraction_4
  []
  [twin_volume_fraction_5]
    type = ElementAverageValue
    variable = twin_volume_fraction_5
  []
  [twin_volume_fraction_6]
    type = ElementAverageValue
    variable = twin_volume_fraction_6
  []
  [twin_volume_fraction_7]
    type = ElementAverageValue
    variable = twin_volume_fraction_7
  []
  [twin_volume_fraction_8]
    type = ElementAverageValue
    variable = twin_volume_fraction_8
  []
  [twin_volume_fraction_9]
    type = ElementAverageValue
    variable = twin_volume_fraction_9
  []
  [twin_volume_fraction_10]
    type = ElementAverageValue
    variable = twin_volume_fraction_10
  []
  [twin_volume_fraction_11]
    type = ElementAverageValue
    variable = twin_volume_fraction_11
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
  petsc_options_value = ' asm      2              lu            gmres     200'
  nl_abs_tol = 1e-10
  nl_rel_tol = 1e-10
  nl_abs_step_tol = 1e-10
  dt = 0.005
  dtmin = 0.01
  num_steps = 6
[]
[Outputs]
  csv = true
  perf_graph = true
[]
(modules/solid_mechanics/test/tests/tensile/small_deform4.i)
# checking for small deformation
# A single element is stretched by 0.75E-6m in the z and x directions
# This causes the return direction to be along the hypersurface sigma_I = sigma_II
# tensile_strength is set to 1Pa, tip_smoother = 0, edge_smoother = 25degrees
# Then A + B + C = 0.609965
#
# The final stress should have meanstress = 0.680118 and bar(sigma) = 0.52443, and sigma_zz = sigma_xx = 0.982896
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    strain = finite
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0.75E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '0.75E-6*z'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1
  [../]
  [./mc]
    type = SolidMechanicsPlasticTensile
    tensile_strength = ts
    yield_function_tolerance = 1E-6
    tensile_tip_smoother = 0.0
    internal_constraint_tolerance = 1E-5
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 2.0E6'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-5
    plastic_models = mc
    debug_fspb = crash
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform4
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/drucker_prager/small_deform2_native.i)
# apply repeated stretches in x, y and z directions, so that mean_stress = 0
# This maps out the yield surface in the octahedral plane for zero mean stress
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '-1.5E-6*x+2E-6*x*sin(t)'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '2E-6*y*sin(2*t)'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '-2E-6*z*(sin(t)+sin(2*t))'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 10
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 20
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 0
  [../]
  [./mc]
    type = SolidMechanicsPlasticDruckerPragerHyperbolic
    mc_cohesion = mc_coh
    mc_friction_angle = mc_phi
    mc_dilation_angle = mc_psi
    smoother = 4
    mc_interpolation_scheme = native
    yield_function_tolerance = 1E-5
    internal_constraint_tolerance = 1E-11
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./strain]
    type = ComputeIncrementalStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-12
    plastic_models = mc
    debug_fspb = crash
  [../]
[]
[Executioner]
  end_time = 100
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform2_native
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform18.i)
# Using CappedMohrCoulomb with compressive failure only
# A single unit element is stretched by -1E-6m in z direction.
# with Lame lambda = 0.6E6 and Lame mu (shear) = 1E6
# stress_zz = -2.6 Pa
# stress_xx = -0.6 Pa
# stress_yy = -0.6 Pa
# compressive_strength is set to 0.5Pa
#
# stress_zz = -0.5
# plastic multiplier = 2.1/2.6 E-6
# stress_xx = -0.6 - (2.1/2.6*-0.6) = -0.115
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'max_principal_stress mid_principal_stress min_principal_stress stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '-1.0E-6*z'
  [../]
[]
[AuxVariables]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./f0_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./intnl_auxk]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl
  [../]
[]
[Postprocessors]
  [./s_I]
    type = PointValue
    point = '0 0 0'
    variable = max_principal_stress
  [../]
  [./s_II]
    type = PointValue
    point = '0 0 0'
    variable = mid_principal_stress
  [../]
  [./s_III]
    type = PointValue
    point = '0 0 0'
    variable = min_principal_stress
  [../]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./f2]
    type = PointValue
    point = '0 0 0'
    variable = f2
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
  [./intnl]
    type = PointValue
    point = '0 0 0'
    variable = intnl
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./cs]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
  [./coh]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./ang]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '0.6E6 1E6'
  [../]
  [./tensile]
    type = CappedMohrCoulombStressUpdate
    tensile_strength = ts
    compressive_strength = cs
    cohesion = coh
    friction_angle = ang
    dilation_angle = ang
    smoothing_tol = 0.0
    yield_function_tol = 1.0E-12
  [../]
  [./stress]
    type = ComputeMultipleInelasticStress
    inelastic_models = tensile
    perform_finite_strain_rotations = false
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform18
  csv = true
[]
(modules/solid_mechanics/test/tests/capped_weak_plane/beam.i)
# A beam with its ends fully clamped
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 10
  nz = 10
  xmin = -10
  xmax = 10
  ymin = -10
  ymax = 10
  zmin = -50
  zmax = 0
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
  [../]
  [./gravity_y]
    type = Gravity
    use_displaced_mesh = false
    variable = disp_y
    value = -10
  [../]
[]
[BCs]
  [./zmax_xfixed]
    type = DirichletBC
    variable = disp_x
    boundary = front
    value = 0
  [../]
  [./zmax_yfixed]
    type = DirichletBC
    variable = disp_y
    boundary = front
    value = 0
  [../]
  [./zmax_zfixed]
    type = DirichletBC
    variable = disp_z
    boundary = front
    value = 0
  [../]
  [./zmin_xfixed]
    type = DirichletBC
    variable = disp_x
    boundary = back
    value = 0
  [../]
  [./zmin_yfixed]
    type = DirichletBC
    variable = disp_y
    boundary = back
    value = 0
  [../]
  [./zmin_zfixed]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_compressive]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./ls]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./strainp_xx]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_xx
    index_i = 0
    index_j = 0
  [../]
  [./strainp_xy]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_xy
    index_i = 0
    index_j = 1
  [../]
  [./strainp_xz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_xz
    index_i = 0
    index_j = 2
  [../]
  [./strainp_yy]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_yy
    index_i = 1
    index_j = 1
  [../]
  [./strainp_yz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_yz
    index_i = 1
    index_j = 2
  [../]
  [./strainp_zz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_zz
    index_i = 2
    index_j = 2
  [../]
  [./straint_xx]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_xx
    index_i = 0
    index_j = 0
  [../]
  [./straint_xy]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_xy
    index_i = 0
    index_j = 1
  [../]
  [./straint_xz]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_xz
    index_i = 0
    index_j = 2
  [../]
  [./straint_yy]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_yy
    index_i = 1
    index_j = 1
  [../]
  [./straint_yz]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_yz
    index_i = 1
    index_j = 2
  [../]
  [./straint_zz]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_zz
    index_i = 2
    index_j = 2
  [../]
  [./f_shear]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f_shear
  [../]
  [./f_tensile]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f_tensile
  [../]
  [./f_compressive]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f_compressive
  [../]
  [./intnl_shear]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl_shear
  [../]
  [./intnl_tensile]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 1
    variable = intnl_tensile
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./ls]
    type = MaterialRealAux
    property = plastic_linesearch_needed
    variable = ls
  [../]
[]
[UserObjects]
  [./coh_irrelevant]
    type = SolidMechanicsHardeningCubic
    value_0 = 2E6
    value_residual = 2E6
    internal_limit = 0.01
  [../]
  [./tanphi]
    type = SolidMechanicsHardeningCubic
    value_0 = 0.5
    value_residual = 0.5
    internal_limit = 0.01
  [../]
  [./tanpsi]
    type = SolidMechanicsHardeningConstant
    value = 0.166666666667
  [../]
  [./t_strength]
    type = SolidMechanicsHardeningCubic
    value_0 = 0
    value_residual = 0
    internal_limit = 0.1
  [../]
  [./c_strength]
    type = SolidMechanicsHardeningCubic
    value_0 = 1E80
    value_residual = 0.0
    internal_limit = 0.01
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '6.4E9 6.4E9'  # young 16MPa, Poisson 0.25
  [../]
  [./strain]
    type = ComputeIncrementalStrain
  [../]
  [./admissible]
    type = ComputeMultipleInelasticStress
    inelastic_models = stress
    tangent_operator = nonlinear
    perform_finite_strain_rotations = false
  [../]
  [./stress]
    type = CappedWeakPlaneStressUpdate
    cohesion = coh_irrelevant
    tan_friction_angle = tanphi
    tan_dilation_angle = tanpsi
    tensile_strength = t_strength
    compressive_strength = c_strength
    max_NR_iterations = 1000
    tip_smoother = 1E5
    smoothing_tol = 1E5
    yield_function_tol = 1E-5
    perfect_guess = true
    min_step_size = 0.1
  [../]
  [./density]
    type = GenericFunctionMaterial
    block = 0
    prop_names = density
    prop_values = 1E3*t
  [../]
[]
[Preconditioning]
  [./andy]
    type = SMP
    full = true
    #petsc_options = '-snes_converged_reason -snes_linesearch_monitor'
    petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
    petsc_options_value = ' asm      2              lu            gmres     200'
  [../]
[]
[Executioner]
  solve_type = 'NEWTON'
  petsc_options = '-snes_converged_reason'
  line_search = bt
  nl_abs_tol = 1E-2
  nl_rel_tol = 1e-15
  l_tol = 1E-10
  l_max_its = 100
  nl_max_its = 100
  end_time = 10
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = beam
  exodus = true
  csv = true
[]
(modules/solid_mechanics/test/tests/multi/three_surface01.i)
# Plasticit models:
# SimpleTester0 with a = 0 and b = 1 and strength = 1
# SimpleTester1 with a = 1 and b = 0 and strength = 1
# SimpleTester2 with a = 1 and b = 1 and strength = 1.5
#
# Lame lambda = 0 (Poisson=0).  Lame mu = 0.5E6
#
# A single element is stretched by 0E-6m in y direction and 1.5E-6 in z direction.
# trial stress_yy = 0 and stress_zz = 1.5
#
# Then SimpleTester0 should activate and the algorithm will return to
# stress_yy = 0, stress_zz = 1
# internal0 should be 0.5, and others zero
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1.5E-6*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int2]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./int0]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 0
    variable = int0
  [../]
  [./int1]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 1
    variable = int1
  [../]
  [./int2]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 2
    variable = int2
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./f2]
    type = PointValue
    point = '0 0 0'
    variable = f2
  [../]
  [./int0]
    type = PointValue
    point = '0 0 0'
    variable = int0
  [../]
  [./int1]
    type = PointValue
    point = '0 0 0'
    variable = int1
  [../]
  [./int2]
    type = PointValue
    point = '0 0 0'
    variable = int2
  [../]
[]
[UserObjects]
  [./simple0]
    type = SolidMechanicsPlasticSimpleTester
    a = 0
    b = 1
    strength = 1
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
  [./simple1]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 0
    strength = 1
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
  [./simple2]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 1
    strength = 1.5
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 0.5E6'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./multi]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = 'simple0 simple1 simple2'
    max_NR_iterations = 2
    min_stepsize = 1
    debug_fspb = crash
    debug_jac_at_stress = '10 0 0 0 10 0 0 0 10'
    debug_jac_at_pm = '1 1'
    debug_jac_at_intnl = '1 1'
    debug_stress_change = 1E-5
    debug_pm_change = '1E-6 1E-6'
    debug_intnl_change = '1E-6 1E-6'
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = three_surface01
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/drucker_prager/random_hyperbolic.i)
# drucker-prager hyperbolic.
# apply many random large deformations, checking that the algorithm returns correctly to
# the yield surface each time.
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 100
  ny = 125
  nz = 1
  xmin = 0
  xmax = 100
  ymin = 0
  ymax = 125
  zmin = 0
  zmax = 1
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[ICs]
  [./x]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_x
  [../]
  [./y]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_y
  [../]
  [./z]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_z
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '0'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
[]
[Postprocessors]
  [./yield_fcn_at_zero]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
    outputs = 'console'
  [../]
  [./should_be_zero]
    type = FunctionValuePostprocessor
    function = should_be_zero_fcn
  [../]
  [./av_iter]
    type = ElementAverageValue
    variable = iter
    outputs = 'console'
  [../]
[]
[Functions]
  [./should_be_zero_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-3,0,a)'
    symbol_names = 'a'
    symbol_values = 'yield_fcn_at_zero'
  [../]
[]
[UserObjects]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 1E3
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 30
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 5
    convert_to_radians = true
  [../]
  [./dp]
    type = SolidMechanicsPlasticDruckerPragerHyperbolic
    mc_cohesion = mc_coh
    mc_friction_angle = mc_phi
    mc_dilation_angle = mc_psi
    smoother = 0.1E3
    yield_function_tolerance = 1E-3
    internal_constraint_tolerance = 1E-6
    use_custom_returnMap = true
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0.7E7 1E7'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./dp]
    type = ComputeMultiPlasticityStress
    block = 0
    max_NR_iterations = 1000
    ep_plastic_tolerance = 1E-6
    min_stepsize = 1E-3
    plastic_models = dp
    debug_fspb = crash
    deactivation_scheme = safe
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = random_hyperbolic
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/mohr_coulomb/many_deforms_cap.i)
# apply many large deformations, checking that the algorithm returns correctly to
# the yield surface each time
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./bottomx]
    type = DirichletBC
    variable = disp_x
    boundary = back
    value = 0.0
  [../]
  [./bottomy]
    type = DirichletBC
    variable = disp_y
    boundary = back
    value = 0.0
  [../]
  [./bottomz]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0.0
  [../]
  [./topx]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = front
    function = '(sin(0.05*t)+x)/1E0'
  [../]
  [./topy]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = front
    function = '(cos(0.04*t)+x*y)/1E0'
  [../]
  [./topz]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = 't/1E2'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./yield_fcn_at_zero]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
    outputs = 'console'
  [../]
  [./should_be_zero]
    type = FunctionValuePostprocessor
    function = should_be_zero_fcn
  [../]
[]
[Functions]
  [./should_be_zero_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-3,0,a)'
    symbol_names = 'a'
    symbol_values = 'yield_fcn_at_zero'
  [../]
[]
[UserObjects]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 1E3
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 30
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 5
    convert_to_radians = true
  [../]
  [./mc]
    type = SolidMechanicsPlasticMohrCoulomb
    cohesion = mc_coh
    friction_angle = mc_phi
    dilation_angle = mc_psi
    tip_scheme = cap
    mc_tip_smoother = 0.0
    cap_start = 1000
    cap_rate = 1E-3
    mc_edge_smoother = 10
    yield_function_tolerance = 1E-3
    internal_constraint_tolerance = 1E-6
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    max_NR_iterations = 1000
    ep_plastic_tolerance = 1E-6
    plastic_models = mc
    debug_fspb = crash
    deactivation_scheme = safe
  [../]
[]
[Executioner]
  end_time = 1000
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = many_deforms_cap
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/user_object_based/exception.i)
[Mesh]
  type = GeneratedMesh
  dim = 3
  elem_type = HEX8
  displacements = 'ux uy uz'
[]
[Variables]
  [./ux]
  [../]
  [./uy]
  [../]
  [./uz]
  [../]
[]
[AuxVariables]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./pk2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./fp_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./rotout]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./e_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./gss]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./slip_increment]
   order = CONSTANT
   family = MONOMIAL
  [../]
[]
[Functions]
  [./tdisp]
    type = ParsedFunction
    expression = 0.1*t
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'ux uy uz'
    use_displaced_mesh = true
  [../]
[]
[AuxKernels]
  [./stress_zz]
    type = RankTwoAux
    variable = stress_zz
    rank_two_tensor = stress
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  [../]
  [./pk2]
   type = RankTwoAux
   variable = pk2
   rank_two_tensor = pk2
   index_j = 2
   index_i = 2
   execute_on = timestep_end
  [../]
  [./fp_zz]
    type = RankTwoAux
    variable = fp_zz
    rank_two_tensor = fp
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  [../]
  [./e_zz]
    type = RankTwoAux
    variable = e_zz
    rank_two_tensor = lage
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  [../]
  [./gss]
    type = MaterialStdVectorAux
    variable = gss
    property = state_var_gss
    index = 0
    execute_on = timestep_end
  [../]
  [./slip_inc]
   type = MaterialStdVectorAux
   variable = slip_increment
   property = slip_rate_gss
   index = 0
   execute_on = timestep_end
  [../]
[]
[BCs]
  [./symmy]
    type = DirichletBC
    variable = uy
    boundary = bottom
    value = 0
  [../]
  [./symmx]
    type = DirichletBC
    variable = ux
    boundary = left
    value = 0
  [../]
  [./symmz]
    type = DirichletBC
    variable = uz
    boundary = back
    value = 0
  [../]
  [./tdisp]
    type = FunctionDirichletBC
    variable = uz
    boundary = front
    function = tdisp
  [../]
[]
[UserObjects]
  [./slip_rate_gss]
    type = CrystalPlasticitySlipRateGSS
    variable_size = 12
    slip_sys_file_name = input_slip_sys.txt
    num_slip_sys_flowrate_props = 2
    flowprops = '1 4 0.001 0.1 5 8 0.001 0.1 9 12 0.001 0.1'
    uo_state_var_name = state_var_gss
  [../]
  [./slip_resistance_gss]
    type = CrystalPlasticitySlipResistanceGSS
    variable_size = 12
    uo_state_var_name = state_var_gss
  [../]
  [./state_var_gss]
    type = CrystalPlasticityStateVariable
    variable_size = 12
    groups = '0 4 8 12'
    group_values = '60.8 60.8 60.8'
    uo_state_var_evol_rate_comp_name = state_var_evol_rate_comp_gss
    scale_factor = 1.0
  [../]
  [./state_var_evol_rate_comp_gss]
    type = CrystalPlasticityStateVarRateComponentGSS
    variable_size = 12
    hprops = '1.0 541.5 109.8 2.5'
    uo_slip_rate_name = slip_rate_gss
    uo_state_var_name = state_var_gss
  [../]
[]
[Materials]
  [./crysp]
    type = FiniteStrainUObasedCP
    block = 0
    stol = 1e-2
    tan_mod_type = exact
    uo_slip_rates = 'slip_rate_gss'
    uo_slip_resistances = 'slip_resistance_gss'
    uo_state_vars = 'state_var_gss'
    uo_state_var_evol_rate_comps = 'state_var_evol_rate_comp_gss'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'ux uy uz'
  [../]
  [./elasticity_tensor]
    type = ComputeElasticityTensorCP
    block = 0
    C_ijkl = '1.684e5 1.214e5 1.214e5 1.684e5 1.214e5 1.684e5 0.754e5 0.754e5 0.754e5'
    fill_method = symmetric9
  [../]
[]
[Postprocessors]
  [./stress_zz]
    type = ElementAverageValue
    variable = stress_zz
  [../]
  [./pk2]
   type = ElementAverageValue
   variable = pk2
  [../]
  [./fp_zz]
    type = ElementAverageValue
    variable = fp_zz
  [../]
  [./e_zz]
    type = ElementAverageValue
    variable = e_zz
  [../]
  [./gss]
    type = ElementAverageValue
    variable = gss
  [../]
  [./slip_increment]
   type = ElementAverageValue
   variable = slip_increment
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  dt = 0.05
  solve_type = 'PJFNK'
  petsc_options_iname = -pc_hypre_type
  petsc_options_value = boomerang
  nl_abs_tol = 1e-10
  nl_rel_step_tol = 1e-10
  dtmax = 10.0
  nl_rel_tol = 1e-10
  end_time = 1
  dtmin = 0.01
  num_steps = 10
  nl_abs_step_tol = 1e-10
[]
[Outputs]
  exodus = true
[]
(modules/solid_mechanics/test/tests/capped_weak_plane/small_deform6.i)
# Plastic deformation, both tensile and shear failure
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz plastic_strain_xx plastic_strain_xy plastic_strain_xz plastic_strain_yy plastic_strain_yz plastic_strain_zz strain_xx strain_xy strain_xz strain_yy strain_yz strain_zz'
  [../]
[]
[BCs]
  [./bottomx]
    type = DirichletBC
    variable = disp_x
    boundary = back
    value = 0.0
  [../]
  [./bottomy]
    type = DirichletBC
    variable = disp_y
    boundary = back
    value = 0.0
  [../]
  [./bottomz]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0.0
  [../]
  [./topx]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = front
    function = 'if(t<30,0.2*t,6)'
  [../]
  [./topy]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = front
    function = 'if(t<30,if(t<10,0,t),30-0.2*t)'
  [../]
  [./topz]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = 'if(t<15,3*t,45)+if(t<30,0,45-3*t)'
  [../]
[]
[AuxVariables]
  [./f_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_compressive]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./ls]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./f_shear]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f_shear
  [../]
  [./f_tensile]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f_tensile
  [../]
  [./f_compressive]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f_compressive
  [../]
  [./intnl_shear]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl_shear
  [../]
  [./intnl_tensile]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 1
    variable = intnl_tensile
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./ls]
    type = MaterialRealAux
    property = plastic_linesearch_needed
    variable = ls
  [../]
[]
[Postprocessors]
  [./stress_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./stress_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./stress_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./stress_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./stress_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./stress_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./strainp_xx]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_xx
  [../]
  [./strainp_xy]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_xy
  [../]
  [./strainp_xz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_xz
  [../]
  [./strainp_yy]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_yy
  [../]
  [./strainp_yz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_yz
  [../]
  [./strainp_zz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_zz
  [../]
  [./straint_xx]
    type = PointValue
    point = '0 0 0'
    variable = strain_xx
  [../]
  [./straint_xy]
    type = PointValue
    point = '0 0 0'
    variable = strain_xy
  [../]
  [./straint_xz]
    type = PointValue
    point = '0 0 0'
    variable = strain_xz
  [../]
  [./straint_yy]
    type = PointValue
    point = '0 0 0'
    variable = strain_yy
  [../]
  [./straint_yz]
    type = PointValue
    point = '0 0 0'
    variable = strain_yz
  [../]
  [./straint_zz]
    type = PointValue
    point = '0 0 0'
    variable = strain_zz
  [../]
  [./f_shear]
    type = PointValue
    point = '0 0 0'
    variable = f_shear
  [../]
  [./f_tensile]
    type = PointValue
    point = '0 0 0'
    variable = f_tensile
  [../]
  [./f_compressive]
    type = PointValue
    point = '0 0 0'
    variable = f_compressive
  [../]
  [./intnl_shear]
    type = PointValue
    point = '0 0 0'
    variable = intnl_shear
  [../]
  [./intnl_tensile]
    type = PointValue
    point = '0 0 0'
    variable = intnl_tensile
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
  [./ls]
    type = PointValue
    point = '0 0 0'
    variable = ls
  [../]
[]
[UserObjects]
  [./coh]
    type = SolidMechanicsHardeningConstant
    value = 20
  [../]
  [./tanphi]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
  [./tanpsi]
    type = SolidMechanicsHardeningConstant
    value = 0.1
  [../]
  [./t_strength]
    type = SolidMechanicsHardeningConstant
    value = 20
  [../]
  [./c_strength]
    type = SolidMechanicsHardeningConstant
    value = 0
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '4 4'
  [../]
  [./admissible]
    type = ComputeMultipleInelasticStress
    inelastic_models = stress
    perform_finite_strain_rotations = false
  [../]
  [./stress]
    type = CappedWeakPlaneStressUpdate
    cohesion = coh
    tan_friction_angle = tanphi
    tan_dilation_angle = tanpsi
    tensile_strength = t_strength
    compressive_strength = c_strength
    max_NR_iterations = 20
    tip_smoother = 5
    smoothing_tol = 5
    yield_function_tol = 1E-10
    perfect_guess = false
  [../]
[]
[Executioner]
  end_time = 40
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform6
  csv = true
[]
(modules/solid_mechanics/examples/coal_mining/coarse.i)
# Strata deformation and fracturing around a coal mine - 3D model
#
# A "half model" is used.  The mine is 400m deep and
# just the roof is studied (-400<=z<=0).  The mining panel
# sits between 0<=x<=150, and 0<=y<=1000, so this simulates
# a coal panel that is 300m wide and 1000m long.  The outer boundaries
# are 1km from the excavation boundaries.
#
# Time is meaningless in this example
# as quasi-static solutions are sought at each timestep, but
# the number of timesteps controls the resolution of the
# process.
#
# The boundary conditions for this simulation are:
#  - disp_x = 0 at x=0 and x=1150
#  - disp_y = 0 at y=-1000 and y=1000
#  - disp_z = 0 at z=-400, but there is a time-dependent
#               Young's modulus that simulates excavation
#  - wc_x = 0 at y=-1000 and y=1000
#  - wc_y = 0 at x=0 and x=1150
# That is, rollers on the sides, free at top,
# and prescribed at bottom in the unexcavated portion.
#
# The small strain formulation is used.
#
# All stresses are measured in MPa.  The initial stress is consistent with
# the weight force from density 2500 kg/m^3, ie, stress_zz = 0.025*z MPa
# where gravity = 10 m.s^-2 = 1E-5 MPa m^2/kg.  The maximum and minimum
# principal horizontal stresses are assumed to be equal to 0.8*stress_zz.
#
# Material properties:
# Young's modulus = 8 GPa
# Poisson's ratio = 0.25
# Cosserat layer thickness = 1 m
# Cosserat-joint normal stiffness = large
# Cosserat-joint shear stiffness = 1 GPa
# MC cohesion = 3 MPa
# MC friction angle = 37 deg
# MC dilation angle = 8 deg
# MC tensile strength = 1 MPa
# MC compressive strength = 100 MPa
# WeakPlane cohesion = 0.1 MPa
# WeakPlane friction angle = 30 deg
# WeakPlane dilation angle = 10 deg
# WeakPlane tensile strength = 0.1 MPa
# WeakPlane compressive strength = 100 MPa softening to 1 MPa at strain = 1
#
[Mesh]
  [file]
    type = FileMeshGenerator
    file = mesh/coarse.e
  []
  [./xmin]
    input = file
    type = SideSetsAroundSubdomainGenerator
    block = '2 3 4 5 6 7 8 9 10 11 12 13 14 15 16'
    new_boundary = xmin
    normal = '-1 0 0'
  [../]
  [./xmax]
    input = xmin
    type = SideSetsAroundSubdomainGenerator
    block = '2 3 4 5 6 7 8 9 10 11 12 13 14 15 16'
    new_boundary = xmax
    normal = '1 0 0'
  [../]
  [./ymin]
    input = xmax
    type = SideSetsAroundSubdomainGenerator
    block = '2 3 4 5 6 7 8 9 10 11 12 13 14 15 16'
    new_boundary = ymin
    normal = '0 -1 0'
  [../]
  [./ymax]
    input = ymin
    type = SideSetsAroundSubdomainGenerator
    block = '2 3 4 5 6 7 8 9 10 11 12 13 14 15 16'
    new_boundary = ymax
    normal = '0 1 0'
  [../]
  [./zmax]
    input = ymax
    type = SideSetsAroundSubdomainGenerator
    block = 16
    new_boundary = zmax
    normal = '0 0 1'
  [../]
  [./zmin]
    input = zmax
    type = SideSetsAroundSubdomainGenerator
    block = 2
    new_boundary = zmin
    normal = '0 0 -1'
  [../]
  [./excav]
    type = SubdomainBoundingBoxGenerator
    input = zmin
    block_id = 1
    bottom_left = '0 0 -400'
    top_right = '150 1000 -397'
  [../]
  [./roof]
    type = SideSetsAroundSubdomainGenerator
    block = 1
    input = excav
    new_boundary = roof
    normal = '0 0 1'
  [../]
[]
[GlobalParams]
  perform_finite_strain_rotations = false
  displacements = 'disp_x disp_y disp_z'
  Cosserat_rotations = 'wc_x wc_y wc_z'
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
  [./wc_x]
  [../]
  [./wc_y]
  [../]
[]
[Kernels]
  [./cx_elastic]
    type = CosseratStressDivergenceTensors
    use_displaced_mesh = false
    variable = disp_x
    component = 0
  [../]
  [./cy_elastic]
    type = CosseratStressDivergenceTensors
    use_displaced_mesh = false
    variable = disp_y
    component = 1
  [../]
  [./cz_elastic]
    type = CosseratStressDivergenceTensors
    use_displaced_mesh = false
    variable = disp_z
    component = 2
  [../]
  [./x_couple]
    type = StressDivergenceTensors
    use_displaced_mesh = false
    variable = wc_x
    displacements = 'wc_x wc_y wc_z'
    component = 0
    base_name = couple
  [../]
  [./y_couple]
    type = StressDivergenceTensors
    use_displaced_mesh = false
    variable = wc_y
    displacements = 'wc_x wc_y wc_z'
    component = 1
    base_name = couple
  [../]
  [./x_moment]
    type = MomentBalancing
    use_displaced_mesh = false
    variable = wc_x
    component = 0
  [../]
  [./y_moment]
    type = MomentBalancing
    use_displaced_mesh = false
    variable = wc_y
    component = 1
  [../]
  [./gravity]
    type = Gravity
    use_displaced_mesh = false
    variable = disp_z
    value = -10E-6 # remember this is in MPa
  [../]
[]
[AuxVariables]
  [./wc_z]
  [../]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./wp_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./wp_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./wp_shear_f]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./wp_tensile_f]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_shear_f]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_tensile_f]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yx
    index_i = 1
    index_j = 0
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zx
    index_i = 2
    index_j = 0
  [../]
  [./stress_zy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zy
    index_i = 2
    index_j = 1
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./mc_shear]
    type = MaterialStdVectorAux
    index = 0
    property = mc_plastic_internal_parameter
    variable = mc_shear
  [../]
  [./mc_tensile]
    type = MaterialStdVectorAux
    index = 1
    property = mc_plastic_internal_parameter
    variable = mc_tensile
  [../]
  [./wp_shear]
    type = MaterialStdVectorAux
    index = 0
    property = wp_plastic_internal_parameter
    variable = wp_shear
  [../]
  [./wp_tensile]
    type = MaterialStdVectorAux
    index = 1
    property = wp_plastic_internal_parameter
    variable = wp_tensile
  [../]
  [./mc_shear_f]
    type = MaterialStdVectorAux
    index = 6
    property = mc_plastic_yield_function
    variable = mc_shear_f
  [../]
  [./mc_tensile_f]
    type = MaterialStdVectorAux
    index = 0
    property = mc_plastic_yield_function
    variable = mc_tensile_f
  [../]
  [./wp_shear_f]
    type = MaterialStdVectorAux
    index = 0
    property = wp_plastic_yield_function
    variable = wp_shear_f
  [../]
  [./wp_tensile_f]
    type = MaterialStdVectorAux
    index = 1
    property = wp_plastic_yield_function
    variable = wp_tensile_f
  [../]
[]
[BCs]
  [./no_x]
    type = DirichletBC
    variable = disp_x
    boundary = 'xmin xmax'
    value = 0.0
  [../]
  [./no_y]
    type = DirichletBC
    variable = disp_y
    boundary = 'ymin ymax'
    value = 0.0
  [../]
  [./no_z]
    type = DirichletBC
    variable = disp_z
    boundary = zmin
    value = 0.0
  [../]
  [./no_wc_x]
    type = DirichletBC
    variable = wc_x
    boundary = 'ymin ymax'
    value = 0.0
  [../]
  [./no_wc_y]
    type = DirichletBC
    variable = wc_y
    boundary = 'xmin xmax'
    value = 0.0
  [../]
  [./roof]
    type = StickyBC
    variable = disp_z
    min_value = -3.0
    boundary = roof
  [../]
[]
[Functions]
  [./ini_xx]
    type = ParsedFunction
    expression = '0.8*2500*10E-6*z'
  [../]
  [./ini_zz]
    type = ParsedFunction
    expression = '2500*10E-6*z'
  [../]
  [./excav_sideways]
    type = ParsedFunction
    symbol_names = 'end_t ymin ymax  minval maxval slope'
    symbol_values = '17.0   0    1000.0 1E-9 1 60'
    # excavation face at ymin+(ymax-ymin)*min(t/end_t,1)
    # slope is the distance over which the modulus reduces from maxval to minval
    expression = 'if(y<ymin+(ymax-ymin)*min(t/end_t,1),minval,if(y<ymin+(ymax-ymin)*min(t/end_t,1)+slope,minval+(maxval-minval)*(y-(ymin+(ymax-ymin)*min(t/end_t,1)))/slope,maxval))'
  [../]
  [./density_sideways]
    type = ParsedFunction
    symbol_names = 'end_t ymin ymax  minval maxval'
    symbol_values = '17.0   0    1000.0 0 2500'
    expression = 'if(y<ymin+(ymax-ymin)*min(t/end_t,1),minval,maxval)'
  [../]
[]
[UserObjects]
  [./mc_coh_strong_harden]
    type = SolidMechanicsHardeningExponential
    value_0 = 2.99 # MPa
    value_residual = 3.01 # MPa
    rate = 1.0
  [../]
  [./mc_fric]
    type = SolidMechanicsHardeningConstant
    value = 0.65 # 37deg
  [../]
  [./mc_dil]
    type = SolidMechanicsHardeningConstant
    value = 0.15 # 8deg
  [../]
  [./mc_tensile_str_strong_harden]
    type = SolidMechanicsHardeningExponential
    value_0 = 1.0 # MPa
    value_residual = 1.0 # MPa
    rate = 1.0
  [../]
  [./mc_compressive_str]
    type = SolidMechanicsHardeningCubic
    value_0 = 100 # Large!
    value_residual = 100
    internal_limit = 0.1
  [../]
  [./wp_coh_harden]
    type = SolidMechanicsHardeningCubic
    value_0 = 0.1
    value_residual = 0.1
    internal_limit = 10
  [../]
  [./wp_tan_fric]
    type = SolidMechanicsHardeningConstant
    value = 0.36 # 20deg
  [../]
  [./wp_tan_dil]
    type = SolidMechanicsHardeningConstant
    value = 0.18 # 10deg
  [../]
  [./wp_tensile_str_harden]
    type = SolidMechanicsHardeningCubic
    value_0 = 0.1
    value_residual = 0.1
    internal_limit = 10
  [../]
  [./wp_compressive_str_soften]
    type = SolidMechanicsHardeningCubic
    value_0 = 100
    value_residual = 1
    internal_limit = 1.0
  [../]
[]
[Materials]
  [./elasticity_tensor_0]
    type = ComputeLayeredCosseratElasticityTensor
    block = '2 3 4 5 6 7 8 9 10 11 12 13 14 15 16'
    young = 8E3 # MPa
    poisson = 0.25
    layer_thickness = 1.0
    joint_normal_stiffness = 1E9 # huge
    joint_shear_stiffness = 1E3 # MPa
  [../]
  [./elasticity_tensor_1]
    type = ComputeLayeredCosseratElasticityTensor
    block = 1
    young = 8E3 # MPa
    poisson = 0.25
    layer_thickness = 1.0
    joint_normal_stiffness = 1E9 # huge
    joint_shear_stiffness = 1E3 # MPa
    elasticity_tensor_prefactor = excav_sideways
  [../]
  [./strain]
    type = ComputeCosseratIncrementalSmallStrain
    eigenstrain_names = ini_stress
  [../]
  [./ini_stress]
    type = ComputeEigenstrainFromInitialStress
    eigenstrain_name = ini_stress
    initial_stress = 'ini_xx 0 0  0 ini_xx 0  0 0 ini_zz'
  [../]
  [./stress_0]
    type = ComputeMultipleInelasticCosseratStress
    block = '2 3 4 5 6 7 8 9 10 11 12 13 14 15 16'
    inelastic_models = 'mc wp'
    cycle_models = true
    relative_tolerance = 2.0
    absolute_tolerance = 1E6
    max_iterations = 1
    tangent_operator = nonlinear
    perform_finite_strain_rotations = false
  [../]
  [./stress_1]
    type = ComputeMultipleInelasticCosseratStress
    block = 1
    inelastic_models = ''
    relative_tolerance = 2.0
    absolute_tolerance = 1E6
    max_iterations = 1
    tangent_operator = nonlinear
    perform_finite_strain_rotations = false
  [../]
  [./mc]
    type = CappedMohrCoulombCosseratStressUpdate
    warn_about_precision_loss = false
    host_youngs_modulus = 8E3
    host_poissons_ratio = 0.25
    base_name = mc
    tensile_strength = mc_tensile_str_strong_harden
    compressive_strength = mc_compressive_str
    cohesion = mc_coh_strong_harden
    friction_angle = mc_fric
    dilation_angle = mc_dil
    max_NR_iterations = 100000
    smoothing_tol = 0.1 # MPa  # Must be linked to cohesion
    yield_function_tol = 1E-9 # MPa.  this is essentially the lowest possible without lots of precision loss
    perfect_guess = true
    min_step_size = 1.0
  [../]
  [./wp]
    type = CappedWeakPlaneCosseratStressUpdate
    warn_about_precision_loss = false
    base_name = wp
    cohesion = wp_coh_harden
    tan_friction_angle = wp_tan_fric
    tan_dilation_angle = wp_tan_dil
    tensile_strength = wp_tensile_str_harden
    compressive_strength = wp_compressive_str_soften
    max_NR_iterations = 10000
    tip_smoother = 0.1
    smoothing_tol = 0.1 # MPa  # Note, this must be tied to cohesion, otherwise get no possible return at cone apex
    yield_function_tol = 1E-11 # MPa.  this is essentially the lowest possible without lots of precision loss
    perfect_guess = true
    min_step_size = 1.0E-3
  [../]
  [./density_0]
    type = GenericConstantMaterial
    block = '2 3 4 5 6 7 8 9 10 11 12 13 14 15 16'
    prop_names = density
    prop_values = 2500
  [../]
  [./density_1]
    type = GenericFunctionMaterial
    block = 1
    prop_names = density
    prop_values = density_sideways
  [../]
[]
[Preconditioning]
  [./SMP]
    type = SMP
    full = true
  []
[]
[Postprocessors]
  [./min_roof_disp]
    type = NodalExtremeValue
    boundary = roof
    value_type = min
    variable = disp_z
  [../]
  [./min_surface_disp]
    type = NodalExtremeValue
    boundary = zmax
    value_type = min
    variable = disp_z
  [../]
[]
[Executioner]
  type = Transient
  solve_type = 'NEWTON'
  petsc_options = '-snes_converged_reason'
  petsc_options_iname = '-pc_type -ksp_type -ksp_gmres_restart'
  petsc_options_value = ' bjacobi  gmres     200'
  line_search = bt
  nl_abs_tol = 1e-3
  nl_rel_tol = 1e-5
  l_max_its = 30
  nl_max_its = 1000
  start_time = 0.0
  dt = 0.5 # this gives min(disp_z)=-4.3, use dt=0.0625 if you want to restrict disp_z>=-3.2
  end_time = 17.0
[]
[Outputs]
  time_step_interval = 1
  print_linear_residuals = false
  exodus = true
  csv = true
  console = true
[]
(modules/solid_mechanics/test/tests/drucker_prager/small_deform2_outer_tip.i)
# apply repeated stretches in x, y and z directions, so that mean_stress = 0
# This maps out the yield surface in the octahedral plane for zero mean stress
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '-1.5E-6*x+2E-6*x*sin(t)'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '2E-6*y*sin(2*t)'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '-2E-6*z*(sin(t)+sin(2*t))'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 10
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 20
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 0
  [../]
  [./mc]
    type = SolidMechanicsPlasticDruckerPragerHyperbolic
    mc_cohesion = mc_coh
    mc_friction_angle = mc_phi
    mc_dilation_angle = mc_psi
    smoother = 4
    mc_interpolation_scheme = outer_tip
    yield_function_tolerance = 1E-5
    internal_constraint_tolerance = 1E-11
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./strain]
    type = ComputeIncrementalStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-12
    plastic_models = mc
    debug_fspb = crash
  [../]
[]
[Executioner]
  end_time = 100
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform2_outer_tip
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/user_object_based/linesearch.i)
[Mesh]
  type = GeneratedMesh
  dim = 3
  elem_type = HEX8
  displacements = 'ux uy uz'
[]
[Variables]
  [./ux]
  [../]
  [./uy]
  [../]
  [./uz]
  [../]
[]
[AuxVariables]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./fp_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./e_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./gss]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[Functions]
  [./tdisp]
    type = ParsedFunction
    expression = 0.01*t
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'ux uy uz'
    use_displaced_mesh = true
  [../]
[]
[AuxKernels]
  [./stress_zz]
    type = RankTwoAux
    variable = stress_zz
    rank_two_tensor = stress
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  [../]
  [./fp_zz]
    type = RankTwoAux
    variable = fp_zz
    rank_two_tensor = fp
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  [../]
  [./e_zz]
    type = RankTwoAux
    variable = e_zz
    rank_two_tensor = lage
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  [../]
  [./gss1]
    type = MaterialStdVectorAux
    variable = gss
    property = state_var_gss
    index = 0
    execute_on = timestep_end
  [../]
[]
[BCs]
  [./symmy]
    type = DirichletBC
    variable = uy
    boundary = bottom
    value = 0
  [../]
  [./symmx]
    type = DirichletBC
    variable = ux
    boundary = left
    value = 0
  [../]
  [./symmz]
    type = DirichletBC
    variable = uz
    boundary = back
    value = 0
  [../]
  [./tdisp]
    type = FunctionDirichletBC
    variable = uz
    boundary = front
    function = tdisp
  [../]
[]
[UserObjects]
  [./slip_rate_gss]
    type = CrystalPlasticitySlipRateGSS
    variable_size = 12
    slip_sys_file_name = input_slip_sys.txt
    num_slip_sys_flowrate_props = 2
    flowprops = '1 4 0.001 0.1 5 8 0.001 0.1 9 12 0.001 0.1'
    uo_state_var_name = state_var_gss
  [../]
  [./slip_resistance_gss]
    type = CrystalPlasticitySlipResistanceGSS
    variable_size = 12
    uo_state_var_name = state_var_gss
  [../]
  [./state_var_gss]
    type = CrystalPlasticityStateVariable
    variable_size = 12
    groups = '0 4 8 12'
    group_values = '60.8 60.8 60.8'
    uo_state_var_evol_rate_comp_name = state_var_evol_rate_comp_gss
    scale_factor = 1.0
  [../]
  [./state_var_evol_rate_comp_gss]
    type = CrystalPlasticityStateVarRateComponentGSS
    variable_size = 12
    hprops = '1.0 541.5 109.8 2.5'
    uo_slip_rate_name = slip_rate_gss
    uo_state_var_name = state_var_gss
  [../]
[]
[Materials]
  [./crysp]
    type = FiniteStrainUObasedCP
    stol = 1e-2
    tan_mod_type = exact
    maximum_substep_iteration = 200
    use_line_search = true
    min_line_search_step_size = 0.01
    uo_slip_rates = 'slip_rate_gss'
    uo_slip_resistances = 'slip_resistance_gss'
    uo_state_vars = 'state_var_gss'
    uo_state_var_evol_rate_comps = 'state_var_evol_rate_comp_gss'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    displacements = 'ux uy uz'
  [../]
  [./elasticity_tensor]
    type = ComputeElasticityTensorCP
    C_ijkl = '1.684e5 1.214e5 1.214e5 1.684e5 1.214e5 1.684e5 0.754e5 0.754e5 0.754e5'
    fill_method = symmetric9
  [../]
[]
[Postprocessors]
  [./stress_zz]
    type = ElementAverageValue
    variable = stress_zz
  [../]
  [./fp_zz]
    type = ElementAverageValue
    variable = fp_zz
  [../]
  [./e_zz]
    type = ElementAverageValue
    variable = e_zz
  [../]
  [./gss]
    type = ElementAverageValue
    variable = gss
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  dt = 0.05
  solve_type = 'PJFNK'
  petsc_options_iname = -pc_hypre_type
  petsc_options_value = boomerang
  nl_abs_tol = 1e-10
  nl_rel_step_tol = 1e-10
  dtmax = 10.0
  nl_rel_tol = 1e-10
  end_time = 1
  dtmin = 0.02
  num_steps = 10
  nl_abs_step_tol = 1e-10
[]
[Outputs]
  exodus = true
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/user_object_based/user_object_Voce_BCC.i)
[Mesh]
  type = GeneratedMesh
  dim = 2
  elem_type = QUAD4
  displacements = 'disp_x disp_y'
  nx = 2
  ny = 2
[]
[GlobalParams]
  volumetric_locking_correction = true
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y'
    use_displaced_mesh = true
  [../]
[]
[AuxVariables]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./e_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./fp_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./gss]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[Functions]
  [./tdisp]
    type = ParsedFunction
    expression = 0.01*t
  [../]
[]
[UserObjects]
  [./prop_read]
    type = PropertyReadFile
    prop_file_name = 'euler_ang_file.txt'
    # Enter file data as prop#1, prop#2, .., prop#nprop
    nprop = 3
    read_type = element
  [../]
[]
[AuxKernels]
  [./stress_yy]
    type = RankTwoAux
    variable = stress_yy
    rank_two_tensor = stress
    index_j = 1
    index_i = 1
    execute_on = timestep_end
  [../]
  [./e_yy]
    type = RankTwoAux
    variable = e_yy
    rank_two_tensor = lage
    index_j = 1
    index_i = 1
    execute_on = timestep_end
  [../]
  [./fp_yy]
    type = RankTwoAux
    variable = fp_yy
    rank_two_tensor = fp
    index_j = 1
    index_i = 1
    execute_on = timestep_end
  [../]
  [./gss]
    type = MaterialStdVectorAux
    variable = gss
    property = state_var_gss
    index = 0
    execute_on = timestep_end
  [../]
[]
[BCs]
  [./fix_x]
    type = DirichletBC
    variable = disp_x
    boundary = 'left'
    value = 0
  [../]
  [./fix_y]
    type = DirichletBC
    variable = disp_y
    boundary = 'bottom'
    value = 0
  [../]
  [./tdisp]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = top
    function = tdisp
  [../]
[]
[UserObjects]
  [./slip_rate_gss]
    type = CrystalPlasticitySlipRateGSS
    variable_size = 48
    slip_sys_file_name = input_slip_sys_bcc48.txt
    num_slip_sys_flowrate_props = 2
    flowprops = '1 12 0.001 0.1 13 24 0.001 0.1 25 48 0.001 0.1'
    uo_state_var_name = state_var_gss
  [../]
  [./slip_resistance_gss]
    type = CrystalPlasticitySlipResistanceGSS
    variable_size = 48
    uo_state_var_name = state_var_gss
  [../]
  [./state_var_gss]
    type = CrystalPlasticityStateVariable
    variable_size = 48
    groups = '0 12 24 48'
    group_values =  '50 51 52'
    uo_state_var_evol_rate_comp_name = state_var_evol_rate_comp_voce
    scale_factor = 1.0
  [../]
  [./state_var_evol_rate_comp_voce]
    type = CrystalPlasticityStateVarRateComponentVoce
    variable_size = 48
    crystal_lattice_type = 'BCC'
    groups = '0 12 24 48'
    h0_group_values = '1 2 3'
    tau0_group_values = '50 51 52'
    tauSat_group_values = '70 81 92'
    hardeningExponent_group_values = '1 2 3'
    selfHardening_group_values ='4 5 6'
    coplanarHardening_group_values='7 8 9'
    GroupGroup_Hardening_group_values = '10 20 30
                                         40 50 60
                                         70 80 90'
    uo_slip_rate_name = slip_rate_gss
    uo_state_var_name = state_var_gss
  [../]
[]
[Materials]
  [./crysp]
    type = FiniteStrainUObasedCP
    stol = 1e-2
    tan_mod_type = exact
    uo_slip_rates = 'slip_rate_gss'
    uo_slip_resistances = 'slip_resistance_gss'
    uo_state_vars = 'state_var_gss'
    uo_state_var_evol_rate_comps = 'state_var_evol_rate_comp_voce'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    displacements = 'disp_x disp_y'
  [../]
  [./elasticity_tensor]
    type = ComputeElasticityTensorCP
    C_ijkl = '1.684e5 1.214e5 1.214e5 1.684e5 1.214e5 1.684e5 0.754e5 0.754e5 0.754e5'
    fill_method = symmetric9
    read_prop_user_object = prop_read
  [../]
[]
[Postprocessors]
  [./stress_yy]
    type = ElementAverageValue
    variable = stress_yy
  [../]
  [./e_yy]
    type = ElementAverageValue
    variable = e_yy
  [../]
  [./fp_yy]
    type = ElementAverageValue
    variable = fp_yy
  [../]
  [./gss]
    type = ElementAverageValue
    variable = gss
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  dt = 0.01
  solve_type = 'PJFNK'
  petsc_options_iname = -pc_hypre_type
  petsc_options_value = boomerang
  nl_abs_tol = 1e-10
  nl_rel_step_tol = 1e-10
  dtmax = 10.0
  nl_rel_tol = 1e-10
  end_time = 1
  dtmin = 0.01
  num_steps = 10
  nl_abs_step_tol = 1e-10
[]
[Outputs]
  exodus = true
[]
(modules/solid_mechanics/test/tests/tensile/small_deform7.i)
# checking for small deformation
# A single element is incrementally stretched in the in the z direction
# This causes the return direction to be along the hypersurface sigma_II = sigma_III,
# and the resulting stresses are checked to lie on the expected yield surface
#
# tensile_strength is set to 1Pa,
# cap smoothing is used with tip_smoother = 0.0, cap_start = 0.5, cap_rate = 2.0
# Lode angle = -30degrees
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    strain = finite
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '0.25E-6*z*t*t'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  [../]
  [./iter_auxk]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1
  [../]
  [./mc]
    type = SolidMechanicsPlasticTensile
    tensile_strength = ts
    yield_function_tolerance = 1E-6
    tip_scheme = cap
    tensile_tip_smoother = 0.0
    cap_start = -0.5
    cap_rate = 2
    internal_constraint_tolerance = 1E-5
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 2.0E6'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-5
    max_NR_iterations = 1000
    plastic_models = mc
    debug_fspb = crash
  [../]
[]
[Executioner]
  end_time = 9
  dt = 0.9
  type = Transient
[]
[Outputs]
  file_base = small_deform7
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/weak_plane_tensile/small_deform_hard_cubic.i)
# Checking evolution tensile strength for cubic hardening
# A single element is stretched by 1E-6*t in z direction, and
# the yield-surface evolution is mapped out
[GlobalParams]
  displacements = 'x_disp y_disp z_disp'
[]
[Mesh]
  type = GeneratedMesh
  dim = 3
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  add_variables = true
  generate_output = 'stress_zz'
[]
[BCs]
  [bottomx]
    type = DirichletBC
    variable = x_disp
    boundary = back
    value = 0.0
  []
  [bottomy]
    type = DirichletBC
    variable = y_disp
    boundary = back
    value = 0.0
  []
  [bottomz]
    type = DirichletBC
    variable = z_disp
    boundary = back
    value = 0.0
  []
  [topx]
    type = DirichletBC
    variable = x_disp
    boundary = front
    value = 0
  []
  [topy]
    type = DirichletBC
    variable = y_disp
    boundary = front
    value = 0
  []
  [topz]
    type = FunctionDirichletBC
    variable = z_disp
    boundary = front
    function = 1E-6*t
  []
[]
[AuxVariables]
  [wpt_internal]
    order = CONSTANT
    family = MONOMIAL
  []
  [yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[AuxKernels]
  [wpt_internal]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = wpt_internal
  []
  [yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  []
[]
[Postprocessors]
  [wpt_internal]
    type = PointValue
    point = '0 0 0'
    variable = wpt_internal
  []
  [s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  []
  [f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  []
[]
[UserObjects]
  [str]
    type = SolidMechanicsHardeningCubic
    value_0 = 10
    value_residual = 4
    internal_limit = 0.000003
  []
  [wpt]
    type = SolidMechanicsPlasticWeakPlaneTensile
    tensile_strength = str
    yield_function_tolerance = 1E-6
    internal_constraint_tolerance = 1E-11
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  []
  [mc]
    type = ComputeMultiPlasticityStress
    plastic_models = wpt
    transverse_direction = '0 0 1'
    ep_plastic_tolerance = 1E-11
  []
[]
[Executioner]
  end_time = 4
  dt = 0.5
  type = Transient
[]
[Outputs]
  csv = true
[]
(modules/solid_mechanics/test/tests/capped_weak_plane/small_deform4.i)
# Plastic deformation, compression failure
# With Young = 10, poisson=0.25 (Lame lambda=4, mu=4)
# applying the following
# deformation to the zmax surface of a unit cube:
# disp_x = 4*t
# disp_y = 3*t
# disp_z = -t
# should yield trial stress:
# stress_zz = 12*t
# stress_zx = 16*t
# stress_zy = -12*t
# Use compressive strength = 6, we should return to stress_zz = -6,
# and stress_xx = stress_yy = -2*t up to t=1 when the system is completely
# plastic, so these stress components will not change
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz plastic_strain_xx plastic_strain_xy plastic_strain_xz plastic_strain_yy plastic_strain_yz plastic_strain_zz strain_xx strain_xy strain_xz strain_yy strain_yz strain_zz'
  [../]
[]
[BCs]
  [./bottomx]
    type = DirichletBC
    variable = disp_x
    boundary = back
    value = 0.0
  [../]
  [./bottomy]
    type = DirichletBC
    variable = disp_y
    boundary = back
    value = 0.0
  [../]
  [./bottomz]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0.0
  [../]
  [./topx]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = front
    function = 4*t
  [../]
  [./topy]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = front
    function = 3*t
  [../]
  [./topz]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = -t
  [../]
[]
[AuxVariables]
  [./f_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_compressive]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./ls]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./f_shear]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f_shear
  [../]
  [./f_tensile]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f_tensile
  [../]
  [./f_compressive]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f_compressive
  [../]
  [./intnl_shear]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl_shear
  [../]
  [./intnl_tensile]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 1
    variable = intnl_tensile
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./ls]
    type = MaterialRealAux
    property = plastic_linesearch_needed
    variable = ls
  [../]
[]
[Postprocessors]
  [./stress_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./stress_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./stress_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./stress_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./stress_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./stress_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./strainp_xx]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_xx
  [../]
  [./strainp_xy]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_xy
  [../]
  [./strainp_xz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_xz
  [../]
  [./strainp_yy]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_yy
  [../]
  [./strainp_yz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_yz
  [../]
  [./strainp_zz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_zz
  [../]
  [./straint_xx]
    type = PointValue
    point = '0 0 0'
    variable = strain_xx
  [../]
  [./straint_xy]
    type = PointValue
    point = '0 0 0'
    variable = strain_xy
  [../]
  [./straint_xz]
    type = PointValue
    point = '0 0 0'
    variable = strain_xz
  [../]
  [./straint_yy]
    type = PointValue
    point = '0 0 0'
    variable = strain_yy
  [../]
  [./straint_yz]
    type = PointValue
    point = '0 0 0'
    variable = strain_yz
  [../]
  [./straint_zz]
    type = PointValue
    point = '0 0 0'
    variable = strain_zz
  [../]
  [./f_shear]
    type = PointValue
    point = '0 0 0'
    variable = f_shear
  [../]
  [./f_tensile]
    type = PointValue
    point = '0 0 0'
    variable = f_tensile
  [../]
  [./f_compressive]
    type = PointValue
    point = '0 0 0'
    variable = f_compressive
  [../]
  [./intnl_shear]
    type = PointValue
    point = '0 0 0'
    variable = intnl_shear
  [../]
  [./intnl_tensile]
    type = PointValue
    point = '0 0 0'
    variable = intnl_tensile
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
  [./ls]
    type = PointValue
    point = '0 0 0'
    variable = ls
  [../]
[]
[UserObjects]
  [./coh]
    type = SolidMechanicsHardeningConstant
    value = 80
  [../]
  [./tanphi]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
  [./tanpsi]
    type = SolidMechanicsHardeningConstant
    value = 0.1111077
  [../]
  [./t_strength]
    type = SolidMechanicsHardeningConstant
    value = 6
  [../]
  [./c_strength]
    type = SolidMechanicsHardeningConstant
    value = 6
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '4 4'
  [../]
  [./admissible]
    type = ComputeMultipleInelasticStress
    inelastic_models = stress
    perform_finite_strain_rotations = false
  [../]
  [./stress]
    type = CappedWeakPlaneStressUpdate
    cohesion = coh
    tan_friction_angle = tanphi
    tan_dilation_angle = tanpsi
    tensile_strength = t_strength
    compressive_strength = c_strength
    tip_smoother = 0
    smoothing_tol = 0
    yield_function_tol = 1E-5
  [../]
[]
[Executioner]
  end_time = 2
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform4
  csv = true
[]
(modules/solid_mechanics/test/tests/multi/two_surface02.i)
# Plasticit models:
# SimpleTester with a = 0 and b = 1 and strength = 1
# SimpleTester with a = 1 and b = 1 and strength = 2
#
# Lame lambda = 0 (Poisson=0).  Lame mu = 0.5E6
#
# A single element is stretched by 1.5E-6m in the y z directions.
# trial stress_zz = 1.5 and stress_yy = 1.5
#
# Then both  SimpleTesters should activate, and the final stress
# should have have stress_zz = 1 = stress_yy (ie, the "corner" point)
# the plastic strain for SimpleTester1 should be zero
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '1.5E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1.5E-6*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int1]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./int0]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 0
    variable = int0
  [../]
  [./int1]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 1
    variable = int1
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./int0]
    type = PointValue
    point = '0 0 0'
    variable = int0
  [../]
  [./int1]
    type = PointValue
    point = '0 0 0'
    variable = int1
  [../]
[]
[UserObjects]
  [./simple1]
    type = SolidMechanicsPlasticSimpleTester
    a = 0
    b = 1
    strength = 1
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
  [./simple2]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 1
    strength = 2
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 0.5E6'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./multi]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = 'simple1 simple2'
    max_NR_iterations = 2
    min_stepsize = 1
    debug_fspb = crash
    debug_jac_at_stress = '10 0 0 0 10 0 0 0 10'
    debug_jac_at_pm = '1 1'
    debug_jac_at_intnl = '1 1'
    debug_stress_change = 1E-5
    debug_pm_change = '1E-6 1E-6'
    debug_intnl_change = '1E-6 1E-6'
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = two_surface02
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/multi/three_surface16.i)
# Plasticit models:
# SimpleTester0 with a = 0 and b = 1 and strength = 1
# SimpleTester1 with a = 1 and b = 0 and strength = 1
# SimpleTester2 with a = 1 and b = 1 and strength = 3
#
# Lame lambda = 0 (Poisson=0).  Lame mu = 0.5E6
#
# A single element is stretched by 3.0E-6m in y direction and 2.1E-6 in z direction.
# trial stress_yy = 3.0 and stress_zz = 2.1
#
# A complicated return will follow, with various contraints being
# deactivated, kuhn-tucker failing, line-searching, etc, but
# the result should be
# stress_yy=1=stress_zz, and internal0=1.1 internal1=2
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '3.0E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '2.1E-6*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int2]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./int0]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 0
    variable = int0
  [../]
  [./int1]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 1
    variable = int1
  [../]
  [./int2]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 2
    variable = int2
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./f2]
    type = PointValue
    point = '0 0 0'
    variable = f2
  [../]
  [./int0]
    type = PointValue
    point = '0 0 0'
    variable = int0
  [../]
  [./int1]
    type = PointValue
    point = '0 0 0'
    variable = int1
  [../]
  [./int2]
    type = PointValue
    point = '0 0 0'
    variable = int2
  [../]
[]
[UserObjects]
  [./simple0]
    type = SolidMechanicsPlasticSimpleTester
    a = 0
    b = 1
    strength = 1
    yield_function_tolerance = 1.0E-6
    internal_constraint_tolerance = 1.0E-6
  [../]
  [./simple1]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 0
    strength = 1
    yield_function_tolerance = 1.0E-6
    internal_constraint_tolerance = 1.0E-6
  [../]
  [./simple2]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 1
    strength = 3
    yield_function_tolerance = 1.0E-6
    internal_constraint_tolerance = 1.0E-6
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 0.5E6'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./multi]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = 'simple0 simple1 simple2'
    max_NR_iterations = 4
    min_stepsize = 1
    debug_fspb = crash
    debug_jac_at_stress = '10 0 0 0 10 0 0 0 10'
    debug_jac_at_pm = '1 1 1'
    debug_jac_at_intnl = '1 1 1'
    debug_stress_change = 1E-5
    debug_pm_change = '1E-6 1E-6 1E-6'
    debug_intnl_change = '1E-6 1E-6 1E-6'
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = three_surface16
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/capped_drucker_prager/small_deform3_inner_edge.i)
# apply repeated stretches in x z directions, and smaller stretches along the y direction,
# so that sigma_I = sigma_II,
# which means that lode angle = 30deg.
# The allows yield surface in meridional plane to be mapped out
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '1E-6*x*t'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '-1.7E-6*y*t'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1E-6*z*t'
  [../]
[]
[AuxVariables]
  [./mc_int]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./mc_int_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = mc_int
  [../]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./internal]
    type = PointValue
    point = '0 0 0'
    variable = mc_int
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1E5
  [../]
  [./cs]
    type = SolidMechanicsHardeningConstant
    value = 1E5
  [../]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 10
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 35
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 5
    convert_to_radians = true
  [../]
  [./dp]
    type = SolidMechanicsPlasticDruckerPrager
    mc_cohesion = mc_coh
    mc_friction_angle = mc_phi
    mc_dilation_angle = mc_psi
    mc_interpolation_scheme = inner_edge
    yield_function_tolerance = 1      # irrelevant here
    internal_constraint_tolerance = 1 # irrelevant here
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./admissible]
    type = ComputeMultipleInelasticStress
    inelastic_models = mc
    perform_finite_strain_rotations = false
  [../]
  [./mc]
    type = CappedDruckerPragerStressUpdate
    DP_model = dp
    tensile_strength = ts
    compressive_strength = cs
    yield_function_tol = 1E-8
    tip_smoother = 8
    smoothing_tol = 1E-7
  [../]
[]
[Executioner]
  end_time = 10
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform3_inner_edge
  exodus = false
  [./csv]
    type = CSV
  [../]
[]
(modules/solid_mechanics/test/tests/multi/four_surface14.i)
# Plasticit models:
# SimpleTester0 with a = 0 and b = 1 and strength = 1
# SimpleTester1 with a = 1 and b = 0 and strength = 1
# SimpleTester2 with a = 1 and b = 1 and strength = 3
# SimpleTester3 with a = 0 and b = 1 and strength = 1.1
#
# Lame lambda = 0 (Poisson=0).  Lame mu = 0.5E6
#
# A single element is stretched by 2.1E-6m in y direction and 3E-6 in z direction.
# trial stress_yy = 2.1 and stress_zz = 3.0
#
# This is similar to three_surface14.i, and a description is found there.
# The result should be stress_zz=1=stress_yy, with internal0=2
# and internal1=1.1
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '2.1E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '3.0E-6*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f3]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int3]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./f3]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 3
    variable = f3
  [../]
  [./int0]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 0
    variable = int0
  [../]
  [./int1]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 1
    variable = int1
  [../]
  [./int2]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 2
    variable = int2
  [../]
  [./int3]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 3
    variable = int3
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./f2]
    type = PointValue
    point = '0 0 0'
    variable = f2
  [../]
  [./f3]
    type = PointValue
    point = '0 0 0'
    variable = f3
  [../]
  [./int0]
    type = PointValue
    point = '0 0 0'
    variable = int0
  [../]
  [./int1]
    type = PointValue
    point = '0 0 0'
    variable = int1
  [../]
  [./int2]
    type = PointValue
    point = '0 0 0'
    variable = int2
  [../]
  [./int3]
    type = PointValue
    point = '0 0 0'
    variable = int3
  [../]
[]
[UserObjects]
  [./simple0]
    type = SolidMechanicsPlasticSimpleTester
    a = 0
    b = 1
    strength = 1
    yield_function_tolerance = 1.0E-6
    internal_constraint_tolerance = 1.0E-6
  [../]
  [./simple1]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 0
    strength = 1
    yield_function_tolerance = 1.0E-6
    internal_constraint_tolerance = 1.0E-6
  [../]
  [./simple2]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 1
    strength = 3
    yield_function_tolerance = 1.0E-6
    internal_constraint_tolerance = 1.0E-6
  [../]
  [./simple3]
    type = SolidMechanicsPlasticSimpleTester
    a = 0
    b = 1
    strength = 1.1
    yield_function_tolerance = 1.0E-6
    internal_constraint_tolerance = 1.0E-6
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 0.5E6'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./multi]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = 'simple0 simple1 simple2 simple3'
    max_NR_iterations = 4
    min_stepsize = 1
    debug_fspb = crash
    debug_jac_at_stress = '10 0 0 0 10 0 0 0 10'
    debug_jac_at_pm = '1 1 1'
    debug_jac_at_intnl = '1 1 1'
    debug_stress_change = 1E-5
    debug_pm_change = '1E-6 1E-6 1E-6'
    debug_intnl_change = '1E-6 1E-6 1E-6'
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = four_surface14
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/weak_plane_shear/small_deform_harden2.i)
# apply a pure tension, then some shear with compression
# the BCs are designed to map out the yield function, showing
# the affect of the hardening
[GlobalParams]
  displacements = 'x_disp y_disp z_disp'
[]
[Mesh]
  type = GeneratedMesh
  dim = 3
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  add_variables = true
  generate_output = 'stress_xz stress_zx stress_yz stress_zz'
[]
[BCs]
  [bottomx]
    type = DirichletBC
    variable = x_disp
    boundary = back
    value = 0.0
  []
  [bottomy]
    type = DirichletBC
    variable = y_disp
    boundary = back
    value = 0.0
  []
  [bottomz]
    type = DirichletBC
    variable = z_disp
    boundary = back
    value = 0.0
  []
  [topx]
    type = FunctionDirichletBC
    variable = x_disp
    boundary = front
    function = 'if(t<1E-6,0,3*t)'
  []
  [topy]
    type = FunctionDirichletBC
    variable = y_disp
    boundary = front
    function = 'if(t<1E-6,0,5*(t-0.01E-6))'
  []
  [topz]
    type = FunctionDirichletBC
    variable = z_disp
    boundary = front
    function = 'if(t<1E-6,t,2E-6-t)'
  []
[]
[AuxVariables]
  [wps_internal]
    order = CONSTANT
    family = MONOMIAL
  []
  [yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[AuxKernels]
  [wps_internal_auxk]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = wps_internal
  []
  [yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  []
[]
[Postprocessors]
  [s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  []
  [s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  []
  [s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  []
  [f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  []
  [int]
    type = PointValue
    point = '0 0 0'
    variable = wps_internal
  []
[]
[UserObjects]
  [coh]
    type = SolidMechanicsHardeningGaussian
    value_0 = 1E3
    value_residual = 700
    rate = 2E16
  []
  [tanphi]
    type = SolidMechanicsHardeningGaussian
    value_0 = 1
    value_residual = 0.577350269
    rate = 2E16
  []
  [tanpsi]
    type = SolidMechanicsHardeningGaussian
    value_0 = 0.0874886635
    value_residual = 0.01745506
    rate = 2E16
  []
  [wps]
    type = SolidMechanicsPlasticWeakPlaneShear
    cohesion = coh
    tan_friction_angle = tanphi
    tan_dilation_angle = tanpsi
    smoother = 500
    yield_function_tolerance = 1E-3
    internal_constraint_tolerance = 1E-3
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '1E9 0.5E9'
  []
  [mc]
    type = ComputeMultiPlasticityStress
    plastic_models = wps
    transverse_direction = '0 0 1'
    ep_plastic_tolerance = 1E-3
    max_NR_iterations = 100
    min_stepsize = 1
    debug_fspb = crash
  []
[]
[Executioner]
  end_time = 2E-6
  dt = 1E-7
  type = Transient
[]
[Outputs]
  csv = true
[]
(modules/solid_mechanics/test/tests/j2_plasticity/small_deform1.i)
# UserObject J2 test
# apply uniform stretch in x, y and z directions.
# no plasticity should be observed
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '1E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '1E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1E-6*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = f
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = f
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
[]
[UserObjects]
  [./str]
    type = SolidMechanicsHardeningConstant
    value = 1
  [../]
  [./j2]
    type = SolidMechanicsPlasticJ2
    yield_strength = str
    yield_function_tolerance = 1E-3
    internal_constraint_tolerance = 1E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E6'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = j2
    debug_fspb = crash
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform1
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform16.i)
# Using CappedMohrCoulomb with compressive failure only
# A single element is incrementally compressed in the z and x directions
# This causes the return direction to be along the hypersurface sigma_I = sigma_II
# and the resulting stresses are checked to lie on the expected yield surface
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'max_principal_stress mid_principal_stress min_principal_stress stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '-1*x*t'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '-0.4*y*t'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '-0.4*z*t'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 3
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_I]
    type = PointValue
    point = '0 0 0'
    variable = max_principal_stress
  [../]
  [./s_II]
    type = PointValue
    point = '0 0 0'
    variable = mid_principal_stress
  [../]
  [./s_III]
    type = PointValue
    point = '0 0 0'
    variable = min_principal_stress
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./cs]
    type = SolidMechanicsHardeningConstant
    value = 1
  [../]
  [./coh]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./ang]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '0 2.0'
  [../]
  [./tensile]
    type = CappedMohrCoulombStressUpdate
    tensile_strength = ts
    compressive_strength = cs
    cohesion = coh
    friction_angle = ang
    dilation_angle = ang
    smoothing_tol = 0.5
    yield_function_tol = 1.0E-12
  [../]
  [./stress]
    type = ComputeMultipleInelasticStress
    inelastic_models = tensile
    perform_finite_strain_rotations = false
  [../]
[]
[Executioner]
  end_time = 1
  dt = 0.1
  type = Transient
[]
[Outputs]
  file_base = small_deform16
  csv = true
[]
(modules/solid_mechanics/test/tests/capped_drucker_prager/small_deform3_native.i)
# apply repeated stretches in x z directions, and smaller stretches along the y direction,
# so that sigma_I = sigma_II,
# which means that lode angle = 30deg.
# The allows yield surface in meridional plane to be mapped out
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '1E-6*x*t'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '-1.35E-6*y*t'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1E-6*z*t'
  [../]
[]
[AuxVariables]
  [./mc_int]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./mc_int_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = mc_int
  [../]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./internal]
    type = PointValue
    point = '0 0 0'
    variable = mc_int
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1E5
  [../]
  [./cs]
    type = SolidMechanicsHardeningConstant
    value = 1E5
  [../]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 10
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 35
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 5
    convert_to_radians = true
  [../]
  [./dp]
    type = SolidMechanicsPlasticDruckerPrager
    mc_cohesion = mc_coh
    mc_friction_angle = mc_phi
    mc_dilation_angle = mc_psi
    mc_interpolation_scheme = native
    yield_function_tolerance = 1      # irrelevant here
    internal_constraint_tolerance = 1 # irrelevant here
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./admissible]
    type = ComputeMultipleInelasticStress
    inelastic_models = mc
    perform_finite_strain_rotations = false
  [../]
  [./mc]
    type = CappedDruckerPragerStressUpdate
    DP_model = dp
    tensile_strength = ts
    compressive_strength = cs
    yield_function_tol = 1E-8
    tip_smoother = 8
    smoothing_tol = 1E-7
  [../]
[]
[Executioner]
  end_time = 10
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform3_native
  exodus = false
  [./csv]
    type = CSV
  [../]
[]
(modules/solid_mechanics/test/tests/weak_plane_tensile/small_deform1.i)
# checking for small deformation
# A single element is stretched by 1E-6m in x,y and z directions.
# stress_zz = Youngs Modulus*Strain = 2E6*1E-6 = 2 Pa
# wpt_tensile_strength is set to 1Pa
# Then the final stress should return to the yeild surface and its value should be 1pa.
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
  type = GeneratedMesh
  dim = 3
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  add_variables = true
  generate_output = 'stress_xz stress_zx stress_yz stress_zz'
[]
[BCs]
  [bottomx]
    type = DirichletBC
    variable = disp_x
    boundary = back
    value = 0.0
  []
  [bottomy]
    type = DirichletBC
    variable = disp_y
    boundary = back
    value = 0.0
  []
  [bottomz]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0.0
  []
  [topx]
    type = DirichletBC
    variable = disp_x
    boundary = front
    value = 0E-6
  []
  [topy]
    type = DirichletBC
    variable = disp_y
    boundary = front
    value = 0E-6
  []
  [topz]
    type = DirichletBC
    variable = disp_z
    boundary = front
    value = 1E-6
  []
[]
[AuxVariables]
  [yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[AuxKernels]
  [yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  []
[]
[Postprocessors]
  [s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  []
  [s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  []
  [s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  []
  [f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  []
[]
[UserObjects]
  [str]
    type = SolidMechanicsHardeningConstant
    value = 1
  []
  [wpt]
    type = SolidMechanicsPlasticWeakPlaneTensile
    tensile_strength = str
    yield_function_tolerance = 1E-6
    internal_constraint_tolerance = 1E-5
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E6'
  []
  [mc]
    type = ComputeMultiPlasticityStress
    plastic_models = wpt
    transverse_direction = '0 0 1'
    ep_plastic_tolerance = 1E-5
  []
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  csv = true
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/cp_eigenstrains/hcp_volumetric_eigenstrain_decrease.i)
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 2
  ny = 2
  nz = 2
  elem_type = HEX8
[]
[AuxVariables]
  [temperature]
    order = FIRST
    family = LAGRANGE
  []
  [e_void_xx]
    order = CONSTANT
    family = MONOMIAL
  []
  [e_void_yy]
    order = CONSTANT
    family = MONOMIAL
  []
  [e_void_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [f_void_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [fp_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [resolved_shear_stress_3]
    order = CONSTANT
    family = MONOMIAL
  []
  [resolved_shear_stress_4]
    order = CONSTANT
    family = MONOMIAL
  []
  [resolved_shear_stress_9]
    order = CONSTANT
    family = MONOMIAL
  []
  [resolved_shear_stress_14]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  incremental = true
  add_variables = true
[]
[AuxKernels]
  [temperature]
    type = FunctionAux
    variable = temperature
    function = '300+400*t' # temperature increases at a constant rate
    execute_on = timestep_begin
  []
  [e_void_xx]
    type = RankTwoAux
    variable = e_void_xx
    rank_two_tensor = void_eigenstrain
    index_j = 0
    index_i = 0
    execute_on = timestep_end
  []
  [e_void_yy]
    type = RankTwoAux
    variable = e_void_yy
    rank_two_tensor = void_eigenstrain
    index_j = 1
    index_i = 1
    execute_on = timestep_end
  []
  [e_void_zz]
    type = RankTwoAux
    variable = e_void_zz
    rank_two_tensor = void_eigenstrain
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [f_void_zz]
    type = RankTwoAux
    variable = f_void_zz
    rank_two_tensor = volumetric_deformation_gradient
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [fp_zz]
    type = RankTwoAux
    variable = fp_zz
    rank_two_tensor = plastic_deformation_gradient
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [tau_3]
    type = MaterialStdVectorAux
    variable = resolved_shear_stress_3
    property = applied_shear_stress
    index = 3
    execute_on = timestep_end
  []
  [tau_4]
    type = MaterialStdVectorAux
    variable = resolved_shear_stress_4
    property = applied_shear_stress
    index = 4
    execute_on = timestep_end
  []
  [tau_9]
    type = MaterialStdVectorAux
    variable = resolved_shear_stress_9
    property = applied_shear_stress
    index = 9
    execute_on = timestep_end
  []
  [tau_14]
    type = MaterialStdVectorAux
    variable = resolved_shear_stress_14
    property = applied_shear_stress
    index = 14
    execute_on = timestep_end
  []
[]
[BCs]
  [symmy]
    type = DirichletBC
    variable = disp_y
    boundary = bottom
    value = 0
  []
  [symmx]
    type = DirichletBC
    variable = disp_x
    boundary = left
    value = 0
  []
  [symmz]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0
  []
  [tdisp]
    type = DirichletBC
    variable = disp_z
    boundary = front
    value = 0
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensorCP
    C_ijkl = '1.684e5 1.214e5 1.214e5 1.684e5 1.214e5 1.684e5 0.754e5 0.754e5 0.754e5'
    fill_method = symmetric9
  []
  [stress]
    type = ComputeMultipleCrystalPlasticityStress
    crystal_plasticity_models = 'trial_xtalpl'
    eigenstrain_names = void_eigenstrain
    tan_mod_type = exact
    maximum_substep_iteration = 5
  []
  [trial_xtalpl]
    type = CrystalPlasticityHCPDislocationSlipBeyerleinUpdate
    number_slip_systems = 15
    slip_sys_file_name = hcp_aprismatic_capyramidal_slip_sys.txt
    unit_cell_dimension = '2.934e-7 2.934e-7 4.657e-7' #Ti, in mm, https://materialsproject.org/materials/mp-46/
    temperature = temperature
    initial_forest_dislocation_density = 15.0e3
    initial_substructure_density = 1.0e3
    slip_system_modes = 2
    number_slip_systems_per_mode = '3 12'
    lattice_friction_per_mode = '9 22' #Knezevic et al MSEA 654 (2013)
    effective_shear_modulus_per_mode = '4.7e2 4.7e2' #Ti, in MPa, https://materialsproject.org/materials/mp-46/
    burgers_vector_per_mode = '2.934e-7 6.586e-7' #Ti, in mm, https://materialsproject.org/materials/mp-46/
    slip_generation_coefficient_per_mode = '1.25e5 2.25e7' #from Beyerlein and Tome 2008 IJP
    normalized_slip_activiation_energy_per_mode = '3.73e-3 3.2e-2' #from Beyerlein and Tome 2008 IJP
    slip_energy_proportionality_factor_per_mode = '330 100' #from Beyerlein and Tome 2008 IJP
    substructure_rate_coefficient_per_mode = '355 0.4' #from Capolungo et al MSEA (2009)
    applied_strain_rate = 0.001
    gamma_o = 1.0e-3
    Hall_Petch_like_constant_per_mode = '0.2 0.2' #Estimated to match graph in Capolungo et al MSEA (2009), Figure 2
    grain_size = 20.0e-3 #20 microns, Beyerlein and Tome IJP (2008)
  []
  [void_eigenstrain]
    type = ComputeCrystalPlasticityVolumetricEigenstrain
    eigenstrain_name = void_eigenstrain
    deformation_gradient_name = volumetric_deformation_gradient
    mean_spherical_void_radius = void_radius
    spherical_void_number_density = void_density
  []
  [void_radius]
    type = ParsedMaterial
    property_name = void_radius
    coupled_variables = temperature
    expression = 'if(temperature<321.0, 1.0e-5, (1.0e-5  - 5.0e-8 * (temperature - 320)))' #mm
  []
  [void_density]
    type = GenericConstantMaterial
    prop_names = void_density
    prop_values = '1.0e8'  ###1/mm^3
  []
[]
[Postprocessors]
  [e_void_xx]
    type = ElementAverageValue
    variable = e_void_xx
  []
  [e_void_yy]
    type = ElementAverageValue
    variable = e_void_yy
  []
  [e_void_zz]
    type = ElementAverageValue
    variable = e_void_zz
  []
  [f_void_zz]
    type = ElementAverageValue
    variable = f_void_zz
  []
  [void_density]
    type = ElementAverageMaterialProperty
    mat_prop = void_density
    execute_on = TIMESTEP_END
  []
  [void_radius]
    type = ElementAverageMaterialProperty
    mat_prop = void_radius
    execute_on = TIMESTEP_END
  []
  [fp_zz]
    type = ElementAverageValue
    variable = fp_zz
  []
  [tau_3]
    type = ElementAverageValue
    variable = resolved_shear_stress_3
  []
  [tau_4]
    type = ElementAverageValue
    variable = resolved_shear_stress_4
  []
  [tau_9]
    type = ElementAverageValue
    variable = resolved_shear_stress_9
  []
  [tau_14]
    type = ElementAverageValue
    variable = resolved_shear_stress_14
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Debug]
  show_var_residual_norms = true
[]
[Executioner]
  type = Transient
  solve_type = 'NEWTON'
  petsc_options = '-snes_converged_reason'
  petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
  petsc_options_value = ' asm      2              lu            gmres     200'
  nl_abs_tol = 1e-10
  nl_rel_tol = 1e-8
  nl_abs_step_tol = 1e-10
  dt = 0.05
  dtmin = 1e-4
  num_steps = 10
[]
[Outputs]
  csv = true
  perf_graph = true
[]
(modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform1_cosserat.i)
# Using Cosserat with large layer thickness, so this should reduce to standard
# Using CappedMohrCoulombCosserat with tensile failure only
# checking for small deformation
# A single element is stretched by 1E-6m in z direction, and by small amounts in x and y directions
# stress_zz = Youngs Modulus*Strain = 2E6*1E-6 = 2 Pa
# tensile_strength is set to 1Pa
# Then the final stress should return to the yeild surface and the minimum principal stress value should be 1pa.
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  perform_finite_strain_rotations = false
  displacements = 'disp_x disp_y disp_z'
  Cosserat_rotations = 'wc_x wc_y wc_z'
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
  [./wc_x]
  [../]
  [./wc_y]
  [../]
[]
[Kernels]
  [./cx_elastic]
    type = CosseratStressDivergenceTensors
    variable = disp_x
    component = 0
  [../]
  [./cy_elastic]
    type = CosseratStressDivergenceTensors
    variable = disp_y
    component = 1
  [../]
  [./cz_elastic]
    type = CosseratStressDivergenceTensors
    variable = disp_z
    component = 2
  [../]
  [./x_couple]
    type = StressDivergenceTensors
    variable = wc_x
    displacements = 'wc_x wc_y wc_z'
    component = 0
    base_name = couple
  [../]
  [./y_couple]
    type = StressDivergenceTensors
    variable = wc_y
    displacements = 'wc_x wc_y wc_z'
    component = 1
    base_name = couple
  [../]
  [./x_moment]
    type = MomentBalancing
    variable = wc_x
    component = 0
  [../]
  [./y_moment]
    type = MomentBalancing
    variable = wc_y
    component = 1
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0.1E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0.2E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1E-6*z'
  [../]
[]
[AuxVariables]
  [./wc_z]
  [../]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1
  [../]
  [./coh]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./ang]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeLayeredCosseratElasticityTensor
    young = 4.0E6
    poisson = 0.0
    layer_thickness = 1.0
    joint_normal_stiffness = 1.0E16
    joint_shear_stiffness = 1.0E16
  [../]
  [./strain]
    type = ComputeCosseratIncrementalSmallStrain
  [../]
  [./tensile]
    type = CappedMohrCoulombCosseratStressUpdate
    tensile_strength = ts
    compressive_strength = ts
    cohesion = coh
    friction_angle = ang
    dilation_angle = ang
    smoothing_tol = 0.0
    yield_function_tol = 1.0E-9
    host_youngs_modulus = 4.0E6
    host_poissons_ratio = 0.0
  [../]
  [./stress]
    type = ComputeMultipleInelasticCosseratStress
    inelastic_models = tensile
    perform_finite_strain_rotations = false
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  nl_abs_tol = 1E-10
  type = Transient
[]
[Outputs]
  file_base = small_deform1_cosserat
  csv = true
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/cp_eigenstrains/volumetric_eigenstrain_increase.i)
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
  [cube]
    type = GeneratedMeshGenerator
    dim = 3
    nx = 2
    ny = 2
    nz = 2
    elem_type = HEX27
  []
[]
[AuxVariables]
  [temperature]
    order = FIRST
    family = LAGRANGE
  []
  [linear_void_strain]
    order = CONSTANT
    family = MONOMIAL
  []
  [e_void_xx]
    order = CONSTANT
    family = MONOMIAL
  []
  [e_void_yy]
    order = CONSTANT
    family = MONOMIAL
  []
  [e_void_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [f_void_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [pk2_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [fp_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [tau_0]
    order = FIRST
    family = MONOMIAL
  []
  [tau_10]
    order = FIRST
    family = MONOMIAL
  []
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  incremental = true
  add_variables = true
[]
[Functions]
  [temperature_ramp]
    type = ParsedFunction
    expression = '600.0 + t'
  []
[]
[AuxKernels]
  [temperature]
    type = FunctionAux
    variable = temperature
    function = 'temperature_ramp'
    execute_on = timestep_begin
  []
  [linear_void_strain]
    type = MaterialRealAux
    variable = linear_void_strain
    property = equivalent_linear_change
    execute_on = timestep_end
  []
  [e_void_xx]
    type = RankTwoAux
    variable = e_void_xx
    rank_two_tensor = void_eigenstrain
    index_j = 0
    index_i = 0
    execute_on = timestep_end
  []
  [e_void_yy]
    type = RankTwoAux
    variable = e_void_yy
    rank_two_tensor = void_eigenstrain
    index_j = 1
    index_i = 1
    execute_on = timestep_end
  []
  [e_void_zz]
    type = RankTwoAux
    variable = e_void_zz
    rank_two_tensor = void_eigenstrain
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [f_void_zz]
    type = RankTwoAux
    variable = f_void_zz
    rank_two_tensor = volumetric_deformation_gradient
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [pk2_zz]
    type = RankTwoAux
    variable = pk2_zz
    rank_two_tensor = second_piola_kirchhoff_stress
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [fp_zz]
    type = RankTwoAux
    variable = fp_zz
    rank_two_tensor = plastic_deformation_gradient
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [tau_0]
    type = MaterialStdVectorAux
    variable = tau_0
    property = applied_shear_stress
    index = 0
    execute_on = timestep_end
  []
  [tau_10]
    type = MaterialStdVectorAux
    variable = tau_10
    property = applied_shear_stress
    index = 10
    execute_on = timestep_end
  []
[]
[BCs]
  [symmy]
    type = DirichletBC
    variable = disp_y
    boundary = bottom
    value = 0
  []
  [symmx]
    type = DirichletBC
    variable = disp_x
    boundary = left
    value = 0
  []
  [symmz]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0
  []
  [hold_front]
    type = DirichletBC
    variable = disp_z
    boundary = front
    value = 0
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensorCP
    C_ijkl = '1.98e5 1.25e5 1.25e5 1.98e5 1.25e5 1.98e5 1.22e5 1.22e5 1.22e5'
    fill_method = symmetric9
  []
  [stress]
    type = ComputeMultipleCrystalPlasticityStress
    crystal_plasticity_models = 'trial_xtalpl'
    eigenstrain_names = void_eigenstrain
    tan_mod_type = exact
    line_search_method = CUT_HALF
    use_line_search = true
    maximum_substep_iteration = 5
  []
  [trial_xtalpl]
    type = CrystalPlasticityKalidindiUpdate
    number_slip_systems = 12
    slip_sys_file_name = input_slip_sys.txt
  []
  [void_eigenstrain]
    type = ComputeCrystalPlasticityVolumetricEigenstrain
    eigenstrain_name = void_eigenstrain
    deformation_gradient_name = volumetric_deformation_gradient
    mean_spherical_void_radius = void_radius
    spherical_void_number_density = void_density
  []
  [void_density]
    type = ParsedMaterial
    property_name = void_density
    coupled_variables = temperature
    expression = '1.0e8 * (temperature - 600.0)'
  []
  [void_radius]
    type = GenericConstantMaterial
    prop_names = void_radius
    prop_values = '1.0e-6'  ##1 nm avg particle radius
  []
[]
[Postprocessors]
  [linear_void_strain]
    type = ElementAverageValue
    variable = linear_void_strain
  []
  [e_void_xx]
    type = ElementAverageValue
    variable = e_void_xx
  []
  [e_void_yy]
    type = ElementAverageValue
    variable = e_void_yy
  []
  [e_void_zz]
    type = ElementAverageValue
    variable = e_void_zz
  []
  [f_void_zz]
    type = ElementAverageValue
    variable = f_void_zz
  []
  [density]
    type = ElementAverageMaterialProperty
    mat_prop = void_density
    execute_on = TIMESTEP_END
  []
  [radius]
    type = ElementAverageMaterialProperty
    mat_prop = void_radius
    execute_on = TIMESTEP_END
  []
  [pk2_zz]
   type = ElementAverageValue
   variable = pk2_zz
  []
  [fp_zz]
    type = ElementAverageValue
    variable = fp_zz
  []
  [tau_0]
    type = ElementAverageValue
    variable = tau_0
  []
  [tau_10]
    type = ElementAverageValue
    variable = tau_10
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  solve_type = 'NEWTON'
  petsc_options = '-snes_converged_reason'
  petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
  petsc_options_value = ' asm      2              lu            gmres     200'
  line_search = 'none'
  nl_abs_tol = 1e-12
  nl_rel_tol = 1e-8
  nl_forced_its = 1
  dt = 1.0
  dtmin = 0.1
  end_time  = 5.0
[]
[Outputs]
  csv = true
  perf_graph = true
[]
(modules/solid_mechanics/test/tests/multi/six_surface14.i)
# Plasticit models:
# SimpleTester0 with a = 0 and b = 1 and strength = 1
# SimpleTester1 with a = 1 and b = 0 and strength = 1
# SimpleTester2 with a = 1 and b = 1 and strength = 3
# SimpleTester3 with a = 0 and b = 1 and strength = 1.1
# SimpleTester4 with a = 1 and b = 0 and strength = 1.1
# SimpleTester5 with a = 1 and b = 1 and strength = 3.1
#
# Lame lambda = 0 (Poisson=0).  Lame mu = 0.5E6
#
# A single element is stretched by 2.1E-6m in y direction and 3E-6 in z direction.
# trial stress_yy = 2.1 and stress_zz = 3.0
#
# This is similar to three_surface14.i, and a description is found there.
# The result should be stress_zz=1=stress_yy, with internal0=2
# and internal1=1.1
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '2.1E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '3.0E-6*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f3]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f4]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f5]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int3]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int4]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int5]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./f3]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 3
    variable = f3
  [../]
  [./f4]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 4
    variable = f4
  [../]
  [./f5]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 5
    variable = f5
  [../]
  [./int0]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 0
    variable = int0
  [../]
  [./int1]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 1
    variable = int1
  [../]
  [./int2]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 2
    variable = int2
  [../]
  [./int3]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 3
    variable = int3
  [../]
  [./int4]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 4
    variable = int4
  [../]
  [./int5]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 5
    variable = int5
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./f2]
    type = PointValue
    point = '0 0 0'
    variable = f2
  [../]
  [./f3]
    type = PointValue
    point = '0 0 0'
    variable = f3
  [../]
  [./f4]
    type = PointValue
    point = '0 0 0'
    variable = f4
  [../]
  [./f5]
    type = PointValue
    point = '0 0 0'
    variable = f5
  [../]
  [./int0]
    type = PointValue
    point = '0 0 0'
    variable = int0
  [../]
  [./int1]
    type = PointValue
    point = '0 0 0'
    variable = int1
  [../]
  [./int2]
    type = PointValue
    point = '0 0 0'
    variable = int2
  [../]
  [./int3]
    type = PointValue
    point = '0 0 0'
    variable = int3
  [../]
  [./int4]
    type = PointValue
    point = '0 0 0'
    variable = int4
  [../]
  [./int5]
    type = PointValue
    point = '0 0 0'
    variable = int5
  [../]
[]
[UserObjects]
  [./simple0]
    type = SolidMechanicsPlasticSimpleTester
    a = 0
    b = 1
    strength = 1
    yield_function_tolerance = 1.0E-6
    internal_constraint_tolerance = 1.0E-6
  [../]
  [./simple1]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 0
    strength = 1
    yield_function_tolerance = 1.0E-6
    internal_constraint_tolerance = 1.0E-6
  [../]
  [./simple2]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 1
    strength = 3
    yield_function_tolerance = 1.0E-6
    internal_constraint_tolerance = 1.0E-6
  [../]
  [./simple3]
    type = SolidMechanicsPlasticSimpleTester
    a = 0
    b = 1
    strength = 1.1
    yield_function_tolerance = 1.0E-6
    internal_constraint_tolerance = 1.0E-6
  [../]
  [./simple4]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 0
    strength = 1.1
    yield_function_tolerance = 1.0E-6
    internal_constraint_tolerance = 1.0E-6
  [../]
  [./simple5]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 1
    strength = 3.1
    yield_function_tolerance = 1.0E-6
    internal_constraint_tolerance = 1.0E-6
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 0.5E6'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./multi]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = 'simple0 simple1 simple2 simple3 simple4 simple5'
    max_NR_iterations = 4
    min_stepsize = 1
    debug_fspb = crash
    debug_jac_at_stress = '10 0 0 0 10 0 0 0 10'
    debug_jac_at_pm = '1 1 1'
    debug_jac_at_intnl = '1 1 1'
    debug_stress_change = 1E-5
    debug_pm_change = '1E-6 1E-6 1E-6'
    debug_intnl_change = '1E-6 1E-6 1E-6'
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = six_surface14
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/jacobian/cto16.i)
# Jacobian check for nonlinear, multi-surface plasticity.
# Returns to the tip of the tensile yield surface
# This is a very nonlinear test and a delicate test because it perturbs around
# a tip of the yield function where some derivatives are not well defined
#
# Plasticity models:
# Tensile with strength = 1MPa softening to 0.5MPa in 2E-2 strain
#
# Lame lambda = 1GPa.  Lame mu = 1.3GPa
#
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./linesearch]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./ld]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./constr_added]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int0]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./linesearch]
    type = MaterialRealAux
    property = plastic_linesearch_needed
    variable = linesearch
  [../]
  [./ld]
    type = MaterialRealAux
    property = plastic_linear_dependence_encountered
    variable = ld
  [../]
  [./constr_added]
    type = MaterialRealAux
    property = plastic_constraints_added
    variable = constr_added
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./int0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    variable = int0
    index = 0
  [../]
  [./int1]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    variable = int1
    index = 1
  [../]
  [./int2]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    variable = int2
    index = 2
  [../]
[]
[Postprocessors]
  [./max_int0]
    type = ElementExtremeValue
    variable = int0
    outputs = console
  [../]
  [./max_int1]
    type = ElementExtremeValue
    variable = int1
    outputs = console
  [../]
  [./max_int2]
    type = ElementExtremeValue
    variable = int2
    outputs = console
  [../]
  [./max_iter]
    type = ElementExtremeValue
    variable = iter
    outputs = console
  [../]
  [./av_linesearch]
    type = ElementAverageValue
    variable = linesearch
    outputs = 'console'  [../]
  [./av_ld]
    type = ElementAverageValue
    variable = ld
    outputs = 'console'  [../]
  [./av_constr_added]
    type = ElementAverageValue
    variable = constr_added
    outputs = 'console'  [../]
  [./av_iter]
    type = ElementAverageValue
    variable = iter
    outputs = 'console'  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningCubic
    value_0 = 1
    value_residual = 0.5
    internal_limit = 2E-2
  [../]
  [./tensile]
    type = SolidMechanicsPlasticTensileMulti
    tensile_strength = ts
    yield_function_tolerance = 1.0E-6  # Note larger value
    shift = 1.0E-6                     # Note larger value
    internal_constraint_tolerance = 1.0E-7
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '1.0E3 1.3E3'
  [../]
  [./strain]
    type = ComputeIncrementalStrain
    displacements = 'disp_x disp_y disp_z'
    eigenstrain_names = ini_stress
  [../]
  [./ini_stress]
    type = ComputeEigenstrainFromInitialStress
    initial_stress = '15 1 0.2  1 10 -0.3  -0.3 0.2 8'
    eigenstrain_name = ini_stress
  [../]
  [./multi]
    type = ComputeMultiPlasticityStress
    ep_plastic_tolerance = 1E-7
    plastic_models = 'tensile'
    max_NR_iterations = 5
    deactivation_scheme = 'safe'
    min_stepsize = 1
    tangent_operator = nonlinear
  [../]
[]
[Preconditioning]
  [./andy]
    type = SMP
    full = true
    petsc_options_iname = '-ksp_type -pc_type -snes_atol -snes_rtol -snes_max_it -snes_type'
    petsc_options_value = 'bcgs bjacobi 1E-15 1E-10 10000 test'
  [../]
[]
[Executioner]
  type = Transient
  solve_type = Newton
[]
[Outputs]
  file_base = cto16
  exodus = false
[]
(modules/solid_mechanics/test/tests/tensile/small_deform3.i)
# checking for small deformation
# A single element is stretched by "ep" in the z and x directions
# This causes the return direction to be along the hypersurface sigma_I = sigma_II
# tensile_strength is set to 1Pa, tip_smoother = 0, edge_smoother = 25degrees
# Then A + B + C = 0.609965
#
# The trial stress is (la, 0, la), with mean stress 2la/3, and bar(sigma)=sqrt(secondInvariant)=la/sqrt(3)
# If this sits on the yield surface then
# 2la/3 + la*K/sqrt(3) - 1 = 0
# So la = 0.9815.  Therefore, with young's modulus = 2MPa, we need "ep" = 0.9815/4.  I set
# "ep" = 0.25 and observe a tiny amount of yielding
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    strain = finite
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0.25E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '0.25E-6*z'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1
  [../]
  [./mc]
    type = SolidMechanicsPlasticTensile
    tensile_strength = ts
    yield_function_tolerance = 1E-6
    tensile_tip_smoother = 0.0
    internal_constraint_tolerance = 1E-5
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 2.0E6'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-5
    plastic_models = mc
    debug_fspb = crash
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform3
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/stress_update_material_based/update_method_test.i)
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
  type = GeneratedMesh
  dim = 3
  elem_type = HEX8
[]
[AuxVariables]
  [pk2]
    order = CONSTANT
    family = MONOMIAL
  []
  [fp_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [e_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [gss]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment]
   order = CONSTANT
   family = MONOMIAL
  []
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  add_variables = true
  generate_output = stress_zz
[]
[AuxKernels]
  [pk2]
   type = RankTwoAux
   variable = pk2
   rank_two_tensor = second_piola_kirchhoff_stress
   index_j = 2
   index_i = 2
   execute_on = timestep_end
  []
  [fp_zz]
    type = RankTwoAux
    variable = fp_zz
    rank_two_tensor = plastic_deformation_gradient
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [e_zz]
    type = RankTwoAux
    variable = e_zz
    rank_two_tensor = total_lagrangian_strain
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [gss]
   type = MaterialStdVectorAux
   variable = gss
   property = slip_resistance
   index = 0
   execute_on = timestep_end
  []
  [slip_inc]
   type = MaterialStdVectorAux
   variable = slip_increment
   property = slip_increment
   index = 0
   execute_on = timestep_end
  []
[]
[BCs]
  [symmy]
    type = DirichletBC
    variable = disp_y
    boundary = bottom
    value = 0
  []
  [symmx]
    type = DirichletBC
    variable = disp_x
    boundary = left
    value = 0
  []
  [symmz]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0
  []
  [tdisp]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = '0.01*t'
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensorCP
    C_ijkl = '1.684e5 1.214e5 1.214e5 1.684e5 1.214e5 1.684e5 0.754e5 0.754e5 0.754e5'
    fill_method = symmetric9
  []
  [stress]
    type = ComputeMultipleCrystalPlasticityStress
    crystal_plasticity_models = 'trial_xtalpl'
    tan_mod_type = exact
  []
  [trial_xtalpl]
    type = CrystalPlasticityKalidindiUpdate
    number_slip_systems = 12
    slip_sys_file_name = input_slip_sys.txt
  []
[]
[Postprocessors]
  [stress_zz]
    type = ElementAverageValue
    variable = stress_zz
  []
  [pk2]
   type = ElementAverageValue
   variable = pk2
  []
  [fp_zz]
    type = ElementAverageValue
    variable = fp_zz
  []
  [e_zz]
    type = ElementAverageValue
    variable = e_zz
  []
  [gss]
    type = ElementAverageValue
    variable = gss
  []
  [slip_increment]
   type = ElementAverageValue
   variable = slip_increment
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
  petsc_options_value = ' asm      2              lu            gmres     200'
  nl_abs_tol = 1e-10
  nl_rel_tol = 1e-10
  nl_abs_step_tol = 1e-10
  dt = 0.05
  dtmin = 0.01
  dtmax = 10.0
  num_steps = 10
[]
[Outputs]
  exodus = true
  perf_graph = true
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/monolithic_material_based/crysp_cutback.i)
[Mesh]
  type = GeneratedMesh
  dim = 3
  elem_type = HEX8
  displacements = 'ux uy uz'
[]
[Variables]
  [./ux]
    block = 0
  [../]
  [./uy]
    block = 0
  [../]
  [./uz]
    block = 0
  [../]
[]
[AuxVariables]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
  [./fp_zz]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
  [./rotout]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
  [./e_zz]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
  [./gss1]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
[]
[Functions]
  [./tdisp]
    type = ParsedFunction
    expression = 0.01*t
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'ux uy uz'
    use_displaced_mesh = true
  [../]
[]
[AuxKernels]
  [./stress_zz]
    type = RankTwoAux
    variable = stress_zz
    rank_two_tensor = stress
    index_j = 2
    index_i = 2
    execute_on = timestep_end
    block = 0
  [../]
  [./fp_zz]
    type = RankTwoAux
    variable = fp_zz
    rank_two_tensor = fp
    index_j = 2
    index_i = 2
    execute_on = timestep_end
    block = 0
  [../]
  [./e_zz]
    type = RankTwoAux
    variable = e_zz
    rank_two_tensor = lage
    index_j = 2
    index_i = 2
    execute_on = timestep_end
    block = 0
  [../]
  [./gss1]
    type = MaterialStdVectorAux
    variable = gss1
    property = gss
    index = 0
    execute_on = timestep_end
    block = 0
  [../]
[]
[BCs]
  [./symmy]
    type = DirichletBC
    variable = uy
    boundary = bottom
    value = 0
  [../]
  [./symmx]
    type = DirichletBC
    variable = ux
    boundary = left
    value = 0
  [../]
  [./symmz]
    type = DirichletBC
    variable = uz
    boundary = back
    value = 0
  [../]
  [./tdisp]
    type = FunctionDirichletBC
    variable = uz
    boundary = front
    function = tdisp
  [../]
[]
[Materials]
  [./crysp]
    type = FiniteStrainCrystalPlasticity
    block = 0
    gtol = 1e-2
    slip_sys_file_name = input_slip_sys.txt
    nss = 12
    num_slip_sys_flowrate_props = 2 #Number of properties in a slip system
    flowprops = '1 4 0.001 0.1 5 8 0.001 0.1 9 12 0.001 0.1'
    hprops = '1.0 541.5 60.8 109.8 2.5'
    gprops = '1 4 60.8 5 8 60.8 9 12 60.8'
    tan_mod_type = exact
    gen_random_stress_flag = true
  [../]
  [./elasticity_tensor]
    type = ComputeElasticityTensorCP
    block = 0
    C_ijkl = '1.684e5 1.214e5 1.214e5 1.684e5 1.214e5 1.684e5 0.754e5 0.754e5 0.754e5'
    fill_method = symmetric9
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'ux uy uz'
  [../]
[]
[Postprocessors]
  [./stress_zz]
    type = ElementAverageValue
    variable = stress_zz
    block = 'ANY_BLOCK_ID 0'
  [../]
  [./fp_zz]
    type = ElementAverageValue
    variable = fp_zz
    block = 'ANY_BLOCK_ID 0'
  [../]
  [./e_zz]
    type = ElementAverageValue
    variable = e_zz
    block = 'ANY_BLOCK_ID 0'
  [../]
  [./gss1]
    type = ElementAverageValue
    variable = gss1
    block = 'ANY_BLOCK_ID 0'
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_factor_shift_type'
  petsc_options_value = 'nonzero'
  nl_rel_tol = 1e-10
  nl_abs_tol = 1e-10
  dt = 1.0
  dtmax = 10.0
  dtmin = 1e-5
  num_steps = 3
  snesmf_reuse_base = false
[]
[Outputs]
  file_base = crysp_cutback_out
  exodus = true
  csv = true
  gnuplot = true
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/user_object_based/fileread.i)
[Mesh]
  type = GeneratedMesh
  dim = 3
  elem_type = HEX8
  displacements = 'ux uy uz'
[]
[Variables]
  [./ux]
  [../]
  [./uy]
  [../]
  [./uz]
  [../]
[]
[AuxVariables]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./fp_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./rotout]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./e_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./gss]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[Functions]
  [./tdisp]
    type = ParsedFunction
    expression = 0.01*t
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'ux uy uz'
    use_displaced_mesh = true
  [../]
[]
[AuxKernels]
  [./stress_zz]
    type = RankTwoAux
    variable = stress_zz
    rank_two_tensor = stress
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  [../]
  [./fp_zz]
    type = RankTwoAux
    variable = fp_zz
    rank_two_tensor = fp
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  [../]
  [./e_zz]
    type = RankTwoAux
    variable = e_zz
    rank_two_tensor = lage
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  [../]
  [./gss]
    type = MaterialStdVectorAux
    variable = gss
    property = state_var_gss
    index = 0
    execute_on = timestep_end
  [../]
[]
[BCs]
  [./symmy]
    type = DirichletBC
    variable = uy
    boundary = bottom
    value = 0
  [../]
  [./symmx]
    type = DirichletBC
    variable = ux
    boundary = left
    value = 0
  [../]
  [./symmz]
    type = DirichletBC
    variable = uz
    boundary = back
    value = 0
  [../]
  [./tdisp]
    type = FunctionDirichletBC
    variable = uz
    boundary = front
    function = tdisp
  [../]
[]
[UserObjects]
  [./slip_rate_gss]
    type = CrystalPlasticitySlipRateGSS
    variable_size = 12
    slip_sys_file_name = input_slip_sys.txt
    num_slip_sys_flowrate_props = 2
    flowprops = '1 4 0.001 0.1 5 8 0.001 0.1 9 12 0.001 0.1'
    uo_state_var_name = state_var_gss
  [../]
  [./slip_resistance_gss]
    type = CrystalPlasticitySlipResistanceGSS
    variable_size = 12
    uo_state_var_name = state_var_gss
  [../]
  [./state_var_gss]
    type = CrystalPlasticityStateVariable
    variable_size = 12
    intvar_read_type = file_input
    state_variable_file_name = input_state_variable.txt
    uo_state_var_evol_rate_comp_name = state_var_evol_rate_comp_gss
    scale_factor = 1.0
  [../]
  [./state_var_evol_rate_comp_gss]
    type = CrystalPlasticityStateVarRateComponentGSS
    variable_size = 12
    hprops = '1.0 541.5 109.8 2.5'
    uo_slip_rate_name = slip_rate_gss
    uo_state_var_name = state_var_gss
  [../]
[]
[Materials]
  [./crysp]
    type = FiniteStrainUObasedCP
    stol = 1e-2
    tan_mod_type = exact
    uo_slip_rates = 'slip_rate_gss'
    uo_slip_resistances = 'slip_resistance_gss'
    uo_state_vars = 'state_var_gss'
    uo_state_var_evol_rate_comps = 'state_var_evol_rate_comp_gss'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    displacements = 'ux uy uz'
  [../]
  [./elasticity_tensor]
    type = ComputeElasticityTensorCP
    C_ijkl = '1.684e5 1.214e5 1.214e5 1.684e5 1.214e5 1.684e5 0.754e5 0.754e5 0.754e5'
    fill_method = symmetric9
  [../]
[]
[Postprocessors]
  [./stress_zz]
    type = ElementAverageValue
    variable = stress_zz
  [../]
  [./fp_zz]
    type = ElementAverageValue
    variable = fp_zz
  [../]
  [./e_zz]
    type = ElementAverageValue
    variable = e_zz
  [../]
  [./gss]
    type = ElementAverageValue
    variable = gss
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  dt = 0.05
  solve_type = 'PJFNK'
  petsc_options_iname = -pc_hypre_type
  petsc_options_value = boomerang
  nl_abs_tol = 1e-10
  nl_rel_step_tol = 1e-10
  dtmax = 10.0
  nl_rel_tol = 1e-10
  end_time = 1
  dtmin = 0.05
  num_steps = 10
  nl_abs_step_tol = 1e-10
[]
[Outputs]
  exodus = true
[]
(modules/porous_flow/test/tests/gravity/grav02g.i)
# Checking that gravity head is established in the transient situation when 0<=saturation<=1 (note the less-than-or-equal-to).
# 2phase (PS), 2components, Brooks-Corey capillary pressure, constant fluid bulk-moduli for each phase, constant viscosity,
# constant permeability, Brooks-Corey relative permeabilities with residual saturation
[Mesh]
  type = GeneratedMesh
  dim = 2
  ny = 10
  ymax = 100
[]
[GlobalParams]
  PorousFlowDictator = dictator
  gravity = '0 -10 0'
[]
[Variables]
  [ppwater]
    initial_condition = 1.5e6
  []
  [sgas]
    initial_condition = 0.3
  []
[]
[AuxVariables]
  [massfrac_ph0_sp0]
    initial_condition = 1
  []
  [massfrac_ph1_sp0]
    initial_condition = 0
  []
  [ppgas]
    family = MONOMIAL
    order = CONSTANT
  []
  [swater]
    family = MONOMIAL
    order = CONSTANT
  []
  [relpermwater]
    family = MONOMIAL
    order = CONSTANT
  []
  [relpermgas]
    family = MONOMIAL
    order = CONSTANT
  []
[]
[Kernels]
  [mass0]
    type = PorousFlowMassTimeDerivative
    fluid_component = 0
    variable = ppwater
  []
  [flux0]
    type = PorousFlowAdvectiveFlux
    fluid_component = 0
    variable = ppwater
  []
  [mass1]
    type = PorousFlowMassTimeDerivative
    fluid_component = 1
    variable = sgas
  []
  [flux1]
    type = PorousFlowAdvectiveFlux
    fluid_component = 1
    variable = sgas
  []
[]
[AuxKernels]
  [ppgas]
    type = PorousFlowPropertyAux
    property = pressure
    phase = 1
    variable = ppgas
  []
  [swater]
    type = PorousFlowPropertyAux
    property = saturation
    phase = 0
    variable = swater
  []
  [relpermwater]
    type = MaterialStdVectorAux
    property = PorousFlow_relative_permeability_qp
    index = 0
    variable = relpermwater
  []
  [relpermgas]
    type = PorousFlowPropertyAux
    property = relperm
    phase = 1
    variable = relpermgas
  []
[]
[UserObjects]
  [dictator]
    type = PorousFlowDictator
    porous_flow_vars = 'ppwater sgas'
    number_fluid_phases = 2
    number_fluid_components = 2
  []
  [pc]
    type = PorousFlowCapillaryPressureBC
    lambda = 2
    pe = 1e4
  []
[]
[FluidProperties]
  [simple_fluid0]
    type = SimpleFluidProperties
    bulk_modulus = 2e9
    density0 = 1000
    viscosity = 1e-3
    thermal_expansion = 0
  []
  [simple_fluid1]
    type = SimpleFluidProperties
    bulk_modulus = 2e9
    density0 = 10
    viscosity = 1e-5
    thermal_expansion = 0
  []
[]
[Materials]
  [temperature]
    type = PorousFlowTemperature
  []
  [ppss]
    type = PorousFlow2PhasePS
    phase0_porepressure = ppwater
    phase1_saturation = sgas
    capillary_pressure = pc
  []
  [massfrac]
    type = PorousFlowMassFraction
    mass_fraction_vars = 'massfrac_ph0_sp0 massfrac_ph1_sp0'
  []
  [simple_fluid0]
    type = PorousFlowSingleComponentFluid
    fp = simple_fluid0
    phase = 0
  []
  [simple_fluid1]
    type = PorousFlowSingleComponentFluid
    fp = simple_fluid1
    phase = 1
  []
  [porosity]
    type = PorousFlowPorosityConst
    porosity = 0.1
  []
  [permeability]
    type = PorousFlowPermeabilityConst
    permeability = '1e-11 0 0 0 1e-11 0  0 0 1e-11'
  []
  [relperm_water]
    type = PorousFlowRelativePermeabilityBC
    lambda = 2
    phase = 0
    s_res = 0.25
    sum_s_res = 0.35
  []
  [relperm_gas]
    type = PorousFlowRelativePermeabilityBC
    lambda = 2
    phase = 1
    s_res = 0.1
    sum_s_res = 0.35
    nw_phase = true
  []
[]
[Postprocessors]
  [mass_ph0]
    type = PorousFlowFluidMass
    fluid_component = 0
    execute_on = 'initial timestep_end'
  []
  [mass_ph1]
    type = PorousFlowFluidMass
    fluid_component = 1
    execute_on = 'initial timestep_end'
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
    petsc_options_iname = '-ksp_type -pc_type -snes_stol -snes_max_it'
    petsc_options_value = 'bcgs bjacobi 1E-13 15'
  []
[]
[Executioner]
  type = Transient
  solve_type = Newton
  end_time = 1e5
  [TimeStepper]
    type = IterationAdaptiveDT
    dt = 5e3
  []
[]
[Outputs]
  execute_on = 'initial timestep_end'
  file_base = grav02g
  exodus = true
  perf_graph = true
  csv = false
[]
(modules/solid_mechanics/test/tests/capped_weak_plane/small_deform_cosserat4.i)
# Plastic deformation.  Layered Cosserat with parameters:
# Young = 10.0
# Poisson = 0.25
# layer_thickness = 10
# joint_normal_stiffness = 2.5
# joint_shear_stiffness = 2.0
# These give the following nonzero components of the elasticity tensor:
# E_0000 = E_1111 = 1.156756756757E+01
# E_0011 = E_1100 = 3.855855855856E+00
# E_2222 = E_pp = 8.108108108108E+00
# E_0022 = E_1122 = E_2200 = E_2211 = 2.702702702703E+00
# G = E_0101 = E_0110 = E_1001 = E_1010 = 4
# Gt = E_qq = E_0202 = E_0220 = E_2002 = E_1212 = E_1221 = E_2112 = 3.333333333333E+00
# E_2020 = E_2121 = 3.666666666667E+00
# They give the following nonzero components of the bending rigidity tensor:
# D = 8.888888888889E+02
# B_0101 = B_1010 = 8.080808080808E+00
# B_0110 = B_1001 = -2.020202020202E+00
#
# Applying the following deformation to the zmax surface of a unit cube:
# disp_x = 32*t/Gt
# disp_y = 24*t/Gt
# disp_z = 10*t/E_2222
# but leaving wc_x and wc_y unfixed
# yields the following strains:
# strain_xz = 32*t/Gt - wc_y = 9.6*t - wc_y
# strain_zx = wc_y
# strain_yz = 24*t/Gt + wc_x = 7.2*t + wc_x
# strain_zy = - wc_x
# strain_zz = 10*t/E_2222 = 1.23333333*t
# and all other components, and the curvature, are zero (assuming
# wc is uniform over the cube).
#
# When wc=0, the nonzero components of stress are therefore:
# stress_xx = stress_yy = 3.33333*t
# stress_xz = stress_zx = 32*t
# stress_yz = stress_zy = 24*t
# stress_zz = 10*t
# The moment stress is zero.
# So q = 40*t and p = 10*t
#
# Use tan(friction_angle) = 0.5 and tan(dilation_angle) = E_qq/Epp/2, and cohesion=20,
# the system should return to p=0, q=20, ie stress_zz=0, stress_xz=16,
# stress_yz=12 on the first time step (t=1)
# and
# stress_xx = stress_yy = 0
# and
# stress_zx = 32, and stress_zy = 24.
# This has resulted in a non-symmetric stress tensor, and there is
# zero moment stress, so the system is not in equilibrium.  A
# nonzero wc must therefore be generated.
#
# The obvious choice of wc is such that stress_zx = 16 and
# stress_zy = 12, because then the final returned stress will
# be symmetric.  This gives
# wc_y = - 48
# wc_x = 36
# At t=1, the nonzero components of stress are
# stress_xx = stress_yy = 3.33333
# stress_xz = 32, stress_zx = 16
# stress_yz = 24, stress_zy = 12
# stress_zz = 10*t
# The moment stress is zero.
#
# The returned stress is
# stress_xx = stress_yy = 0
# stress_xz = stress_zx = 16
# stress_yz = stress_zy = 12
# stress_zz = 0
# The total strains are given above.
# Since q returned from 40 to 20, plastic_strain_xz = 9.6/2 = 4.8
# and plastic_strain_yz = 7.2/2 = 3.6.
# Since p returned to zero, all of the total strain_zz is
# plastic, ie plastic_strain_zz = 1.23333
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
  Cosserat_rotations = 'wc_x wc_y wc_z'
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
  [./wc_x]
  [../]
  [./wc_y]
  [../]
[]
[Kernels]
  [./cx_elastic]
    type = CosseratStressDivergenceTensors
    variable = disp_x
    component = 0
  [../]
  [./cy_elastic]
    type = CosseratStressDivergenceTensors
    variable = disp_y
    component = 1
  [../]
  [./cz_elastic]
    type = CosseratStressDivergenceTensors
    variable = disp_z
    component = 2
  [../]
  [./x_couple]
    type = StressDivergenceTensors
    variable = wc_x
    displacements = 'wc_x wc_y wc_z'
    component = 0
    base_name = couple
  [../]
  [./y_couple]
    type = StressDivergenceTensors
    variable = wc_y
    displacements = 'wc_x wc_y wc_z'
    component = 1
    base_name = couple
  [../]
  [./x_moment]
    type = MomentBalancing
    variable = wc_x
    component = 0
  [../]
  [./y_moment]
    type = MomentBalancing
    variable = wc_y
    component = 1
  [../]
[]
[BCs]
  [./bottomx]
    type = DirichletBC
    variable = disp_x
    boundary = back
    value = 0.0
  [../]
  [./bottomy]
    type = DirichletBC
    variable = disp_y
    boundary = back
    value = 0.0
  [../]
  [./bottomz]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0.0
  [../]
  [./topx]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = front
    function = 32*t/3.333333333333E+00
  [../]
  [./topy]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = front
    function = 24*t/3.333333333333E+00
  [../]
  [./topz]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = 10*t/8.108108108108E+00
  [../]
[]
[AuxVariables]
  [./wc_z]
  [../]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./couple_stress_xx]
    family = MONOMIAL
    order = CONSTANT
  [../]
  [./couple_stress_xy]
    family = MONOMIAL
    order = CONSTANT
  [../]
  [./couple_stress_xz]
    family = MONOMIAL
    order = CONSTANT
  [../]
  [./couple_stress_yx]
    family = MONOMIAL
    order = CONSTANT
  [../]
  [./couple_stress_yy]
    family = MONOMIAL
    order = CONSTANT
  [../]
  [./couple_stress_yz]
    family = MONOMIAL
    order = CONSTANT
  [../]
  [./couple_stress_zx]
    family = MONOMIAL
    order = CONSTANT
  [../]
  [./couple_stress_zy]
    family = MONOMIAL
    order = CONSTANT
  [../]
  [./couple_stress_zz]
    family = MONOMIAL
    order = CONSTANT
  [../]
  [./strainp_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_yx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_zx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_zy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_yx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_zx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_zy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_compressive]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./ls]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yx
    index_i = 1
    index_j = 0
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zx
    index_i = 2
    index_j = 0
  [../]
  [./stress_zy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zy
    index_i = 2
    index_j = 1
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./couple_stress_xx]
    type = RankTwoAux
    rank_two_tensor = couple_stress
    variable = couple_stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./couple_stress_xy]
    type = RankTwoAux
    rank_two_tensor = couple_stress
    variable = couple_stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./couple_stress_xz]
    type = RankTwoAux
    rank_two_tensor = couple_stress
    variable = couple_stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./couple_stress_yx]
    type = RankTwoAux
    rank_two_tensor = couple_stress
    variable = couple_stress_yx
    index_i = 1
    index_j = 0
  [../]
  [./couple_stress_yy]
    type = RankTwoAux
    rank_two_tensor = couple_stress
    variable = couple_stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./couple_stress_yz]
    type = RankTwoAux
    rank_two_tensor = couple_stress
    variable = couple_stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./couple_stress_zx]
    type = RankTwoAux
    rank_two_tensor = couple_stress
    variable = couple_stress_zx
    index_i = 2
    index_j = 0
  [../]
  [./couple_stress_zy]
    type = RankTwoAux
    rank_two_tensor = couple_stress
    variable = couple_stress_zy
    index_i = 2
    index_j = 1
  [../]
  [./couple_stress_zz]
    type = RankTwoAux
    rank_two_tensor = couple_stress
    variable = couple_stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./strainp_xx]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_xx
    index_i = 0
    index_j = 0
  [../]
  [./strainp_xy]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_xy
    index_i = 0
    index_j = 1
  [../]
  [./strainp_xz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_xz
    index_i = 0
    index_j = 2
  [../]
  [./strainp_yx]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_yx
    index_i = 1
    index_j = 0
  [../]
  [./strainp_yy]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_yy
    index_i = 1
    index_j = 1
  [../]
  [./strainp_yz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_yz
    index_i = 1
    index_j = 2
  [../]
  [./strainp_zx]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_zx
    index_i = 2
    index_j = 0
  [../]
  [./strainp_zy]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_zy
    index_i = 2
    index_j = 1
  [../]
  [./strainp_zz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_zz
    index_i = 2
    index_j = 2
  [../]
  [./straint_xx]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_xx
    index_i = 0
    index_j = 0
  [../]
  [./straint_xy]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_xy
    index_i = 0
    index_j = 1
  [../]
  [./straint_xz]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_xz
    index_i = 0
    index_j = 2
  [../]
  [./straint_yx]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_yx
    index_i = 1
    index_j = 0
  [../]
  [./straint_yy]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_yy
    index_i = 1
    index_j = 1
  [../]
  [./straint_yz]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_yz
    index_i = 1
    index_j = 2
  [../]
  [./straint_zx]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_zx
    index_i = 2
    index_j = 0
  [../]
  [./straint_zy]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_zy
    index_i = 2
    index_j = 1
  [../]
  [./straint_zz]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_zz
    index_i = 2
    index_j = 2
  [../]
  [./f_shear]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f_shear
  [../]
  [./f_tensile]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f_tensile
  [../]
  [./f_compressive]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f_compressive
  [../]
  [./intnl_shear]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl_shear
  [../]
  [./intnl_tensile]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 1
    variable = intnl_tensile
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./ls]
    type = MaterialRealAux
    property = plastic_linesearch_needed
    variable = ls
  [../]
[]
[Postprocessors]
  [./wc_x]
    type = PointValue
    point = '0 0 0'
    variable = wc_x
  [../]
  [./wc_y]
    type = PointValue
    point = '0 0 0'
    variable = wc_y
  [../]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yx]
    type = PointValue
    point = '0 0 0'
    variable = stress_yx
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zx]
    type = PointValue
    point = '0 0 0'
    variable = stress_zx
  [../]
  [./s_zy]
    type = PointValue
    point = '0 0 0'
    variable = stress_zy
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./c_s_xx]
    type = PointValue
    point = '0 0 0'
    variable = couple_stress_xx
  [../]
  [./c_s_xy]
    type = PointValue
    point = '0 0 0'
    variable = couple_stress_xy
  [../]
  [./c_s_xz]
    type = PointValue
    point = '0 0 0'
    variable = couple_stress_xz
  [../]
  [./c_s_yx]
    type = PointValue
    point = '0 0 0'
    variable = couple_stress_yx
  [../]
  [./c_s_yy]
    type = PointValue
    point = '0 0 0'
    variable = couple_stress_yy
  [../]
  [./c_s_yz]
    type = PointValue
    point = '0 0 0'
    variable = couple_stress_yz
  [../]
  [./c_s_zx]
    type = PointValue
    point = '0 0 0'
    variable = couple_stress_zx
  [../]
  [./c_s_zy]
    type = PointValue
    point = '0 0 0'
    variable = couple_stress_zy
  [../]
  [./c_s_zz]
    type = PointValue
    point = '0 0 0'
    variable = couple_stress_zz
  [../]
  [./strainp_xx]
    type = PointValue
    point = '0 0 0'
    variable = strainp_xx
  [../]
  [./strainp_xy]
    type = PointValue
    point = '0 0 0'
    variable = strainp_xy
  [../]
  [./strainp_xz]
    type = PointValue
    point = '0 0 0'
    variable = strainp_xz
  [../]
  [./strainp_yx]
    type = PointValue
    point = '0 0 0'
    variable = strainp_yx
  [../]
  [./strainp_yy]
    type = PointValue
    point = '0 0 0'
    variable = strainp_yy
  [../]
  [./strainp_yz]
    type = PointValue
    point = '0 0 0'
    variable = strainp_yz
  [../]
  [./strainp_zx]
    type = PointValue
    point = '0 0 0'
    variable = strainp_zx
  [../]
  [./strainp_zy]
    type = PointValue
    point = '0 0 0'
    variable = strainp_zy
  [../]
  [./strainp_zz]
    type = PointValue
    point = '0 0 0'
    variable = strainp_zz
  [../]
  [./straint_xx]
    type = PointValue
    point = '0 0 0'
    variable = straint_xx
  [../]
  [./straint_xy]
    type = PointValue
    point = '0 0 0'
    variable = straint_xy
  [../]
  [./straint_xz]
    type = PointValue
    point = '0 0 0'
    variable = straint_xz
  [../]
  [./straint_yx]
    type = PointValue
    point = '0 0 0'
    variable = straint_yx
  [../]
  [./straint_yy]
    type = PointValue
    point = '0 0 0'
    variable = straint_yy
  [../]
  [./straint_yz]
    type = PointValue
    point = '0 0 0'
    variable = straint_yz
  [../]
  [./straint_zx]
    type = PointValue
    point = '0 0 0'
    variable = straint_zx
  [../]
  [./straint_zy]
    type = PointValue
    point = '0 0 0'
    variable = straint_zy
  [../]
  [./straint_zz]
    type = PointValue
    point = '0 0 0'
    variable = straint_zz
  [../]
  [./f_shear]
    type = PointValue
    point = '0 0 0'
    variable = f_shear
  [../]
  [./f_tensile]
    type = PointValue
    point = '0 0 0'
    variable = f_tensile
  [../]
  [./f_compressive]
    type = PointValue
    point = '0 0 0'
    variable = f_compressive
  [../]
  [./intnl_shear]
    type = PointValue
    point = '0 0 0'
    variable = intnl_shear
  [../]
  [./intnl_tensile]
    type = PointValue
    point = '0 0 0'
    variable = intnl_tensile
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
  [./ls]
    type = PointValue
    point = '0 0 0'
    variable = ls
  [../]
[]
[UserObjects]
  [./coh]
    type = SolidMechanicsHardeningConstant
    value = 20
  [../]
  [./tanphi]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
  [./tanpsi]
    type = SolidMechanicsHardeningConstant
    value = 2.055555555556E-01
  [../]
  [./t_strength]
    type = SolidMechanicsHardeningConstant
    value = 100
  [../]
  [./c_strength]
    type = SolidMechanicsHardeningConstant
    value = 100
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeLayeredCosseratElasticityTensor
    young = 10.0
    poisson = 0.25
    layer_thickness = 10.0
    joint_normal_stiffness = 2.5
    joint_shear_stiffness = 2.0
  [../]
  [./strain]
    type = ComputeCosseratIncrementalSmallStrain
  [../]
  [./admissible]
    type = ComputeMultipleInelasticCosseratStress
    inelastic_models = stress
    perform_finite_strain_rotations = false
  [../]
  [./stress]
    type = CappedWeakPlaneCosseratStressUpdate
    cohesion = coh
    tan_friction_angle = tanphi
    tan_dilation_angle = tanpsi
    tensile_strength = t_strength
    compressive_strength = c_strength
    tip_smoother = 0
    smoothing_tol = 0
    yield_function_tol = 1E-5
  [../]
[]
[Preconditioning]
  [./andy]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  solve_type = 'NEWTON'
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform_cosserat4
  csv = true
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/hcp_twinning/demonstration_combined_hcp_slip_twins.i)
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
  [single_xtal]
    type = GeneratedMeshGenerator
    dim = 3
    nx = 2
    ny = 2
    nz = 2
    elem_type = HEX8
  []
[]
[AuxVariables]
  [temperature]
  []
  [pk2]
    order = CONSTANT
    family = MONOMIAL
  []
  [fp_xx]
    order = CONSTANT
    family = MONOMIAL
  []
  [fp_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [e_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [total_twin_volume_fraction]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_0]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_3]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_9]
    order = CONSTANT
    family = MONOMIAL
  []
  [resolved_shear_stress_3]
    order = CONSTANT
    family = MONOMIAL
  []
  [resolved_shear_stress_9]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_resistance_0]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_resistance_3]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_resistance_9]
    order = CONSTANT
    family = MONOMIAL
  []
  [resolved_twin_stress_0]
    order = CONSTANT
    family = MONOMIAL
  []
  [twin_resistance_0]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  incremental = true
  add_variables = true
  generate_output = stress_zz
[]
[AuxKernels]
  [temperature]
    type = ConstantAux
    variable = temperature
    value= 300
  []
  [pk2]
    type = RankTwoAux
    variable = pk2
    rank_two_tensor = second_piola_kirchhoff_stress
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [fp_xx]
    type = RankTwoAux
    variable = fp_xx
    rank_two_tensor = plastic_deformation_gradient
    index_j = 0
    index_i = 0
    execute_on = timestep_end
  []
  [fp_zz]
    type = RankTwoAux
    variable = fp_zz
    rank_two_tensor = plastic_deformation_gradient
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [e_zz]
    type = RankTwoAux
    variable = e_zz
    rank_two_tensor = total_lagrangian_strain
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [total_twin_volume_fraction]
    type = MaterialRealAux
    variable = total_twin_volume_fraction
    property = twin_total_volume_fraction_twins
    execute_on = timestep_end
  []
  [slip_increment_0]
   type = MaterialStdVectorAux
   variable = slip_increment_0
   property = slip_increment
   index = 0
   execute_on = timestep_end
  []
  [slip_increment_3]
   type = MaterialStdVectorAux
   variable = slip_increment_3
   property = slip_increment
   index = 3
   execute_on = timestep_end
  []
  [slip_increment_9]
   type = MaterialStdVectorAux
   variable = slip_increment_9
   property = slip_increment
   index = 9
   execute_on = timestep_end
  []
  [tau_3]
    type = MaterialStdVectorAux
    variable = resolved_shear_stress_3
    property = applied_shear_stress
    index = 3
    execute_on = timestep_end
  []
  [tau_9]
    type = MaterialStdVectorAux
    variable = resolved_shear_stress_9
    property = applied_shear_stress
    index = 9
    execute_on = timestep_end
  []
  [slip_resistance_0]
    type = MaterialStdVectorAux
    variable = slip_resistance_0
    property = slip_resistance
    index = 0
    execute_on = timestep_end
  []
  [slip_resistance_3]
    type = MaterialStdVectorAux
    variable = slip_resistance_3
    property = slip_resistance
    index = 3
    execute_on = timestep_end
  []
  [slip_resistance_9]
    type = MaterialStdVectorAux
    variable = slip_resistance_9
    property = slip_resistance
    index = 9
    execute_on = timestep_end
  []
  [twin_tau_0]
    type = MaterialStdVectorAux
    variable = resolved_twin_stress_0
    property = twin_applied_shear_stress
    index = 0
    execute_on = timestep_end
  []
  [twin_resistance_0]
    type = MaterialStdVectorAux
    variable = twin_resistance_0
    property = twin_slip_resistance
    index = 0
    execute_on = timestep_end
  []
[]
[BCs]
  [symmy]
    type = DirichletBC
    variable = disp_y
    preset = true
    boundary = bottom
    value = 0
  []
  [symmx]
    type = DirichletBC
    variable = disp_x
    boundary = left
    value = 0
  []
  [symmz]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0
  []
  [tdisp]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = '0.005*t'
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensorCP
    C_ijkl = '1.622e5 9.18e4 6.88e4 1.622e5 6.88e4 1.805e5 4.67e4 4.67e4 4.67e4' #alpha Ti, Alankar et al. Acta Materialia 59 (2011) 7003-7009
    fill_method = symmetric9
  []
  [stress]
    type = ComputeMultipleCrystalPlasticityStress
    crystal_plasticity_models = 'slip_xtalpl twin_xtalpl'
    tan_mod_type = exact
  []
  [slip_xtalpl]
    type = CrystalPlasticityHCPDislocationSlipBeyerleinUpdate
    number_slip_systems = 15
    slip_sys_file_name = 'hcp_aprismatic_capyramidal_slip_sys.txt'
    unit_cell_dimension = '2.934e-7 2.934e-7 4.657e-7' #Ti, in mm, https://materialsproject.org/materials/mp-46/
    zero_tol = 5e-10
    temperature = temperature
    initial_forest_dislocation_density = 15.0e5
    initial_substructure_density = 1.0e3
    slip_system_modes = 2
    number_slip_systems_per_mode = '3 12'
    lattice_friction_per_mode = '98 224' #Knezevic et al MSEA 654 (2013)
    effective_shear_modulus_per_mode = '4.7e4 4.7e4' #Ti, in MPa, https://materialsproject.org/materials/mp-46/
    burgers_vector_per_mode = '2.934e-7 6.586e-7' #Ti, in mm, https://materialsproject.org/materials/mp-46/
    slip_generation_coefficient_per_mode = '1.25e5 2.25e7' #from Beyerlein and Tome 2008 IJP
    normalized_slip_activiation_energy_per_mode = '3.73e-3 3.2e-2' #from Beyerlein and Tome 2008 IJP
    slip_energy_proportionality_factor_per_mode = '330 100' #from Beyerlein and Tome 2008 IJP
    substructure_rate_coefficient_per_mode = '355 0.4' #from Capolungo et al MSEA (2009)
    applied_strain_rate = 0.001
    gamma_o = 1.0e-3
    Hall_Petch_like_constant_per_mode = '0.2 0.2' #Estimated to match graph in Capolungo et al MSEA (2009), Figure 2
    grain_size = 20.0e-3 #20 microns, Beyerlein and Tome IJP (2008)
    total_twin_volume_fraction = twin_total_volume_fraction_twins
  []
  [twin_xtalpl]
    type = CrystalPlasticityTwinningKalidindiUpdate
    base_name = twin
    crystal_lattice_type = HCP
    unit_cell_dimension = '2.934e-7 2.934e-7 4.657e-7' #Ti, in mm, https://materialsproject.org/materials/mp-46/
    number_slip_systems = 6
    slip_sys_file_name = 'hcp_tensile_twin_systems.txt'
    initial_twin_lattice_friction = 1140.0
    non_coplanar_coefficient_twin_hardening = 10000
    coplanar_coefficient_twin_hardening = 1000
    characteristic_twin_shear = 0.167
  []
[]
[Postprocessors]
  [stress_zz]
    type = ElementAverageValue
    variable = stress_zz
  []
  [pk2]
    type = ElementAverageValue
    variable = pk2
  []
  [fp_xx]
    type = ElementAverageValue
    variable = fp_xx
  []
  [fp_zz]
    type = ElementAverageValue
    variable = fp_zz
  []
  [e_zz]
    type = ElementAverageValue
    variable = e_zz
  []
  [total_twin_volume_fraction]
    type = ElementAverageValue
    variable = total_twin_volume_fraction
  []
  [slip_increment_0]
    type = ElementAverageValue
    variable = slip_increment_0
  []
  [slip_increment_3]
    type = ElementAverageValue
    variable = slip_increment_3
  []
  [slip_increment_9]
    type = ElementAverageValue
    variable = slip_increment_9
  []
  [tau_3]
    type = ElementAverageValue
    variable = resolved_shear_stress_3
  []
  [tau_9]
    type = ElementAverageValue
    variable = resolved_shear_stress_9
  []
  [slip_resistance_0]
    type = ElementAverageValue
    variable = slip_resistance_0
  []
  [slip_resistance_3]
    type = ElementAverageValue
    variable = slip_resistance_3
  []
  [slip_resistance_9]
    type = ElementAverageValue
    variable = slip_resistance_9
  []
  [twin_tau_0]
    type = ElementAverageValue
    variable = resolved_twin_stress_0
  []
  [twin_resistance_0]
    type = ElementAverageValue
    variable = twin_resistance_0
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
  petsc_options_value = ' asm      2              lu            gmres     200'
  nl_rel_tol = 1e-12
  nl_abs_step_tol = 1e-10
  dt = 0.5
  dtmin = 1.0e-2
  dtmax = 10.0
  end_time = 2.25
[]
[Outputs]
  csv = true
  perf_graph = true
[]
(modules/solid_mechanics/test/tests/weak_plane_shear/small_deform1.i)
# deformations are applied so that the trial stress is
# shear = 10, normalstress = 2
#
# Cohesion is chosen to be 1, and friction angle = 26.565, so tan(friction_angle) = 1/2
# This means that (shear, normalstress) = (0, 2) is the apex
# of the shear envelope
#
# Poisson's ratio is chosen to be zero, and Lame mu = 1E6,
# so the return must solve
# f = 0
# shear = shear_trial - (1/2)*mu*ga = 10 - 0.5E6*ga
# normalstress = normalstress - mu*tan(dilation)*ga
#
# Finally, tan(dilation) = 2/18 is chosen.
#
# Then the returned value should have
# shear = 1, normalstress = 0
#
# Here shear = sqrt(s_yz^2 + s_xz^2)
[GlobalParams]
  displacements = 'x_disp y_disp z_disp'
[]
[Mesh]
  type = GeneratedMesh
  dim = 3
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  add_variables = true
  generate_output = 'stress_xz stress_zx stress_yz stress_zz'
[]
[BCs]
  [bottomx]
    type = DirichletBC
    variable = x_disp
    boundary = back
    value = 0.0
  []
  [bottomy]
    type = DirichletBC
    variable = y_disp
    boundary = back
    value = 0.0
  []
  [bottomz]
    type = DirichletBC
    variable = z_disp
    boundary = back
    value = 0.0
  []
  [topx]
    type = DirichletBC
    variable = x_disp
    boundary = front
    value = 8E-6
  []
  [topy]
    type = DirichletBC
    variable = y_disp
    boundary = front
    value = 6E-6
  []
  [topz]
    type = DirichletBC
    variable = z_disp
    boundary = front
    value = 1E-6
  []
[]
[AuxVariables]
  [yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[AuxKernels]
  [yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  []
[]
[Postprocessors]
  [s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  []
  [s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  []
  [s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  []
  [f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  []
[]
[UserObjects]
  [coh]
    type = SolidMechanicsHardeningConstant
    value = 1
  []
  [tanphi]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  []
  [tanpsi]
    type = SolidMechanicsHardeningConstant
    value = 0.1111077
  []
  [wps]
    type = SolidMechanicsPlasticWeakPlaneShear
    cohesion = coh
    tan_friction_angle = tanphi
    tan_dilation_angle = tanpsi
    smoother = 0
    yield_function_tolerance = 1E-6
    internal_constraint_tolerance = 1E-6
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E6'
  []
  [mc]
    type = ComputeMultiPlasticityStress
    plastic_models = wps
    transverse_direction = '0 0 1'
    ep_plastic_tolerance = 1E-5
    debug_fspb = crash
  []
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  csv = true
[]
(modules/solid_mechanics/test/tests/multi/three_surface13.i)
# Plasticit models:
# SimpleTester0 with a = 0 and b = 1 and strength = 1
# SimpleTester1 with a = 1 and b = 0 and strength = 1
# SimpleTester2 with a = 1 and b = 1 and strength = 3
#
# Lame lambda = 0 (Poisson=0).  Lame mu = 0.5E6
#
# A single element is stretched by 2.0E-6m in y direction and 0E-6 in z direction.
# trial stress_yy = 2 and stress_zz = 0
#
# Then SimpleTester1 should activate and the algorithm will return to
# stress_yy=1
# internal1 should be 1
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '2.0E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '0.0E-6*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int2]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./int0]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 0
    variable = int0
  [../]
  [./int1]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 1
    variable = int1
  [../]
  [./int2]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 2
    variable = int2
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./f2]
    type = PointValue
    point = '0 0 0'
    variable = f2
  [../]
  [./int0]
    type = PointValue
    point = '0 0 0'
    variable = int0
  [../]
  [./int1]
    type = PointValue
    point = '0 0 0'
    variable = int1
  [../]
  [./int2]
    type = PointValue
    point = '0 0 0'
    variable = int2
  [../]
[]
[UserObjects]
  [./simple0]
    type = SolidMechanicsPlasticSimpleTester
    a = 0
    b = 1
    strength = 1
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
  [./simple1]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 0
    strength = 1
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
  [./simple2]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 1
    strength = 3
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 0.5E6'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./multi]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = 'simple0 simple1 simple2'
    max_NR_iterations = 2
    min_stepsize = 1
    debug_fspb = crash
    debug_jac_at_stress = '10 0 0 0 10 0 0 0 10'
    debug_jac_at_pm = '1 1'
    debug_jac_at_intnl = '1 1'
    debug_stress_change = 1E-5
    debug_pm_change = '1E-6 1E-6'
    debug_intnl_change = '1E-6 1E-6'
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = three_surface13
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/capped_weak_plane/small_deform3.i)
# Plastic deformation, tensile failure
# With Young = 10, poisson=0.25 (Lame lambda=4, mu=4)
# applying the following
# deformation to the zmax surface of a unit cube:
# disp_x = 4*t
# disp_y = 3*t
# disp_z = t
# should yield trial stress:
# stress_zz = 12*t
# stress_zx = 16*t
# stress_zy = 12*t
# Use tensile strength = 6, we should return to stress_zz = 6,
# and stress_xx = stress_yy = 2*t up to t=1 when the system is completely
# plastic, so these stress components will not change
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz plastic_strain_xx plastic_strain_xy plastic_strain_xz plastic_strain_yy plastic_strain_yz plastic_strain_zz strain_xx strain_xy strain_xz strain_yy strain_yz strain_zz'
  [../]
[]
[BCs]
  [./bottomx]
    type = DirichletBC
    variable = disp_x
    boundary = back
    value = 0.0
  [../]
  [./bottomy]
    type = DirichletBC
    variable = disp_y
    boundary = back
    value = 0.0
  [../]
  [./bottomz]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0.0
  [../]
  [./topx]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = front
    function = 4*t
  [../]
  [./topy]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = front
    function = 3*t
  [../]
  [./topz]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = t
  [../]
[]
[AuxVariables]
  [./f_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_compressive]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./ls]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./f_shear]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f_shear
  [../]
  [./f_tensile]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f_tensile
  [../]
  [./f_compressive]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f_compressive
  [../]
  [./intnl_shear]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl_shear
  [../]
  [./intnl_tensile]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 1
    variable = intnl_tensile
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./ls]
    type = MaterialRealAux
    property = plastic_linesearch_needed
    variable = ls
  [../]
[]
[Postprocessors]
  [./stress_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./stress_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./stress_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./stress_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./stress_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./stress_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./strainp_xx]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_xx
  [../]
  [./strainp_xy]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_xy
  [../]
  [./strainp_xz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_xz
  [../]
  [./strainp_yy]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_yy
  [../]
  [./strainp_yz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_yz
  [../]
  [./strainp_zz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_zz
  [../]
  [./straint_xx]
    type = PointValue
    point = '0 0 0'
    variable = strain_xx
  [../]
  [./straint_xy]
    type = PointValue
    point = '0 0 0'
    variable = strain_xy
  [../]
  [./straint_xz]
    type = PointValue
    point = '0 0 0'
    variable = strain_xz
  [../]
  [./straint_yy]
    type = PointValue
    point = '0 0 0'
    variable = strain_yy
  [../]
  [./straint_yz]
    type = PointValue
    point = '0 0 0'
    variable = strain_yz
  [../]
  [./straint_zz]
    type = PointValue
    point = '0 0 0'
    variable = strain_zz
  [../]
  [./f_shear]
    type = PointValue
    point = '0 0 0'
    variable = f_shear
  [../]
  [./f_tensile]
    type = PointValue
    point = '0 0 0'
    variable = f_tensile
  [../]
  [./f_compressive]
    type = PointValue
    point = '0 0 0'
    variable = f_compressive
  [../]
  [./intnl_shear]
    type = PointValue
    point = '0 0 0'
    variable = intnl_shear
  [../]
  [./intnl_tensile]
    type = PointValue
    point = '0 0 0'
    variable = intnl_tensile
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
  [./ls]
    type = PointValue
    point = '0 0 0'
    variable = ls
  [../]
[]
[UserObjects]
  [./coh]
    type = SolidMechanicsHardeningConstant
    value = 80
  [../]
  [./tanphi]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
  [./tanpsi]
    type = SolidMechanicsHardeningConstant
    value = 0.1111077
  [../]
  [./t_strength]
    type = SolidMechanicsHardeningConstant
    value = 6
  [../]
  [./c_strength]
    type = SolidMechanicsHardeningConstant
    value = 40
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '4 4'
  [../]
  [./admissible]
    type = ComputeMultipleInelasticStress
    inelastic_models = stress
    perform_finite_strain_rotations = false
  [../]
  [./stress]
    type = CappedWeakPlaneStressUpdate
    cohesion = coh
    tan_friction_angle = tanphi
    tan_dilation_angle = tanpsi
    tensile_strength = t_strength
    compressive_strength = c_strength
    tip_smoother = 0
    smoothing_tol = 0
    yield_function_tol = 1E-5
  [../]
[]
[Executioner]
  end_time = 2
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform3
  csv = true
[]
(modules/solid_mechanics/test/tests/mohr_coulomb/random_planar.i)
# apply many random large deformations, checking that the algorithm returns correctly to
# the yield surface each time.
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 100
  ny = 1250
  nz = 1
  xmin = 0
  xmax = 100
  ymin = 0
  ymax = 1250
  zmin = 0
  zmax = 1
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[ICs]
  [./x]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_x
  [../]
  [./y]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_y
  [../]
  [./z]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_z
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '0'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
[]
[Postprocessors]
  [./yield_fcn_at_zero]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
    outputs = 'console'
  [../]
  [./should_be_zero]
    type = FunctionValuePostprocessor
    function = should_be_zero_fcn
  [../]
  [./av_iter]
    type = ElementAverageValue
    variable = iter
    outputs = 'console'
  [../]
[]
[Functions]
  [./should_be_zero_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-3,0,a)'
    symbol_names = 'a'
    symbol_values = 'yield_fcn_at_zero'
  [../]
[]
[UserObjects]
  [./coh]
    type = SolidMechanicsHardeningCubic
    value_0 = 1000
    value_residual = 100
    internal_limit = 4
  [../]
  [./phi]
    type = SolidMechanicsHardeningCubic
    value_0 = 0.8
    value_residual = 0.3
    internal_limit = 2
  [../]
  [./psi]
    type = SolidMechanicsHardeningConstant
    value = 15
    convert_to_radians = true
  [../]
  [./mc]
    type = SolidMechanicsPlasticMohrCoulombMulti
    cohesion = coh
    friction_angle = phi
    dilation_angle = psi
    yield_function_tolerance = 1E-3
    shift = 1E-10
    internal_constraint_tolerance = 1E-6
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0.7E7 1E7'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-10
    plastic_models = mc
    min_stepsize = 1
    max_stepsize_for_dumb = 1
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = random_planar
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/capped_weak_plane/small_deform7.i)
# Plastic deformation, tensile with hardening
# With Lame lambda=0 and Lame mu=1, applying the following
# deformation to the zmax surface of a unit cube:
# disp_z = t
# should yield trial stress:
# stress_zz = 2*t
# The tensile strength varies as a cubic between 1 (at intnl=0)
# and 2 (at intnl=1).  The equation to solve is
# 2 - Ezzzz * ga = -2 * (ga - 1/2)^3 + (3/2) (ga - 1/2) + 3/2
# where the left-hand side comes from p = p_trial - ga * Ezzzz
# and the right-hand side is the cubic tensile strength
# The solution is ga = 0.355416 ( = intnl[1]), and the cubic
# is 1.289168 ( = p) at that point
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz plastic_strain_xx plastic_strain_xy plastic_strain_xz plastic_strain_yy plastic_strain_yz plastic_strain_zz strain_xx strain_xy strain_xz strain_yy strain_yz strain_zz'
  [../]
[]
[BCs]
  [./bottomx]
    type = DirichletBC
    variable = disp_x
    boundary = back
    value = 0.0
  [../]
  [./bottomy]
    type = DirichletBC
    variable = disp_y
    boundary = back
    value = 0.0
  [../]
  [./bottomz]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0.0
  [../]
  [./topx]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = front
    function = 0
  [../]
  [./topy]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = front
    function = 0
  [../]
  [./topz]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = t
  [../]
[]
[AuxVariables]
  [./f_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_compressive]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./ls]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./f_shear]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f_shear
  [../]
  [./f_tensile]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f_tensile
  [../]
  [./f_compressive]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f_compressive
  [../]
  [./intnl_shear]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl_shear
  [../]
  [./intnl_tensile]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 1
    variable = intnl_tensile
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./ls]
    type = MaterialRealAux
    property = plastic_linesearch_needed
    variable = ls
  [../]
[]
[Postprocessors]
  [./stress_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./stress_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./stress_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./stress_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./stress_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./stress_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./strainp_xx]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_xx
  [../]
  [./strainp_xy]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_xy
  [../]
  [./strainp_xz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_xz
  [../]
  [./strainp_yy]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_yy
  [../]
  [./strainp_yz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_yz
  [../]
  [./strainp_zz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_zz
  [../]
  [./straint_xx]
    type = PointValue
    point = '0 0 0'
    variable = strain_xx
  [../]
  [./straint_xy]
    type = PointValue
    point = '0 0 0'
    variable = strain_xy
  [../]
  [./straint_xz]
    type = PointValue
    point = '0 0 0'
    variable = strain_xz
  [../]
  [./straint_yy]
    type = PointValue
    point = '0 0 0'
    variable = strain_yy
  [../]
  [./straint_yz]
    type = PointValue
    point = '0 0 0'
    variable = strain_yz
  [../]
  [./straint_zz]
    type = PointValue
    point = '0 0 0'
    variable = strain_zz
  [../]
  [./f_shear]
    type = PointValue
    point = '0 0 0'
    variable = f_shear
  [../]
  [./f_tensile]
    type = PointValue
    point = '0 0 0'
    variable = f_tensile
  [../]
  [./f_compressive]
    type = PointValue
    point = '0 0 0'
    variable = f_compressive
  [../]
  [./intnl_shear]
    type = PointValue
    point = '0 0 0'
    variable = intnl_shear
  [../]
  [./intnl_tensile]
    type = PointValue
    point = '0 0 0'
    variable = intnl_tensile
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
  [./ls]
    type = PointValue
    point = '0 0 0'
    variable = ls
  [../]
[]
[UserObjects]
  [./coh]
    type = SolidMechanicsHardeningConstant
    value = 20
  [../]
  [./tanphi]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
  [./tanpsi]
    type = SolidMechanicsHardeningConstant
    value = 0.1
  [../]
  [./t_strength]
    type = SolidMechanicsHardeningCubic
    value_0 = 1
    value_residual = 2
    internal_limit = 1
  [../]
  [./c_strength]
    type = SolidMechanicsHardeningConstant
    value = 100
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '0 1'
  [../]
  [./admissible]
    type = ComputeMultipleInelasticStress
    inelastic_models = stress
    perform_finite_strain_rotations = false
  [../]
  [./stress]
    type = CappedWeakPlaneStressUpdate
    cohesion = coh
    tan_friction_angle = tanphi
    tan_dilation_angle = tanpsi
    tensile_strength = t_strength
    compressive_strength = c_strength
    max_NR_iterations = 20
    tip_smoother = 5
    smoothing_tol = 5
    yield_function_tol = 1E-10
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform7
  csv = true
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/hcp_single_crystal/update_method_hcp_aprismatic_capyramidal.i)
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 2
  ny = 2
  nz = 2
  elem_type = HEX8
[]
[AuxVariables]
  [temperature]
  []
  [pk2]
    order = CONSTANT
    family = MONOMIAL
  []
  [fp_xx]
    order = CONSTANT
    family = MONOMIAL
  []
  [fp_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [e_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [resolved_shear_stress_3]
    order = CONSTANT
    family = MONOMIAL
  []
  [resolved_shear_stress_4]
    order = CONSTANT
    family = MONOMIAL
  []
  [resolved_shear_stress_5]
    order = CONSTANT
    family = MONOMIAL
  []
  [resolved_shear_stress_6]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_resistance_0]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_resistance_3]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  incremental= true
  add_variables = true
  generate_output = stress_zz
[]
[AuxKernels]
  [temperature]
    type = ConstantAux
    variable = temperature
    value= 300
  []
  [pk2]
    type = RankTwoAux
    variable = pk2
    rank_two_tensor = second_piola_kirchhoff_stress
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [fp_xx]
    type = RankTwoAux
    variable = fp_xx
    rank_two_tensor = plastic_deformation_gradient
    index_j = 0
    index_i = 0
    execute_on = timestep_end
  []
  [fp_zz]
    type = RankTwoAux
    variable = fp_zz
    rank_two_tensor = plastic_deformation_gradient
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [e_zz]
    type = RankTwoAux
    variable = e_zz
    rank_two_tensor = total_lagrangian_strain
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [tau_3]
    type = MaterialStdVectorAux
    variable = resolved_shear_stress_3
    property = applied_shear_stress
    index = 3
    execute_on = timestep_end
  []
  [tau_4]
    type = MaterialStdVectorAux
    variable = resolved_shear_stress_4
    property = applied_shear_stress
    index = 4
    execute_on = timestep_end
  []
  [tau_5]
    type = MaterialStdVectorAux
    variable = resolved_shear_stress_5
    property = applied_shear_stress
    index = 5
    execute_on = timestep_end
  []
  [tau_6]
    type = MaterialStdVectorAux
    variable = resolved_shear_stress_6
    property = applied_shear_stress
    index = 6
    execute_on = timestep_end
  []
  [slip_resistance_0]
    type = MaterialStdVectorAux
    variable = slip_resistance_0
    property = slip_resistance
    index = 0
    execute_on = timestep_end
  []
  [slip_resistance_3]
    type = MaterialStdVectorAux
    variable = slip_resistance_3
    property = slip_resistance
    index = 3
    execute_on = timestep_end
  []
[]
[BCs]
  [symmy]
    type = DirichletBC
    variable = disp_y
    preset = true
    boundary = bottom
    value = 0
  []
  [symmx]
    type = DirichletBC
    variable = disp_x
    boundary = left
    value = 0
  []
  [symmz]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0
  []
  [tdisp]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = '0.001*t'
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensorCP
    C_ijkl = '1.622e5 9.18e4 6.88e4 1.622e5 6.88e4 1.805e5 4.67e4 4.67e4 4.67e4' #alpha Ti, Alankar et al. Acta Materialia 59 (2011) 7003-7009
    fill_method = symmetric9
  []
  [stress]
    type = ComputeMultipleCrystalPlasticityStress
    crystal_plasticity_models = 'trial_xtalpl'
    tan_mod_type = exact
  []
  [trial_xtalpl]
    type = CrystalPlasticityHCPDislocationSlipBeyerleinUpdate
    number_slip_systems = 15
    slip_sys_file_name = hcp_aprismatic_capyramidal_slip_sys.txt
    unit_cell_dimension = '2.934e-7 2.934e-7 4.657e-7' #Ti, in mm, https://materialsproject.org/materials/mp-46/
    temperature = temperature
    initial_forest_dislocation_density = 15.0e5
    initial_substructure_density = 1.0e3
    slip_system_modes = 2
    number_slip_systems_per_mode = '3 12'
    lattice_friction_per_mode = '98 224' #Knezevic et al MSEA 654 (2013)
    effective_shear_modulus_per_mode = '4.7e4 4.7e4' #Ti, in MPa, https://materialsproject.org/materials/mp-46/
    burgers_vector_per_mode = '2.934e-7 6.586e-7' #Ti, in mm, https://materialsproject.org/materials/mp-46/
    slip_generation_coefficient_per_mode = '1.25e5 2.25e7' #from Beyerlein and Tome 2008 IJP
    normalized_slip_activiation_energy_per_mode = '3.73e-3 3.2e-2' #from Beyerlein and Tome 2008 IJP
    slip_energy_proportionality_factor_per_mode = '330 100' #from Beyerlein and Tome 2008 IJP
    substructure_rate_coefficient_per_mode = '355 0.4' #from Capolungo et al MSEA (2009)
    applied_strain_rate = 0.001
    gamma_o = 1.0e-3
    Hall_Petch_like_constant_per_mode = '0.2 0.2' #Estimated to match graph in Capolungo et al MSEA (2009), Figure 2
    grain_size = 20.0e-3 #20 microns, Beyerlein and Tome IJP (2008)
  []
[]
[Postprocessors]
  [stress_zz]
    type = ElementAverageValue
    variable = stress_zz
  []
  [pk2]
    type = ElementAverageValue
    variable = pk2
  []
  [fp_xx]
    type = ElementAverageValue
    variable = fp_xx
  []
  [fp_zz]
    type = ElementAverageValue
    variable = fp_zz
  []
  [e_zz]
    type = ElementAverageValue
    variable = e_zz
  []
  [tau_3]
    type = ElementAverageValue
    variable = resolved_shear_stress_3
  []
  [tau_4]
    type = ElementAverageValue
    variable = resolved_shear_stress_4
  []
  [tau_5]
    type = ElementAverageValue
    variable = resolved_shear_stress_5
  []
  [tau_6]
    type = ElementAverageValue
    variable = resolved_shear_stress_6
  []
  [slip_resistance_0]
    type = ElementAverageValue
    variable = slip_resistance_0
  []
  [slip_resistance_3]
    type = ElementAverageValue
    variable = slip_resistance_3
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
  petsc_options_value = ' asm      2              lu            gmres     200'
  nl_abs_tol = 1e-10
  nl_rel_tol = 1e-10
  nl_abs_step_tol = 1e-10
  dt = 0.5
  dtmin = 1.0e-2
  dtmax = 10.0
  end_time = 5
[]
[Outputs]
  csv = true
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/stress_update_material_based/exception.i)
[GlobalParams]
  displacements = 'ux uy uz'
[]
[Mesh]
  type = GeneratedMesh
  dim = 3
  elem_type = HEX8
[]
[AuxVariables]
  [pk2]
    order = CONSTANT
    family = MONOMIAL
  []
  [fp_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [rotout]
    order = CONSTANT
    family = MONOMIAL
  []
  [e_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [gss]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment]
   order = CONSTANT
   family = MONOMIAL
  []
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  add_variables = true
  generate_output = stress_zz
[]
[AuxKernels]
  [fp_zz]
    type = RankTwoAux
    variable = fp_zz
    rank_two_tensor = plastic_deformation_gradient
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [pk2]
   type = RankTwoAux
   variable = pk2
   rank_two_tensor = second_piola_kirchhoff_stress
   index_j = 2
   index_i = 2
   execute_on = timestep_end
  []
  [e_zz]
    type = RankTwoAux
    variable = e_zz
    rank_two_tensor = total_lagrangian_strain
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [gss]
    type = MaterialStdVectorAux
    variable = gss
    property = slip_resistance
    index = 0
    execute_on = timestep_end
  []
  [slip_inc]
   type = MaterialStdVectorAux
   variable = slip_increment
   property = slip_increment
   index = 0
   execute_on = timestep_end
  []
[]
[BCs]
  [symmy]
    type = DirichletBC
    variable = uy
    boundary = bottom
    value = 0
  []
  [symmx]
    type = DirichletBC
    variable = ux
    boundary = left
    value = 0
  []
  [symmz]
    type = DirichletBC
    variable = uz
    boundary = back
    value = 0
  []
  [tdisp]
    type = FunctionDirichletBC
    variable = uz
    boundary = front
    function = '0.1*t'
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensorCP
    C_ijkl = '1.684e5 1.214e5 1.214e5 1.684e5 1.214e5 1.684e5 0.754e5 0.754e5 0.754e5'
    fill_method = symmetric9
  []
  [stress]
    type = ComputeMultipleCrystalPlasticityStress
    crystal_plasticity_models = 'trial_xtalpl'
    tan_mod_type = exact
    maximum_substep_iteration = 1
  []
  [trial_xtalpl]
    type = CrystalPlasticityKalidindiUpdate
    number_slip_systems = 12
    slip_sys_file_name = input_slip_sys.txt
  []
[]
[Postprocessors]
  [stress_zz]
    type = ElementAverageValue
    variable = stress_zz
  []
  [pk2]
   type = ElementAverageValue
   variable = pk2
  []
  [fp_zz]
    type = ElementAverageValue
    variable = fp_zz
  []
  [e_zz]
    type = ElementAverageValue
    variable = e_zz
  []
  [gss]
    type = ElementAverageValue
    variable = gss
  []
  [slip_increment]
   type = ElementAverageValue
   variable = slip_increment
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  dt = 0.05
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
  petsc_options_value = ' asm      2              lu            gmres     200'
  nl_abs_tol = 1e-10
  nl_rel_step_tol = 1e-10
  dtmax = 10.0
  nl_rel_tol = 1e-10
  end_time = 1
  dtmin = 0.01
  num_steps = 10
  nl_abs_step_tol = 1e-10
[]
[Outputs]
  exodus = true
[]
(modules/solid_mechanics/test/tests/isotropicSD_plasticity/isotropicSD.i)
# UserObject IsotropicSD test, with constant hardening.
# Linear strain is applied in the x and y direction.
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin =  -.5
  xmax = .5
  ymin = -.5
  ymax = .5
  zmin = -.5
  zmax = .5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./xdisp]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'right'
    function = '0.005*t'
  [../]
  [./ydisp]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'top'
    function = '0.005*t'
  [../]
  [./yfix]
    type = DirichletBC
    variable = disp_y
    boundary = 'bottom'
    value = 0
  [../]
  [./xfix]
    type = DirichletBC
    variable = disp_x
    boundary = 'left'
    value = 0
  [../]
  [./zfix]
    type = DirichletBC
    variable = disp_z
    boundary = 'back'
    value = 0
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./plastic_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./plastic_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./plastic_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./plastic_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./plastic_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./plastic_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./sdev]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./sdet]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./plastic_xx]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = plastic_xx
    index_i = 0
    index_j = 0
  [../]
  [./plastic_xy]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = plastic_xy
    index_i = 0
    index_j = 1
  [../]
  [./plastic_xz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = plastic_xz
    index_i = 0
    index_j = 2
  [../]
  [./plastic_yy]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = plastic_yy
    index_i = 1
    index_j = 1
  [../]
  [./plastic_yz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = plastic_yz
    index_i = 1
    index_j = 2
  [../]
  [./plastic_zz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = plastic_zz
    index_i = 2
    index_j = 2
  [../]
  [./f]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = f
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./intnl]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = intnl
  [../]
  [./sdev]
    type = RankTwoScalarAux
    variable = sdev
    rank_two_tensor = stress
    scalar_type = VonMisesStress
  [../]
[]
[Postprocessors]
  [./sdev]
    type = PointValue
    point = '0 0 0'
    variable = sdev
  [../]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./p_xx]
    type = PointValue
    point = '0 0 0'
    variable = plastic_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./p_xy]
    type = PointValue
    point = '0 0 0'
    variable = plastic_xy
  [../]
  [./p_xz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_xz
  [../]
  [./p_yz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_yz
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./p_yy]
    type = PointValue
    point = '0 0 0'
    variable = plastic_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./p_zz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_zz
  [../]
  [./intnl]
    type = PointValue
    point = '0 0 0'
    variable = intnl
  [../]
[]
[UserObjects]
  [./str]
    type = SolidMechanicsHardeningConstant
    value = 300
  [../]
  [./IsotropicSD]
    type = SolidMechanicsPlasticIsotropicSD
    b = -0.2
    c = -0.779422863
    associative = true
    yield_strength = str
    yield_function_tolerance = 1e-5
    internal_constraint_tolerance = 1e-9
    use_custom_returnMap = false
    use_custom_cto = false
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '121e3 80e3'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1e-9
    plastic_models = IsotropicSD
    debug_fspb = crash
    tangent_operator = elastic
  [../]
[]
[Executioner]
  num_steps = 3
  dt = .5
  type = Transient
  nl_rel_tol = 1e-6
  nl_max_its = 10
  l_tol = 1e-4
  l_max_its = 50
  solve_type = PJFNK
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
[]
[Outputs]
  perf_graph = false
  csv = true
[]
[Preconditioning]
 [./smp]
   type = SMP
   full = true
 [../]
[]
(modules/solid_mechanics/test/tests/capped_weak_plane/except6.i)
# Plastic deformation, tensile failure, with normal=(1,0,0)
# With Lame lambda=0 and Lame mu=1, applying the following
# deformation to the zmax surface of a unit cube:
# disp_x = t
# should yield trial stress:
# stress_xx = 2*t
# Use tensile strength = 1, we should return to stress_xx = 1
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./bottomx]
    type = DirichletBC
    variable = disp_x
    boundary = left
    value = 0.0
  [../]
  [./bottomy]
    type = DirichletBC
    variable = disp_y
    boundary = left
    value = 0.0
  [../]
  [./bottomz]
    type = DirichletBC
    variable = disp_z
    boundary = left
    value = 0.0
  [../]
  [./topx]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = right
    function = t
  [../]
  [./topy]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = right
    function = 0
  [../]
  [./topz]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = right
    function = 0
  [../]
[]
[AuxVariables]
  [./strainp_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_compressive]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./ls]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./strainp_xx]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_xx
    index_i = 0
    index_j = 0
  [../]
  [./strainp_xy]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_xy
    index_i = 0
    index_j = 1
  [../]
  [./strainp_xz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_xz
    index_i = 0
    index_j = 2
  [../]
  [./strainp_yy]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_yy
    index_i = 1
    index_j = 1
  [../]
  [./strainp_yz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_yz
    index_i = 1
    index_j = 2
  [../]
  [./strainp_zz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_zz
    index_i = 2
    index_j = 2
  [../]
  [./straint_xx]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_xx
    index_i = 0
    index_j = 0
  [../]
  [./straint_xy]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_xy
    index_i = 0
    index_j = 1
  [../]
  [./straint_xz]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_xz
    index_i = 0
    index_j = 2
  [../]
  [./straint_yy]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_yy
    index_i = 1
    index_j = 1
  [../]
  [./straint_yz]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_yz
    index_i = 1
    index_j = 2
  [../]
  [./straint_zz]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_zz
    index_i = 2
    index_j = 2
  [../]
  [./f_shear]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f_shear
  [../]
  [./f_tensile]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f_tensile
  [../]
  [./f_compressive]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f_compressive
  [../]
  [./intnl_shear]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl_shear
  [../]
  [./intnl_tensile]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 1
    variable = intnl_tensile
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./ls]
    type = MaterialRealAux
    property = plastic_linesearch_needed
    variable = ls
  [../]
[]
[Postprocessors]
  [./stress_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./stress_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./stress_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./stress_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./stress_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./stress_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./strainp_xx]
    type = PointValue
    point = '0 0 0'
    variable = strainp_xx
  [../]
  [./strainp_xy]
    type = PointValue
    point = '0 0 0'
    variable = strainp_xy
  [../]
  [./strainp_xz]
    type = PointValue
    point = '0 0 0'
    variable = strainp_xz
  [../]
  [./strainp_yy]
    type = PointValue
    point = '0 0 0'
    variable = strainp_yy
  [../]
  [./strainp_yz]
    type = PointValue
    point = '0 0 0'
    variable = strainp_yz
  [../]
  [./strainp_zz]
    type = PointValue
    point = '0 0 0'
    variable = strainp_zz
  [../]
  [./straint_xx]
    type = PointValue
    point = '0 0 0'
    variable = straint_xx
  [../]
  [./straint_xy]
    type = PointValue
    point = '0 0 0'
    variable = straint_xy
  [../]
  [./straint_xz]
    type = PointValue
    point = '0 0 0'
    variable = straint_xz
  [../]
  [./straint_yy]
    type = PointValue
    point = '0 0 0'
    variable = straint_yy
  [../]
  [./straint_yz]
    type = PointValue
    point = '0 0 0'
    variable = straint_yz
  [../]
  [./straint_zz]
    type = PointValue
    point = '0 0 0'
    variable = straint_zz
  [../]
  [./f_shear]
    type = PointValue
    point = '0 0 0'
    variable = f_shear
  [../]
  [./f_tensile]
    type = PointValue
    point = '0 0 0'
    variable = f_tensile
  [../]
  [./f_compressive]
    type = PointValue
    point = '0 0 0'
    variable = f_compressive
  [../]
  [./intnl_shear]
    type = PointValue
    point = '0 0 0'
    variable = intnl_shear
  [../]
  [./intnl_tensile]
    type = PointValue
    point = '0 0 0'
    variable = intnl_tensile
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
  [./ls]
    type = PointValue
    point = '0 0 0'
    variable = ls
  [../]
[]
[UserObjects]
  [./coh]
    type = SolidMechanicsHardeningConstant
    value = 30
  [../]
  [./tanphi]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
  [./tanpsi]
    type = SolidMechanicsHardeningConstant
    value = 0.1111077
  [../]
  [./t_strength]
    type = SolidMechanicsHardeningConstant
    value = 1
  [../]
  [./c_strength]
    type = SolidMechanicsHardeningConstant
    value = 40
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '0 1'
  [../]
  [./admissible]
    type = ComputeMultipleInelasticStress
    inelastic_models = stress
    perform_finite_strain_rotations = false
  [../]
  [./stress]
    type = CappedWeakInclinedPlaneStressUpdate
    normal_vector = '0 0 0'
    cohesion = coh
    tan_friction_angle = tanphi
    tan_dilation_angle = tanpsi
    tensile_strength = t_strength
    compressive_strength = c_strength
    tip_smoother = 0
    smoothing_tol = 0
    yield_function_tol = 1E-5
  [../]
[]
[Executioner]
  end_time = 2
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = except6
  csv = true
[]
(modules/solid_mechanics/test/tests/multi/three_surface11.i)
# Plasticit models:
# SimpleTester0 with a = 0 and b = 1 and strength = 1
# SimpleTester1 with a = 1 and b = 0 and strength = 1
# SimpleTester2 with a = 1 and b = 1 and strength = 3
#
# Lame lambda = 0 (Poisson=0).  Lame mu = 0.5E6
#
# A single element is stretched by 0E-6m in y direction and 2E-6 in z direction.
# trial stress_yy = 0 and stress_zz = 2.0
#
# Then SimpleTester0 should activate and the algorithm will return to
# stress_zz=1
# internal0 should be 1.0
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0.0E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '2.0E-6*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int2]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./int0]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 0
    variable = int0
  [../]
  [./int1]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 1
    variable = int1
  [../]
  [./int2]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 2
    variable = int2
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./f2]
    type = PointValue
    point = '0 0 0'
    variable = f2
  [../]
  [./int0]
    type = PointValue
    point = '0 0 0'
    variable = int0
  [../]
  [./int1]
    type = PointValue
    point = '0 0 0'
    variable = int1
  [../]
  [./int2]
    type = PointValue
    point = '0 0 0'
    variable = int2
  [../]
[]
[UserObjects]
  [./simple0]
    type = SolidMechanicsPlasticSimpleTester
    a = 0
    b = 1
    strength = 1
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
  [./simple1]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 0
    strength = 1
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
  [./simple2]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 1
    strength = 3
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 0.5E6'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./multi]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = 'simple0 simple1 simple2'
    max_NR_iterations = 2
    min_stepsize = 1
    debug_fspb = crash
    debug_jac_at_stress = '10 0 0 0 10 0 0 0 10'
    debug_jac_at_pm = '1 1'
    debug_jac_at_intnl = '1 1'
    debug_stress_change = 1E-5
    debug_pm_change = '1E-6 1E-6'
    debug_intnl_change = '1E-6 1E-6'
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = three_surface11
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/weak_plane_tensile/large_deform1.i)
# rotate the mesh by 90degrees
# then pull in the z direction - should be no plasticity
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
  type = GeneratedMesh
  dim = 3
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  add_variables = true
  decomposition_method = EigenSolution
  generate_output = 'stress_xz stress_zx stress_yz stress_zz'
[]
[BCs]
  # rotate:
  # ynew = c*y + s*z.  znew = -s*y + c*z
  [bottomx]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = back
    function = '0'
  []
  [bottomy]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = back
    function = '0*y+1*z-y'
  []
  [bottomz]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = back
    function = '-1*y+0*z-z+if(t>0,0.5-y,0)' # note that this uses original nodal values of (x,y,z)
  []
  [topx]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = front
    function = '0'
  []
  [topy]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = front
    function = '0*y+1*z-y'
  []
  [topz]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = '-1*y+0*z-z+if(t>0,0.5-y,0)' # note that this uses original nodal values of (x,y,z)
  []
[]
[AuxVariables]
  [yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[AuxKernels]
  [yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  []
[]
[Postprocessors]
  [s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  []
  [s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  []
  [s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  []
  [f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  []
[]
[UserObjects]
  [str]
    type = SolidMechanicsHardeningConstant
    value = 1
  []
  [wpt]
    type = SolidMechanicsPlasticWeakPlaneTensile
    tensile_strength = str
    yield_function_tolerance = 1E-6
    internal_constraint_tolerance = 1E-5
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E6'
  []
  [mc]
    type = ComputeMultiPlasticityStress
    plastic_models = wpt
    transverse_direction = '0 0 1'
    ep_plastic_tolerance = 1E-5
  []
[]
[Executioner]
  start_time = -1
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  exodus = true
[]
(modules/solid_mechanics/test/tests/capped_drucker_prager/small_deform2_lode_zero.i)
# apply repeated stretches in x, y and z directions, so that mean_stress = 0
# This maps out the yield surface in the octahedral plane for zero mean stress
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '-1.5E-6*x+2E-6*x*sin(t)'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '2E-6*y*sin(2*t)'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '-2E-6*z*(sin(t)+sin(2*t))'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1000
  [../]
  [./cs]
    type = SolidMechanicsHardeningConstant
    value = 1000
  [../]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 10
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 20
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 0
  [../]
  [./dp]
    type = SolidMechanicsPlasticDruckerPrager
    mc_cohesion = mc_coh
    mc_friction_angle = mc_phi
    mc_dilation_angle = mc_psi
    mc_interpolation_scheme = lode_zero
    internal_constraint_tolerance = 1 # irrelevant here
    yield_function_tolerance = 1      # irrelevant here
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeIsotropicElasticityTensor
    block = 0
    lambda = 0.0
    shear_modulus = 1.0e7
  [../]
  [./admissible]
    type = ComputeMultipleInelasticStress
    inelastic_models = cdp
    perform_finite_strain_rotations = false
  [../]
  [./cdp]
    type = CappedDruckerPragerStressUpdate
    DP_model = dp
    tensile_strength = ts
    compressive_strength = cs
    yield_function_tol = 1E-8
    tip_smoother = 4
    smoothing_tol = 1E-5
  [../]
[]
[Executioner]
  end_time = 100
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform2_lode_zero
  exodus = false
  [./csv]
    type = CSV
  [../]
[]
(modules/solid_mechanics/test/tests/mean_cap_TC/random02.i)
# apply many random large deformations, checking that the algorithm returns correctly to
# the yield surface each time.
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1000
  ny = 125
  nz = 1
  xmin = 0
  xmax = 1000
  ymin = 0
  ymax = 125
  zmin = 0
  zmax = 1
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[ICs]
  [./x]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_x
  [../]
  [./y]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_y
  [../]
  [./z]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_z
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '0'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
[]
[Postprocessors]
  [./max_yield_fcn]
    type = ElementExtremeValue
    variable = yield_fcn
    outputs = 'console'
  [../]
  [./should_be_zero]
    type = FunctionValuePostprocessor
    function = should_be_zero_fcn
  [../]
  [./av_iter]
    type = ElementAverageValue
    variable = iter
    outputs = 'console'
  [../]
[]
[Functions]
  [./should_be_zero_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-3,0,a)'
    symbol_names = 'a'
    symbol_values = 'max_yield_fcn'
  [../]
[]
[UserObjects]
  [./tensile_strength]
    type = SolidMechanicsHardeningConstant
    value = 1
  [../]
  [./compressive_strength]
    type = SolidMechanicsHardeningConstant
    value = -1.5
  [../]
  [./cap]
    type = SolidMechanicsPlasticMeanCapTC
    tensile_strength = tensile_strength
    compressive_strength = compressive_strength
    yield_function_tolerance = 1E-3
    internal_constraint_tolerance = 1E-9
    use_custom_returnMap = true
    use_custom_cto = true
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0.7E7 1E7'
  [../]
  [./strain]
    type = ComputeIncrementalStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    max_NR_iterations = 2
    ep_plastic_tolerance = 1E-6
    plastic_models = cap
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = random02
  exodus = false
  [./csv]
    type = CSV
  [../]
[]
(modules/solid_mechanics/test/tests/multiple_two_parameter_plasticity/dp_then_wp.i)
# Use ComputeMultipleInelasticStress with two inelastic models: CappedDruckerPrager and CappedWeakPlane.
# The relative_tolerance and absolute_tolerance parameters are set very large so that
# only one iteration is performed.  This is the algorithm that FLAC uses to model
# jointed rocks, only Capped-Mohr-Coulomb is used instead of CappedDruckerPrager
#
# initial_stress = diag(1E3, 1E3, 1E3)
# The CappedDruckerPrager has tensile strength 3E2 and large cohesion,
# so the stress initially returns to diag(1E2, 1E2, 1E2)
# The CappedWeakPlane has tensile strength zero and large cohesion,
# so the stress returns to diag(1E2 - v/(1-v)*1E2, 1E2 - v/(1-v)*1E2, 0)
# where v=0.2 is the Poisson's ratio
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    eigenstrain_names = ini_stress
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = 0
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = 0
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = 0
  [../]
[]
[AuxVariables]
  [./yield_fcn_dp]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn_wp]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_dp_auxk]
    type = MaterialStdVectorAux
    index = 1    # this is the tensile yield function - it should be zero
    property = cdp_plastic_yield_function
    variable = yield_fcn_dp
  [../]
  [./yield_fcn_wp_auxk]
    type = MaterialStdVectorAux
    index = 1    # this is the tensile yield function - it should be zero
    property = cwp_plastic_yield_function
    variable = yield_fcn_wp
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f_dp]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn_dp
  [../]
  [./f_wp]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn_wp
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 300
  [../]
  [./cs]
    type = SolidMechanicsHardeningConstant
    value = 1E4
  [../]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 1E4
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 20
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 0
  [../]
  [./dp]
    type = SolidMechanicsPlasticDruckerPrager
    mc_cohesion = mc_coh
    mc_friction_angle = mc_phi
    mc_dilation_angle = mc_psi
    internal_constraint_tolerance = 1 # irrelevant here
    yield_function_tolerance = 1      # irrelevant here
  [../]
  [./wp_coh]
    type = SolidMechanicsHardeningConstant
    value = 1E4
  [../]
  [./wp_tanphi]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
  [./wp_tanpsi]
    type = SolidMechanicsHardeningConstant
    value = 0.1111077
  [../]
  [./wp_t_strength]
    type = SolidMechanicsHardeningConstant
    value = 0
  [../]
  [./wp_c_strength]
    type = SolidMechanicsHardeningConstant
    value = 1E4
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeIsotropicElasticityTensor
    poissons_ratio = 0.2
    youngs_modulus = 1E7
  [../]
  [./ini_stress]
    type = ComputeEigenstrainFromInitialStress
    initial_stress = '1E3 0 0  0 1E3 0  0 0 1E3'
    eigenstrain_name = ini_stress
  [../]
  [./admissible]
    type = ComputeMultipleInelasticStress
    relative_tolerance = 1E4
    absolute_tolerance = 2
    inelastic_models = 'cdp cwp'
    perform_finite_strain_rotations = false
  [../]
  [./cdp]
    type = CappedDruckerPragerStressUpdate
    base_name = cdp
    DP_model = dp
    tensile_strength = ts
    compressive_strength = cs
    yield_function_tol = 1E-5
    tip_smoother = 1E3
    smoothing_tol = 1E3
  [../]
  [./cwp]
    type = CappedWeakPlaneStressUpdate
    base_name = cwp
    cohesion = wp_coh
    tan_friction_angle = wp_tanphi
    tan_dilation_angle = wp_tanpsi
    tensile_strength = wp_t_strength
    compressive_strength = wp_c_strength
    tip_smoother = 1E3
    smoothing_tol = 1E3
    yield_function_tol = 1E-5
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = dp_then_wp
  csv = true
[]
(modules/solid_mechanics/test/tests/notched_plastic_block/biaxial_planar.i)
# Uses non-smoothed Mohr-Coulomb (via ComputeMultiPlasticityStress and SolidMechanicsPlasticMohrCoulombMulti) to simulate the following problem.
# A cubical block is notched around its equator.
# All of its outer surfaces have roller BCs, but the notched region is free to move as needed
# The block is initialised with a high hydrostatic tensile stress
# Without the notch, the BCs do not allow contraction of the block, and this stress configuration is admissible
# With the notch, however, the interior parts of the block are free to move in order to relieve stress, and this causes plastic failure
# The top surface is then pulled upwards (the bottom is fixed because of the roller BCs)
# This causes more failure
[Mesh]
  [generated_mesh]
    type = GeneratedMeshGenerator
    dim = 3
    nx = 9
    ny = 9
    nz = 9
    xmin = 0
    xmax = 0.1
    ymin = 0
    ymax = 0.1
    zmin = 0
    zmax = 0.1
  []
  [block_to_remove_xmin]
    type = SubdomainBoundingBoxGenerator
    bottom_left = '-0.01 -0.01 0.045'
    top_right = '0.01 0.11 0.055'
    location = INSIDE
    block_id = 1
    input = generated_mesh
  []
  [block_to_remove_xmax]
    type = SubdomainBoundingBoxGenerator
    bottom_left = '0.09 -0.01 0.045'
    top_right = '0.11 0.11 0.055'
    location = INSIDE
    block_id = 1
    input = block_to_remove_xmin
  []
  [block_to_remove_ymin]
    type = SubdomainBoundingBoxGenerator
    bottom_left = '-0.01 -0.01 0.045'
    top_right = '0.11 0.01 0.055'
    location = INSIDE
    block_id = 1
    input = block_to_remove_xmax
  []
  [block_to_remove_ymax]
    type = SubdomainBoundingBoxGenerator
    bottom_left = '-0.01 0.09 0.045'
    top_right = '0.11 0.11 0.055'
    location = INSIDE
    block_id = 1
    input = block_to_remove_ymin
  []
  [remove_block]
    type = BlockDeletionGenerator
    block = 1
    input = block_to_remove_ymax
  []
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [all]
    add_variables = true
    incremental = true
    generate_output = 'max_principal_stress mid_principal_stress min_principal_stress stress_zz'
    eigenstrain_names = ini_stress
  []
[]
[Postprocessors]
  [uz]
    type = PointValue
    point = '0 0 0.1'
    use_displaced_mesh = false
    variable = disp_z
  []
  [s_zz]
    type = ElementAverageValue
    use_displaced_mesh = false
    variable = stress_zz
  []
  [num_res]
    type = NumResidualEvaluations
  []
  [nr_its]
    type = ElementAverageValue
    variable = num_iters
  []
  [max_nr_its]
    type = ElementExtremeValue
    variable = num_iters
  []
  [runtime]
    type = PerfGraphData
    data_type = TOTAL
    section_name = 'Root'
  []
[]
[BCs]
  # back=zmin, front=zmax, bottom=ymin, top=ymax, left=xmin, right=xmax
  [xmin_xzero]
    type = DirichletBC
    variable = disp_x
    boundary = left
    value = 0.0
  []
  [xmax_xzero]
    type = DirichletBC
    variable = disp_x
    boundary = right
    value = 0.0
  []
  [ymin_yzero]
    type = DirichletBC
    variable = disp_y
    boundary = bottom
    value = 0.0
  []
  [ymax_yzero]
    type = DirichletBC
    variable = disp_y
    boundary = top
    value = 0.0
  []
  [zmin_zzero]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = '0'
  []
  [zmax_disp]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = '1E-6*max(t,0)'
  []
[]
[AuxVariables]
  [mc_int]
    order = CONSTANT
    family = MONOMIAL
  []
  [plastic_strain]
    order = CONSTANT
    family = MONOMIAL
  []
  [num_iters]
    order = CONSTANT
    family = MONOMIAL
  []
  [yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[AuxKernels]
  [mc_int_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = mc_int
  []
  [plastic_strain_aux]
    type = MaterialRankTwoTensorAux
    i = 2
    j = 2
    property = plastic_strain
    variable = plastic_strain
  []
  [num_iters_auxk] # cannot use plastic_NR_iterations directly as this is zero, since no NR iterations are actually used, since we use a custom algorithm to do the return
    type = ParsedAux
    coupled_variables = plastic_strain
    expression = 'if(plastic_strain>0,1,0)'
    variable = num_iters
  []
  [yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  []
[]
[UserObjects]
  [mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 5E6
  []
  [mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 35
    convert_to_radians = true
  []
  [mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 10
    convert_to_radians = true
  []
  [mc]
    type = SolidMechanicsPlasticMohrCoulombMulti
    cohesion = mc_coh
    friction_angle = mc_phi
    dilation_angle = mc_psi
    yield_function_tolerance = 1E-5
    internal_constraint_tolerance = 1E-11
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 16E9
    poissons_ratio = 0.25
  []
  [mc]
    type = ComputeMultiPlasticityStress
    ep_plastic_tolerance = 1E-11
    plastic_models = mc
    max_NR_iterations = 1000
    debug_fspb = crash
  []
  [strain_from_initial_stress]
    type = ComputeEigenstrainFromInitialStress
    initial_stress = '6E6 0 0  0 6E6 0  0 0 6E6'
    eigenstrain_name = ini_stress
  []
[]
[Preconditioning]
  [andy]
    type = SMP
    full = true
  []
[]
[Executioner]
  start_time = -1
  end_time = 10
  dt = 1
  dtmin = 1
  solve_type = NEWTON
  type = Transient
  l_tol = 1E-2
  nl_abs_tol = 1E-5
  nl_rel_tol = 1E-7
  l_max_its = 200
  nl_max_its = 400
  petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
  petsc_options_value = ' asm      2              lu            gmres     200'
[]
[Outputs]
  perf_graph = true
  csv = true
[]
(modules/solid_mechanics/test/tests/multi/three_surface12.i)
# Plasticit models:
# SimpleTester0 with a = 0 and b = 1 and strength = 1
# SimpleTester1 with a = 1 and b = 0 and strength = 1
# SimpleTester2 with a = 1 and b = 1 and strength = 3
#
# Lame lambda = 0 (Poisson=0).  Lame mu = 0.5E6
#
# A single element is stretched by 1.5E-6m in y direction and 1.5E-6 in z direction.
# trial stress_yy = .15 and stress_zz = 1.5
#
# Then SimpleTester0 and SimpleTester1 should activate and the algorithm will return to
# stress_zz=1=stress_yy
# internal0 should be 0.5 and internal1 should be 0.5
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '1.5E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1.5E-6*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int2]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./int0]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 0
    variable = int0
  [../]
  [./int1]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 1
    variable = int1
  [../]
  [./int2]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 2
    variable = int2
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./f2]
    type = PointValue
    point = '0 0 0'
    variable = f2
  [../]
  [./int0]
    type = PointValue
    point = '0 0 0'
    variable = int0
  [../]
  [./int1]
    type = PointValue
    point = '0 0 0'
    variable = int1
  [../]
  [./int2]
    type = PointValue
    point = '0 0 0'
    variable = int2
  [../]
[]
[UserObjects]
  [./simple0]
    type = SolidMechanicsPlasticSimpleTester
    a = 0
    b = 1
    strength = 1
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
  [./simple1]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 0
    strength = 1
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
  [./simple2]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 1
    strength = 3
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 0.5E6'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./multi]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = 'simple0 simple1 simple2'
    max_NR_iterations = 2
    min_stepsize = 1
    debug_fspb = crash
    debug_jac_at_stress = '10 0 0 0 10 0 0 0 10'
    debug_jac_at_pm = '1 1'
    debug_jac_at_intnl = '1 1'
    debug_stress_change = 1E-5
    debug_pm_change = '1E-6 1E-6'
    debug_intnl_change = '1E-6 1E-6'
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = three_surface12
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/hcp_single_crystal/update_method_hcp_aprismatic_active.i)
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
  [cube]
    type = GeneratedMeshGenerator
    dim = 3
    nx = 2
    ny = 2
    nz = 2
    elem_type = HEX8
  []
  [center_node]
    type = BoundingBoxNodeSetGenerator
    input = cube
    new_boundary = 'center_point'
    top_right = '0.51 0.51 0'
    bottom_left = '0.49 0.49 0'
  []
  [back_edge_y]
    type = BoundingBoxNodeSetGenerator
    input = center_node
    new_boundary = 'back_edge_y'
    bottom_left = '0.9 0.5 0'
    top_right = '1.1 0.5 0'
  []
  [back_edge_x]
    type = BoundingBoxNodeSetGenerator
    input = back_edge_y
    new_boundary = back_edge_x
    bottom_left = '0.5 0.9 0'
    top_right =   '0.5 1.0 0'
  []
[]
[AuxVariables]
  [temperature]
    initial_condition = 300
  []
  [pk2]
    order = CONSTANT
    family = MONOMIAL
  []
  [fp_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [resolved_shear_stress_0]
   order = CONSTANT
   family = MONOMIAL
  []
  [resolved_shear_stress_1]
   order = CONSTANT
   family = MONOMIAL
  []
  [resolved_shear_stress_2]
   order = CONSTANT
   family = MONOMIAL
  []
  [resolved_shear_stress_12]
   order = CONSTANT
   family = MONOMIAL
  []
  [resolved_shear_stress_13]
   order = CONSTANT
   family = MONOMIAL
  []
  [forest_dislocations_0]
   order = CONSTANT
   family = MONOMIAL
  []
  [forest_dislocations_1]
   order = CONSTANT
   family = MONOMIAL
  []
  [forest_dislocations_2]
   order = CONSTANT
   family = MONOMIAL
  []
  [forest_dislocations_12]
   order = CONSTANT
   family = MONOMIAL
  []
  [forest_dislocations_13]
   order = CONSTANT
   family = MONOMIAL
  []
  [substructure_density]
   order = CONSTANT
   family = MONOMIAL
  []
  [slip_resistance_0]
   order = CONSTANT
   family = MONOMIAL
  []
  [slip_resistance_1]
   order = CONSTANT
   family = MONOMIAL
  []
  [slip_resistance_2]
   order = CONSTANT
   family = MONOMIAL
  []
  [slip_resistance_12]
   order = CONSTANT
   family = MONOMIAL
  []
  [slip_resistance_13]
   order = CONSTANT
   family = MONOMIAL
  []
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  incremental = true
  add_variables = true
[]
[AuxKernels]
  [pk2]
    type = RankTwoAux
    variable = pk2
    rank_two_tensor = second_piola_kirchhoff_stress
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [fp_zz]
    type = RankTwoAux
    variable = fp_zz
    rank_two_tensor = plastic_deformation_gradient
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [tau_0]
    type = MaterialStdVectorAux
    variable = resolved_shear_stress_0
    property = applied_shear_stress
    index = 0
    execute_on = timestep_end
  []
  [tau_1]
    type = MaterialStdVectorAux
    variable = resolved_shear_stress_1
    property = applied_shear_stress
    index = 1
    execute_on = timestep_end
  []
  [tau_2]
    type = MaterialStdVectorAux
    variable = resolved_shear_stress_2
    property = applied_shear_stress
    index = 2
    execute_on = timestep_end
  []
  [tau_12]
    type = MaterialStdVectorAux
    variable = resolved_shear_stress_12
    property = applied_shear_stress
    index = 12
    execute_on = timestep_end
  []
  [tau_13]
    type = MaterialStdVectorAux
    variable = resolved_shear_stress_13
    property = applied_shear_stress
    index = 13
    execute_on = timestep_end
  []
  [forest_dislocations_0]
    type = MaterialStdVectorAux
    variable = forest_dislocations_0
    property = forest_dislocation_density
    index = 0
    execute_on = timestep_end
  []
  [forest_dislocations_1]
    type = MaterialStdVectorAux
    variable = forest_dislocations_1
    property = forest_dislocation_density
    index = 1
    execute_on = timestep_end
  []
  [forest_dislocations_2]
    type = MaterialStdVectorAux
    variable = forest_dislocations_2
    property = forest_dislocation_density
    index = 2
    execute_on = timestep_end
  []
  [forest_dislocations_12]
    type = MaterialStdVectorAux
    variable = forest_dislocations_12
    property = forest_dislocation_density
    index = 12
    execute_on = timestep_end
  []
  [forest_dislocations_13]
    type = MaterialStdVectorAux
    variable = forest_dislocations_13
    property = forest_dislocation_density
    index = 13
    execute_on = timestep_end
  []
  [substructure_density]
    type = MaterialRealAux
    variable = substructure_density
    property = total_substructure_density
    execute_on = timestep_end
  []
  [slip_resistance_0]
    type = MaterialStdVectorAux
    variable = slip_resistance_0
    property = slip_resistance
    index = 0
    execute_on = timestep_end
  []
  [slip_resistance_1]
    type = MaterialStdVectorAux
    variable = slip_resistance_1
    property = slip_resistance
    index = 1
    execute_on = timestep_end
  []
  [slip_resistance_2]
    type = MaterialStdVectorAux
    variable = slip_resistance_2
    property = slip_resistance
    index = 2
    execute_on = timestep_end
  []
  [slip_resistance_12]
    type = MaterialStdVectorAux
    variable = slip_resistance_12
    property = slip_resistance
    index = 12
    execute_on = timestep_end
  []
  [slip_resistance_13]
    type = MaterialStdVectorAux
    variable = slip_resistance_13
    property = slip_resistance
    index = 13
    execute_on = timestep_end
  []
[]
[BCs]
  [fix_y]
    type = DirichletBC
    variable = disp_y
    preset = true
    boundary = 'center_point back_edge_y'
    value = 0
  []
  [fix_x]
    type = DirichletBC
    variable = disp_x
    boundary = 'center_point back_edge_x'
    value = 0
  []
  [fix_z]
    type = DirichletBC
    variable = disp_z
    boundary = 'back'
    value = 0
  []
  [tdisp]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = '0.001*t'
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensorCP
    C_ijkl = '1.622e5 9.18e4 6.88e4 1.622e5 6.88e4 1.805e5 4.67e4 4.67e4 4.67e4' #alpha Ti, Alankar et al. Acta Materialia 59 (2011) 7003-7009
    fill_method = symmetric9
    euler_angle_1 = 164.5
    euler_angle_2 =  90.0
    euler_angle_3 =  15.3
  []
  [stress]
    type = ComputeMultipleCrystalPlasticityStress
    crystal_plasticity_models = 'trial_xtalpl'
    tan_mod_type = exact
  []
  [trial_xtalpl]
    type = CrystalPlasticityHCPDislocationSlipBeyerleinUpdate
    number_slip_systems = 15
    slip_sys_file_name = hcp_aprismatic_capyramidal_slip_sys.txt
    unit_cell_dimension = '2.934e-7 2.934e-7 4.657e-7' #Ti, in mm, https://materialsproject.org/materials/mp-46/
    temperature = temperature
    initial_forest_dislocation_density = 15.0e5
    initial_substructure_density = 1.0e3
    slip_system_modes = 2
    number_slip_systems_per_mode = '3 12'
    lattice_friction_per_mode = '0.5 5'
    effective_shear_modulus_per_mode = '4.7e4 4.7e4' #Ti, in MPa, https://materialsproject.org/materials/mp-46/
    burgers_vector_per_mode = '2.934e-7 6.586e-7' #Ti, in mm, https://materialsproject.org/materials/mp-46/
    slip_generation_coefficient_per_mode = '1e5 2e7'
    normalized_slip_activiation_energy_per_mode = '4e-3 3e-2'
    slip_energy_proportionality_factor_per_mode = '330 100'
    substructure_rate_coefficient_per_mode = '400 100'
    applied_strain_rate = 0.001
    gamma_o = 1.0e-3
    Hall_Petch_like_constant_per_mode = '2e-3 2e-3' #minimize impact
    grain_size = 20.0e-3 #20 microns
  []
[]
[Postprocessors]
  [pk2]
    type = ElementAverageValue
    variable = pk2
  []
  [fp_zz]
    type = ElementAverageValue
    variable = fp_zz
  []
  [tau_0]
    type = ElementAverageValue
    variable = resolved_shear_stress_0
  []
  [tau_1]
    type = ElementAverageValue
    variable = resolved_shear_stress_1
  []
  [tau_2]
    type = ElementAverageValue
    variable = resolved_shear_stress_2
  []
  [tau_12]
    type = ElementAverageValue
    variable = resolved_shear_stress_12
  []
  [tau_13]
    type = ElementAverageValue
    variable = resolved_shear_stress_13
  []
  [forest_dislocation_0]
    type = ElementAverageValue
    variable = forest_dislocations_0
  []
  [forest_dislocation_1]
    type = ElementAverageValue
    variable = forest_dislocations_1
  []
  [forest_dislocation_2]
    type = ElementAverageValue
    variable = forest_dislocations_2
  []
  [forest_dislocation_12]
    type = ElementAverageValue
    variable = forest_dislocations_12
  []
  [forest_dislocation_13]
    type = ElementAverageValue
    variable = forest_dislocations_13
  []
  [substructure_density]
    type = ElementAverageValue
    variable = substructure_density
  []
  [slip_resistance_0]
    type = ElementAverageValue
    variable = slip_resistance_0
  []
  [slip_resistance_1]
    type = ElementAverageValue
    variable = slip_resistance_1
  []
  [slip_resistance_2]
    type = ElementAverageValue
    variable = slip_resistance_2
  []
  [slip_resistance_12]
    type = ElementAverageValue
    variable = slip_resistance_12
  []
  [slip_resistance_13]
    type = ElementAverageValue
    variable = slip_resistance_13
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
  petsc_options_value = ' asm      2              lu            gmres     200'
  nl_abs_tol = 1e-10
  nl_rel_tol = 1e-10
  nl_abs_step_tol = 1e-10
  nl_max_its = 20
  l_max_its = 50
  dt = 0.005
  dtmin = 1.0e-4
  dtmax = 0.1
  end_time = 0.09
[]
[Outputs]
  csv = true
[]
(modules/solid_mechanics/test/tests/multi/paper5.i)
# This runs the J2+cap+hardening example model described in the 'MultiSurface' plasticity paper
#
# Plasticity models:
# J2 with strength = 20MPa to 10MPa in 100% strain
# Compressive cap with strength = 15MPa to 5MPa in 100% strain
#
# Lame lambda = 1.2GPa.  Lame mu = 1.2GPa (Young = 3GPa, poisson = 0.25)
#
# A line of elements is perturbed randomly, and return to the yield surface at each quadpoint is checked
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1000
  ny = 125
  nz = 1
  xmin = 0
  xmax = 1000
  ymin = 0
  ymax = 125
  zmin = 0
  zmax = 1
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[ICs]
  [./x]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_x
  [../]
  [./y]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_y
  [../]
  [./z]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_z
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '0'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./linesearch]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./ld]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./constr_added]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./intnl0]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl0
  [../]
  [./intnl1]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 1
    variable = intnl1
  [../]
  [./linesearch]
    type = MaterialRealAux
    property = plastic_linesearch_needed
    variable = linesearch
  [../]
  [./ld]
    type = MaterialRealAux
    property = plastic_linear_dependence_encountered
    variable = ld
  [../]
  [./constr_added]
    type = MaterialRealAux
    property = plastic_constraints_added
    variable = constr_added
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
[]
[Postprocessors]
  [./max_f0]
    type = ElementExtremeValue
    variable = f0
    outputs = console
  [../]
  [./max_f1]
    type = ElementExtremeValue
    variable = f1
    outputs = console
  [../]
  [./max_iter]
    type = ElementExtremeValue
    variable = iter
    outputs = console
  [../]
  [./av_iter]
    type = ElementAverageValue
    variable = iter
    outputs = 'console csv'
  [../]
  [./av_linesearch]
    type = ElementAverageValue
    variable = linesearch
    outputs = 'console csv'
  [../]
  [./av_ld]
    type = ElementAverageValue
    variable = ld
    outputs = 'console csv'
  [../]
  [./av_constr_added]
    type = ElementAverageValue
    variable = constr_added
    outputs = 'console csv'
  [../]
[]
[UserObjects]
  [./yield_strength]
    type = SolidMechanicsHardeningCubic
    value_0 = 20E6
    value_residual = 10E6
    internal_limit = 1
  [../]
  [./j2]
    type = SolidMechanicsPlasticJ2
    yield_strength = yield_strength
    yield_function_tolerance = 1.0E2
    internal_constraint_tolerance = 1.0E-7
    use_custom_returnMap = false
  [../]
  [./compressive_strength]
    type = SolidMechanicsHardeningCubic
    value_0 = 15E6
    value_residual = 5E6
    internal_limit = 1
  [../]
  [./cap]
    type = SolidMechanicsPlasticMeanCap
    a = -1
    strength = compressive_strength
    yield_function_tolerance = 1.0E2
    internal_constraint_tolerance = 1.0E-7
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '1.2E9 1.2E9'
  [../]
  [./strain]
    type = ComputeIncrementalStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./multi]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-5
    plastic_models = 'j2 cap'
    max_NR_iterations = 10
    deactivation_scheme = 'safe'
    min_stepsize = 1
    max_stepsize_for_dumb = 1
    tangent_operator = elastic # tangent operator is unimportant in this test
    debug_fspb = crash
    debug_jac_at_stress = '10E6 0 0 0 10E6 0 0 0 10E6'
    debug_jac_at_pm = '1E-2 1E-2'
    debug_jac_at_intnl = '0.05 0.05'
    debug_stress_change = 1E1
    debug_pm_change = '1E-6 1E-6'
    debug_intnl_change = '1E-6 1E-6'
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = paper5
  exodus = false
  csv = true
  perf_graph = true
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/hcp_single_crystal/update_method_hcp_no_negative_aprismatic.i)
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
  [cube]
    type = GeneratedMeshGenerator
    dim = 3
    nx = 2
    ny = 2
    nz = 2
    elem_type = HEX8
  []
  [center_node]
    type = BoundingBoxNodeSetGenerator
    input = cube
    new_boundary = 'center_point'
    top_right = '0.51 0.51 0'
    bottom_left = '0.49 0.49 0'
  []
  [back_edge_y]
    type = BoundingBoxNodeSetGenerator
    input = center_node
    new_boundary = 'back_edge_y'
    bottom_left = '0.9 0.5 0'
    top_right = '1.1 0.5 0'
  []
  [back_edge_x]
    type = BoundingBoxNodeSetGenerator
    input = back_edge_y
    new_boundary = back_edge_x
    bottom_left = '0.5 0.9 0'
    top_right =   '0.5 1.0 0'
  []
[]
[AuxVariables]
  [temperature]
    initial_condition = 300
  []
  [pk2]
    order = CONSTANT
    family = MONOMIAL
  []
  [fp_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [resolved_shear_stress_0]
   order = CONSTANT
   family = MONOMIAL
  []
  [resolved_shear_stress_1]
   order = CONSTANT
   family = MONOMIAL
  []
  [resolved_shear_stress_2]
   order = CONSTANT
   family = MONOMIAL
  []
  [resolved_shear_stress_12]
   order = CONSTANT
   family = MONOMIAL
  []
  [resolved_shear_stress_13]
   order = CONSTANT
   family = MONOMIAL
  []
  [forest_dislocations_0]
   order = CONSTANT
   family = MONOMIAL
  []
  [forest_dislocations_1]
   order = CONSTANT
   family = MONOMIAL
  []
  [forest_dislocations_2]
   order = CONSTANT
   family = MONOMIAL
  []
  [forest_dislocations_12]
   order = CONSTANT
   family = MONOMIAL
  []
  [forest_dislocations_13]
   order = CONSTANT
   family = MONOMIAL
  []
  [substructure_density]
   order = CONSTANT
   family = MONOMIAL
  []
  [slip_resistance_0]
   order = CONSTANT
   family = MONOMIAL
  []
  [slip_resistance_1]
   order = CONSTANT
   family = MONOMIAL
  []
  [slip_resistance_2]
   order = CONSTANT
   family = MONOMIAL
  []
  [slip_resistance_12]
   order = CONSTANT
   family = MONOMIAL
  []
  [slip_resistance_13]
   order = CONSTANT
   family = MONOMIAL
  []
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  incremental = true
  add_variables = true
[]
[AuxKernels]
  [pk2]
    type = RankTwoAux
    variable = pk2
    rank_two_tensor = second_piola_kirchhoff_stress
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [fp_zz]
    type = RankTwoAux
    variable = fp_zz
    rank_two_tensor = plastic_deformation_gradient
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [tau_0]
    type = MaterialStdVectorAux
    variable = resolved_shear_stress_0
    property = applied_shear_stress
    index = 0
    execute_on = timestep_end
  []
  [tau_1]
    type = MaterialStdVectorAux
    variable = resolved_shear_stress_1
    property = applied_shear_stress
    index = 1
    execute_on = timestep_end
  []
  [tau_2]
    type = MaterialStdVectorAux
    variable = resolved_shear_stress_2
    property = applied_shear_stress
    index = 2
    execute_on = timestep_end
  []
  [tau_12]
    type = MaterialStdVectorAux
    variable = resolved_shear_stress_12
    property = applied_shear_stress
    index = 12
    execute_on = timestep_end
  []
  [tau_13]
    type = MaterialStdVectorAux
    variable = resolved_shear_stress_13
    property = applied_shear_stress
    index = 13
    execute_on = timestep_end
  []
  [forest_dislocations_0]
    type = MaterialStdVectorAux
    variable = forest_dislocations_0
    property = forest_dislocation_density
    index = 0
    execute_on = timestep_end
  []
  [forest_dislocations_1]
    type = MaterialStdVectorAux
    variable = forest_dislocations_1
    property = forest_dislocation_density
    index = 1
    execute_on = timestep_end
  []
  [forest_dislocations_2]
    type = MaterialStdVectorAux
    variable = forest_dislocations_2
    property = forest_dislocation_density
    index = 2
    execute_on = timestep_end
  []
  [forest_dislocations_12]
    type = MaterialStdVectorAux
    variable = forest_dislocations_12
    property = forest_dislocation_density
    index = 12
    execute_on = timestep_end
  []
  [forest_dislocations_13]
    type = MaterialStdVectorAux
    variable = forest_dislocations_13
    property = forest_dislocation_density
    index = 13
    execute_on = timestep_end
  []
  [substructure_density]
    type = MaterialRealAux
    variable = substructure_density
    property = total_substructure_density
    execute_on = timestep_end
  []
  [slip_resistance_0]
    type = MaterialStdVectorAux
    variable = slip_resistance_0
    property = slip_resistance
    index = 0
    execute_on = timestep_end
  []
  [slip_resistance_1]
    type = MaterialStdVectorAux
    variable = slip_resistance_1
    property = slip_resistance
    index = 1
    execute_on = timestep_end
  []
  [slip_resistance_2]
    type = MaterialStdVectorAux
    variable = slip_resistance_2
    property = slip_resistance
    index = 2
    execute_on = timestep_end
  []
  [slip_resistance_12]
    type = MaterialStdVectorAux
    variable = slip_resistance_12
    property = slip_resistance
    index = 12
    execute_on = timestep_end
  []
  [slip_resistance_13]
    type = MaterialStdVectorAux
    variable = slip_resistance_13
    property = slip_resistance
    index = 13
    execute_on = timestep_end
  []
[]
[BCs]
  [fix_y]
    type = DirichletBC
    variable = disp_y
    preset = true
    boundary = 'center_point back_edge_y'
    value = 0
  []
  [fix_x]
    type = DirichletBC
    variable = disp_x
    boundary = 'center_point back_edge_x'
    value = 0
  []
  [fix_z]
    type = DirichletBC
    variable = disp_z
    boundary = 'back'
    value = 0
  []
  [tdisp]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = '0.001*t'
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensorCP
    C_ijkl = '1.622e5 9.18e4 6.88e4 1.622e5 6.88e4 1.805e5 4.67e4 4.67e4 4.67e4' #alpha Ti, Alankar et al. Acta Materialia 59 (2011) 7003-7009
    fill_method = symmetric9
    euler_angle_1 = 164.5
    euler_angle_2 =  90.0
    euler_angle_3 =  15.3
  []
  [stress]
    type = ComputeMultipleCrystalPlasticityStress
    crystal_plasticity_models = 'trial_xtalpl'
    tan_mod_type = exact
  []
  [trial_xtalpl]
    type = CrystalPlasticityHCPDislocationSlipBeyerleinUpdate
    number_slip_systems = 15
    slip_sys_file_name = hcp_aprismatic_capyramidal_slip_sys.txt
    unit_cell_dimension = '2.934e-7 2.934e-7 4.657e-7' #Ti, in mm, https://materialsproject.org/materials/mp-46/
    temperature = temperature
    initial_forest_dislocation_density = 15.0
    zero_tol = 1.1
    initial_substructure_density = 1.0e3
    slip_system_modes = 2
    number_slip_systems_per_mode = '3 12'
    lattice_friction_per_mode = '0.5 5'
    effective_shear_modulus_per_mode = '4.7e4 4.7e4' #Ti, in MPa, https://materialsproject.org/materials/mp-46/
    burgers_vector_per_mode = '2.934e-7 6.586e-7' #Ti, in mm, https://materialsproject.org/materials/mp-46/
    slip_generation_coefficient_per_mode = '-1e5 -2e7'
    normalized_slip_activiation_energy_per_mode = '4e-3 3e-2'
    slip_energy_proportionality_factor_per_mode = '330 100'
    substructure_rate_coefficient_per_mode = '400 100'
    applied_strain_rate = 0.001
    gamma_o = 1.0e-3
    Hall_Petch_like_constant_per_mode = '2e-3 2e-3' #minimize impact
    grain_size = 20.0e-3 #20 microns
  []
[]
[Postprocessors]
  [pk2]
    type = ElementAverageValue
    variable = pk2
  []
  [fp_zz]
    type = ElementAverageValue
    variable = fp_zz
  []
  [tau_0]
    type = ElementAverageValue
    variable = resolved_shear_stress_0
  []
  [tau_1]
    type = ElementAverageValue
    variable = resolved_shear_stress_1
  []
  [tau_2]
    type = ElementAverageValue
    variable = resolved_shear_stress_2
  []
  [tau_12]
    type = ElementAverageValue
    variable = resolved_shear_stress_12
  []
  [tau_13]
    type = ElementAverageValue
    variable = resolved_shear_stress_13
  []
  [forest_dislocation_0]
    type = ElementAverageValue
    variable = forest_dislocations_0
  []
  [forest_dislocation_1]
    type = ElementAverageValue
    variable = forest_dislocations_1
  []
  [forest_dislocation_2]
    type = ElementAverageValue
    variable = forest_dislocations_2
  []
  [forest_dislocation_12]
    type = ElementAverageValue
    variable = forest_dislocations_12
  []
  [forest_dislocation_13]
    type = ElementAverageValue
    variable = forest_dislocations_13
  []
  [substructure_density]
    type = ElementAverageValue
    variable = substructure_density
  []
  [slip_resistance_0]
    type = ElementAverageValue
    variable = slip_resistance_0
  []
  [slip_resistance_1]
    type = ElementAverageValue
    variable = slip_resistance_1
  []
  [slip_resistance_2]
    type = ElementAverageValue
    variable = slip_resistance_2
  []
  [slip_resistance_12]
    type = ElementAverageValue
    variable = slip_resistance_12
  []
  [slip_resistance_13]
    type = ElementAverageValue
    variable = slip_resistance_13
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
  petsc_options_value = ' asm      2              lu            gmres     200'
  nl_abs_tol = 1e-10
  nl_rel_tol = 1e-10
  nl_abs_step_tol = 1e-10
  nl_max_its = 20
  l_max_its = 50
  dt = 0.00375
  dtmin = 1.0e-4
  dtmax = 0.1
  num_steps = 9
[]
[Outputs]
  csv = true
[]
(modules/solid_mechanics/test/tests/j2_plasticity/small_deform3.i)
# UserObject J2 test
# apply uniform compression in x direction to give
# trial stress_xx = -7, so sqrt(3*J2) = 7
# with zero Poisson's ratio, this should return to
# stress_xx = -3, stress_yy = -2 = stress_zz
# (note that stress_xx - stress_yy = stress_xx - stress_zz = -1, so sqrt(3*j2) = 1,
#  and that the mean stress remains = -7/3)
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '-3.5E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '0E-6*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = f
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = f
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
[]
[UserObjects]
  [./str]
    type = SolidMechanicsHardeningConstant
    value = 1
  [../]
  [./j2]
    type = SolidMechanicsPlasticJ2
    yield_strength = str
    yield_function_tolerance = 1E-3
    internal_constraint_tolerance = 1E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E6'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = j2
    debug_fspb = crash
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform3
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/mean_cap_TC/small_deform1.i)
# apply uniform stretch in x, y and z directions.
# trial_stress(0, 0) = -2
# trial_stress(1, 1) = 6
# trial_stress(2, 2) = 10
# With tensile_strength = 2, the algorithm should return to trace(stress) = 2, or
# stress(0, 0) = -6
# stress(1, 1) = 2
# stress(2, 2) = 6
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '-1E-7*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '3E-7*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '5E-7*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = f
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = f
  [../]
[]
[UserObjects]
  [./tensile_strength]
    type = SolidMechanicsHardeningConstant
    value = 2
  [../]
  [./compressive_strength]
    type = SolidMechanicsHardeningConstant
    value = -1
  [../]
  [./cap]
    type = SolidMechanicsPlasticMeanCapTC
    tensile_strength = tensile_strength
    compressive_strength = compressive_strength
    yield_function_tolerance = 1E-3
    internal_constraint_tolerance = 1E-9
    use_custom_returnMap = false
    use_custom_cto = false
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./strain]
    type = ComputeIncrementalStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mean_cap]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = cap
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform1
  exodus = false
  [./csv]
    type = CSV
  [../]
[]
(modules/solid_mechanics/test/tests/tensile/small_deform1.i)
# checking for small deformation
# A single element is stretched by 1E-6m in z direction, and by small amounts in x and y directions
# stress_zz = Youngs Modulus*Strain = 2E6*1E-6 = 2 Pa
# tensile_strength is set to 1Pa
# Then the final stress should return to the yeild surface and the maximum principal stress value should be 1pa.
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    strain = finite
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0.1E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0.2E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1E-6*z'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1
  [../]
  [./mc]
    type = SolidMechanicsPlasticTensile
    tensile_strength = ts
    yield_function_tolerance = 1E-6
    tensile_tip_smoother = 0.0
    internal_constraint_tolerance = 1E-5
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 2.0E6'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-5
    plastic_models = mc
    debug_fspb = crash
    debug_jac_at_stress = '1 2 3 2 -4 -5 3 -5 10'
    debug_jac_at_pm = 0.8
    debug_jac_at_intnl = 1
    debug_stress_change = 1E-8
    debug_pm_change = 1E-5
    debug_intnl_change = 1E-5
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform1
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/jacobian/cto15.i)
# Jacobian check for nonlinear, multi-surface plasticity
# This returns to the edge of Mohr Coulomb.
# This is a very nonlinear test and a delicate test because it perturbs around
# an edge of the yield function where some derivatives are not well defined
#
# Plasticity models:
# Mohr-Coulomb with cohesion = 40MPa, friction angle = 35deg, dilation angle = 5deg
# Tensile with strength = 1MPa
#
# Lame lambda = 1GPa.  Lame mu = 1.3GPa
#
# NOTE: The yield function tolerances here are set at 100-times what i would usually use
# This is because otherwise the test fails on the 'pearcey' architecture.
# This is because identical stress tensors yield slightly different eigenvalues
# (and hence return-map residuals) on 'pearcey' than elsewhere, which results in
# a different number of NR iterations are needed to return to the yield surface.
# This is presumably because of compiler internals, or the BLAS routines being
# optimised differently or something similar.
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./linesearch]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./ld]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./constr_added]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int3]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int4]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int5]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int6]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int7]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int8]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int0]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./linesearch]
    type = MaterialRealAux
    property = plastic_linesearch_needed
    variable = linesearch
  [../]
  [./ld]
    type = MaterialRealAux
    property = plastic_linear_dependence_encountered
    variable = ld
  [../]
  [./constr_added]
    type = MaterialRealAux
    property = plastic_constraints_added
    variable = constr_added
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./int0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    variable = int0
    index = 0
  [../]
  [./int1]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    variable = int1
    index = 1
  [../]
  [./int2]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    variable = int2
    index = 2
  [../]
  [./int3]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    variable = int3
    index = 3
  [../]
  [./int4]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    variable = int4
    index = 4
  [../]
  [./int5]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    variable = int5
    index = 5
  [../]
  [./int6]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    variable = int6
    index = 6
  [../]
  [./int7]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    variable = int7
    index = 7
  [../]
  [./int8]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    variable = int8
    index = 8
  [../]
[]
[Postprocessors]
  [./max_int0]
    type = ElementExtremeValue
    variable = int0
    outputs = console
  [../]
  [./max_int1]
    type = ElementExtremeValue
    variable = int1
    outputs = console
  [../]
  [./max_int2]
    type = ElementExtremeValue
    variable = int2
    outputs = console
  [../]
  [./max_int3]
    type = ElementExtremeValue
    variable = int3
    outputs = console
  [../]
  [./max_int4]
    type = ElementExtremeValue
    variable = int4
    outputs = console
  [../]
  [./max_int5]
    type = ElementExtremeValue
    variable = int5
    outputs = console
  [../]
  [./max_int6]
    type = ElementExtremeValue
    variable = int6
    outputs = console
  [../]
  [./max_int7]
    type = ElementExtremeValue
    variable = int7
    outputs = console
  [../]
  [./max_int8]
    type = ElementExtremeValue
    variable = int8
    outputs = console
  [../]
  [./max_iter]
    type = ElementExtremeValue
    variable = iter
    outputs = console
  [../]
  [./av_linesearch]
    type = ElementAverageValue
    variable = linesearch
    outputs = 'console'  [../]
  [./av_ld]
    type = ElementAverageValue
    variable = ld
    outputs = 'console'  [../]
  [./av_constr_added]
    type = ElementAverageValue
    variable = constr_added
    outputs = 'console'  [../]
  [./av_iter]
    type = ElementAverageValue
    variable = iter
    outputs = 'console'  [../]
[]
[UserObjects]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 4E1
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 35
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 5
    convert_to_radians = true
  [../]
  [./mc]
    type = SolidMechanicsPlasticMohrCoulombMulti
    cohesion = mc_coh
    friction_angle = mc_phi
    dilation_angle = mc_psi
    yield_function_tolerance = 1.0E-4  # Note larger value
    shift = 1.0E-4                     # Note larger value
    internal_constraint_tolerance = 1.0E-7
  [../]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1E2
  [../]
  [./tensile]
    type = SolidMechanicsPlasticTensileMulti
    tensile_strength = ts
    yield_function_tolerance = 1.0E-4  # Note larger value
    shift = 1.0E-4                     # Note larger value
    internal_constraint_tolerance = 1.0E-7
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '1.0E3 1.3E3'
  [../]
  [./strain]
    type = ComputeIncrementalStrain
    displacements = 'disp_x disp_y disp_z'
    eigenstrain_names = ini_stress
  [../]
  [./ini_stress]
    type = ComputeEigenstrainFromInitialStress
    initial_stress = '100.1 0.1 -0.2  0.1 0.9 0  -0.2 0 1.1'
    eigenstrain_name = ini_stress
  [../]
  [./multi]
    type = ComputeMultiPlasticityStress
    ep_plastic_tolerance = 1E-7
    plastic_models = 'tensile mc'
    max_NR_iterations = 5
    specialIC = 'rock'
    deactivation_scheme = 'safe'
    min_stepsize = 1
    max_stepsize_for_dumb = 1
    tangent_operator = nonlinear
  [../]
[]
[Preconditioning]
  [./andy]
    type = SMP
    full = true
    petsc_options_iname = '-ksp_type -pc_type -snes_atol -snes_rtol -snes_max_it -snes_type'
    petsc_options_value = 'bcgs bjacobi 1E-15 1E-10 10000 test'
  [../]
[]
[Executioner]
  type = Transient
  solve_type = Newton
  end_time = 1
[]
[Outputs]
  file_base = cto15
  exodus = false
[]
(modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform19.i)
# Using CappedMohrCoulomb with compressive failure only
# A single unit element is stretched in a complicated way
# that the trial stress is
#
#  -1.2 -2.0 -0.8
#  -2.0  4.4   0
#  -0.8   0   2.8
#
# This has eigenvalues
# la = {-1.963, 2.89478, 5.06822}
# and eigenvectors
# {0.94197, 0.296077, 0.158214}
# {-0.116245, -0.154456, 0.981137},
# {-0.314929, 0.942593, 0.111075},
#
# The compressive strength is 0.5 and Young=1 and Poisson=0.25.
# The return-map algorithm should return to stress_min = -0.5
# This is an increment of 1.463, so stress_mid and stress_max
# should both increase by 1.463 v/(1-v) = 0.488, giving
# stress_mid = 3.382
# stress_max = 5.556
#
# E_22 = E(1-v)/(1+v)/(1-2v)=1.2 and E_02 = E_22 v/(1-v)
# gamma_shear = ((smax-smin)^trial - (smax-smin)) / (E_22 - E_02)
# = ((2v-1)/(1-v)) * (smin^trial - smin) / (E_22(1 - 2v)/(1-v))
# = -(smin^trial - smin) / E_22
# Using psi = 30deg, sin(psi) = 1/2
# the shear correction to the tensile internal parameter is
# gamma_shear (E_22 + E_20) sin(psi) = gamma_shear E_22 sin(psi) / (1 - v)
# = -(smin^trial - smin) / (1 - v) / 2
# Then the tensile internal parameter is
# (1 - v) * (reduction_of_(max+min)_principal - gamma_shear * E_22 / (1-v) / 2) / E_22
# = -1.829
#
# The final stress is
#
# {0.15, -1.7, -0.65},
# {-1.7, 4.97, 0.046},
# {-0.65, 0.046, 3.3}
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'max_principal_stress mid_principal_stress min_principal_stress stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '-(3*x+2*y+z)'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '-(3*x-4*y)'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '-(x-2*z)'
  [../]
[]
[AuxVariables]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./f0_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./intnl_auxk]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 1
    variable = intnl
  [../]
[]
[Postprocessors]
  [./s_I]
    type = PointValue
    point = '0 0 0'
    variable = max_principal_stress
  [../]
  [./s_II]
    type = PointValue
    point = '0 0 0'
    variable = mid_principal_stress
  [../]
  [./s_III]
    type = PointValue
    point = '0 0 0'
    variable = min_principal_stress
  [../]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./f2]
    type = PointValue
    point = '0 0 0'
    variable = f2
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
  [./intnl]
    type = PointValue
    point = '0 0 0'
    variable = intnl
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./cs]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
  [./coh]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./ang]
    type = SolidMechanicsHardeningConstant
    value = 30
    convert_to_radians = true
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 1
    poissons_ratio = 0.25
  [../]
  [./tensile]
    type = CappedMohrCoulombStressUpdate
    tensile_strength = ts
    compressive_strength = cs
    cohesion = coh
    friction_angle = ang
    dilation_angle = ang
    smoothing_tol = 0.001
    yield_function_tol = 1.0E-12
  [../]
  [./stress]
    type = ComputeMultipleInelasticStress
    inelastic_models = tensile
    perform_finite_strain_rotations = false
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform19
  csv = true
[]
(modules/solid_mechanics/test/tests/tensile/small_deform3_update_version.i)
# Using TensileStressUpdate
# checking for small deformation
# A single element is stretched by "ep" in the z and x directions
# This causes the return direction to be along the hypersurface sigma_I = sigma_II
# where sigma_I = (E_2222 + E_2200) * ep
# tensile_strength is set to 1Pa, smoothing_tol = 0.1Pa
# The smoothed yield function is
# yf = sigma_I + ismoother(0) - tensile_strength
#    = sigma_I + (0.5 * smoothing_tol - smoothing_tol / Pi) - tensile_strength
#    = sigma_I - 0.98183
#
# With zero Poisson's ratio, the return stress will be
# stress_00 = stress_22 = 0.98183
# with all other stress components being zero
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    strain = finite
    generate_output = 'max_principal_stress mid_principal_stress min_principal_stress stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0.25E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '0.25E-6*z'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 2.0E6'
  [../]
  [./tensile]
    type = TensileStressUpdate
    tensile_strength = ts
    smoothing_tol = 0.1
    yield_function_tol = 1.0E-9
  [../]
  [./stress]
    type = ComputeMultipleInelasticStress
    inelastic_models = tensile
    perform_finite_strain_rotations = false
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform3_update_version
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/user_object_based/save_euler.i)
[Mesh]
  type = GeneratedMesh
  dim = 2
  elem_type = QUAD4
  displacements = 'disp_x disp_y'
  nx = 2
  ny = 2
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
[]
[GlobalParams]
  volumetric_locking_correction = true
[]
[AuxVariables]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./e_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./fp_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./gss]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./euler1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./euler2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./euler3]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[Functions]
  [./tdisp]
    type = ParsedFunction
    expression = 0.01*t
  [../]
[]
[UserObjects]
  [./prop_read]
    type = PropertyReadFile
    prop_file_name = 'euler_ang_file.txt'
    # Enter file data as prop#1, prop#2, .., prop#nprop
    nprop = 3
    read_type = element
  [../]
[]
[AuxKernels]
  [./stress_yy]
    type = RankTwoAux
    variable = stress_yy
    rank_two_tensor = stress
    index_j = 1
    index_i = 1
    execute_on = timestep_end
  [../]
  [./e_yy]
    type = RankTwoAux
    variable = e_yy
    rank_two_tensor = lage
    index_j = 1
    index_i = 1
    execute_on = timestep_end
  [../]
  [./fp_yy]
    type = RankTwoAux
    variable = fp_yy
    rank_two_tensor = fp
    index_j = 1
    index_i = 1
    execute_on = timestep_end
  [../]
  [./gss]
    type = MaterialStdVectorAux
    variable = gss
    property = state_var_gss
    index = 0
    execute_on = timestep_end
  [../]
  [./euler1]
    type = MaterialRealVectorValueAux
    variable = euler1
    property = Euler_angles
    component = 0
    execute_on = timestep_end
  [../]
  [./euler2]
    type = MaterialRealVectorValueAux
    variable = euler2
    property = Euler_angles
    component = 1
    execute_on = timestep_end
  [../]
  [./euler3]
    type = MaterialRealVectorValueAux
    variable = euler3
    property = Euler_angles
    component = 2
    execute_on = timestep_end
  [../]
[]
[BCs]
  [./fix_x]
    type = DirichletBC
    variable = disp_x
    boundary = 'left'
    value = 0
  [../]
  [./fix_y]
    type = DirichletBC
    variable = disp_y
    boundary = 'bottom'
    value = 0
  [../]
  [./tdisp]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = top
    function = tdisp
  [../]
[]
[UserObjects]
  [./slip_rate_gss]
    type = CrystalPlasticitySlipRateGSS
    variable_size = 12
    slip_sys_file_name = input_slip_sys.txt
    num_slip_sys_flowrate_props = 2
    flowprops = '1 4 0.001 0.1 5 8 0.001 0.1 9 12 0.001 0.1'
    uo_state_var_name = state_var_gss
  [../]
  [./slip_resistance_gss]
    type = CrystalPlasticitySlipResistanceGSS
    variable_size = 12
    uo_state_var_name = state_var_gss
  [../]
  [./state_var_gss]
    type = CrystalPlasticityStateVariable
    variable_size = 12
    groups = '0 4 8 12'
    group_values = '60.8 60.8 60.8'
    uo_state_var_evol_rate_comp_name = state_var_evol_rate_comp_gss
    scale_factor = 1.0
  [../]
  [./state_var_evol_rate_comp_gss]
    type = CrystalPlasticityStateVarRateComponentGSS
    variable_size = 12
    hprops = '1.0 541.5 109.8 2.5'
    uo_slip_rate_name = slip_rate_gss
    uo_state_var_name = state_var_gss
  [../]
[]
[Materials]
  [./crysp]
    type = FiniteStrainUObasedCP
    stol = 1e-2
    tan_mod_type = exact
    uo_slip_rates = 'slip_rate_gss'
    uo_slip_resistances = 'slip_resistance_gss'
    uo_state_vars = 'state_var_gss'
    uo_state_var_evol_rate_comps = 'state_var_evol_rate_comp_gss'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    displacements = 'disp_x disp_y'
  [../]
  [./elasticity_tensor]
    type = ComputeElasticityTensorCP
    C_ijkl = '1.684e5 1.214e5 1.214e5 1.684e5 1.214e5 1.684e5 0.754e5 0.754e5 0.754e5'
    fill_method = symmetric9
    read_prop_user_object = prop_read
  [../]
[]
[Postprocessors]
  [./stress_yy]
    type = ElementAverageValue
    variable = stress_yy
  [../]
  [./e_yy]
    type = ElementAverageValue
    variable = e_yy
  [../]
  [./fp_yy]
    type = ElementAverageValue
    variable = fp_yy
  [../]
  [./gss]
    type = ElementAverageValue
    variable = gss
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  dt = 0.01
  solve_type = 'PJFNK'
  petsc_options_iname = -pc_hypre_type
  petsc_options_value = boomerang
  nl_abs_tol = 1e-10
  nl_rel_step_tol = 1e-10
  dtmax = 10.0
  nl_rel_tol = 1e-10
  end_time = 1
  dtmin = 0.01
  num_steps = 10
  nl_abs_step_tol = 1e-10
[]
[Outputs]
  exodus = true
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y'
    use_displaced_mesh = true
  [../]
[]
(modules/solid_mechanics/test/tests/multi/three_surface04.i)
# Plasticit models:
# SimpleTester0 with a = 0 and b = 1 and strength = 1
# SimpleTester1 with a = 1 and b = 0 and strength = 1
# SimpleTester2 with a = 1 and b = 1 and strength = 1.5
#
# Lame lambda = 0 (Poisson=0).  Lame mu = 0.5E6
#
# A single element is stretched by 0.8E-6m in y direction and 1.5E-6 in z direction.
# trial stress_yy = 0.8 and stress_zz = 1.5
#
# Then SimpleTester0 and SimpleTester2 should activate and the algorithm will return to
# the corner stress_yy=0.5, stress_zz=1
# internal0 should be 0.2, and internal2 should be 0.3
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0.8E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1.5E-6*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int2]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./int0]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 0
    variable = int0
  [../]
  [./int1]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 1
    variable = int1
  [../]
  [./int2]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 2
    variable = int2
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./f2]
    type = PointValue
    point = '0 0 0'
    variable = f2
  [../]
  [./int0]
    type = PointValue
    point = '0 0 0'
    variable = int0
  [../]
  [./int1]
    type = PointValue
    point = '0 0 0'
    variable = int1
  [../]
  [./int2]
    type = PointValue
    point = '0 0 0'
    variable = int2
  [../]
[]
[UserObjects]
  [./simple0]
    type = SolidMechanicsPlasticSimpleTester
    a = 0
    b = 1
    strength = 1
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
  [./simple1]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 0
    strength = 1
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
  [./simple2]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 1
    strength = 1.5
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 0.5E6'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./multi]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = 'simple0 simple1 simple2'
    max_NR_iterations = 2
    min_stepsize = 1
    debug_fspb = crash
    debug_jac_at_stress = '10 0 0 0 10 0 0 0 10'
    debug_jac_at_pm = '1 1'
    debug_jac_at_intnl = '1 1'
    debug_stress_change = 1E-5
    debug_pm_change = '1E-6 1E-6'
    debug_intnl_change = '1E-6 1E-6'
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = three_surface04
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/mohr_coulomb/small_deform5.i)
# apply repeated stretches in x z directions, and smaller stretches along the y direction,
# so that sigma_I = sigma_II,
# which means that lode angle = 30deg.
# The allows yield surface in meridional plane to be mapped out
# Use 'cap' smoothing
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '1E-6*x*t'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0.9E-6*y*sin(t)'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1E-6*z*t'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_int]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./mc_int_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = mc_int
  [../]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
  [./iter_auxk]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./internal]
    type = PointValue
    point = '0 0 0'
    variable = mc_int
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
[]
[UserObjects]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 10
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 50
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningExponential
    value_0 = 0
    value_residual = 0.8726646 # 50deg
    rate = 3000.0
  [../]
  [./mc]
    type = SolidMechanicsPlasticMohrCoulomb
    cohesion = mc_coh
    friction_angle = mc_phi
    dilation_angle = mc_psi
    tip_scheme = cap
    mc_tip_smoother = 0
    cap_start = 3
    cap_rate = 0.8
    mc_edge_smoother = 20
    yield_function_tolerance = 1E-8
    internal_constraint_tolerance = 1E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = mc
    debug_fspb = crash
  [../]
[]
[Executioner]
  end_time = 150
  dt = 5
  type = Transient
[]
[Outputs]
  file_base = small_deform5
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/multiple_two_parameter_plasticity/cycled_dp_then_wp.i)
# Use ComputeMultipleInelasticStress with two inelastic models: CappedDruckerPrager and CappedWeakPlane.
# The relative_tolerance and absolute_tolerance parameters are set very large so that
# only one iteration is performed.  This is the algorithm that FLAC uses to model
# jointed rocks, only Capped-Mohr-Coulomb is used instead of CappedDruckerPrager
#
# In this test "cycle_models=true" so that in the first timestep only
# CappedDruckerPrager is used, while in the second timestep only
# CappedWeakPlane is used.
#
# initial_stress = diag(1E3, 1E3, 1E3)
# The CappedDruckerPrager has tensile strength 3E2 and large cohesion,
# so the stress initially returns to diag(1E2, 1E2, 1E2)
# The CappedWeakPlane has tensile strength zero and large cohesion,
# so the stress returns to diag(1E2 - v/(1-v)*1E2, 1E2 - v/(1-v)*1E2, 0)
# where v=0.2 is the Poisson's ratio
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    eigenstrain_names = ini_stress
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = 0
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = 0
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = 0
  [../]
[]
[AuxVariables]
  [./yield_fcn_dp]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn_wp]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./tensile_cdp]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./tensile_cwp]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_dp_auxk]
    type = MaterialStdVectorAux
    index = 1    # this is the tensile yield function - it should be zero
    property = cdp_plastic_yield_function
    variable = yield_fcn_dp
  [../]
  [./yield_fcn_wp_auxk]
    type = MaterialStdVectorAux
    index = 1    # this is the tensile yield function - it should be zero
    property = cwp_plastic_yield_function
    variable = yield_fcn_wp
  [../]
  [./tensile_cdp]
    type = MaterialStdVectorAux
    index = 1
    property = cdp_plastic_internal_parameter
    variable = tensile_cdp
  [../]
  [./tensile_cwp]
    type = MaterialStdVectorAux
    index = 1
    property = cwp_plastic_internal_parameter
    variable = tensile_cwp
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./i_cdp]
    type = PointValue
    point = '0 0 0'
    variable = tensile_cdp
  [../]
  [./i_cwp]
    type = PointValue
    point = '0 0 0'
    variable = tensile_cwp
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 300
  [../]
  [./cs]
    type = SolidMechanicsHardeningConstant
    value = 1E4
  [../]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 1E4
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 20
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 0
  [../]
  [./dp]
    type = SolidMechanicsPlasticDruckerPrager
    mc_cohesion = mc_coh
    mc_friction_angle = mc_phi
    mc_dilation_angle = mc_psi
    internal_constraint_tolerance = 1 # irrelevant here
    yield_function_tolerance = 1      # irrelevant here
  [../]
  [./wp_coh]
    type = SolidMechanicsHardeningConstant
    value = 1E4
  [../]
  [./wp_tanphi]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
  [./wp_tanpsi]
    type = SolidMechanicsHardeningConstant
    value = 0.1111077
  [../]
  [./wp_t_strength]
    type = SolidMechanicsHardeningConstant
    value = 0
  [../]
  [./wp_c_strength]
    type = SolidMechanicsHardeningConstant
    value = 1E4
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeIsotropicElasticityTensor
    poissons_ratio = 0.2
    youngs_modulus = 1.0
  [../]
  [./ini_stress]
    type = ComputeEigenstrainFromInitialStress
    initial_stress = '1E3 0 0  0 1E3 0  0 0 1E3'
    eigenstrain_name = ini_stress
  [../]
  [./admissible]
    type = ComputeMultipleInelasticStress
    relative_tolerance = 1E4
    absolute_tolerance = 2
    inelastic_models = 'cdp cwp'
    perform_finite_strain_rotations = false
    cycle_models = true
  [../]
  [./cdp]
    type = CappedDruckerPragerStressUpdate
    base_name = cdp
    DP_model = dp
    tensile_strength = ts
    compressive_strength = cs
    yield_function_tol = 1E-5
    tip_smoother = 1E3
    smoothing_tol = 1E3
  [../]
  [./cwp]
    type = CappedWeakPlaneStressUpdate
    base_name = cwp
    cohesion = wp_coh
    tan_friction_angle = wp_tanphi
    tan_dilation_angle = wp_tanpsi
    tensile_strength = wp_t_strength
    compressive_strength = wp_c_strength
    tip_smoother = 1E3
    smoothing_tol = 1E3
    yield_function_tol = 1E-5
  [../]
[]
[Executioner]
  end_time = 2
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = cycled_dp_then_wp
  csv = true
[]
(modules/solid_mechanics/test/tests/tensile/planar6.i)
# A single unit element is stretched by (0.5, 0.4, 0.3)E-6m
# with Lame lambda = 0.6E6 and Lame mu (shear) = 1E6
# stress_xx = 1.72 Pa
# stress_yy = 1.52 Pa
# stress_zz = 1.32 Pa
# tensile_strength is set to 0.5Pa with cubic hardening to 1Pa at intnl=1E-6
#
# The return should be to the tip with, according to mathematica
# sum(plastic_multiplier) = 5.67923989317E-7
# stress_xx = stress_yy = stress_zz = 0.80062961323
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    strain = finite
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0.5E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0.4E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '0.3E-6*z'
  [../]
[]
[AuxVariables]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./f0_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./intnl_auxk]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./f2]
    type = PointValue
    point = '0 0 0'
    variable = f2
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
  [./intnl]
    type = PointValue
    point = '0 0 0'
    variable = intnl
  [../]
[]
[UserObjects]
  [./hard]
    type = SolidMechanicsHardeningCubic
    value_0 = 0.5
    value_residual = 1
    internal_limit = 1E-6
  [../]
  [./tens]
    type = SolidMechanicsPlasticTensileMulti
    tensile_strength = hard
    shift = 1E-6
    yield_function_tolerance = 1E-6
    internal_constraint_tolerance = 1E-5
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0.6E6 1E6'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-5
    plastic_models = tens
    debug_fspb = none
    debug_jac_at_stress = '1 2 3 2 -4 -5 3 -5 10'
    debug_jac_at_pm = '0.1 0.2 0.3'
    debug_jac_at_intnl = 1E-6
    debug_stress_change = 1E-6
    debug_pm_change = '1E-6 1E-6 1E-6'
    debug_intnl_change = 1E-6
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = planar6
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/mean_cap_TC/small_deform4.i)
# apply nonuniform compression in x, y and z directions such that
# trial_stress(0, 0) = 2
# trial_stress(1, 1) = -8
# trial_stress(2, 2) = -10
# With compressive_strength = -1, the algorithm should return to trace(stress) = -1, or
# stress(0, 0) = 7
# stress(1, 1) = -3
# stress(2, 2) = -5
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '1E-7*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '-4E-7*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '-5E-7*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = f
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = f
  [../]
[]
[UserObjects]
  [./tensile_strength]
    type = SolidMechanicsHardeningConstant
    value = 2
  [../]
  [./compressive_strength]
    type = SolidMechanicsHardeningConstant
    value = -1
  [../]
  [./cap]
    type = SolidMechanicsPlasticMeanCapTC
    tensile_strength = tensile_strength
    compressive_strength = compressive_strength
    yield_function_tolerance = 1E-3
    internal_constraint_tolerance = 1E-9
    use_custom_returnMap = true
    use_custom_cto = true
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./strain]
    type = ComputeIncrementalStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mean_cap]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = cap
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform4
  exodus = false
  [./csv]
    type = CSV
  [../]
[]
(modules/solid_mechanics/test/tests/multi/rock1.i)
# Plasticity models:
# Mohr-Coulomb with cohesion = 40MPa, friction angle = 35deg, dilation angle = 10deg
# Tensile with strength = 1MPa
# WeakPlaneShear with cohesion = 1MPa, friction angle = 25deg, dilation angle = 25deg
# WeakPlaneTensile with strength = 0.01MPa
#
# Lame lambda = 1GPa.  Lame mu = 1.3GPa
#
# A line of elements is perturbed randomly, and return to the yield surface at each quadpoint is checked
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1000
  ny = 1234
  nz = 1
  xmin = 0
  xmax = 1000
  ymin = 0
  ymax = 1234
  zmin = 0
  zmax = 1
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[ICs]
  [./x]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_x
  [../]
  [./y]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_y
  [../]
  [./z]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_z
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '0'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f3]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int3]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./f3]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 3
    variable = f3
  [../]
  [./int0]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 0
    variable = int0
  [../]
  [./int1]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 1
    variable = int1
  [../]
  [./int2]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 2
    variable = int2
  [../]
  [./int3]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 3
    variable = int3
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
[]
[Postprocessors]
  [./raw_f0]
    type = ElementExtremeValue
    variable = f0
    outputs = console
  [../]
  [./raw_f1]
    type = ElementExtremeValue
    variable = f1
    outputs = console
  [../]
  [./raw_f2]
    type = ElementExtremeValue
    variable = f2
    outputs = console
  [../]
  [./raw_f3]
    type = ElementExtremeValue
    variable = f3
    outputs = console
  [../]
  [./iter]
    type = ElementExtremeValue
    variable = iter
    outputs = console
  [../]
  [./f0]
    type = FunctionValuePostprocessor
    function = should_be_zero0_fcn
  [../]
  [./f1]
    type = FunctionValuePostprocessor
    function = should_be_zero1_fcn
  [../]
  [./f2]
    type = FunctionValuePostprocessor
    function = should_be_zero2_fcn
  [../]
  [./f3]
    type = FunctionValuePostprocessor
    function = should_be_zero3_fcn
  [../]
[]
[Functions]
  [./should_be_zero0_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-1,0,a)'
    symbol_names = 'a'
    symbol_values = 'raw_f0'
  [../]
  [./should_be_zero1_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-1,0,a)'
    symbol_names = 'a'
    symbol_values = 'raw_f1'
  [../]
  [./should_be_zero2_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-1,0,a)'
    symbol_names = 'a'
    symbol_values = 'raw_f2'
  [../]
  [./should_be_zero3_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-1,0,a)'
    symbol_names = 'a'
    symbol_values = 'raw_f3'
  [../]
[]
[UserObjects]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 4E7
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 35
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 10
    convert_to_radians = true
  [../]
  [./mc]
    type = SolidMechanicsPlasticMohrCoulomb
    cohesion = mc_coh
    friction_angle = mc_phi
    dilation_angle = mc_psi
    mc_tip_smoother = 4E6
    yield_function_tolerance = 1.0E-1
    internal_constraint_tolerance = 1.0E-7
  [../]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./tensile]
    type = SolidMechanicsPlasticTensile
    tensile_strength = ts
    tensile_tip_smoother = 1E5
    yield_function_tolerance = 1.0E-1
    internal_constraint_tolerance = 1.0E-7
  [../]
  [./coh]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./tanphi]
    type = SolidMechanicsHardeningConstant
    value = 0.46630766
  [../]
  [./tanpsi]
    type = SolidMechanicsHardeningConstant
    value = 0.46630766
  [../]
  [./wps]
    type = SolidMechanicsPlasticWeakPlaneShear
    cohesion = coh
    tan_friction_angle = tanphi
    tan_dilation_angle = tanpsi
    smoother = 1E5
    yield_function_tolerance = 1.0E-1
    internal_constraint_tolerance = 1.0E-7
  [../]
  [./str]
    type = SolidMechanicsHardeningConstant
    value = 0.01E6
  [../]
  [./wpt]
    type = SolidMechanicsPlasticWeakPlaneTensile
    tensile_strength = str
    yield_function_tolerance = 1.0E-1
    internal_constraint_tolerance = 1.0E-7
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '1E9 1.3E9'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./multi]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-7
    plastic_models = 'mc tensile wps wpt'
    deactivation_scheme = 'optimized_to_safe_to_dumb'
    max_NR_iterations = 20
    min_stepsize = 1E-4
    max_stepsize_for_dumb = 1E-3
    debug_fspb = crash
    debug_jac_at_stress = '10 0 0 0 10 0 0 0 10'
    debug_jac_at_pm = '1 1 1 1'
    debug_jac_at_intnl = '1 1 1 1'
    debug_stress_change = 1E1
    debug_pm_change = '1E-6 1E-6 1E-6 1E-6'
    debug_intnl_change = '1E-6 1E-6 1E-6 1E-6'
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = rock1
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/multi/two_surface03.i)
# Plasticit models:
# SimpleTester with a = 0 and b = 1 and strength = 1
# SimpleTester with a = 1 and b = 1 and strength = 2
#
# Lame lambda = 0 (Poisson=0).  Lame mu = 0.5E6
#
# A single element is stretched by 3.0E-6m in z directions and 0.5E-6 in y direction.
# trial stress_zz = 3.0 and stress_yy = 0.5
#
# Then both  SimpleTesters should activate initially and return to the "corner" point
# (stress_zz = 1 = stress_yy), but then the plastic multiplier for SimpleTester2 will
# be negative, and so it will be deactivated, and the algorithm will return to
# stress_zz = 1, stress_yy = 0.5
# internal0 should be 2, and internal1 should be 0
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0.5E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '3E-6*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int1]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./int0]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 0
    variable = int0
  [../]
  [./int1]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 1
    variable = int1
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./int0]
    type = PointValue
    point = '0 0 0'
    variable = int0
  [../]
  [./int1]
    type = PointValue
    point = '0 0 0'
    variable = int1
  [../]
[]
[UserObjects]
  [./simple1]
    type = SolidMechanicsPlasticSimpleTester
    a = 0
    b = 1
    strength = 1
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
  [./simple2]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 1
    strength = 2
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 0.5E6'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./multi]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = 'simple1 simple2'
    max_NR_iterations = 2
    min_stepsize = 1
    debug_fspb = crash
    debug_jac_at_stress = '10 0 0 0 10 0 0 0 10'
    debug_jac_at_pm = '1 1'
    debug_jac_at_intnl = '1 1'
    debug_stress_change = 1E-5
    debug_pm_change = '1E-6 1E-6'
    debug_intnl_change = '1E-6 1E-6'
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = two_surface03
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/capped_weak_plane/small_deform5.i)
# Plastic deformation, shear failure
# With Young = 10, poisson=0.25 (Lame lambda=4, mu=4)
# applying the following
# deformation to the zmax surface of a unit cube:
# disp_x = 8*t
# disp_y = 6*t
# disp_z = 5*t/6
# should yield trial stress:
# stress_zz = 10*t
# stress_zx = 32*t
# stress_zy = 24*t (so q_trial = 40*t)
# Use tan(friction_angle) = 0.5 and tan(dilation_angle) = 1/6, and cohesion=20,
# the system should return to p=0, q=20, ie stress_zz=0, stress_xz=16,
# stress_yz=12 on the first time step (t=1)
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz plastic_strain_xx plastic_strain_xy plastic_strain_xz plastic_strain_yy plastic_strain_yz plastic_strain_zz strain_xx strain_xy strain_xz strain_yy strain_yz strain_zz'
  [../]
[]
[BCs]
  [./bottomx]
    type = DirichletBC
    variable = disp_x
    boundary = back
    value = 0.0
  [../]
  [./bottomy]
    type = DirichletBC
    variable = disp_y
    boundary = back
    value = 0.0
  [../]
  [./bottomz]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0.0
  [../]
  [./topx]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = front
    function = 8*t
  [../]
  [./topy]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = front
    function = 6*t
  [../]
  [./topz]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = 5*t/6
  [../]
[]
[AuxVariables]
  [./f_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_compressive]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./ls]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./f_shear]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f_shear
  [../]
  [./f_tensile]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f_tensile
  [../]
  [./f_compressive]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f_compressive
  [../]
  [./intnl_shear]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl_shear
  [../]
  [./intnl_tensile]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 1
    variable = intnl_tensile
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./ls]
    type = MaterialRealAux
    property = plastic_linesearch_needed
    variable = ls
  [../]
[]
[Postprocessors]
  [./stress_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./stress_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./stress_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./stress_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./stress_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./stress_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./strainp_xx]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_xx
  [../]
  [./strainp_xy]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_xy
  [../]
  [./strainp_xz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_xz
  [../]
  [./strainp_yy]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_yy
  [../]
  [./strainp_yz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_yz
  [../]
  [./strainp_zz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_zz
  [../]
  [./straint_xx]
    type = PointValue
    point = '0 0 0'
    variable = strain_xx
  [../]
  [./straint_xy]
    type = PointValue
    point = '0 0 0'
    variable = strain_xy
  [../]
  [./straint_xz]
    type = PointValue
    point = '0 0 0'
    variable = strain_xz
  [../]
  [./straint_yy]
    type = PointValue
    point = '0 0 0'
    variable = strain_yy
  [../]
  [./straint_yz]
    type = PointValue
    point = '0 0 0'
    variable = strain_yz
  [../]
  [./straint_zz]
    type = PointValue
    point = '0 0 0'
    variable = strain_zz
  [../]
  [./f_shear]
    type = PointValue
    point = '0 0 0'
    variable = f_shear
  [../]
  [./f_tensile]
    type = PointValue
    point = '0 0 0'
    variable = f_tensile
  [../]
  [./f_compressive]
    type = PointValue
    point = '0 0 0'
    variable = f_compressive
  [../]
  [./intnl_shear]
    type = PointValue
    point = '0 0 0'
    variable = intnl_shear
  [../]
  [./intnl_tensile]
    type = PointValue
    point = '0 0 0'
    variable = intnl_tensile
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
  [./ls]
    type = PointValue
    point = '0 0 0'
    variable = ls
  [../]
[]
[UserObjects]
  [./coh]
    type = SolidMechanicsHardeningConstant
    value = 20
  [../]
  [./tanphi]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
  [./tanpsi]
    type = SolidMechanicsHardeningConstant
    value = 0.166666666667
  [../]
  [./t_strength]
    type = SolidMechanicsHardeningConstant
    value = 100
  [../]
  [./c_strength]
    type = SolidMechanicsHardeningConstant
    value = 100
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '4 4'
  [../]
  [./admissible]
    type = ComputeMultipleInelasticStress
    inelastic_models = stress
    perform_finite_strain_rotations = false
  [../]
  [./stress]
    type = CappedWeakPlaneStressUpdate
    cohesion = coh
    tan_friction_angle = tanphi
    tan_dilation_angle = tanpsi
    tensile_strength = t_strength
    compressive_strength = c_strength
    tip_smoother = 0
    smoothing_tol = 0
    yield_function_tol = 1E-5
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform5
  csv = true
[]
(modules/solid_mechanics/test/tests/mean_cap_TC/random04.i)
# apply many random large deformations, checking that the algorithm returns correctly to
# the yield surface each time.
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1000
  ny = 125
  nz = 1
  xmin = 0
  xmax = 1000
  ymin = 0
  ymax = 125
  zmin = 0
  zmax = 1
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[ICs]
  [./x]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_x
  [../]
  [./y]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_y
  [../]
  [./z]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_z
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '0'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
[]
[Postprocessors]
  [./max_yield_fcn]
    type = ElementExtremeValue
    variable = yield_fcn
    outputs = 'console'
  [../]
  [./should_be_zero]
    type = FunctionValuePostprocessor
    function = should_be_zero_fcn
  [../]
  [./av_iter]
    type = ElementAverageValue
    variable = iter
    outputs = 'console'
  [../]
[]
[Functions]
  [./should_be_zero_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-3,0,a)'
    symbol_names = 'a'
    symbol_values = 'max_yield_fcn'
  [../]
[]
[UserObjects]
  [./tensile_strength]
    type = SolidMechanicsHardeningCubic
    value_0 = 1
    value_residual = 0.1
    internal_limit = 0.1
  [../]
  [./compressive_strength]
    type = SolidMechanicsHardeningCubic
    value_0 = -1.5
    value_residual = 0
    internal_limit = 0.1
  [../]
  [./cap]
    type = SolidMechanicsPlasticMeanCapTC
    tensile_strength = tensile_strength
    compressive_strength = compressive_strength
    yield_function_tolerance = 1E-3
    internal_constraint_tolerance = 1E-9
    use_custom_returnMap = true
    use_custom_cto = true
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0.7E7 1E7'
  [../]
  [./strain]
    type = ComputeIncrementalStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    max_NR_iterations = 2
    ep_plastic_tolerance = 1E-6
    plastic_models = cap
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = random04
  exodus = false
  [./csv]
    type = CSV
  [../]
[]
(modules/solid_mechanics/test/tests/capped_drucker_prager/random.i)
# capped drucker-prager
# apply many random large deformations, checking that the algorithm returns correctly to
# the yield surface each time.
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1000
  ny = 125
  nz = 1
  xmin = 0
  xmax = 1000
  ymin = 0
  ymax = 125
  zmin = 0
  zmax = 1
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    strain = finite
  [../]
[]
[ICs]
  [./x]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_x
  [../]
  [./y]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_y
  [../]
  [./z]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_z
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '0'
  [../]
[]
[AuxVariables]
  [./shear_yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./tensile_yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./compressive_yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./shear_yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = shear_yield_fcn
  [../]
  [./tensile_fcn_auxk]
    type = MaterialStdVectorAux
    index = 1
    property = plastic_yield_function
    variable = tensile_yield_fcn
  [../]
  [./compressive_yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 2
    property = plastic_yield_function
    variable = compressive_yield_fcn
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
[]
[Postprocessors]
  [./shear_max]
    type = ElementExtremeValue
    variable = shear_yield_fcn
    outputs = 'console'
  [../]
  [./tensile_max]
    type = ElementExtremeValue
    variable = tensile_yield_fcn
    outputs = 'console'
  [../]
  [./compressive_max]
    type = ElementExtremeValue
    variable = compressive_yield_fcn
    outputs = 'console'
  [../]
  [./should_be_zero_shear]
    type = FunctionValuePostprocessor
    function = shear_should_be_zero_fcn
  [../]
  [./should_be_zero_compressive]
    type = FunctionValuePostprocessor
    function = compressive_should_be_zero_fcn
  [../]
  [./should_be_zero_tensile]
    type = FunctionValuePostprocessor
    function = tensile_should_be_zero_fcn
  [../]
  [./av_iter]
    type = ElementAverageValue
    variable = iter
    outputs = 'console'
  [../]
[]
[Functions]
  [./shear_should_be_zero_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-3,0,a)'
    symbol_names = 'a'
    symbol_values = 'shear_max'
  [../]
  [./tensile_should_be_zero_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-3,0,a)'
    symbol_names = 'a'
    symbol_values = 'tensile_max'
  [../]
  [./compressive_should_be_zero_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-3,0,a)'
    symbol_names = 'a'
    symbol_values = 'compressive_max'
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1000
  [../]
  [./cs]
    type = SolidMechanicsHardeningConstant
    value = 1000
  [../]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 1E3
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 30
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 5
    convert_to_radians = true
  [../]
  [./dp]
    type = SolidMechanicsPlasticDruckerPrager
    mc_cohesion = mc_coh
    mc_friction_angle = mc_phi
    mc_dilation_angle = mc_psi
    yield_function_tolerance = 1      # irrelevant here
    internal_constraint_tolerance = 1 # irrelevant here
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0.7E7 1E7'
  [../]
  [./admissible]
    type = ComputeMultipleInelasticStress
    inelastic_models = dp
    perform_finite_strain_rotations = false
  [../]
  [./dp]
    type = CappedDruckerPragerStressUpdate
    DP_model = dp
    tensile_strength = ts
    compressive_strength = cs
    yield_function_tol = 1E-3
    tip_smoother = 0.1E3
    smoothing_tol = 0.1E3
    max_NR_iterations = 1000
    small_dilation = false
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = random
  exodus = false
  [./csv]
    type = CSV
  [../]
[]
(modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform11.i)
# Using CappedMohrCoulomb with compressive failure only
# checking for small deformation
# A single element is stretched by -1E-6m in z direction, and by small amounts in x and y directions
# stress_zz = Youngs Modulus*Strain = -2E6*1E-6 = -2 Pa
# compressive_strength is set to 1Pa
# Then the final stress should return to the yeild surface and the minimum principal stress value should be -1pa.
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '-0.1E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '-0.2E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '-1E-6*z'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1
  [../]
  [./cs]
    type = SolidMechanicsHardeningConstant
    value = 1
  [../]
  [./coh]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./ang]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 2.0E6'
  [../]
  [./tensile]
    type = CappedMohrCoulombStressUpdate
    tensile_strength = ts
    compressive_strength = cs
    cohesion = coh
    friction_angle = ang
    dilation_angle = ang
    smoothing_tol = 0.0
    yield_function_tol = 1.0E-9
  [../]
  [./stress]
    type = ComputeMultipleInelasticStress
    inelastic_models = tensile
    perform_finite_strain_rotations = false
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform11
  csv = true
[]
(modules/solid_mechanics/test/tests/tensile/random_planar.i)
# Plasticity models:
# Planar tensile with strength = 1MPa
#
# Lame lambda = 1GPa.  Lame mu = 1.3GPa
#
# A line of elements is perturbed randomly, and return to the yield surface at each quadpoint is checked
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1000
  ny = 1250
  nz = 1
  xmin = 0
  xmax = 1000
  ymin = 0
  ymax = 1250
  zmin = 0
  zmax = 1
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    strain = finite
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[ICs]
  [./x]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_x
  [../]
  [./y]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_y
  [../]
  [./z]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_z
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '0'
  [../]
[]
[AuxVariables]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./f0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./int0]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 0
    variable = int0
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
[]
[Postprocessors]
  [./tot_iters]
    type = ElementIntegralMaterialProperty
    mat_prop = plastic_NR_iterations
    outputs = console
  [../]
  [./raw_f0]
    type = ElementExtremeValue
    variable = f0
    outputs = console
  [../]
  [./raw_f1]
    type = ElementExtremeValue
    variable = f1
    outputs = console
  [../]
  [./raw_f2]
    type = ElementExtremeValue
    variable = f2
    outputs = console
  [../]
  [./iter]
    type = ElementExtremeValue
    variable = iter
    outputs = console
  [../]
  [./f0]
    type = FunctionValuePostprocessor
    function = should_be_zero0_fcn
  [../]
  [./f1]
    type = FunctionValuePostprocessor
    function = should_be_zero1_fcn
  [../]
  [./f2]
    type = FunctionValuePostprocessor
    function = should_be_zero2_fcn
  [../]
[]
[Functions]
  [./should_be_zero0_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-1,0,a)'
    symbol_names = 'a'
    symbol_values = 'raw_f0'
  [../]
  [./should_be_zero1_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-1,0,a)'
    symbol_names = 'a'
    symbol_values = 'raw_f1'
  [../]
  [./should_be_zero2_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-1,0,a)'
    symbol_names = 'a'
    symbol_values = 'raw_f2'
  [../]
[]
[UserObjects]
  [./hard]
    type = SolidMechanicsHardeningCubic
    value_0 = 1E6
    value_residual = 0
    internal_limit = 1
  [../]
  [./tensile]
    type = SolidMechanicsPlasticTensileMulti
    tensile_strength = hard
    yield_function_tolerance = 1.0E-1
    shift = 1.0E-1
    internal_constraint_tolerance = 1.0E-7
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '1E9 1.3E9'
  [../]
  [./multi]
    type = ComputeMultiPlasticityStress
    block = 0
    deactivation_scheme = 'safe_to_dumb'
    ep_plastic_tolerance = 1E-7
    plastic_models = 'tensile'
    max_NR_iterations = 5
    min_stepsize = 1E-3
    max_stepsize_for_dumb = 1
    debug_fspb = crash
    debug_jac_at_stress = '10 0 0 0 10 0 0 0 10'
    debug_jac_at_pm = '1 1 1'
    debug_jac_at_intnl = '1 1 1'
    debug_stress_change = 1E1
    debug_pm_change = '1E-6 1E-6 1E-6'
    debug_intnl_change = '1E-6 1E-6 1E-6'
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = random_planar
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/porous_flow/test/tests/infiltration_and_drainage/rd01.i)
[Mesh]
  type = GeneratedMesh
  dim = 2
  nx = 120
  ny = 1
  xmin = 0
  xmax = 6
  ymin = 0
  ymax = 0.05
[]
[GlobalParams]
  PorousFlowDictator = dictator
[]
[Functions]
  [dts]
    type = PiecewiseLinear
    y = '1E-2 1 10 500 5000 5000'
    x = '0 10 100 1000 10000 100000'
  []
[]
[UserObjects]
  [dictator]
    type = PorousFlowDictator
    porous_flow_vars = pressure
    number_fluid_phases = 1
    number_fluid_components = 1
  []
  [pc]
    type = PorousFlowCapillaryPressureVG
    m = 0.336
    alpha = 1.43e-4
  []
[]
[FluidProperties]
  [simple_fluid]
    type = SimpleFluidProperties
    bulk_modulus = 2e7
    viscosity = 1.01e-3
    density0 = 1000
    thermal_expansion = 0
  []
[]
[Materials]
  [massfrac]
    type = PorousFlowMassFraction
  []
  [temperature]
    type = PorousFlowTemperature
  []
  [simple_fluid]
    type = PorousFlowSingleComponentFluid
    fp = simple_fluid
    phase = 0
  []
  [ppss]
    type = PorousFlow1PhaseP
    porepressure = pressure
    capillary_pressure = pc
  []
  [relperm]
    type = PorousFlowRelativePermeabilityVG
    m = 0.336
    seff_turnover = 0.99
    phase = 0
  []
  [porosity]
    type = PorousFlowPorosityConst
    porosity = 0.33
  []
  [permeability]
    type = PorousFlowPermeabilityConst
    permeability = '0.295E-12 0 0  0 0.295E-12 0  0 0 0.295E-12'
  []
[]
[Variables]
  [pressure]
    initial_condition = -72620.4
  []
[]
[Kernels]
  [mass0]
    type = PorousFlowMassTimeDerivative
    fluid_component = 0
    variable = pressure
  []
  [flux0]
    type = PorousFlowAdvectiveFlux
    fluid_component = 0
    variable = pressure
    gravity = '-10 0 0'
  []
[]
[AuxVariables]
  [SWater]
    family = MONOMIAL
    order = CONSTANT
  []
[]
[AuxKernels]
  [SWater]
    type = MaterialStdVectorAux
    property = PorousFlow_saturation_qp
    index = 0
    variable = SWater
  []
[]
[BCs]
  [base]
    type = PorousFlowSink
    boundary = right
    flux_function = -2.315E-3
    variable = pressure
  []
[]
[Preconditioning]
  [andy]
    type = SMP
    full = true
    petsc_options = '-snes_converged_reason -ksp_diagonal_scale -ksp_diagonal_scale_fix -ksp_gmres_modifiedgramschmidt -snes_linesearch_monitor'
    petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap -snes_atol -snes_rtol -snes_max_it'
    petsc_options_value = 'gmres      asm      lu           NONZERO                   2               1E-10      1E-10      10'
  []
[]
[VectorPostprocessors]
  [swater]
    type = LineValueSampler
    warn_discontinuous_face_values = false
    variable = SWater
    start_point = '0 0 0'
    end_point = '6 0 0'
    sort_by = x
    num_points = 121
    execute_on = timestep_end
  []
[]
[Executioner]
  type = Transient
  solve_type = Newton
  petsc_options = '-snes_converged_reason'
  end_time = 359424
  [TimeStepper]
    type = FunctionDT
    function = dts
  []
[]
[Outputs]
  file_base = rd01
  [exodus]
    type = Exodus
    execute_on = 'initial final'
  []
  [along_line]
    type = CSV
    execute_on = final
  []
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/user_object_based/prop_block_read.i)
[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    ymin = 0
    xmax = 1
    ymax = 1
    nx = 2
    ny = 2
    elem_type = QUAD4
  []
  [./subdomain_id]
    input = gen
    type = SubdomainPerElementGenerator
    subdomain_ids = '0 1
                     0 1'
  [../]
  displacements = 'disp_x disp_y'
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
[]
[GlobalParams]
  volumetric_locking_correction = true
[]
[AuxVariables]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./e_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./fp_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./gss]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./euler1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./euler2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./euler3]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[Functions]
  [./tdisp]
    type = ParsedFunction
    expression = 0.01*t
  [../]
[]
[UserObjects]
  [./prop_read]
    type = PropertyReadFile
    prop_file_name = 'euler_ang_file.txt'
    # Enter file data as prop#1, prop#2, .., prop#nprop
    nprop = 3
    read_type = block
    nblock= 2
  [../]
[]
[AuxKernels]
  [./stress_yy]
    type = RankTwoAux
    variable = stress_yy
    rank_two_tensor = stress
    index_j = 1
    index_i = 1
    execute_on = timestep_end
  [../]
  [./e_yy]
    type = RankTwoAux
    variable = e_yy
    rank_two_tensor = lage
    index_j = 1
    index_i = 1
    execute_on = timestep_end
  [../]
  [./fp_yy]
    type = RankTwoAux
    variable = fp_yy
    rank_two_tensor = fp
    index_j = 1
    index_i = 1
    execute_on = timestep_end
  [../]
  [./gss]
    type = MaterialStdVectorAux
    variable = gss
    property = state_var_gss
    index = 0
    execute_on = timestep_end
  [../]
  [./euler1]
    type = MaterialRealVectorValueAux
    variable = euler1
    property = Euler_angles
    component = 0
    execute_on = timestep_end
  [../]
  [./euler2]
    type = MaterialRealVectorValueAux
    variable = euler2
    property = Euler_angles
    component = 1
    execute_on = timestep_end
  [../]
  [./euler3]
    type = MaterialRealVectorValueAux
    variable = euler3
    property = Euler_angles
    component = 2
    execute_on = timestep_end
  [../]
[]
[BCs]
  [./fix_x]
    type = DirichletBC
    variable = disp_x
    boundary = 'left'
    value = 0
  [../]
  [./fix_y]
    type = DirichletBC
    variable = disp_y
    boundary = 'bottom'
    value = 0
  [../]
  [./tdisp]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = top
    function = tdisp
  [../]
[]
[UserObjects]
  [./slip_rate_gss]
    type = CrystalPlasticitySlipRateGSS
    variable_size = 12
    slip_sys_file_name = input_slip_sys.txt
    num_slip_sys_flowrate_props = 2
    flowprops = '1 4 0.001 0.1 5 8 0.001 0.1 9 12 0.001 0.1'
    uo_state_var_name = state_var_gss
  [../]
  [./slip_resistance_gss]
    type = CrystalPlasticitySlipResistanceGSS
    variable_size = 12
    uo_state_var_name = state_var_gss
  [../]
  [./state_var_gss]
    type = CrystalPlasticityStateVariable
    variable_size = 12
    groups = '0 4 8 12'
    group_values = '60.8 60.8 60.8'
    uo_state_var_evol_rate_comp_name = state_var_evol_rate_comp_gss
    scale_factor = 1.0
  [../]
  [./state_var_evol_rate_comp_gss]
    type = CrystalPlasticityStateVarRateComponentGSS
    variable_size = 12
    hprops = '1.0 541.5 109.8 2.5'
    uo_slip_rate_name = slip_rate_gss
    uo_state_var_name = state_var_gss
  [../]
[]
[Materials]
  [./crysp]
    type = FiniteStrainUObasedCP
    stol = 1e-2
    tan_mod_type = exact
    uo_slip_rates = 'slip_rate_gss'
    uo_slip_resistances = 'slip_resistance_gss'
    uo_state_vars = 'state_var_gss'
    uo_state_var_evol_rate_comps = 'state_var_evol_rate_comp_gss'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    displacements = 'disp_x disp_y'
  [../]
  [./elasticity_tensor]
    type = ComputeElasticityTensorCP
    C_ijkl = '1.684e5 1.214e5 1.214e5 1.684e5 1.214e5 1.684e5 0.754e5 0.754e5 0.754e5'
    fill_method = symmetric9
    read_prop_user_object = prop_read
  [../]
[]
[Postprocessors]
  [./stress_yy]
    type = ElementAverageValue
    variable = stress_yy
  [../]
  [./e_yy]
    type = ElementAverageValue
    variable = e_yy
  [../]
  [./fp_yy]
    type = ElementAverageValue
    variable = fp_yy
  [../]
  [./gss]
    type = ElementAverageValue
    variable = gss
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  dt = 0.01
  solve_type = 'PJFNK'
  petsc_options_iname = -pc_hypre_type
  petsc_options_value = boomerang
  nl_abs_tol = 1e-10
  nl_rel_step_tol = 1e-10
  dtmax = 10.0
  nl_rel_tol = 1e-10
  end_time = 1
  dtmin = 0.01
  num_steps = 10
  nl_abs_step_tol = 1e-10
[]
[Outputs]
  exodus = true
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y'
    use_displaced_mesh = true
  [../]
[]
(modules/solid_mechanics/test/tests/multi/three_surface08.i)
# Plasticit models:
# SimpleTester0 with a = 0 and b = 1 and strength = 1
# SimpleTester1 with a = 1 and b = 0 and strength = 1
# SimpleTester2 with a = 1 and b = 1 and strength = 1.5
#
# Lame lambda = 0 (Poisson=0).  Lame mu = 0.5E6
#
# A single element is stretched by 2.0E-6m in y direction and 0.5E-6 in z direction.
# trial stress_yy = 2.0 and stress_zz = 0.5
#
# Then SimpleTester1 and SimpleTester2 should activate and the algorithm will return to
# the corner stress_yy=1.0, stress_zz=0.5
# internal1 should be 1.0, and internal2 should be 0
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '2.0E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '0.5E-6*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int2]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./int0]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 0
    variable = int0
  [../]
  [./int1]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 1
    variable = int1
  [../]
  [./int2]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 2
    variable = int2
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./f2]
    type = PointValue
    point = '0 0 0'
    variable = f2
  [../]
  [./int0]
    type = PointValue
    point = '0 0 0'
    variable = int0
  [../]
  [./int1]
    type = PointValue
    point = '0 0 0'
    variable = int1
  [../]
  [./int2]
    type = PointValue
    point = '0 0 0'
    variable = int2
  [../]
[]
[UserObjects]
  [./simple0]
    type = SolidMechanicsPlasticSimpleTester
    a = 0
    b = 1
    strength = 1
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
  [./simple1]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 0
    strength = 1
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
  [./simple2]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 1
    strength = 1.5
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 0.5E6'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./multi]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = 'simple0 simple1 simple2'
    max_NR_iterations = 2
    min_stepsize = 1
    debug_fspb = crash
    debug_jac_at_stress = '10 0 0 0 10 0 0 0 10'
    debug_jac_at_pm = '1 1'
    debug_jac_at_intnl = '1 1'
    debug_stress_change = 1E-5
    debug_pm_change = '1E-6 1E-6'
    debug_intnl_change = '1E-6 1E-6'
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = three_surface08
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/examples/coal_mining/fine.i)
# Strata deformation and fracturing around a coal mine - 3D model
#
# A "half model" is used.  The mine is 400m deep and
# just the roof is studied (-400<=z<=0).  The mining panel
# sits between 0<=x<=150, and 0<=y<=1000, so this simulates
# a coal panel that is 300m wide and 1000m long.  The outer boundaries
# are 1km from the excavation boundaries.
#
# Time is meaningless in this example
# as quasi-static solutions are sought at each timestep, but
# the number of timesteps controls the resolution of the
# process.
#
# The boundary conditions for this simulation are:
#  - disp_x = 0 at x=0 and x=1150
#  - disp_y = 0 at y=-1000 and y=1000
#  - disp_z = 0 at z=-400, but there is a time-dependent
#               Young's modulus that simulates excavation
#  - wc_x = 0 at y=-1000 and y=1000
#  - wc_y = 0 at x=0 and x=1150
# That is, rollers on the sides, free at top,
# and prescribed at bottom in the unexcavated portion.
#
# The small strain formulation is used.
#
# All stresses are measured in MPa.  The initial stress is consistent with
# the weight force from density 2500 kg/m^3, ie, stress_zz = 0.025*z MPa
# where gravity = 10 m.s^-2 = 1E-5 MPa m^2/kg.  The maximum and minimum
# principal horizontal stresses are assumed to be equal to 0.8*stress_zz.
#
# Material properties:
# Young's modulus = 8 GPa
# Poisson's ratio = 0.25
# Cosserat layer thickness = 1 m
# Cosserat-joint normal stiffness = large
# Cosserat-joint shear stiffness = 1 GPa
# MC cohesion = 3 MPa
# MC friction angle = 37 deg
# MC dilation angle = 8 deg
# MC tensile strength = 1 MPa
# MC compressive strength = 100 MPa
# WeakPlane cohesion = 0.1 MPa
# WeakPlane friction angle = 30 deg
# WeakPlane dilation angle = 10 deg
# WeakPlane tensile strength = 0.1 MPa
# WeakPlane compressive strength = 100 MPa softening to 1 MPa at strain = 1
#
[Mesh]
  [file]
    type = FileMeshGenerator
    file = mesh/fine.e
  []
  [./xmin]
    input = file
    type = SideSetsAroundSubdomainGenerator
    block = '2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30'
    new_boundary = xmin
    normal = '-1 0 0'
  [../]
  [./xmax]
    input = xmin
    type = SideSetsAroundSubdomainGenerator
    block = '2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30'
    new_boundary = xmax
    normal = '1 0 0'
  [../]
  [./ymin]
    input = xmax
    type = SideSetsAroundSubdomainGenerator
    block = '2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30'
    new_boundary = ymin
    normal = '0 -1 0'
  [../]
  [./ymax]
    input = ymin
    type = SideSetsAroundSubdomainGenerator
    block = '2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30'
    new_boundary = ymax
    normal = '0 1 0'
  [../]
  [./zmax]
    input = ymax
    type = SideSetsAroundSubdomainGenerator
    block = 30
    new_boundary = zmax
    normal = '0 0 1'
  [../]
  [./zmin]
    input = zmax
    type = SideSetsAroundSubdomainGenerator
    block = 2
    new_boundary = zmin
    normal = '0 0 -1'
  [../]
  [./excav]
    type = SubdomainBoundingBoxGenerator
    input = zmin
    block_id = 1
    bottom_left = '0 0 -400'
    top_right = '150 1000 -397'
  [../]
  [./roof]
    type = SideSetsAroundSubdomainGenerator
    block = 1
    input = excav
    new_boundary = roof
    normal = '0 0 1'
  [../]
[]
[GlobalParams]
  perform_finite_strain_rotations = false
  displacements = 'disp_x disp_y disp_z'
  Cosserat_rotations = 'wc_x wc_y wc_z'
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
  [./wc_x]
  [../]
  [./wc_y]
  [../]
[]
[Kernels]
  [./cx_elastic]
    type = CosseratStressDivergenceTensors
    use_displaced_mesh = false
    variable = disp_x
    component = 0
  [../]
  [./cy_elastic]
    type = CosseratStressDivergenceTensors
    use_displaced_mesh = false
    variable = disp_y
    component = 1
  [../]
  [./cz_elastic]
    type = CosseratStressDivergenceTensors
    use_displaced_mesh = false
    variable = disp_z
    component = 2
  [../]
  [./x_couple]
    type = StressDivergenceTensors
    use_displaced_mesh = false
    variable = wc_x
    displacements = 'wc_x wc_y wc_z'
    component = 0
    base_name = couple
  [../]
  [./y_couple]
    type = StressDivergenceTensors
    use_displaced_mesh = false
    variable = wc_y
    displacements = 'wc_x wc_y wc_z'
    component = 1
    base_name = couple
  [../]
  [./x_moment]
    type = MomentBalancing
    use_displaced_mesh = false
    variable = wc_x
    component = 0
  [../]
  [./y_moment]
    type = MomentBalancing
    use_displaced_mesh = false
    variable = wc_y
    component = 1
  [../]
  [./gravity]
    type = Gravity
    use_displaced_mesh = false
    variable = disp_z
    value = -10E-6 # remember this is in MPa
  [../]
[]
[AuxVariables]
  [./wc_z]
  [../]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./wp_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./wp_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./wp_shear_f]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./wp_tensile_f]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_shear_f]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_tensile_f]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yx
    index_i = 1
    index_j = 0
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zx
    index_i = 2
    index_j = 0
  [../]
  [./stress_zy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zy
    index_i = 2
    index_j = 1
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./mc_shear]
    type = MaterialStdVectorAux
    index = 0
    property = mc_plastic_internal_parameter
    variable = mc_shear
  [../]
  [./mc_tensile]
    type = MaterialStdVectorAux
    index = 1
    property = mc_plastic_internal_parameter
    variable = mc_tensile
  [../]
  [./wp_shear]
    type = MaterialStdVectorAux
    index = 0
    property = wp_plastic_internal_parameter
    variable = wp_shear
  [../]
  [./wp_tensile]
    type = MaterialStdVectorAux
    index = 1
    property = wp_plastic_internal_parameter
    variable = wp_tensile
  [../]
  [./mc_shear_f]
    type = MaterialStdVectorAux
    index = 6
    property = mc_plastic_yield_function
    variable = mc_shear_f
  [../]
  [./mc_tensile_f]
    type = MaterialStdVectorAux
    index = 0
    property = mc_plastic_yield_function
    variable = mc_tensile_f
  [../]
  [./wp_shear_f]
    type = MaterialStdVectorAux
    index = 0
    property = wp_plastic_yield_function
    variable = wp_shear_f
  [../]
  [./wp_tensile_f]
    type = MaterialStdVectorAux
    index = 1
    property = wp_plastic_yield_function
    variable = wp_tensile_f
  [../]
[]
[BCs]
  [./no_x]
    type = DirichletBC
    variable = disp_x
    boundary = 'xmin xmax'
    value = 0.0
  [../]
  [./no_y]
    type = DirichletBC
    variable = disp_y
    boundary = 'ymin ymax'
    value = 0.0
  [../]
  [./no_z]
    type = DirichletBC
    variable = disp_z
    boundary = zmin
    value = 0.0
  [../]
  [./no_wc_x]
    type = DirichletBC
    variable = wc_x
    boundary = 'ymin ymax'
    value = 0.0
  [../]
  [./no_wc_y]
    type = DirichletBC
    variable = wc_y
    boundary = 'xmin xmax'
    value = 0.0
  [../]
  [./roof]
    type = StickyBC
    variable = disp_z
    min_value = -3.0
    boundary = roof
  [../]
[]
[Functions]
  [./ini_xx]
    type = ParsedFunction
    expression = '0.8*2500*10E-6*z'
  [../]
  [./ini_zz]
    type = ParsedFunction
    expression = '2500*10E-6*z'
  [../]
  [./excav_sideways]
    type = ParsedFunction
    symbol_names = 'end_t ymin ymax  minval maxval slope'
    symbol_values = '100.0   0    1000.0 1E-9 1 10'
    # excavation face at ymin+(ymax-ymin)*min(t/end_t,1)
    # slope is the distance over which the modulus reduces from maxval to minval
    expression = 'if(y<ymin+(ymax-ymin)*min(t/end_t,1),minval,if(y<ymin+(ymax-ymin)*min(t/end_t,1)+slope,minval+(maxval-minval)*(y-(ymin+(ymax-ymin)*min(t/end_t,1)))/slope,maxval))'
  [../]
  [./density_sideways]
    type = ParsedFunction
    symbol_names = 'end_t ymin ymax  minval maxval'
    symbol_values = '100.0   0    1000.0 0 2500'
    expression = 'if(y<ymin+(ymax-ymin)*min(t/end_t,1),minval,maxval)'
  [../]
[]
[UserObjects]
  [./mc_coh_strong_harden]
    type = SolidMechanicsHardeningExponential
    value_0 = 2.99 # MPa
    value_residual = 3.01 # MPa
    rate = 1.0
  [../]
  [./mc_fric]
    type = SolidMechanicsHardeningConstant
    value = 0.65 # 37deg
  [../]
  [./mc_dil]
    type = SolidMechanicsHardeningConstant
    value = 0.15 # 8deg
  [../]
  [./mc_tensile_str_strong_harden]
    type = SolidMechanicsHardeningExponential
    value_0 = 1.0 # MPa
    value_residual = 1.0 # MPa
    rate = 1.0
  [../]
  [./mc_compressive_str]
    type = SolidMechanicsHardeningCubic
    value_0 = 100 # Large!
    value_residual = 100
    internal_limit = 0.1
  [../]
  [./wp_coh_harden]
    type = SolidMechanicsHardeningCubic
    value_0 = 0.1
    value_residual = 0.1
    internal_limit = 10
  [../]
  [./wp_tan_fric]
    type = SolidMechanicsHardeningConstant
    value = 0.36 # 20deg
  [../]
  [./wp_tan_dil]
    type = SolidMechanicsHardeningConstant
    value = 0.18 # 10deg
  [../]
  [./wp_tensile_str_harden]
    type = SolidMechanicsHardeningCubic
    value_0 = 0.1
    value_residual = 0.1
    internal_limit = 10
  [../]
  [./wp_compressive_str_soften]
    type = SolidMechanicsHardeningCubic
    value_0 = 100
    value_residual = 1
    internal_limit = 1.0
  [../]
[]
[Materials]
  [./elasticity_tensor_0]
    type = ComputeLayeredCosseratElasticityTensor
    block = '2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30'
    young = 8E3 # MPa
    poisson = 0.25
    layer_thickness = 1.0
    joint_normal_stiffness = 1E9 # huge
    joint_shear_stiffness = 1E3 # MPa
  [../]
  [./elasticity_tensor_1]
    type = ComputeLayeredCosseratElasticityTensor
    block = 1
    young = 8E3 # MPa
    poisson = 0.25
    layer_thickness = 1.0
    joint_normal_stiffness = 1E9 # huge
    joint_shear_stiffness = 1E3 # MPa
    elasticity_tensor_prefactor = excav_sideways
  [../]
  [./strain]
    type = ComputeCosseratIncrementalSmallStrain
    eigenstrain_names = ini_stress
  [../]
  [./ini_stress]
    type = ComputeEigenstrainFromInitialStress
    eigenstrain_name = ini_stress
    initial_stress = 'ini_xx 0 0  0 ini_xx 0  0 0 ini_zz'
  [../]
  [./stress_0]
    type = ComputeMultipleInelasticCosseratStress
    block = '2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30'
    inelastic_models = 'mc wp'
    cycle_models = true
    relative_tolerance = 2.0
    absolute_tolerance = 1E6
    max_iterations = 1
    tangent_operator = nonlinear
    perform_finite_strain_rotations = false
  [../]
  [./stress_1]
    type = ComputeMultipleInelasticCosseratStress
    block = 1
    inelastic_models = ''
    relative_tolerance = 2.0
    absolute_tolerance = 1E6
    max_iterations = 1
    tangent_operator = nonlinear
    perform_finite_strain_rotations = false
  [../]
  [./mc]
    type = CappedMohrCoulombCosseratStressUpdate
    warn_about_precision_loss = false
    host_youngs_modulus = 8E3
    host_poissons_ratio = 0.25
    base_name = mc
    tensile_strength = mc_tensile_str_strong_harden
    compressive_strength = mc_compressive_str
    cohesion = mc_coh_strong_harden
    friction_angle = mc_fric
    dilation_angle = mc_dil
    max_NR_iterations = 100000
    smoothing_tol = 0.1 # MPa  # Must be linked to cohesion
    yield_function_tol = 1E-9 # MPa.  this is essentially the lowest possible without lots of precision loss
    perfect_guess = true
    min_step_size = 1.0
  [../]
  [./wp]
    type = CappedWeakPlaneCosseratStressUpdate
    warn_about_precision_loss = false
    base_name = wp
    cohesion = wp_coh_harden
    tan_friction_angle = wp_tan_fric
    tan_dilation_angle = wp_tan_dil
    tensile_strength = wp_tensile_str_harden
    compressive_strength = wp_compressive_str_soften
    max_NR_iterations = 10000
    tip_smoother = 0.1
    smoothing_tol = 0.1 # MPa  # Note, this must be tied to cohesion, otherwise get no possible return at cone apex
    yield_function_tol = 1E-11 # MPa.  this is essentially the lowest possible without lots of precision loss
    perfect_guess = true
    min_step_size = 1.0E-3
  [../]
  [./density_0]
    type = GenericConstantMaterial
    block = '2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30'
    prop_names = density
    prop_values = 2500
  [../]
  [./density_1]
    type = GenericFunctionMaterial
    block = 1
    prop_names = density
    prop_values = density_sideways
  [../]
[]
[Preconditioning]
  [./SMP]
    type = SMP
    full = true
  []
[]
[Postprocessors]
  [./min_roof_disp]
    type = NodalExtremeValue
    boundary = roof
    value_type = min
    variable = disp_z
  [../]
  [./min_surface_disp]
    type = NodalExtremeValue
    boundary = zmax
    value_type = min
    variable = disp_z
  [../]
[]
[Executioner]
  type = Transient
  solve_type = 'NEWTON'
  petsc_options = '-snes_converged_reason'
  petsc_options_iname = '-pc_type -ksp_type -ksp_gmres_restart'
  petsc_options_value = ' bjacobi  gmres     200'
  line_search = bt
  nl_abs_tol = 1e-3
  nl_rel_tol = 1e-5
  l_max_its = 30
  nl_max_its = 1000
  start_time = 0.0
  dt = 0.5
  end_time = 100.0
[]
[Outputs]
  time_step_interval = 1
  print_linear_residuals = false
  exodus = true
  csv = true
  console = true
[]
(modules/solid_mechanics/test/tests/capped_weak_plane/small_deform_inclined2.i)
# Plastic deformation, tensile failure, with normal=(1,0,0)
# With Lame lambda=0 and Lame mu=1, applying the following
# deformation to the zmax surface of a unit cube:
# disp_x = t
# should yield trial stress:
# stress_xx = 2*t
# Use tensile strength = 1, we should return to stress_xx = 1
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz plastic_strain_xx plastic_strain_xy plastic_strain_xz plastic_strain_yy plastic_strain_yz plastic_strain_zz strain_xx strain_xy strain_xz strain_yy strain_yz strain_zz'
  [../]
[]
[BCs]
  [./bottomx]
    type = DirichletBC
    variable = disp_x
    boundary = left
    value = 0.0
  [../]
  [./bottomy]
    type = DirichletBC
    variable = disp_y
    boundary = left
    value = 0.0
  [../]
  [./bottomz]
    type = DirichletBC
    variable = disp_z
    boundary = left
    value = 0.0
  [../]
  [./topx]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = right
    function = t
  [../]
  [./topy]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = right
    function = 0
  [../]
  [./topz]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = right
    function = 0
  [../]
[]
[AuxVariables]
  [./f_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_compressive]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./ls]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./f_shear]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f_shear
  [../]
  [./f_tensile]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f_tensile
  [../]
  [./f_compressive]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f_compressive
  [../]
  [./intnl_shear]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl_shear
  [../]
  [./intnl_tensile]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 1
    variable = intnl_tensile
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./ls]
    type = MaterialRealAux
    property = plastic_linesearch_needed
    variable = ls
  [../]
[]
[Postprocessors]
  [./stress_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./stress_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./stress_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./stress_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./stress_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./stress_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./strainp_xx]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_xx
  [../]
  [./strainp_xy]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_xy
  [../]
  [./strainp_xz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_xz
  [../]
  [./strainp_yy]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_yy
  [../]
  [./strainp_yz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_yz
  [../]
  [./strainp_zz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_zz
  [../]
  [./straint_xx]
    type = PointValue
    point = '0 0 0'
    variable = strain_xx
  [../]
  [./straint_xy]
    type = PointValue
    point = '0 0 0'
    variable = strain_xy
  [../]
  [./straint_xz]
    type = PointValue
    point = '0 0 0'
    variable = strain_xz
  [../]
  [./straint_yy]
    type = PointValue
    point = '0 0 0'
    variable = strain_yy
  [../]
  [./straint_yz]
    type = PointValue
    point = '0 0 0'
    variable = strain_yz
  [../]
  [./straint_zz]
    type = PointValue
    point = '0 0 0'
    variable = strain_zz
  [../]
  [./f_shear]
    type = PointValue
    point = '0 0 0'
    variable = f_shear
  [../]
  [./f_tensile]
    type = PointValue
    point = '0 0 0'
    variable = f_tensile
  [../]
  [./f_compressive]
    type = PointValue
    point = '0 0 0'
    variable = f_compressive
  [../]
  [./intnl_shear]
    type = PointValue
    point = '0 0 0'
    variable = intnl_shear
  [../]
  [./intnl_tensile]
    type = PointValue
    point = '0 0 0'
    variable = intnl_tensile
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
  [./ls]
    type = PointValue
    point = '0 0 0'
    variable = ls
  [../]
[]
[UserObjects]
  [./coh]
    type = SolidMechanicsHardeningConstant
    value = 30
  [../]
  [./tanphi]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
  [./tanpsi]
    type = SolidMechanicsHardeningConstant
    value = 0.1111077
  [../]
  [./t_strength]
    type = SolidMechanicsHardeningConstant
    value = 1
  [../]
  [./c_strength]
    type = SolidMechanicsHardeningConstant
    value = 40
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '0 1'
  [../]
  [./admissible]
    type = ComputeMultipleInelasticStress
    inelastic_models = stress
    perform_finite_strain_rotations = false
  [../]
  [./stress]
    type = CappedWeakInclinedPlaneStressUpdate
    normal_vector = '1 0 0'
    cohesion = coh
    tan_friction_angle = tanphi
    tan_dilation_angle = tanpsi
    tensile_strength = t_strength
    compressive_strength = c_strength
    tip_smoother = 0
    smoothing_tol = 0
    yield_function_tol = 1E-5
  [../]
[]
[Executioner]
  end_time = 2
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform_inclined2
  csv = true
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/hcp_twinning/modified_kalidindi_for_hcp.i)
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
  [single_xtal]
    type = GeneratedMeshGenerator
    dim = 3
    nx = 2
    ny = 2
    nz = 2
    elem_type = HEX8
  []
[]
[AuxVariables]
  [temperature]
    initial_condition = 300
  []
  [pk2]
    order = CONSTANT
    family = MONOMIAL
  []
  [fp_xx]
    order = CONSTANT
    family = MONOMIAL
  []
  [fp_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [e_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [total_twin_volume_fraction]
    order = CONSTANT
    family = MONOMIAL
  []
  [twin_volume_fraction_0]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_1]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_2]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_3]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_4]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_5]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_increment_0]
    order = CONSTANT
    family = MONOMIAL
  []
  [twin_increment_1]
    order = CONSTANT
    family = MONOMIAL
  []
  [twin_increment_2]
    order = CONSTANT
    family = MONOMIAL
  []
  [twin_increment_3]
    order = CONSTANT
    family = MONOMIAL
  []
  [twin_increment_4]
    order = CONSTANT
    family = MONOMIAL
  []
  [twin_increment_5]
    order = CONSTANT
    family = MONOMIAL
  []
  [twin_resistance_0]
    order = CONSTANT
    family = MONOMIAL
  []
  [twin_resistance_1]
    order = CONSTANT
    family = MONOMIAL
  []
  [twin_resistance_2]
    order = CONSTANT
    family = MONOMIAL
  []
  [twin_resistance_3]
    order = CONSTANT
    family = MONOMIAL
  []
  [twin_resistance_4]
    order = CONSTANT
    family = MONOMIAL
  []
  [twin_resistance_5]
    order = CONSTANT
    family = MONOMIAL
  []
  [resolved_twin_stress_0]
    order = CONSTANT
    family = MONOMIAL
  []
  [resolved_twin_stress_1]
    order = CONSTANT
    family = MONOMIAL
  []
  [resolved_twin_stress_2]
    order = CONSTANT
    family = MONOMIAL
  []
  [resolved_twin_stress_3]
    order = CONSTANT
    family = MONOMIAL
  []
  [resolved_twin_stress_4]
    order = CONSTANT
    family = MONOMIAL
  []
  [resolved_twin_stress_5]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  add_variables = true
  generate_output = stress_zz
[]
[AuxKernels]
  [pk2]
    type = RankTwoAux
    variable = pk2
    rank_two_tensor = second_piola_kirchhoff_stress
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [fp_xx]
    type = RankTwoAux
    variable = fp_xx
    rank_two_tensor = plastic_deformation_gradient
    index_j = 0
    index_i = 0
    execute_on = timestep_end
  []
  [fp_zz]
    type = RankTwoAux
    variable = fp_zz
    rank_two_tensor = plastic_deformation_gradient
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [e_zz]
    type = RankTwoAux
    variable = e_zz
    rank_two_tensor = total_lagrangian_strain
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [total_twin_volume_fraction]
    type = MaterialRealAux
    variable = total_twin_volume_fraction
    property = twin_total_volume_fraction_twins
    execute_on = timestep_end
  []
  [twin_volume_fraction_0]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_0
   property = twin_twin_system_volume_fraction
   index = 0
   execute_on = timestep_end
  []
  [twin_volume_fraction_1]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_1
   property = twin_twin_system_volume_fraction
   index = 1
   execute_on = timestep_end
  []
  [twin_volume_fraction_2]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_2
   property = twin_twin_system_volume_fraction
   index = 2
   execute_on = timestep_end
  []
  [twin_volume_fraction_3]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_3
   property = twin_twin_system_volume_fraction
   index = 3
   execute_on = timestep_end
  []
  [twin_volume_fraction_4]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_4
   property = twin_twin_system_volume_fraction
   index = 4
   execute_on = timestep_end
  []
  [twin_volume_fraction_5]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_5
   property = twin_twin_system_volume_fraction
   index = 5
   execute_on = timestep_end
  []
  [twin_resistance_0]
    type = MaterialStdVectorAux
    variable = twin_resistance_0
    property = twin_slip_resistance
    index = 0
    execute_on = timestep_end
  []
  [twin_resistance_1]
    type = MaterialStdVectorAux
    variable = twin_resistance_1
    property = twin_slip_resistance
    index = 1
    execute_on = timestep_end
  []
  [twin_resistance_2]
    type = MaterialStdVectorAux
    variable = twin_resistance_2
    property = twin_slip_resistance
    index = 2
    execute_on = timestep_end
  []
  [twin_resistance_3]
    type = MaterialStdVectorAux
    variable = twin_resistance_3
    property = twin_slip_resistance
    index = 3
    execute_on = timestep_end
  []
  [twin_resistance_4]
    type = MaterialStdVectorAux
    variable = twin_resistance_4
    property = twin_slip_resistance
    index = 4
    execute_on = timestep_end
  []
  [twin_resistance_5]
    type = MaterialStdVectorAux
    variable = twin_resistance_5
    property = twin_slip_resistance
    index = 5
    execute_on = timestep_end
  []
  [twin_increment_0]
    type = MaterialStdVectorAux
    variable = twin_increment_0
    property = twin_slip_increment
    index = 0
    execute_on = timestep_end
  []
  [twin_increment_1]
    type = MaterialStdVectorAux
    variable = twin_increment_1
    property = twin_slip_increment
    index = 1
    execute_on = timestep_end
  []
  [twin_increment_2]
    type = MaterialStdVectorAux
    variable = twin_increment_2
    property = twin_slip_increment
    index = 2
    execute_on = timestep_end
  []
  [twin_increment_3]
    type = MaterialStdVectorAux
    variable = twin_increment_3
    property = twin_slip_increment
    index = 3
    execute_on = timestep_end
  []
  [twin_increment_4]
    type = MaterialStdVectorAux
    variable = twin_increment_4
    property = twin_slip_increment
    index = 4
    execute_on = timestep_end
  []
  [twin_increment_5]
    type = MaterialStdVectorAux
    variable = twin_increment_5
    property = twin_slip_increment
    index = 5
    execute_on = timestep_end
  []
  [twin_tau_0]
    type = MaterialStdVectorAux
    variable = resolved_twin_stress_0
    property = twin_applied_shear_stress
    index = 0
    execute_on = timestep_end
  []
  [twin_tau_1]
    type = MaterialStdVectorAux
    variable = resolved_twin_stress_1
    property = twin_applied_shear_stress
    index = 1
    execute_on = timestep_end
  []
  [twin_tau_2]
    type = MaterialStdVectorAux
    variable = resolved_twin_stress_2
    property = twin_applied_shear_stress
    index = 2
    execute_on = timestep_end
  []
  [twin_tau_3]
    type = MaterialStdVectorAux
    variable = resolved_twin_stress_3
    property = twin_applied_shear_stress
    index = 3
    execute_on = timestep_end
  []
  [twin_tau_4]
    type = MaterialStdVectorAux
    variable = resolved_twin_stress_4
    property = twin_applied_shear_stress
    index = 4
    execute_on = timestep_end
  []
  [twin_tau_5]
    type = MaterialStdVectorAux
    variable = resolved_twin_stress_5
    property = twin_applied_shear_stress
    index = 5
    execute_on = timestep_end
  []
[]
[BCs]
  [symmy]
    type = DirichletBC
    variable = disp_y
    preset = true
    boundary = bottom
    value = 0
  []
  [symmx]
    type = DirichletBC
    variable = disp_x
    boundary = left
    value = 0
  []
  [symmz]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0
  []
  [tdisp]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = '0.01*t'
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensorCP
    C_ijkl = '1.622e5 9.18e4 6.88e4 1.622e5 6.88e4 1.805e5 4.67e4 4.67e4 4.67e4' #alpha Ti, Alankar et al. Acta Materialia 59 (2011) 7003-7009
    fill_method = symmetric9
  []
  [stress]
    type = ComputeMultipleCrystalPlasticityStress
    crystal_plasticity_models = 'twin_xtalpl'
    tan_mod_type = exact
  []
  [twin_xtalpl]
    type = CrystalPlasticityTwinningKalidindiUpdate
    base_name = twin
    crystal_lattice_type = HCP
    unit_cell_dimension = '2.934e-7 2.934e-7 4.657e-7' #Ti, in mm, https://materialsproject.org/materials/mp-46/
    number_slip_systems = 6
    slip_sys_file_name = 'hcp_tensile_twin_systems.txt'
    initial_twin_lattice_friction = 1140
    non_coplanar_coefficient_twin_hardening = 10000
    coplanar_coefficient_twin_hardening = 1000
    characteristic_twin_shear = 0.167
  []
[]
[Postprocessors]
  [stress_zz]
    type = ElementAverageValue
    variable = stress_zz
  []
  [pk2]
    type = ElementAverageValue
    variable = pk2
  []
  [fp_xx]
    type = ElementAverageValue
    variable = fp_xx
  []
  [fp_zz]
    type = ElementAverageValue
    variable = fp_zz
  []
  [e_zz]
    type = ElementAverageValue
    variable = e_zz
  []
  [total_twin_volume_fraction]
    type = ElementAverageValue
    variable = total_twin_volume_fraction
  []
  [twin_volume_fraction_0]
    type = ElementAverageValue
    variable = twin_volume_fraction_0
  []
  [twin_volume_fraction_1]
    type = ElementAverageValue
    variable = twin_volume_fraction_1
  []
  [twin_volume_fraction_2]
    type = ElementAverageValue
    variable = twin_volume_fraction_2
  []
  [twin_volume_fraction_3]
    type = ElementAverageValue
    variable = twin_volume_fraction_3
  []
  [twin_volume_fraction_4]
    type = ElementAverageValue
    variable = twin_volume_fraction_4
  []
  [twin_volume_fraction_5]
    type = ElementAverageValue
    variable = twin_volume_fraction_5
  []
  [twin_resistance_0]
    type = ElementAverageValue
    variable = twin_resistance_0
  []
  [twin_resistance_1]
    type = ElementAverageValue
    variable = twin_resistance_1
  []
  [twin_resistance_2]
    type = ElementAverageValue
    variable = twin_resistance_2
  []
  [twin_resistance_3]
    type = ElementAverageValue
    variable = twin_resistance_3
  []
  [twin_resistance_4]
    type = ElementAverageValue
    variable = twin_resistance_4
  []
  [twin_resistance_5]
    type = ElementAverageValue
    variable = twin_resistance_5
  []
  [twin_increment_0]
    type = ElementAverageValue
    variable = twin_increment_0
  []
  [twin_increment_1]
    type = ElementAverageValue
    variable = twin_increment_1
  []
  [twin_increment_2]
    type = ElementAverageValue
    variable = twin_increment_2
  []
  [twin_increment_3]
    type = ElementAverageValue
    variable = twin_increment_3
  []
  [twin_increment_4]
    type = ElementAverageValue
    variable = twin_increment_4
  []
  [twin_increment_5]
    type = ElementAverageValue
    variable = twin_increment_5
  []
  [twin_tau_0]
    type = ElementAverageValue
    variable = resolved_twin_stress_0
  []
  [twin_tau_1]
    type = ElementAverageValue
    variable = resolved_twin_stress_1
  []
  [twin_tau_2]
    type = ElementAverageValue
    variable = resolved_twin_stress_2
  []
  [twin_tau_3]
    type = ElementAverageValue
    variable = resolved_twin_stress_3
  []
  [twin_tau_4]
    type = ElementAverageValue
    variable = resolved_twin_stress_4
  []
  [twin_tau_5]
    type = ElementAverageValue
    variable = resolved_twin_stress_5
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
  petsc_options_value = ' asm      2              lu            gmres     200'
  nl_abs_tol = 1e-10
  nl_rel_tol = 1e-10
  nl_abs_step_tol = 1e-10
  dt = 0.5
  dtmin = 1.0e-2
  dtmax = 10.0
  end_time = 2.5
[]
[Outputs]
  csv = true
[]
(modules/solid_mechanics/test/tests/weak_plane_shear/large_deform3.i)
# apply a number of "random" configurations and
# check that the algorithm returns to the yield surface
#
# must be careful here - we cannot put in arbitrary values of C_ijkl, otherwise the condition
# df/dsigma * C * flow_dirn < 0 for some stresses
# The important features that must be obeyed are:
# 0 = C_0222 = C_1222  (holds for transversely isotropic, for instance)
# C_0212 < C_0202 = C_1212 (holds for transversely isotropic)
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
  type = GeneratedMesh
  dim = 3
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  add_variables = true
[]
[BCs]
  [bottomx]
    type = DirichletBC
    variable = disp_x
    boundary = back
    value = 0.0
  []
  [bottomy]
    type = DirichletBC
    variable = disp_y
    boundary = back
    value = 0.0
  []
  [bottomz]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0.0
  []
  # the following are "random" deformations
  # each is O(1E-1) to provide large deformations
  [topx]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = front
    function = '(sin(0.1*t)+x)/1E1'
  []
  [topy]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = front
    function = '(cos(t)+x*y)/1E1'
  []
  [topz]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = 'sin(0.4321*t)*x*y*z/1E1'
  []
[]
[AuxVariables]
  [yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[AuxKernels]
  [yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  []
[]
[Postprocessors]
  [yield_fcn_at_zero]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
    outputs = 'console'
  []
  [should_be_zero]
    type = FunctionValuePostprocessor
    function = should_be_zero_fcn
  []
[]
[Functions]
  [should_be_zero_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-3,0,a)'
    symbol_names = 'a'
    symbol_values = 'yield_fcn_at_zero'
  []
[]
[UserObjects]
  [coh]
    type = SolidMechanicsHardeningConstant
    value = 1E3
  []
  [tanphi]
    type = SolidMechanicsHardeningConstant
    value = 0.577350269
  []
  [tanpsi]
    type = SolidMechanicsHardeningConstant
    value = 0.08748866
  []
  [wps]
    type = SolidMechanicsPlasticWeakPlaneShear
    cohesion = coh
    tan_friction_angle = tanphi
    tan_dilation_angle = tanpsi
    smoother = 100
    yield_function_tolerance = 1E-3
    internal_constraint_tolerance = 1E-3
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensor
    # the following is transversely isotropic, i think.
    fill_method = symmetric9
    C_ijkl = '3E9 1E9 3E9 3E9 3E9 6E9 1E9 1E9 9E9'
  []
  [mc]
    type = ComputeMultiPlasticityStress
    plastic_models = wps
    transverse_direction = '0 0 1'
    max_NR_iterations = 100
    ep_plastic_tolerance = 1E-3
    debug_fspb = crash
  []
[]
[Executioner]
  end_time = 1E4
  dt = 1
  type = Transient
[]
[Outputs]
  csv = true
[]
(modules/solid_mechanics/test/tests/tensile/small_deform6_update_version.i)
# checking for small deformation
# A single element is incrementally stretched in the in the z direction
# This causes the return direction to be along the hypersurface sigma_II = sigma_III,
# and the resulting stresses are checked to lie on the expected yield surface
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    strain = finite
    generate_output = 'max_principal_stress mid_principal_stress min_principal_stress stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '4*x*t'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = 'y*(t-0.5)'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = 'z*(t-0.5)'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_I]
    type = PointValue
    point = '0 0 0'
    variable = max_principal_stress
  [../]
  [./s_II]
    type = PointValue
    point = '0 0 0'
    variable = mid_principal_stress
  [../]
  [./s_III]
    type = PointValue
    point = '0 0 0'
    variable = min_principal_stress
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '0 2.0'
  [../]
  [./tensile]
    type = TensileStressUpdate
    tensile_strength = ts
    smoothing_tol = 0.5
    yield_function_tol = 1.0E-12
  [../]
  [./stress]
    type = ComputeMultipleInelasticStress
    inelastic_models = tensile
    perform_finite_strain_rotations = false
  [../]
[]
[Executioner]
  end_time = 1
  dt = 0.1
  type = Transient
[]
[Outputs]
  file_base = small_deform6_update_version
  exodus = false
  [./csv]
    type = CSV
  [../]
[]
(modules/solid_mechanics/test/tests/mohr_coulomb/planar3.i)
# apply repeated stretches in x z directions, and smaller stretches along the y direction,
# so that sigma_I = sigma_II,
# which means that lode angle = 30deg.
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '1E-6*x*t'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0.25E-6*y*sin(t)'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1.1E-6*z*t'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = f
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = f
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
[]
[UserObjects]
  [./coh]
    type = SolidMechanicsHardeningConstant
    value = 10
  [../]
  [./phi]
    type = SolidMechanicsHardeningConstant
    value = 0.9
  [../]
  [./psi]
    type = SolidMechanicsHardeningConstant
    value = 0.1
  [../]
  [./mc]
    type = SolidMechanicsPlasticMohrCoulombMulti
    cohesion = coh
    friction_angle = phi
    dilation_angle = psi
    yield_function_tolerance = 1E-8
    shift = 1E-8
    internal_constraint_tolerance = 1E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = mc
    deactivation_scheme = safe
    max_NR_iterations = 3
    min_stepsize = 1
    max_stepsize_for_dumb = 1
    debug_fspb = crash
    debug_jac_at_stress = '10 5 2 5 11 -1 2 -1 12'
    debug_jac_at_pm = '1 1 1 1 1 1'
    debug_jac_at_intnl = 1
    debug_stress_change = 1E-5
    debug_pm_change = '1E-6 1E-6 1E-6 1E-6 1E-6 1E-6'
    debug_intnl_change = 1E-6
  [../]
[]
[Executioner]
  end_time = 10
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = planar3
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/capped_weak_plane/small_deform11.i)
# use an initial stress, then apply a shear deformation and tensile stretch to observe all hardening.
# Here p_trial=12, q_trial=2*Sqrt(20)
# MOOSE yields:
# q_returned = 1.696
# p_returned = 0.100
# intnl_shear = 1.81
# intnl_tens = 0.886
# These give, at the returned point
# cohesion = 1.84
# tanphi = 0.513
# tanpsi = 0.058
# tensile = 0.412
# This means that
# f_shear = -0.0895
# f_tensile = -0.312
# Note that these are within smoothing_tol (=1) of each other
# Hence, smoothing must be used:
# ismoother = 0.0895
# (which gives the yield function value = 0)
# smoother = 0.328
# This latter gives dg/dq = 0.671, dg/dp = 0.368
# for the flow directions.  Finally ga = 2.70, and
# the returned point satisfies the normality conditions.
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    eigenstrain_names = ini_stress
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz plastic_strain_xx plastic_strain_xy plastic_strain_xz plastic_strain_yy plastic_strain_yz plastic_strain_zz strain_xx strain_xy strain_xz strain_yy strain_yz strain_zz'
  [../]
[]
[BCs]
  [./bottomx]
    type = DirichletBC
    variable = disp_x
    boundary = back
    value = 0.0
  [../]
  [./bottomy]
    type = DirichletBC
    variable = disp_y
    boundary = back
    value = 0.0
  [../]
  [./bottomz]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0.0
  [../]
  [./topx]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = front
    function = '0.5*t'
  [../]
  [./topy]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = front
    function = 't'
  [../]
  [./topz]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = '0.5*t'
  [../]
[]
[AuxVariables]
  [./f_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_compressive]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./ls]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./f_shear]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f_shear
  [../]
  [./f_tensile]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f_tensile
  [../]
  [./f_compressive]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f_compressive
  [../]
  [./intnl_shear]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl_shear
  [../]
  [./intnl_tensile]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 1
    variable = intnl_tensile
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./ls]
    type = MaterialRealAux
    property = plastic_linesearch_needed
    variable = ls
  [../]
[]
[Postprocessors]
  [./stress_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./stress_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./stress_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./stress_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./stress_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./stress_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./strainp_xx]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_xx
  [../]
  [./strainp_xy]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_xy
  [../]
  [./strainp_xz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_xz
  [../]
  [./strainp_yy]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_yy
  [../]
  [./strainp_yz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_yz
  [../]
  [./strainp_zz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_zz
  [../]
  [./straint_xx]
    type = PointValue
    point = '0 0 0'
    variable = strain_xx
  [../]
  [./straint_xy]
    type = PointValue
    point = '0 0 0'
    variable = strain_xy
  [../]
  [./straint_xz]
    type = PointValue
    point = '0 0 0'
    variable = strain_xz
  [../]
  [./straint_yy]
    type = PointValue
    point = '0 0 0'
    variable = strain_yy
  [../]
  [./straint_yz]
    type = PointValue
    point = '0 0 0'
    variable = strain_yz
  [../]
  [./straint_zz]
    type = PointValue
    point = '0 0 0'
    variable = strain_zz
  [../]
  [./f_shear]
    type = PointValue
    point = '0 0 0'
    variable = f_shear
  [../]
  [./f_tensile]
    type = PointValue
    point = '0 0 0'
    variable = f_tensile
  [../]
  [./f_compressive]
    type = PointValue
    point = '0 0 0'
    variable = f_compressive
  [../]
  [./intnl_shear]
    type = PointValue
    point = '0 0 0'
    variable = intnl_shear
  [../]
  [./intnl_tensile]
    type = PointValue
    point = '0 0 0'
    variable = intnl_tensile
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
  [./ls]
    type = PointValue
    point = '0 0 0'
    variable = ls
  [../]
[]
[UserObjects]
  [./coh]
    type = SolidMechanicsHardeningExponential
    value_0 = 1
    value_residual = 2
    rate = 1
  [../]
  [./tanphi]
    type = SolidMechanicsHardeningExponential
    value_0 = 1.0
    value_residual = 0.5
    rate = 2
  [../]
  [./tanpsi]
    type = SolidMechanicsHardeningExponential
    value_0 = 0.1
    value_residual = 0.05
    rate = 1
  [../]
  [./t_strength]
    type = SolidMechanicsHardeningExponential
    value_0 = 1
    value_residual = 0
    rate = 1
  [../]
  [./c_strength]
    type = SolidMechanicsHardeningConstant
    value = 1E8
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeIsotropicElasticityTensor
    lambda = 4.0
    shear_modulus = 4.0
  [../]
  [./ini_stress]
    type = ComputeEigenstrainFromInitialStress
    initial_stress = '0 0 2 0 0 4 2 4 6'
    eigenstrain_name = ini_stress
  [../]
  [./admissible]
    type = ComputeMultipleInelasticStress
    inelastic_models = stress
    perform_finite_strain_rotations = false
  [../]
  [./stress]
    type = CappedWeakPlaneStressUpdate
    cohesion = coh
    tan_friction_angle = tanphi
    tan_dilation_angle = tanpsi
    tensile_strength = t_strength
    compressive_strength = c_strength
    max_NR_iterations = 20
    tip_smoother = 0
    smoothing_tol = 1
    yield_function_tol = 1E-3
    perfect_guess = false
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform11
  [./csv]
    type = CSV
  [../]
[]
(modules/solid_mechanics/test/tests/capped_weak_plane/small_deform_inclined5.i)
# Plastic deformation, shear failure, with inclined normal direction = (1, 0, 0)
# With Young = 10, poisson=0.25 (Lame lambda=4, mu=4)
# applying the following
# deformation to the xmax surface of a unit cube:
# disp_x = 5*t/6
# disp_y = 6*t
# disp_z = 8*t
# should yield trial stress:
# stress_xx = 10*t
# stress_xz = 32*t
# stress_xy = 24*t (so q_trial = 40*t)
# Use tan(friction_angle) = 0.5 and tan(dilation_angle) = 1/6, and cohesion=20,
# the system should return to p=0, q=20, ie stress_xx=0, stress_zx=16,
# stress_yx=12 on the first time step (t=1)
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz plastic_strain_xx plastic_strain_xy plastic_strain_xz plastic_strain_yy plastic_strain_yz plastic_strain_zz strain_xx strain_xy strain_xz strain_yy strain_yz strain_zz'
  [../]
[]
[BCs]
  [./bottomx]
    type = DirichletBC
    variable = disp_x
    boundary = left
    value = 0.0
  [../]
  [./bottomy]
    type = DirichletBC
    variable = disp_y
    boundary = left
    value = 0.0
  [../]
  [./bottomz]
    type = DirichletBC
    variable = disp_z
    boundary = left
    value = 0.0
  [../]
  [./topx]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = right
    function = 5*t/6
  [../]
  [./topy]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = right
    function = 6*t
  [../]
  [./topz]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = right
    function = 8*t
  [../]
[]
[AuxVariables]
  [./f_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_compressive]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./ls]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./f_shear]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f_shear
  [../]
  [./f_tensile]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f_tensile
  [../]
  [./f_compressive]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f_compressive
  [../]
  [./intnl_shear]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl_shear
  [../]
  [./intnl_tensile]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 1
    variable = intnl_tensile
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./ls]
    type = MaterialRealAux
    property = plastic_linesearch_needed
    variable = ls
  [../]
[]
[Postprocessors]
  [./stress_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./stress_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./stress_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./stress_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./stress_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./stress_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./strainp_xx]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_xx
  [../]
  [./strainp_xy]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_xy
  [../]
  [./strainp_xz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_xz
  [../]
  [./strainp_yy]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_yy
  [../]
  [./strainp_yz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_yz
  [../]
  [./strainp_zz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_zz
  [../]
  [./straint_xx]
    type = PointValue
    point = '0 0 0'
    variable = strain_xx
  [../]
  [./straint_xy]
    type = PointValue
    point = '0 0 0'
    variable = strain_xy
  [../]
  [./straint_xz]
    type = PointValue
    point = '0 0 0'
    variable = strain_xz
  [../]
  [./straint_yy]
    type = PointValue
    point = '0 0 0'
    variable = strain_yy
  [../]
  [./straint_yz]
    type = PointValue
    point = '0 0 0'
    variable = strain_yz
  [../]
  [./straint_zz]
    type = PointValue
    point = '0 0 0'
    variable = strain_zz
  [../]
  [./f_shear]
    type = PointValue
    point = '0 0 0'
    variable = f_shear
  [../]
  [./f_tensile]
    type = PointValue
    point = '0 0 0'
    variable = f_tensile
  [../]
  [./f_compressive]
    type = PointValue
    point = '0 0 0'
    variable = f_compressive
  [../]
  [./intnl_shear]
    type = PointValue
    point = '0 0 0'
    variable = intnl_shear
  [../]
  [./intnl_tensile]
    type = PointValue
    point = '0 0 0'
    variable = intnl_tensile
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
  [./ls]
    type = PointValue
    point = '0 0 0'
    variable = ls
  [../]
[]
[UserObjects]
  [./coh]
    type = SolidMechanicsHardeningConstant
    value = 20
  [../]
  [./tanphi]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
  [./tanpsi]
    type = SolidMechanicsHardeningConstant
    value = 0.166666666667
  [../]
  [./t_strength]
    type = SolidMechanicsHardeningConstant
    value = 100
  [../]
  [./c_strength]
    type = SolidMechanicsHardeningConstant
    value = 100
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '4 4'
  [../]
  [./admissible]
    type = ComputeMultipleInelasticStress
    inelastic_models = stress
    perform_finite_strain_rotations = false
  [../]
  [./stress]
    type = CappedWeakInclinedPlaneStressUpdate
    normal_vector = '1 0 0'
    cohesion = coh
    tan_friction_angle = tanphi
    tan_dilation_angle = tanpsi
    tensile_strength = t_strength
    compressive_strength = c_strength
    tip_smoother = 0
    smoothing_tol = 0
    yield_function_tol = 1E-5
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform_inclined5
  csv = true
[]
(modules/porous_flow/examples/coal_mining/coarse_with_fluid.i)
# Strata deformation and fluid flow aaround a coal mine - 3D model
#
# A "half model" is used.  The mine is 400m deep and
# just the roof is studied (-400<=z<=0).  The mining panel
# sits between 0<=x<=150, and 0<=y<=1000, so this simulates
# a coal panel that is 300m wide and 1000m long.  The outer boundaries
# are 1km from the excavation boundaries.
#
# The excavation takes 0.5 years.
#
# The boundary conditions for this simulation are:
#  - disp_x = 0 at x=0 and x=1150
#  - disp_y = 0 at y=-1000 and y=1000
#  - disp_z = 0 at z=-400, but there is a time-dependent
#               Young modulus that simulates excavation
#  - wc_x = 0 at y=-1000 and y=1000
#  - wc_y = 0 at x=0 and x=1150
#  - no flow at x=0, z=-400 and z=0
#  - fixed porepressure at y=-1000, y=1000 and x=1150
# That is, rollers on the sides, free at top,
# and prescribed at bottom in the unexcavated portion.
#
# A single-phase unsaturated fluid is used.
#
# The small strain formulation is used.
#
# All stresses are measured in MPa, and time units are measured in years.
#
# The initial porepressure is hydrostatic with P=0 at z=0, so
# Porepressure ~ - 0.01*z MPa, where the fluid has density 1E3 kg/m^3 and
# gravity = = 10 m.s^-2 = 1E-5 MPa m^2/kg.
# To be more accurate, i use
# Porepressure = -bulk * log(1 + g*rho0*z/bulk)
# where bulk=2E3 MPa and rho0=1Ee kg/m^3.
# The initial stress is consistent with the weight force from undrained
# density 2500 kg/m^3, and fluid porepressure, and a Biot coefficient of 0.7, ie,
# stress_zz^effective = 0.025*z + 0.7 * initial_porepressure
# The maximum and minimum principal horizontal effective stresses are
# assumed to be equal to 0.8*stress_zz.
#
# Material properties:
# Young's modulus = 8 GPa
# Poisson's ratio = 0.25
# Cosserat layer thickness = 1 m
# Cosserat-joint normal stiffness = large
# Cosserat-joint shear stiffness = 1 GPa
# MC cohesion = 2 MPa
# MC friction angle = 35 deg
# MC dilation angle = 8 deg
# MC tensile strength = 1 MPa
# MC compressive strength = 100 MPa
# WeakPlane cohesion = 0.1 MPa
# WeakPlane friction angle = 30 deg
# WeakPlane dilation angle = 10 deg
# WeakPlane tensile strength = 0.1 MPa
# WeakPlane compressive strength = 100 MPa softening to 1 MPa at strain = 1
# Fluid density at zero porepressure = 1E3 kg/m^3
# Fluid bulk modulus = 2E3 MPa
# Fluid viscosity = 1.1E-3 Pa.s = 1.1E-9 MPa.s = 3.5E-17 MPa.year
#
[GlobalParams]
  perform_finite_strain_rotations = false
  displacements = 'disp_x disp_y disp_z'
  Cosserat_rotations = 'wc_x wc_y wc_z'
  PorousFlowDictator = dictator
  biot_coefficient = 0.7
[]
[Mesh]
  [file]
    type = FileMeshGenerator
    file = mesh/coarse.e
  []
  [xmin]
    type = SideSetsAroundSubdomainGenerator
     block = '2 3 4 5 6 7 8 9 10 11 12 13 14 15 16'
    new_boundary = xmin
    normal = '-1 0 0'
    input = file
  []
  [xmax]
    type = SideSetsAroundSubdomainGenerator
     block = '2 3 4 5 6 7 8 9 10 11 12 13 14 15 16'
    new_boundary = xmax
    normal = '1 0 0'
    input = xmin
  []
  [ymin]
    type = SideSetsAroundSubdomainGenerator
     block = '2 3 4 5 6 7 8 9 10 11 12 13 14 15 16'
    new_boundary = ymin
    normal = '0 -1 0'
    input = xmax
  []
  [ymax]
    type = SideSetsAroundSubdomainGenerator
     block = '2 3 4 5 6 7 8 9 10 11 12 13 14 15 16'
    new_boundary = ymax
    normal = '0 1 0'
    input = ymin
  []
  [zmax]
    type = SideSetsAroundSubdomainGenerator
    block = 16
    new_boundary = zmax
    normal = '0 0 1'
    input = ymax
  []
  [zmin]
    type = SideSetsAroundSubdomainGenerator
    block = 2
    new_boundary = zmin
    normal = '0 0 -1'
    input = zmax
  []
  [excav]
    type = SubdomainBoundingBoxGenerator
    input = zmin
    block_id = 1
    bottom_left = '0 0 -400'
    top_right = '150 1000 -397'
  []
  [roof]
    type = SideSetsBetweenSubdomainsGenerator
    primary_block = 3
    paired_block = 1
    input = excav
    new_boundary = roof
  []
[]
[Variables]
  [disp_x]
  []
  [disp_y]
  []
  [disp_z]
  []
  [wc_x]
  []
  [wc_y]
  []
  [porepressure]
    scaling = 1E-5
  []
[]
[ICs]
  [porepressure]
    type = FunctionIC
    variable = porepressure
    function = ini_pp
  []
[]
[Kernels]
  [cx_elastic]
    type = CosseratStressDivergenceTensors
    use_displaced_mesh = false
    variable = disp_x
    component = 0
  []
  [cy_elastic]
    type = CosseratStressDivergenceTensors
    use_displaced_mesh = false
    variable = disp_y
    component = 1
  []
  [cz_elastic]
    type = CosseratStressDivergenceTensors
    use_displaced_mesh = false
    variable = disp_z
    component = 2
  []
  [x_couple]
    type = StressDivergenceTensors
    use_displaced_mesh = false
    variable = wc_x
    displacements = 'wc_x wc_y wc_z'
    component = 0
    base_name = couple
  []
  [y_couple]
    type = StressDivergenceTensors
    use_displaced_mesh = false
    variable = wc_y
    displacements = 'wc_x wc_y wc_z'
    component = 1
    base_name = couple
  []
  [x_moment]
    type = MomentBalancing
    use_displaced_mesh = false
    variable = wc_x
    component = 0
  []
  [y_moment]
    type = MomentBalancing
    use_displaced_mesh = false
    variable = wc_y
    component = 1
  []
  [gravity]
    type = Gravity
    use_displaced_mesh = false
    variable = disp_z
    value = -10E-6 # remember this is in MPa
  []
  [poro_x]
    type = PorousFlowEffectiveStressCoupling
    use_displaced_mesh = false
    variable = disp_x
    component = 0
  []
  [poro_y]
    type = PorousFlowEffectiveStressCoupling
    use_displaced_mesh = false
    variable = disp_y
    component = 1
  []
  [poro_z]
    type = PorousFlowEffectiveStressCoupling
    use_displaced_mesh = false
    component = 2
    variable = disp_z
  []
  [mass0]
    type = PorousFlowMassTimeDerivative
    fluid_component = 0
    variable = porepressure
  []
  [flux]
    type = PorousFlowAdvectiveFlux
    use_displaced_mesh = false
    variable = porepressure
    gravity = '0 0 -10E-6'
    fluid_component = 0
  []
  [poro_vol_exp]
    type = PorousFlowMassVolumetricExpansion
    block = '2 3 4 5 6 7 8 9 10 11 12 13 14 15 16'
    variable = porepressure
    fluid_component = 0
  []
[]
[AuxVariables]
  [saturation]
    order = CONSTANT
    family = MONOMIAL
  []
  [darcy_x]
    order = CONSTANT
    family = MONOMIAL
  []
  [darcy_y]
    order = CONSTANT
    family = MONOMIAL
  []
  [darcy_z]
    order = CONSTANT
    family = MONOMIAL
  []
  [porosity]
    order = CONSTANT
    family = MONOMIAL
  []
  [wc_z]
  []
  [stress_xx]
    order = CONSTANT
    family = MONOMIAL
  []
  [stress_xy]
    order = CONSTANT
    family = MONOMIAL
  []
  [stress_xz]
    order = CONSTANT
    family = MONOMIAL
  []
  [stress_yx]
    order = CONSTANT
    family = MONOMIAL
  []
  [stress_yy]
    order = CONSTANT
    family = MONOMIAL
  []
  [stress_yz]
    order = CONSTANT
    family = MONOMIAL
  []
  [stress_zx]
    order = CONSTANT
    family = MONOMIAL
  []
  [stress_zy]
    order = CONSTANT
    family = MONOMIAL
  []
  [stress_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [total_strain_xx]
    order = CONSTANT
    family = MONOMIAL
  []
  [total_strain_xy]
    order = CONSTANT
    family = MONOMIAL
  []
  [total_strain_xz]
    order = CONSTANT
    family = MONOMIAL
  []
  [total_strain_yx]
    order = CONSTANT
    family = MONOMIAL
  []
  [total_strain_yy]
    order = CONSTANT
    family = MONOMIAL
  []
  [total_strain_yz]
    order = CONSTANT
    family = MONOMIAL
  []
  [total_strain_zx]
    order = CONSTANT
    family = MONOMIAL
  []
  [total_strain_zy]
    order = CONSTANT
    family = MONOMIAL
  []
  [total_strain_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [perm_xx]
    order = CONSTANT
    family = MONOMIAL
  []
  [perm_yy]
    order = CONSTANT
    family = MONOMIAL
  []
  [perm_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [mc_shear]
    order = CONSTANT
    family = MONOMIAL
  []
  [mc_tensile]
    order = CONSTANT
    family = MONOMIAL
  []
  [wp_shear]
    order = CONSTANT
    family = MONOMIAL
  []
  [wp_tensile]
    order = CONSTANT
    family = MONOMIAL
  []
  [wp_shear_f]
    order = CONSTANT
    family = MONOMIAL
  []
  [wp_tensile_f]
    order = CONSTANT
    family = MONOMIAL
  []
  [mc_shear_f]
    order = CONSTANT
    family = MONOMIAL
  []
  [mc_tensile_f]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[AuxKernels]
  [saturation_water]
    type = PorousFlowPropertyAux
    variable = saturation
    property = saturation
    phase = 0
    execute_on = timestep_end
  []
  [darcy_x]
    type = PorousFlowDarcyVelocityComponent
    variable = darcy_x
    gravity = '0 0 -10E-6'
    component = x
  []
  [darcy_y]
    type = PorousFlowDarcyVelocityComponent
    variable = darcy_y
    gravity = '0 0 -10E-6'
    component = y
  []
  [darcy_z]
    type = PorousFlowDarcyVelocityComponent
    variable = darcy_z
    gravity = '0 0 -10E-6'
    component = z
  []
  [porosity]
    type = PorousFlowPropertyAux
    property = porosity
    variable = porosity
    execute_on = timestep_end
  []
  [stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
    execute_on = timestep_end
  []
  [stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
    execute_on = timestep_end
  []
  [stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
    execute_on = timestep_end
  []
  [stress_yx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yx
    index_i = 1
    index_j = 0
    execute_on = timestep_end
  []
  [stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
    execute_on = timestep_end
  []
  [stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
    execute_on = timestep_end
  []
  [stress_zx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zx
    index_i = 2
    index_j = 0
    execute_on = timestep_end
  []
  [stress_zy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zy
    index_i = 2
    index_j = 1
    execute_on = timestep_end
  []
  [stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
    execute_on = timestep_end
  []
  [total_strain_xx]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = total_strain_xx
    index_i = 0
    index_j = 0
    execute_on = timestep_end
  []
  [total_strain_xy]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = total_strain_xy
    index_i = 0
    index_j = 1
    execute_on = timestep_end
  []
  [total_strain_xz]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = total_strain_xz
    index_i = 0
    index_j = 2
    execute_on = timestep_end
  []
  [total_strain_yx]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = total_strain_yx
    index_i = 1
    index_j = 0
    execute_on = timestep_end
  []
  [total_strain_yy]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = total_strain_yy
    index_i = 1
    index_j = 1
    execute_on = timestep_end
  []
  [total_strain_yz]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = total_strain_yz
    index_i = 1
    index_j = 2
    execute_on = timestep_end
  []
  [total_strain_zx]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = total_strain_zx
    index_i = 2
    index_j = 0
    execute_on = timestep_end
  []
  [total_strain_zy]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = total_strain_zy
    index_i = 2
    index_j = 1
    execute_on = timestep_end
  []
  [total_strain_zz]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = total_strain_zz
    index_i = 2
    index_j = 2
    execute_on = timestep_end
  []
  [perm_xx]
    type = PorousFlowPropertyAux
    property = permeability
    variable = perm_xx
    row = 0
    column = 0
    execute_on = timestep_end
  []
  [perm_yy]
    type = PorousFlowPropertyAux
    property = permeability
    variable = perm_yy
    row = 1
    column = 1
    execute_on = timestep_end
  []
  [perm_zz]
    type = PorousFlowPropertyAux
    property = permeability
    variable = perm_zz
    row = 2
    column = 2
    execute_on = timestep_end
  []
  [mc_shear]
    type = MaterialStdVectorAux
    index = 0
    property = mc_plastic_internal_parameter
    variable = mc_shear
    execute_on = timestep_end
  []
  [mc_tensile]
    type = MaterialStdVectorAux
    index = 1
    property = mc_plastic_internal_parameter
    variable = mc_tensile
    execute_on = timestep_end
  []
  [wp_shear]
    type = MaterialStdVectorAux
    index = 0
    property = wp_plastic_internal_parameter
    variable = wp_shear
    execute_on = timestep_end
  []
  [wp_tensile]
    type = MaterialStdVectorAux
    index = 1
    property = wp_plastic_internal_parameter
    variable = wp_tensile
    execute_on = timestep_end
  []
  [mc_shear_f]
    type = MaterialStdVectorAux
    index = 6
    property = mc_plastic_yield_function
    variable = mc_shear_f
    execute_on = timestep_end
  []
  [mc_tensile_f]
    type = MaterialStdVectorAux
    index = 0
    property = mc_plastic_yield_function
    variable = mc_tensile_f
    execute_on = timestep_end
  []
  [wp_shear_f]
    type = MaterialStdVectorAux
    index = 0
    property = wp_plastic_yield_function
    variable = wp_shear_f
    execute_on = timestep_end
  []
  [wp_tensile_f]
    type = MaterialStdVectorAux
    index = 1
    property = wp_plastic_yield_function
    variable = wp_tensile_f
    execute_on = timestep_end
  []
[]
[BCs]
  [no_x]
    type = DirichletBC
    variable = disp_x
    boundary = 'xmin xmax'
    value = 0.0
  []
  [no_y]
    type = DirichletBC
    variable = disp_y
    boundary = 'ymin ymax'
    value = 0.0
  []
  [no_z]
    type = DirichletBC
    variable = disp_z
    boundary = zmin
    value = 0.0
  []
  [no_wc_x]
    type = DirichletBC
    variable = wc_x
    boundary = 'ymin ymax'
    value = 0.0
  []
  [no_wc_y]
    type = DirichletBC
    variable = wc_y
    boundary = 'xmin xmax'
    value = 0.0
  []
  [fix_porepressure]
    type = FunctionDirichletBC
    variable = porepressure
    boundary = 'ymin ymax xmax'
    function = ini_pp
  []
  [roof_porepressure]
    type = PorousFlowPiecewiseLinearSink
    variable = porepressure
    pt_vals = '-1E3 1E3'
    multipliers = '-1 1'
    fluid_phase = 0
    flux_function = roof_conductance
    boundary = roof
  []
  [roof_bcs]
    type = StickyBC
    variable = disp_z
    min_value = -3.0
    boundary = roof
  []
[]
[Functions]
  [ini_pp]
    type = ParsedFunction
    symbol_names = 'bulk p0 g    rho0'
    symbol_values = '2E3 0.0 1E-5 1E3'
    expression = '-bulk*log(exp(-p0/bulk)+g*rho0*z/bulk)'
  []
  [ini_xx]
    type = ParsedFunction
    symbol_names = 'bulk p0 g    rho0 biot'
    symbol_values = '2E3 0.0 1E-5 1E3  0.7'
    expression = '0.8*(2500*10E-6*z+biot*(-bulk*log(exp(-p0/bulk)+g*rho0*z/bulk)))'
  []
  [ini_zz]
    type = ParsedFunction
    symbol_names = 'bulk p0 g    rho0 biot'
    symbol_values = '2E3 0.0 1E-5 1E3  0.7'
    expression = '2500*10E-6*z+biot*(-bulk*log(exp(-p0/bulk)+g*rho0*z/bulk))'
  []
  [excav_sideways]
    type = ParsedFunction
    symbol_names = 'end_t ymin ymax  minval maxval slope'
    symbol_values = '0.5   0    1000.0 1E-9 1 60'
    # excavation face at ymin+(ymax-ymin)*min(t/end_t,1)
    # slope is the distance over which the modulus reduces from maxval to minval
    expression = 'if(y<ymin+(ymax-ymin)*min(t/end_t,1),minval,if(y<ymin+(ymax-ymin)*min(t/end_t,1)+slope,minval+(maxval-minval)*(y-(ymin+(ymax-ymin)*min(t/end_t,1)))/slope,maxval))'
  []
  [density_sideways]
    type = ParsedFunction
    symbol_names = 'end_t ymin ymax  minval maxval'
    symbol_values = '0.5   0    1000.0 0 2500'
    expression = 'if(y<ymin+(ymax-ymin)*min(t/end_t,1),minval,maxval)'
  []
  [roof_conductance]
    type = ParsedFunction
    symbol_names = 'end_t ymin ymax   maxval minval'
    symbol_values = '0.5   0    1000.0 1E7      0'
    expression = 'if(y<ymin+(ymax-ymin)*min(t/end_t,1),maxval,minval)'
  []
[]
[UserObjects]
  [dictator]
    type = PorousFlowDictator
    porous_flow_vars = 'porepressure disp_x disp_y disp_z'
    number_fluid_phases = 1
    number_fluid_components = 1
  []
  [pc]
    type = PorousFlowCapillaryPressureVG
    m = 0.5
    alpha = 1 # MPa^-1
  []
  [mc_coh_strong_harden]
    type = TensorMechanicsHardeningExponential
    value_0 = 1.99 # MPa
    value_residual = 2.01 # MPa
    rate = 1.0
  []
  [mc_fric]
    type = TensorMechanicsHardeningConstant
    value = 0.61 # 35deg
  []
  [mc_dil]
    type = TensorMechanicsHardeningConstant
    value = 0.15 # 8deg
  []
  [mc_tensile_str_strong_harden]
    type = TensorMechanicsHardeningExponential
    value_0 = 1.0 # MPa
    value_residual = 1.0 # MPa
    rate = 1.0
  []
  [mc_compressive_str]
    type = TensorMechanicsHardeningCubic
    value_0 = 100 # Large!
    value_residual = 100
    internal_limit = 0.1
  []
  [wp_coh_harden]
    type = TensorMechanicsHardeningCubic
    value_0 = 0.05
    value_residual = 0.05
    internal_limit = 10
  []
  [wp_tan_fric]
    type = TensorMechanicsHardeningConstant
    value = 0.26 # 15deg
  []
  [wp_tan_dil]
    type = TensorMechanicsHardeningConstant
    value = 0.18 # 10deg
  []
  [wp_tensile_str_harden]
    type = TensorMechanicsHardeningCubic
    value_0 = 0.05
    value_residual = 0.05
    internal_limit = 10
  []
  [wp_compressive_str_soften]
    type = TensorMechanicsHardeningCubic
    value_0 = 100
    value_residual = 1
    internal_limit = 1.0
  []
[]
[FluidProperties]
  [simple_fluid]
    type = SimpleFluidProperties
    bulk_modulus = 2E3
    density0 = 1000
    thermal_expansion = 0
    viscosity = 3.5E-17
  []
[]
[Materials]
  [temperature]
    type = PorousFlowTemperature
  []
  [eff_fluid_pressure]
    type = PorousFlowEffectiveFluidPressure
  []
  [vol_strain]
    type = PorousFlowVolumetricStrain
  []
  [ppss]
    type = PorousFlow1PhaseP
    porepressure = porepressure
    capillary_pressure = pc
  []
  [massfrac]
    type = PorousFlowMassFraction
  []
  [simple_fluid]
    type = PorousFlowSingleComponentFluid
    fp = simple_fluid
    phase = 0
  []
  [porosity_bulk]
    type = PorousFlowPorosity
    fluid = true
    mechanical = true
    block = '2 3 4 5 6 7 8 9 10 11 12 13 14 15 16'
    ensure_positive = true
    porosity_zero = 0.02
    solid_bulk = 5.3333E3
  []
  [porosity_excav]
    type = PorousFlowPorosityConst
    block = 1
    porosity = 1.0
  []
  [permeability_bulk]
    type = PorousFlowPermeabilityKozenyCarman
    block = '2 3 4 5 6 7 8 9 10 11 12 13 14 15 16'
    poroperm_function = kozeny_carman_phi0
    k0 = 1E-15
    phi0 = 0.02
    n = 2
    m = 2
  []
  [permeability_excav]
    type = PorousFlowPermeabilityConst
    block = 1
    permeability = '0 0 0   0 0 0   0 0 0'
  []
  [relperm]
    type = PorousFlowRelativePermeabilityCorey
    n = 4
    s_res = 0.4
    sum_s_res = 0.4
    phase = 0
  []
  [elasticity_tensor_0]
    type = ComputeLayeredCosseratElasticityTensor
     block = '2 3 4 5 6 7 8 9 10 11 12 13 14 15 16'
    young = 8E3 # MPa
    poisson = 0.25
    layer_thickness = 1.0
    joint_normal_stiffness = 1E9 # huge
    joint_shear_stiffness = 1E3 # MPa
  []
  [elasticity_tensor_1]
    type = ComputeLayeredCosseratElasticityTensor
    block = 1
    young = 8E3 # MPa
    poisson = 0.25
    layer_thickness = 1.0
    joint_normal_stiffness = 1E9 # huge
    joint_shear_stiffness = 1E3 # MPa
    elasticity_tensor_prefactor = excav_sideways
  []
  [strain]
    type = ComputeCosseratIncrementalSmallStrain
    eigenstrain_names = ini_stress
  []
  [ini_stress]
    type = ComputeEigenstrainFromInitialStress
    eigenstrain_name = ini_stress
    initial_stress = 'ini_xx 0 0  0 ini_xx 0  0 0 ini_zz'
  []
  [stress_0]
    type = ComputeMultipleInelasticCosseratStress
     block = '2 3 4 5 6 7 8 9 10 11 12 13 14 15 16'
    inelastic_models = 'mc wp'
    cycle_models = true
    relative_tolerance = 2.0
    absolute_tolerance = 1E6
    max_iterations = 1
    tangent_operator = nonlinear
    perform_finite_strain_rotations = false
  []
  [stress_1]
    type = ComputeMultipleInelasticCosseratStress
    block = 1
    inelastic_models = ''
    relative_tolerance = 2.0
    absolute_tolerance = 1E6
    max_iterations = 1
    tangent_operator = nonlinear
    perform_finite_strain_rotations = false
  []
  [mc]
    type = CappedMohrCoulombCosseratStressUpdate
    warn_about_precision_loss = false
    host_youngs_modulus = 8E3
    host_poissons_ratio = 0.25
    base_name = mc
    tensile_strength = mc_tensile_str_strong_harden
    compressive_strength = mc_compressive_str
    cohesion = mc_coh_strong_harden
    friction_angle = mc_fric
    dilation_angle = mc_dil
    max_NR_iterations = 100000
    smoothing_tol = 0.1 # MPa  # Must be linked to cohesion
    yield_function_tol = 1E-9 # MPa.  this is essentially the lowest possible without lots of precision loss
    perfect_guess = true
    min_step_size = 1.0
  []
  [wp]
    type = CappedWeakPlaneCosseratStressUpdate
    warn_about_precision_loss = false
    base_name = wp
    cohesion = wp_coh_harden
    tan_friction_angle = wp_tan_fric
    tan_dilation_angle = wp_tan_dil
    tensile_strength = wp_tensile_str_harden
    compressive_strength = wp_compressive_str_soften
    max_NR_iterations = 10000
    tip_smoother = 0.05
    smoothing_tol = 0.05 # MPa  # Note, this must be tied to cohesion, otherwise get no possible return at cone apex
    yield_function_tol = 1E-11 # MPa.  this is essentially the lowest possible without lots of precision loss
    perfect_guess = true
    min_step_size = 1.0E-3
  []
  [undrained_density_0]
    type = GenericConstantMaterial
     block = '2 3 4 5 6 7 8 9 10 11 12 13 14 15 16'
    prop_names = density
    prop_values = 2500
  []
  [undrained_density_1]
    type = GenericFunctionMaterial
    block = 1
    prop_names = density
    prop_values = density_sideways
  []
[]
[Preconditioning]
  [SMP]
    type = SMP
    full = true
  []
[]
[Postprocessors]
  [min_roof_disp]
    type = NodalExtremeValue
    boundary = roof
    value_type = min
    variable = disp_z
  []
  [min_roof_pp]
    type = NodalExtremeValue
    boundary = roof
    value_type = min
    variable = porepressure
  []
  [min_surface_disp]
    type = NodalExtremeValue
    boundary = zmax
    value_type = min
    variable = disp_z
  []
  [min_surface_pp]
    type = NodalExtremeValue
    boundary = zmax
    value_type = min
    variable = porepressure
  []
  [max_perm_zz]
    type = ElementExtremeValue
     block = '2 3 4 5 6 7 8 9 10 11 12 13 14 15 16'
    variable = perm_zz
  []
[]
[Executioner]
  type = Transient
  solve_type = 'NEWTON'
  petsc_options = '-snes_converged_reason'
  # best overall
  # petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
  # petsc_options_value = ' lu       mumps'
  # best if you do not have mumps:
  petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
  petsc_options_value = ' lu       superlu_dist'
  # best if you do not have mumps or superlu_dist:
  #petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
  #petsc_options_value = ' asm      2              lu            gmres     200'
  # very basic:
  #petsc_options_iname = '-pc_type -ksp_type -ksp_gmres_restart'
  #petsc_options_value = ' bjacobi  gmres     200'
  line_search = bt
  nl_abs_tol = 1e-3
  nl_rel_tol = 1e-5
  l_max_its = 200
  nl_max_its = 30
  start_time = 0.0
  dt = 0.014706
  end_time = 0.014706 #0.5
[]
[Outputs]
  time_step_interval = 1
  print_linear_residuals = true
  exodus = true
  csv = true
  console = true
[]
(modules/solid_mechanics/test/tests/weak_plane_shear/large_deform1.i)
# rotate the mesh by 90degrees
# then pull in the z direction - should be no plasticity
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
  type = GeneratedMesh
  dim = 3
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  add_variables = true
  decomposition_method = EigenSolution
  generate_output = 'stress_xz stress_zx stress_yz stress_zz'
[]
[BCs]
  # rotate:
  # ynew = c*y + s*z.  znew = -s*y + c*z
  [bottomx]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = back
    function = '0'
  []
  [bottomy]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = back
    function = '0*y+1*z-y'
  []
  [bottomz]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = back
    function = '-1*y+0*z-z+if(t>0,0.5-y,0)' # note that this uses original nodal values of (x,y,z)
  []
  [topx]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = front
    function = '0'
  []
  [topy]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = front
    function = '0*y+1*z-y'
  []
  [topz]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = '-1*y+0*z-z+if(t>0,0.5-y,0)' # note that this uses original nodal values of (x,y,z)
  []
[]
[AuxVariables]
  [yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[AuxKernels]
  [yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  []
[]
[Postprocessors]
  [s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  []
  [s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  []
  [s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  []
  [f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  []
[]
[UserObjects]
  [coh]
    type = SolidMechanicsHardeningConstant
    value = 1
  []
  [tanphi]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  []
  [tanpsi]
    type = SolidMechanicsHardeningConstant
    value = 0.1111077
  []
  [wps]
    type = SolidMechanicsPlasticWeakPlaneShear
    cohesion = coh
    tan_friction_angle = tanphi
    tan_dilation_angle = tanpsi
    smoother = 0.5
    yield_function_tolerance = 1E-6
    internal_constraint_tolerance = 1E-6
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E6'
  []
  [mc]
    type = ComputeMultiPlasticityStress
    plastic_models = wps
    transverse_direction = '0 0 1'
    ep_plastic_tolerance = 1E-5
    debug_fspb = crash
  []
[]
[Executioner]
  start_time = -1
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  exodus = true
[]
(modules/solid_mechanics/test/tests/capped_weak_plane/pull_push.i)
# A column of elements has its bottom pulled down, and then pushed up again.
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 2
  xmin = -10
  xmax = 10
  ymin = -10
  ymax = 10
  zmin = -100
  zmax = 0
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
  [../]
[]
[BCs]
  [./no_x2]
    type = DirichletBC
    variable = disp_x
    boundary = right
    value = 0.0
  [../]
  [./no_x1]
    type = DirichletBC
    variable = disp_x
    boundary = left
    value = 0.0
  [../]
  [./no_y1]
    type = DirichletBC
    variable = disp_y
    boundary = bottom
    value = 0.0
  [../]
  [./no_y2]
    type = DirichletBC
    variable = disp_y
    boundary = top
    value = 0.0
  [../]
  [./topz]
    type = DirichletBC
    variable = disp_z
    boundary = front
    value = 0
  [../]
  [./bottomz]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = back
    function = 'if(t>1,-2.0+t,-t)'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./strainp_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./straint_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_compressive]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./ls]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./strainp_xx]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_xx
    index_i = 0
    index_j = 0
  [../]
  [./strainp_xy]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_xy
    index_i = 0
    index_j = 1
  [../]
  [./strainp_xz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_xz
    index_i = 0
    index_j = 2
  [../]
  [./strainp_yy]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_yy
    index_i = 1
    index_j = 1
  [../]
  [./strainp_yz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_yz
    index_i = 1
    index_j = 2
  [../]
  [./strainp_zz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = strainp_zz
    index_i = 2
    index_j = 2
  [../]
  [./straint_xx]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_xx
    index_i = 0
    index_j = 0
  [../]
  [./straint_xy]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_xy
    index_i = 0
    index_j = 1
  [../]
  [./straint_xz]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_xz
    index_i = 0
    index_j = 2
  [../]
  [./straint_yy]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_yy
    index_i = 1
    index_j = 1
  [../]
  [./straint_yz]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_yz
    index_i = 1
    index_j = 2
  [../]
  [./straint_zz]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = straint_zz
    index_i = 2
    index_j = 2
  [../]
  [./f_shear]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f_shear
  [../]
  [./f_tensile]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f_tensile
  [../]
  [./f_compressive]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f_compressive
  [../]
  [./intnl_shear]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl_shear
  [../]
  [./intnl_tensile]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 1
    variable = intnl_tensile
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./ls]
    type = MaterialRealAux
    property = plastic_linesearch_needed
    variable = ls
  [../]
[]
[UserObjects]
  [./coh_irrelevant]
    type = SolidMechanicsHardeningCubic
    value_0 = 2E6
    value_residual = 1E6
    internal_limit = 0.01
  [../]
  [./tanphi]
    type = SolidMechanicsHardeningCubic
    value_0 = 0.5
    value_residual = 0.2
    internal_limit = 0.01
  [../]
  [./tanpsi]
    type = SolidMechanicsHardeningConstant
    value = 0.166666666667
  [../]
  [./t_strength]
    type = SolidMechanicsHardeningConstant
    value = 2E6
  [../]
  [./c_strength]
    type = SolidMechanicsHardeningCubic
    value_0 = 1E8
    value_residual = 0.0
    internal_limit = 0.01
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeIsotropicElasticityTensor
    lambda = 6.4e9
    shear_modulus = 6.4e9 # young 16MPa, Poisson 0.25
  [../]
  [./strain]
    type = ComputeIncrementalStrain
  [../]
  [./admissible]
    type = ComputeMultipleInelasticStress
    inelastic_models = stress
    tangent_operator = nonlinear
    perform_finite_strain_rotations = false
  [../]
  [./stress]
    type = CappedWeakPlaneStressUpdate
    cohesion = coh_irrelevant
    tan_friction_angle = tanphi
    tan_dilation_angle = tanpsi
    tensile_strength = t_strength
    compressive_strength = c_strength
    max_NR_iterations = 10
    tip_smoother = 0
    smoothing_tol = 0
    yield_function_tol = 1E-2
    perfect_guess = false
    min_step_size = 1
  [../]
[]
[Preconditioning]
  [./andy]
    type = SMP
    full = true
    petsc_options = '-snes_converged_reason -snes_linesearch_monitor'
    petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
    petsc_options_value = ' asm      2              lu            gmres     200'
  [../]
[]
[Executioner]
  solve_type = 'NEWTON'
  petsc_options = '-snes_converged_reason'
  line_search = bt
  nl_abs_tol = 1E1
  nl_rel_tol = 1e-5
  l_tol = 1E-10
  l_max_its = 100
  nl_max_its = 100
  end_time = 3.0
  dt = 0.1
  type = Transient
[]
[Outputs]
  file_base = pull_push
  exodus = true
  csv = true
[]
(modules/solid_mechanics/test/tests/capped_drucker_prager/small_deform2_outer_tip.i)
# apply repeated stretches in x, y and z directions, so that mean_stress = 0
# This maps out the yield surface in the octahedral plane for zero mean stress
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '-1.5E-6*x+2E-6*x*sin(t)'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '2E-6*y*sin(2*t)'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '-2E-6*z*(sin(t)+sin(2*t))'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1000
  [../]
  [./cs]
    type = SolidMechanicsHardeningConstant
    value = 1000
  [../]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 10
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 20
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 0
  [../]
  [./dp]
    type = SolidMechanicsPlasticDruckerPrager
    mc_cohesion = mc_coh
    mc_friction_angle = mc_phi
    mc_dilation_angle = mc_psi
    mc_interpolation_scheme = outer_tip
    internal_constraint_tolerance = 1 # irrelevant here
    yield_function_tolerance = 1      # irrelevant here
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./admissible]
    type = ComputeMultipleInelasticStress
    inelastic_models = cdp
    perform_finite_strain_rotations = false
  [../]
  [./cdp]
    type = CappedDruckerPragerStressUpdate
    DP_model = dp
    tensile_strength = ts
    compressive_strength = cs
    yield_function_tol = 1E-8
    tip_smoother = 4
    smoothing_tol = 1E-5
  [../]
[]
[Executioner]
  end_time = 100
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform2_outer_tip
  exodus = false
  [./csv]
    type = CSV
  [../]
[]
(modules/porous_flow/test/tests/infiltration_and_drainage/bw02.i)
[Mesh]
  type = GeneratedMesh
  dim = 2
  nx = 200
  ny = 1
  xmin = -10
  xmax = 10
  ymin = 0
  ymax = 0.05
[]
[GlobalParams]
  PorousFlowDictator = dictator
[]
[Functions]
  [dts]
    type = PiecewiseLinear
    y = '1E-1 5E-1 5E-1'
    x = '0 1 10'
  []
[]
[UserObjects]
  [dictator]
    type = PorousFlowDictator
    porous_flow_vars = pressure
    number_fluid_phases = 1
    number_fluid_components = 1
  []
  [pc]
    type = PorousFlowCapillaryPressureBW
    Sn = 0.0
    Ss = 1.0
    C = 1.5
    las = 2
  []
[]
[FluidProperties]
  [simple_fluid]
    type = SimpleFluidProperties
    bulk_modulus = 2e9
    viscosity = 4
    density0 = 10
    thermal_expansion = 0
  []
[]
[Materials]
  [massfrac]
    type = PorousFlowMassFraction
  []
  [temperature]
    type = PorousFlowTemperature
  []
  [simple_fluid]
    type = PorousFlowSingleComponentFluid
    fp = simple_fluid
    phase = 0
  []
  [ppss]
    type = PorousFlow1PhaseP
    porepressure = pressure
    capillary_pressure = pc
  []
  [relperm]
    type = PorousFlowRelativePermeabilityBW
    Sn = 0.0
    Ss = 1.0
    Kn = 0
    Ks = 1
    C = 1.5
    phase = 0
  []
  [porosity]
    type = PorousFlowPorosityConst
    porosity = 0.25
  []
  [permeability]
    type = PorousFlowPermeabilityConst
    permeability = '1 0 0  0 1 0  0 0 1'
  []
[]
[Variables]
  [pressure]
    initial_condition = -9E2
  []
[]
[Kernels]
  [mass0]
    type = PorousFlowMassTimeDerivative
    fluid_component = 0
    variable = pressure
  []
  [flux0]
    type = PorousFlowAdvectiveFlux
    fluid_component = 0
    variable = pressure
    gravity = '-0.1 0 0'
  []
[]
[AuxVariables]
  [SWater]
    family = MONOMIAL
    order = CONSTANT
  []
[]
[AuxKernels]
  [SWater]
    type = MaterialStdVectorAux
    property = PorousFlow_saturation_qp
    index = 0
    variable = SWater
  []
[]
[BCs]
  [recharge]
    type = PorousFlowSink
    variable = pressure
    boundary = right
    flux_function = -1.25 # corresponds to Rstar being 0.5 because i have to multiply by density*porosity
  []
[]
[Preconditioning]
  [andy]
    type = SMP
    full = true
    petsc_options = '-snes_converged_reason -ksp_diagonal_scale -ksp_diagonal_scale_fix -ksp_gmres_modifiedgramschmidt -snes_linesearch_monitor'
    petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap -snes_atol -snes_rtol -snes_max_it'
    petsc_options_value = 'gmres      asm      lu           NONZERO                   2               1E-10      1E-10      10000'
  []
[]
[Executioner]
  type = Transient
  solve_type = Newton
  petsc_options = '-snes_converged_reason'
  end_time = 2
  [TimeStepper]
    type = FunctionDT
    function = dts
  []
[]
[VectorPostprocessors]
  [swater]
    type = LineValueSampler
    variable = SWater
    start_point = '-10 0 0'
    end_point = '10 0 0'
    sort_by = x
    num_points = 80
    execute_on = timestep_end
  []
[]
[Outputs]
  file_base = bw02
  sync_times = '0.5 2 8'
  [exodus]
    type = Exodus
    sync_only = true
  []
  [along_line]
    type = CSV
    sync_only = true
  []
[]
(modules/solid_mechanics/test/tests/capped_mohr_coulomb/random3.i)
# Using CappedMohrCoulomb with Mohr-Coulomb failure only
# Plasticity models:
# Cohesion = 1MPa
# Friction angle = dilation angle = 0.5
#
# Lame lambda = 1GPa.  Lame mu = 1.3GPa
#
# A line of elements is perturbed randomly, and return to the yield surface at each quadpoint is checked
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1000
  ny = 1234
  nz = 1
  xmin = 0
  xmax = 1000
  ymin = 0
  ymax = 1234
  zmin = 0
  zmax = 1
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[ICs]
  [./x]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_x
  [../]
  [./y]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_y
  [../]
  [./z]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_z
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '0'
  [../]
[]
[AuxVariables]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f3]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f4]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f5]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./f0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 6
    variable = f0
  [../]
  [./f1]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 7
    variable = f1
  [../]
  [./f2]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 8
    variable = f2
  [../]
  [./f3]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 9
    variable = f3
  [../]
  [./f4]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 10
    variable = f4
  [../]
  [./f5]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 11
    variable = f5
  [../]
  [./int0]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = int0
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
[]
[Postprocessors]
  [./tot_iters]
    type = ElementIntegralMaterialProperty
    mat_prop = plastic_NR_iterations
    outputs = console
  [../]
  [./intnl_max]
    type = ElementExtremeValue
    variable = int0
    outputs = console
  [../]
  [./raw_f0]
    type = ElementExtremeValue
    variable = f0
    outputs = console
  [../]
  [./raw_f1]
    type = ElementExtremeValue
    variable = f1
    outputs = console
  [../]
  [./raw_f2]
    type = ElementExtremeValue
    variable = f2
    outputs = console
  [../]
  [./raw_f3]
    type = ElementExtremeValue
    variable = f3
    outputs = console
  [../]
  [./raw_f4]
    type = ElementExtremeValue
    variable = f4
    outputs = console
  [../]
  [./raw_f5]
    type = ElementExtremeValue
    variable = f5
    outputs = console
  [../]
  [./iter]
    type = ElementExtremeValue
    variable = iter
    outputs = console
  [../]
  [./f0]
    type = FunctionValuePostprocessor
    function = should_be_zero0_fcn
  [../]
  [./f1]
    type = FunctionValuePostprocessor
    function = should_be_zero1_fcn
  [../]
  [./f2]
    type = FunctionValuePostprocessor
    function = should_be_zero2_fcn
  [../]
  [./f3]
    type = FunctionValuePostprocessor
    function = should_be_zero3_fcn
  [../]
  [./f4]
    type = FunctionValuePostprocessor
    function = should_be_zero4_fcn
  [../]
  [./f5]
    type = FunctionValuePostprocessor
    function = should_be_zero5_fcn
  [../]
[]
[Functions]
  [./should_be_zero0_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-1,0,a)'
    symbol_names = 'a'
    symbol_values = 'raw_f0'
  [../]
  [./should_be_zero1_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-1,0,a)'
    symbol_names = 'a'
    symbol_values = 'raw_f1'
  [../]
  [./should_be_zero2_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-1,0,a)'
    symbol_names = 'a'
    symbol_values = 'raw_f2'
  [../]
  [./should_be_zero3_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-1,0,a)'
    symbol_names = 'a'
    symbol_values = 'raw_f3'
  [../]
  [./should_be_zero4_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-1,0,a)'
    symbol_names = 'a'
    symbol_values = 'raw_f4'
  [../]
  [./should_be_zero5_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-1,0,a)'
    symbol_names = 'a'
    symbol_values = 'raw_f5'
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1E12
  [../]
  [./cs]
    type = SolidMechanicsHardeningConstant
    value = 1E12
  [../]
  [./coh]
    type = SolidMechanicsHardeningCubic
    value_0 = 1E6
    value_residual = 0
    internal_limit = 1
  [../]
  [./ang]
    type = SolidMechanicsHardeningCubic
    value_0 = 0.9
    value_residual = 0.2
    internal_limit = 1
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '1E9 1.3E9'
  [../]
  [./tensile]
    type = CappedMohrCoulombStressUpdate
    tensile_strength = ts
    compressive_strength = cs
    cohesion = coh
    friction_angle = ang
    dilation_angle = ang
    smoothing_tol = 1E5
    max_NR_iterations = 100
    yield_function_tol = 1.0E-1
  [../]
  [./stress]
    type = ComputeMultipleInelasticStress
    inelastic_models = tensile
    perform_finite_strain_rotations = false
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = random3
  csv = true
[]
(modules/solid_mechanics/test/tests/multi/two_surface01.i)
# Plasticit models:
# SimpleTester with a = 0 and b = 1 and strength = 1
# SimpleTester with a = 1 and b = 1 and strength = 2
#
# Lame lambda = 0 (Poisson=0).  Lame mu = 0.5E6
#
# A single element is stretched by 1.5E-6m in the z directions.
# stress_zz = 1.5
#
# Then only the first SimpleTester should activate, and the final stress
# should have have only nonzero component stress_zz = 1
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1.5E-6*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int1]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./int0]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 0
    variable = int0
  [../]
  [./int1]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 1
    variable = int1
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./int0]
    type = PointValue
    point = '0 0 0'
    variable = int0
  [../]
  [./int1]
    type = PointValue
    point = '0 0 0'
    variable = int1
  [../]
[]
[UserObjects]
  [./simple1]
    type = SolidMechanicsPlasticSimpleTester
    a = 0
    b = 1
    strength = 1
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
  [./simple2]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 1
    strength = 2
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 0.5E6'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./multi]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = 'simple1 simple2'
    max_NR_iterations = 2
    min_stepsize = 1
    debug_fspb = crash
    debug_jac_at_stress = '10 0 0 0 10 0 0 0 10'
    debug_jac_at_pm = '1 1'
    debug_jac_at_intnl = '1 1'
    debug_stress_change = 1E-5
    debug_pm_change = '1E-6 1E-6'
    debug_intnl_change = '1E-6 1E-6'
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = two_surface01
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/multi/two_surface04.i)
# Plasticit models:
# SimpleTester with a = 0 and b = 1 and strength = 1
# SimpleTester with a = 1 and b = 1 and strength = 2
#
# Lame lambda = 0 (Poisson=0).  Lame mu = 0.5E6
#
# A single element is stretched by 4.0E-6m in y directions and 2.0E-6 in z direction.
# trial stress_zz = 2 and stress_yy = 4
#
# Then both  SimpleTesters should activate initially and return to the "corner" point
# (stress_zz = 1 = stress_yy), but then the plastic multiplier for SimpleTester1 will
# be negative, and so it will be deactivated, and the algorithm will return to
# stress_zz = 0, stress_yy = 2
# internal1 should be zero, internal2 should be 2
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '4E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '2E-6*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int1]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./int0]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 0
    variable = int0
  [../]
  [./int1]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 1
    variable = int1
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./int0]
    type = PointValue
    point = '0 0 0'
    variable = int0
  [../]
  [./int1]
    type = PointValue
    point = '0 0 0'
    variable = int1
  [../]
[]
[UserObjects]
  [./simple1]
    type = SolidMechanicsPlasticSimpleTester
    a = 0
    b = 1
    strength = 1
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
  [./simple2]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 1
    strength = 2
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 0.5E6'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./multi]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = 'simple1 simple2'
    max_NR_iterations = 2
    min_stepsize = 1
    debug_fspb = crash
    debug_jac_at_stress = '10 0 0 0 10 0 0 0 10'
    debug_jac_at_pm = '1 1'
    debug_jac_at_intnl = '1 1'
    debug_stress_change = 1E-5
    debug_pm_change = '1E-6 1E-6'
    debug_intnl_change = '1E-6 1E-6'
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = two_surface04
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/tensile/small_deform1_update_version.i)
# Using TensileStressUpdate
# checking for small deformation
# A single element is stretched by 1E-6m in z direction, and by small amounts in x and y directions
# stress_zz = Youngs Modulus*Strain = 2E6*1E-6 = 2 Pa
# tensile_strength is set to 1Pa
# Then the final stress should return to the yeild surface and the maximum principal stress value should be 1pa.
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
  [GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    strain = finite
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0.1E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0.2E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1E-6*z'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 2.0E6'
  [../]
  [./tensile]
    type = TensileStressUpdate
    tensile_strength = ts
    smoothing_tol = 0.0
    yield_function_tol = 1.0E-9
  [../]
  [./stress]
    type = ComputeMultipleInelasticStress
    inelastic_models = tensile
    perform_finite_strain_rotations = false
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform1_update_version
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/tensile/small_deform9_update_version.i)
# A single unit element is stretched in a complicated way
# that the trial stress is
#
#      1.16226      -0.0116587       0.0587872
#     -0.0116587         1.12695       0.0779428
#      0.0587872       0.0779428        0.710169
#
# This has eigenvalues
# la = {0.68849, 1.14101, 1.16987}
# and eigenvectors
#
# {-0.125484, -0.176871, 0.976202}
# {-0.0343704, -0.982614, -0.182451}
# {0.9915, -0.0564471, 0.117223}
#
# The tensile strength is 0.5 and Young=1 and Poisson=0.25.
# Using smoothing_tol=0.01, the return-map algorithm should
# return to, approximately, stress_I=stress_II=0.5.  This
# is a reduction of 0.65, so stress_III is approximately
# 0.68849 - 0.25 * 0.65 * 2 = 0.36.  The stress_I reduction of
# 0.67 gives an internal parameter of
# 0.67 / (E(1-v)/(1+v)/(1-2v)) = 0.558
# The final stress is
#
# {0.498, -0.003, 0.017},
# {-0.003, 0.495, 0.024},
# {0.017, 0.024,  0.367}
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    strain = finite
    generate_output = 'max_principal_stress mid_principal_stress min_principal_stress stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '3*x+2*y+z'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '3*x-4*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = 'x-2*z'
  [../]
[]
[AuxVariables]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./f0_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./intnl_auxk]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl
  [../]
[]
[Postprocessors]
  [./s_I]
    type = PointValue
    point = '0 0 0'
    variable = max_principal_stress
  [../]
  [./s_II]
    type = PointValue
    point = '0 0 0'
    variable = mid_principal_stress
  [../]
  [./s_III]
    type = PointValue
    point = '0 0 0'
    variable = min_principal_stress
  [../]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./f2]
    type = PointValue
    point = '0 0 0'
    variable = f2
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
  [./intnl]
    type = PointValue
    point = '0 0 0'
    variable = intnl
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 1
    poissons_ratio = 0.25
  [../]
  [./tensile]
    type = TensileStressUpdate
    tensile_strength = ts
    smoothing_tol = 0.001
    yield_function_tol = 1.0E-12
  [../]
  [./stress]
    type = ComputeMultipleInelasticStress
    inelastic_models = tensile
    perform_finite_strain_rotations = false
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform9_update_version
  exodus = false
  [./csv]
    type = CSV
  [../]
[]
(modules/solid_mechanics/test/tests/drucker_prager/small_deform3_inner_tip.i)
# apply repeated stretches in x z directions, and smaller stretches along the y direction,
# so that sigma_I = sigma_II,
# which means that lode angle = 30deg.
# The allows yield surface in meridional plane to be mapped out
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '1E-6*x*t'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '-1.7E-6*y*t'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1E-6*z*t'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_int]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./mc_int_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = mc_int
  [../]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./internal]
    type = PointValue
    point = '0 0 0'
    variable = mc_int
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 10
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 35
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 5
    convert_to_radians = true
  [../]
  [./mc]
    type = SolidMechanicsPlasticDruckerPragerHyperbolic
    mc_cohesion = mc_coh
    mc_friction_angle = mc_phi
    mc_dilation_angle = mc_psi
    smoother = 8
    mc_interpolation_scheme = inner_tip
    yield_function_tolerance = 1E-7
    internal_constraint_tolerance = 1E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./strain]
    type = ComputeIncrementalStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-13
    plastic_models = mc
    debug_fspb = crash
  [../]
[]
[Executioner]
  end_time = 10
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform3_inner_tip
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/porous_flow/test/tests/buckley_leverett/bl01.i)
# Buckley-Leverett 1-phase.
# The front starts at (around) x=5, and at t=50 it should
# have moved to x=9.6.  The version below has a nonzero
# suction function, and at t=50, the front sits between
# (about) x=9.6 and x=9.9.  Changing the van-Genuchten
# al parameter to 1E-4 softens the front so it sits between
# (about) x=9.7 and x=10.4, and the simulation runs much faster.
# With al=1E-2 and nx=600, the front sits between x=9.6 and x=9.8,
# but takes about 100 times longer to run.
[Mesh]
  type = GeneratedMesh
  dim = 1
  nx = 150
  xmin = 0
  xmax = 15
[]
[GlobalParams]
  PorousFlowDictator = dictator
  compute_enthalpy = false
  compute_internal_energy = false
[]
[Variables]
  [pp]
    [InitialCondition]
      type = FunctionIC
      function = 'max((1000000-x/5*1000000)-20000,-20000)'
    []
  []
[]
[Kernels]
  [mass0]
    type = PorousFlowMassTimeDerivative
    fluid_component = 0
    variable = pp
  []
  [flux0]
    type = PorousFlowAdvectiveFlux
    fluid_component = 0
    variable = pp
    gravity = '0 0 0'
  []
[]
[BCs]
  [left]
    type = DirichletBC
    variable = pp
    boundary = left
    value = 980000
  []
[]
[AuxVariables]
  [sat]
    family = MONOMIAL
    order = CONSTANT
  []
[]
[AuxKernels]
  [sat]
    type = MaterialStdVectorAux
    variable = sat
    execute_on = timestep_end
    index = 0
    property = PorousFlow_saturation_qp
  []
[]
[UserObjects]
  [dictator]
    type = PorousFlowDictator
    porous_flow_vars = 'pp'
    number_fluid_phases = 1
    number_fluid_components = 1
  []
  [pc]
    type = PorousFlowCapillaryPressureVG
    m = 0.8
    alpha = 1e-3
  []
[]
[FluidProperties]
  [simple_fluid]
    type = SimpleFluidProperties
    bulk_modulus = 2e6
    viscosity = 1e-3
    density0 = 1000
    thermal_expansion = 0
  []
[]
[Materials]
  [temperature]
    type = PorousFlowTemperature
  []
  [ppss]
    type = PorousFlow1PhaseP
    porepressure = pp
    capillary_pressure = pc
  []
  [massfrac]
    type = PorousFlowMassFraction
  []
  [simple_fluid]
    type = PorousFlowSingleComponentFluid
    fp = simple_fluid
    phase = 0
  []
  [permeability]
    type = PorousFlowPermeabilityConst
    permeability = '1E-10 0 0  0 1E-10 0  0 0 1E-10'
  []
  [relperm]
    type = PorousFlowRelativePermeabilityCorey
    n = 2
    phase = 0
  []
  [porosity]
    type = PorousFlowPorosityConst
    porosity = 0.15
  []
[]
[Preconditioning]
  active = andy
  [andy]
    type = SMP
    full = true
    petsc_options_iname = '-ksp_type -pc_type -snes_atol -snes_rtol -snes_max_it'
    petsc_options_value = 'gmres bjacobi 1E-10 1E-10 20'
  []
[]
[Functions]
  [timestepper]
    type = PiecewiseLinear
    x = '0    0.01 0.1 1   1.5 2   20  30  40  50'
    y = '0.01 0.1  0.2 0.3 0.1 0.3 0.3 0.4 0.4 0.5'
  []
[]
[Executioner]
  type = Transient
  solve_type = Newton
  end_time = 50
  [TimeStepper]
    type = FunctionDT
    function = timestepper
  []
[]
[VectorPostprocessors]
  [pp]
    type = LineValueSampler
    start_point = '0 0 0'
    end_point = '15 0 0'
    num_points = 150
    sort_by = x
    variable = pp
  []
  [sat]
    type = LineValueSampler
    warn_discontinuous_face_values = false
    start_point = '0 0 0'
    end_point = '15 0 0'
    num_points = 150
    sort_by = x
    variable = sat
  []
[]
[Outputs]
  file_base = bl01
  [csv]
    type = CSV
    sync_only = true
    sync_times = '0.01 50'
  []
  [exodus]
    type = Exodus
    execute_on = 'initial final'
  []
[]
(modules/solid_mechanics/test/tests/multi/three_surface15.i)
# Plasticit models:
# SimpleTester0 with a = 0 and b = 1 and strength = 1
# SimpleTester1 with a = 1 and b = 0 and strength = 1
# SimpleTester2 with a = 1 and b = 1 and strength = 3
#
# Lame lambda = 0 (Poisson=0).  Lame mu = 0.5E6
#
# A single element is stretched by 3.0E-6m in y direction and 3E-6 in z direction.
# trial stress_yy = 3.0 and stress_zz = 3
#
# A complicated return will follow, with various contraints being
# deactivated, kuhn-tucker failing, line-searching, etc, but
# the result should be
# stress_yy=1=stress_zz, and internal0=2 internal1=2
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '3.0E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '3.0E-6*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int2]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./int0]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 0
    variable = int0
  [../]
  [./int1]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 1
    variable = int1
  [../]
  [./int2]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 2
    variable = int2
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./f2]
    type = PointValue
    point = '0 0 0'
    variable = f2
  [../]
  [./int0]
    type = PointValue
    point = '0 0 0'
    variable = int0
  [../]
  [./int1]
    type = PointValue
    point = '0 0 0'
    variable = int1
  [../]
  [./int2]
    type = PointValue
    point = '0 0 0'
    variable = int2
  [../]
[]
[UserObjects]
  [./simple0]
    type = SolidMechanicsPlasticSimpleTester
    a = 0
    b = 1
    strength = 1
    yield_function_tolerance = 1.0E-6
    internal_constraint_tolerance = 1.0E-6
  [../]
  [./simple1]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 0
    strength = 1
    yield_function_tolerance = 1.0E-6
    internal_constraint_tolerance = 1.0E-6
  [../]
  [./simple2]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 1
    strength = 3
    yield_function_tolerance = 1.0E-6
    internal_constraint_tolerance = 1.0E-6
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 0.5E6'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./multi]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = 'simple0 simple1 simple2'
    max_NR_iterations = 4
    min_stepsize = 1
    debug_fspb = crash
    debug_jac_at_stress = '10 0 0 0 10 0 0 0 10'
    debug_jac_at_pm = '1 1 1'
    debug_jac_at_intnl = '1 1 1'
    debug_stress_change = 1E-5
    debug_pm_change = '1E-6 1E-6 1E-6'
    debug_intnl_change = '1E-6 1E-6 1E-6'
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = three_surface15
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/monolithic_material_based/crysp_read_slip_prop.i)
[Mesh]
  type = GeneratedMesh
  dim = 3
  elem_type = HEX8
  displacements = 'ux uy uz'
[]
[Variables]
  [./ux]
    block = 0
  [../]
  [./uy]
    block = 0
  [../]
  [./uz]
    block = 0
  [../]
[]
[AuxVariables]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
  [./fp_zz]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
  [./rotout]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
  [./e_zz]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
  [./gss1]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
[]
[Functions]
  [./tdisp]
    type = ParsedFunction
    expression = 0.01*t
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'ux uy uz'
    use_displaced_mesh = true
  [../]
[]
[AuxKernels]
  [./stress_zz]
    type = RankTwoAux
    variable = stress_zz
    rank_two_tensor = stress
    index_j = 2
    index_i = 2
    execute_on = timestep_end
    block = 0
  [../]
  [./fp_zz]
    type = RankTwoAux
    variable = fp_zz
    rank_two_tensor = fp
    index_j = 2
    index_i = 2
    execute_on = timestep_end
    block = 0
  [../]
  [./e_zz]
    type = RankTwoAux
    variable = e_zz
    rank_two_tensor = lage
    index_j = 2
    index_i = 2
    execute_on = timestep_end
    block = 0
  [../]
  [./gss1]
    type = MaterialStdVectorAux
    variable = gss1
    property = gss
    index = 0
    execute_on = timestep_end
    block = 0
  [../]
[]
[BCs]
  [./symmy]
    type = DirichletBC
    variable = uy
    boundary = bottom
    value = 0
  [../]
  [./symmx]
    type = DirichletBC
    variable = ux
    boundary = left
    value = 0
  [../]
  [./symmz]
    type = DirichletBC
    variable = uz
    boundary = back
    value = 0
  [../]
  [./tdisp]
    type = FunctionDirichletBC
    variable = uz
    boundary = front
    function = tdisp
  [../]
[]
[Materials]
  [./crysp]
    type = FiniteStrainCrystalPlasticity
    block = 0
    gtol = 1e-2
    slip_sys_file_name = input_slip_sys_prop.txt
    nss = 12
    num_slip_sys_flowrate_props = 2 #Number of properties in a slip system
    flowprops = '1 4 0.001 0.1 5 8 0.001 0.1 9 12 0.001 0.1'
    hprops = '1.0 541.5 60.8 109.8 2.5'
    tan_mod_type = exact
    intvar_read_type = slip_sys_file
    num_slip_sys_props = 1
  [../]
  [./elasticity_tensor]
    type = ComputeElasticityTensorCP
    block = 0
    C_ijkl = '1.684e5 1.214e5 1.214e5 1.684e5 1.214e5 1.684e5 0.754e5 0.754e5 0.754e5'
    fill_method = symmetric9
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'ux uy uz'
  [../]
[]
[Postprocessors]
  [./stress_zz]
    type = ElementAverageValue
    variable = stress_zz
    block = 'ANY_BLOCK_ID 0'
  [../]
  [./fp_zz]
    type = ElementAverageValue
    variable = fp_zz
    block = 'ANY_BLOCK_ID 0'
  [../]
  [./e_zz]
    type = ElementAverageValue
    variable = e_zz
    block = 'ANY_BLOCK_ID 0'
  [../]
  [./gss1]
    type = ElementAverageValue
    variable = gss1
    block = 'ANY_BLOCK_ID 0'
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  #Preconditioned JFNK (default)
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  nl_rel_tol = 1e-10
  nl_abs_tol = 1e-10
  dt = 0.05
  dtmax = 10.0
  dtmin = 0.05
  num_steps = 10
[]
[Outputs]
  file_base = crysp_read_slip_prop_out
  exodus = true
[]
(modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform12.i)
# Using CappedMohrCoulomb with compressive failure only
# checking for small deformation
# A single element is stretched equally in all directions.
# This causes the return direction to be along the sigma_I = sigma_II = sigma_III line
# compressive_strength is set to 1Pa, and smoothing_tol = 0.1Pa
# The smoothed yield function comes from two smoothing operations.
# The first is on sigma_I and sigma_II (sigma_I >= sigma_II >= sigma_III):
# yf = -sigma_I + ismoother(0) - compressive_strength
#    = -sigma_I + (0.5 * smoothing_tol - smoothing_tol / Pi) - compressive_strength
#    = -sigma_I + 0.018169 - 1
# The second has the argument of ismoother equal to -0.018169.
# ismoother(-0.018169) = 0.5 * (-0.018169 + 0.1) - 0.1 * cos (0.5 * Pi * -0.018169 / 0.1) / Pi
#                     = 0.010372
# So the final yield function is
# yf = -sigma_I + 0.018169 + 0.010372 - 1 = -sigma_I + 0.028541 - 1
# However, because of the asymmetry in smoothing (the yield function is obtained
# by first smoothing -sigma_I-cs and -sigma_II-cs, and then by smoothing this
# result with -sigma_III-cs) the result is sigma_I > sigma_II = sigma_III
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'max_principal_stress mid_principal_stress min_principal_stress stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '-1E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '-1E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '-1E-6*z'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_I]
    type = PointValue
    point = '0 0 0'
    variable = max_principal_stress
  [../]
  [./s_II]
    type = PointValue
    point = '0 0 0'
    variable = mid_principal_stress
  [../]
  [./s_III]
    type = PointValue
    point = '0 0 0'
    variable = min_principal_stress
  [../]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1
  [../]
  [./cs]
    type = SolidMechanicsHardeningConstant
    value = 1
  [../]
  [./coh]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./ang]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 2.0E6'
  [../]
  [./tensile]
    type = CappedMohrCoulombStressUpdate
    tensile_strength = ts
    compressive_strength = cs
    cohesion = coh
    friction_angle = ang
    dilation_angle = ang
    smoothing_tol = 0.1
    yield_function_tol = 1.0E-12
  [../]
  [./stress]
    type = ComputeMultipleInelasticStress
    inelastic_models = tensile
    perform_finite_strain_rotations = false
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform12
  csv = true
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/monolithic_material_based/crysp_substep.i)
[Mesh]
  type = GeneratedMesh
  dim = 3
  elem_type = HEX8
  displacements = 'ux uy uz'
[]
[Variables]
  [./ux]
    block = 0
  [../]
  [./uy]
    block = 0
  [../]
  [./uz]
    block = 0
  [../]
[]
[AuxVariables]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
  [./fp_zz]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
  [./rotout]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
  [./e_zz]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
  [./gss1]
    order = CONSTANT
    family = MONOMIAL
    block = 0
  [../]
[]
[Functions]
  [./tdisp]
    type = ParsedFunction
    expression = 0.01*t
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'ux uy uz'
    use_displaced_mesh = true
  [../]
[]
[AuxKernels]
  [./stress_zz]
    type = RankTwoAux
    variable = stress_zz
    rank_two_tensor = stress
    index_j = 2
    index_i = 2
    execute_on = timestep_end
    block = 0
  [../]
  [./fp_zz]
    type = RankTwoAux
    variable = fp_zz
    rank_two_tensor = fp
    index_j = 2
    index_i = 2
    execute_on = timestep_end
    block = 0
  [../]
  [./e_zz]
    type = RankTwoAux
    variable = e_zz
    rank_two_tensor = lage
    index_j = 2
    index_i = 2
    execute_on = timestep_end
    block = 0
  [../]
  [./gss1]
    type = MaterialStdVectorAux
    variable = gss1
    property = gss
    index = 0
    execute_on = timestep_end
    block = 0
  [../]
[]
[BCs]
  [./symmy]
    type = DirichletBC
    variable = uy
    boundary = bottom
    value = 0
  [../]
  [./symmx]
    type = DirichletBC
    variable = ux
    boundary = left
    value = 0
  [../]
  [./symmz]
    type = DirichletBC
    variable = uz
    boundary = back
    value = 0
  [../]
  [./tdisp]
    type = FunctionDirichletBC
    variable = uz
    boundary = front
    function = tdisp
  [../]
[]
[Materials]
  [./crysp]
    type = FiniteStrainCrystalPlasticity
    block = 0
    gtol = 1e-2
    slip_sys_file_name = input_slip_sys.txt
    nss = 12
    num_slip_sys_flowrate_props = 2 #Number of properties in a slip system
    flowprops = '1 4 0.001 0.1 5 8 0.001 0.1 9 12 0.001 0.1'
    hprops = '1.0 541.5 60.8 109.8 2.5'
    gprops = '1 4 60.8 5 8 60.8 9 12 60.8'
    tan_mod_type = exact
    gen_random_stress_flag = false
    maximum_substep_iteration = 2
  [../]
  [./elasticity_tensor]
    type = ComputeElasticityTensorCP
    block = 0
    C_ijkl = '1.684e5 1.214e5 1.214e5 1.684e5 1.214e5 1.684e5 0.754e5 0.754e5 0.754e5'
    fill_method = symmetric9
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'ux uy uz'
  [../]
[]
[Postprocessors]
  [./stress_zz]
    type = ElementAverageValue
    variable = stress_zz
    block = 'ANY_BLOCK_ID 0'
  [../]
  [./fp_zz]
    type = ElementAverageValue
    variable = fp_zz
    block = 'ANY_BLOCK_ID 0'
  [../]
  [./e_zz]
    type = ElementAverageValue
    variable = e_zz
    block = 'ANY_BLOCK_ID 0'
  [../]
  [./gss1]
    type = ElementAverageValue
    variable = gss1
    block = 'ANY_BLOCK_ID 0'
  [../]
[]
[Preconditioning]
  [./smp]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  type = Transient
  #Preconditioned JFNK (default)
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  nl_rel_tol = 1e-10
  nl_abs_tol = 1e-10
  dt = 0.5
  dtmax = 10.0
  dtmin = 0.5
  num_steps = 3
[]
[Outputs]
  file_base = crysp_substep_out
  exodus = true
  csv = true
  gnuplot = true
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/twinning/combined_twinning_slip_111tension.i)
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
  [cube]
    type = GeneratedMeshGenerator
    dim = 3
    nx = 2
    ny = 2
    nz = 2
    elem_type = HEX8
  []
[]
[AuxVariables]
  [fp_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [total_twin_volume_fraction]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_0]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_1]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_2]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_3]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_4]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_5]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_6]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_7]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_8]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_9]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_10]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_11]
    order = CONSTANT
    family = MONOMIAL
  []
  [twin_volume_fraction_0]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_1]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_2]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_3]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_4]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_5]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_6]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_7]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_8]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_9]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_10]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_11]
   order = CONSTANT
   family = MONOMIAL
  []
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  add_variables = true
[]
[AuxKernels]
  [fp_zz]
    type = RankTwoAux
    variable = fp_zz
    rank_two_tensor = plastic_deformation_gradient
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [total_twin_volume_fraction]
    type = MaterialRealAux
    variable = total_twin_volume_fraction
    property = twin_total_volume_fraction_twins
    execute_on = timestep_end
  []
  [slip_increment_0]
   type = MaterialStdVectorAux
   variable = slip_increment_0
   property = slip_increment
   index = 0
   execute_on = timestep_end
  []
  [slip_increment_1]
   type = MaterialStdVectorAux
   variable = slip_increment_1
   property = slip_increment
   index = 1
   execute_on = timestep_end
  []
  [slip_increment_2]
   type = MaterialStdVectorAux
   variable = slip_increment_2
   property = slip_increment
   index = 2
   execute_on = timestep_end
  []
  [slip_increment_3]
   type = MaterialStdVectorAux
   variable = slip_increment_3
   property = slip_increment
   index = 3
   execute_on = timestep_end
  []
  [slip_increment_4]
   type = MaterialStdVectorAux
   variable = slip_increment_4
   property = slip_increment
   index = 4
   execute_on = timestep_end
  []
  [slip_increment_5]
   type = MaterialStdVectorAux
   variable = slip_increment_5
   property = slip_increment
   index = 5
   execute_on = timestep_end
  []
  [slip_increment_6]
   type = MaterialStdVectorAux
   variable = slip_increment_6
   property = slip_increment
   index = 6
   execute_on = timestep_end
  []
  [slip_increment_7]
   type = MaterialStdVectorAux
   variable = slip_increment_7
   property = slip_increment
   index = 7
   execute_on = timestep_end
  []
  [slip_increment_8]
   type = MaterialStdVectorAux
   variable = slip_increment_8
   property = slip_increment
   index = 8
   execute_on = timestep_end
  []
  [slip_increment_9]
   type = MaterialStdVectorAux
   variable = slip_increment_9
   property = slip_increment
   index = 9
   execute_on = timestep_end
  []
  [slip_increment_10]
   type = MaterialStdVectorAux
   variable = slip_increment_10
   property = slip_increment
   index = 10
   execute_on = timestep_end
  []
  [slip_increment_11]
   type = MaterialStdVectorAux
   variable = slip_increment_11
   property = slip_increment
   index = 11
   execute_on = timestep_end
  []
  [twin_volume_fraction_0]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_0
   property = twin_twin_system_volume_fraction
   index = 0
   execute_on = timestep_end
  []
  [twin_volume_fraction_1]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_1
   property = twin_twin_system_volume_fraction
   index = 1
   execute_on = timestep_end
  []
  [twin_volume_fraction_2]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_2
   property = twin_twin_system_volume_fraction
   index = 2
   execute_on = timestep_end
  []
  [twin_volume_fraction_3]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_3
   property = twin_twin_system_volume_fraction
   index = 3
   execute_on = timestep_end
  []
  [twin_volume_fraction_4]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_4
   property = twin_twin_system_volume_fraction
   index = 4
   execute_on = timestep_end
  []
  [twin_volume_fraction_5]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_5
   property = twin_twin_system_volume_fraction
   index = 5
   execute_on = timestep_end
  []
  [twin_volume_fraction_6]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_6
   property = twin_twin_system_volume_fraction
   index = 6
   execute_on = timestep_end
  []
  [twin_volume_fraction_7]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_7
   property = twin_twin_system_volume_fraction
   index = 7
   execute_on = timestep_end
  []
  [twin_volume_fraction_8]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_8
   property = twin_twin_system_volume_fraction
   index = 8
   execute_on = timestep_end
  []
  [twin_volume_fraction_9]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_9
   property = twin_twin_system_volume_fraction
   index = 9
   execute_on = timestep_end
  []
  [twin_volume_fraction_10]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_10
   property = twin_twin_system_volume_fraction
   index = 10
   execute_on = timestep_end
  []
  [twin_volume_fraction_11]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_11
   property = twin_twin_system_volume_fraction
   index = 11
   execute_on = timestep_end
  []
[]
[BCs]
  [fix_y]
    type = DirichletBC
    variable = disp_y
    preset = true
    boundary = 'bottom'
    value = 0
  []
  [fix_x]
    type = DirichletBC
    variable = disp_x
    boundary = 'left'
    value = 0
  []
  [fix_z]
    type = DirichletBC
    variable = disp_z
    boundary = 'back'
    value = 0
  []
  [tdisp]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = '0.02*t'
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensorCP
    C_ijkl = '1.684e5 1.214e5 1.214e5 1.684e5 1.214e5 1.684e5 0.754e5 0.754e5 0.754e5' # roughly copper
    fill_method = symmetric9
    euler_angle_1 = 54.74
    euler_angle_2 = 45.0
    euler_angle_3 = 270.0
  []
  [stress]
    type = ComputeMultipleCrystalPlasticityStress
    crystal_plasticity_models = 'twin_xtalpl slip_xtalpl'
    tan_mod_type = exact
  []
  [twin_xtalpl]
    type = CrystalPlasticityTwinningKalidindiUpdate
    base_name = twin
    number_slip_systems = 12
    slip_sys_file_name = 'fcc_input_twinning_systems.txt'
    initial_twin_lattice_friction = 60.0
  []
  [slip_xtalpl]
    type = CrystalPlasticityKalidindiUpdate
    number_slip_systems = 12
    slip_sys_file_name = input_slip_sys.txt
    total_twin_volume_fraction = 'twin_total_volume_fraction_twins'
  []
[]
[Postprocessors]
  [fp_zz]
    type = ElementAverageValue
    variable = fp_zz
  []
  [total_twin_volume_fraction]
    type = ElementAverageValue
    variable = total_twin_volume_fraction
  []
  [slip_increment_0]
    type = ElementAverageValue
    variable = slip_increment_0
  []
  [slip_increment_1]
    type = ElementAverageValue
    variable = slip_increment_1
  []
  [slip_increment_2]
    type = ElementAverageValue
    variable = slip_increment_2
  []
  [slip_increment_3]
    type = ElementAverageValue
    variable = slip_increment_3
  []
  [slip_increment_4]
    type = ElementAverageValue
    variable = slip_increment_4
  []
  [slip_increment_5]
    type = ElementAverageValue
    variable = slip_increment_5
  []
  [slip_increment_6]
    type = ElementAverageValue
    variable = slip_increment_6
  []
  [slip_increment_7]
    type = ElementAverageValue
    variable = slip_increment_7
  []
  [slip_increment_8]
    type = ElementAverageValue
    variable = slip_increment_8
  []
  [slip_increment_9]
    type = ElementAverageValue
    variable = slip_increment_9
  []
  [slip_increment_10]
    type = ElementAverageValue
    variable = slip_increment_10
  []
  [slip_increment_11]
    type = ElementAverageValue
    variable = slip_increment_11
  []
  [twin_volume_fraction_0]
    type = ElementAverageValue
    variable = twin_volume_fraction_0
  []
  [twin_volume_fraction_1]
    type = ElementAverageValue
    variable = twin_volume_fraction_1
  []
  [twin_volume_fraction_2]
    type = ElementAverageValue
    variable = twin_volume_fraction_2
  []
  [twin_volume_fraction_3]
    type = ElementAverageValue
    variable = twin_volume_fraction_3
  []
  [twin_volume_fraction_4]
    type = ElementAverageValue
    variable = twin_volume_fraction_4
  []
  [twin_volume_fraction_5]
    type = ElementAverageValue
    variable = twin_volume_fraction_5
  []
  [twin_volume_fraction_6]
    type = ElementAverageValue
    variable = twin_volume_fraction_6
  []
  [twin_volume_fraction_7]
    type = ElementAverageValue
    variable = twin_volume_fraction_7
  []
  [twin_volume_fraction_8]
    type = ElementAverageValue
    variable = twin_volume_fraction_8
  []
  [twin_volume_fraction_9]
    type = ElementAverageValue
    variable = twin_volume_fraction_9
  []
  [twin_volume_fraction_10]
    type = ElementAverageValue
    variable = twin_volume_fraction_10
  []
  [twin_volume_fraction_11]
    type = ElementAverageValue
    variable = twin_volume_fraction_11
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
  petsc_options_value = ' asm      2              lu            gmres     200'
  nl_abs_tol = 1e-10
  nl_rel_tol = 1e-10
  nl_abs_step_tol = 1e-10
  dt = 0.005
  dtmin = 0.01
  num_steps = 6
[]
[Outputs]
  csv = true
  perf_graph = true
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/hcp_single_crystal/update_method_hcp_basal_active.i)
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
  [cube]
    type = GeneratedMeshGenerator
    dim = 3
    nx = 2
    ny = 2
    nz = 2
    elem_type = HEX8
  []
[]
[AuxVariables]
  [temperature]
  []
  [pk2_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [fp_xx]
    order = CONSTANT
    family = MONOMIAL
  []
  [fp_yy]
    order = CONSTANT
    family = MONOMIAL
  []
  [fp_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [e_xx]
    order = CONSTANT
    family = MONOMIAL
  []
  [e_yy]
    order = CONSTANT
    family = MONOMIAL
  []
  [e_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_0]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment_1]
    order = CONSTANT
    family = MONOMIAL
  []
  [resolved_shear_stress_0]
    order = CONSTANT
    family = MONOMIAL
  []
  [resolved_shear_stress_1]
    order = CONSTANT
    family = MONOMIAL
  []
  [resolved_shear_stress_2]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_resistance_0]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_resistance_1]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_resistance_2]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  incremental = true
  add_variables = true
  generate_output = stress_zz
[]
[AuxKernels]
  [temperature]
    type = ConstantAux
    variable = temperature
    value= 300
  []
  [pk2_zz]
    type = RankTwoAux
    variable = pk2_zz
    rank_two_tensor = second_piola_kirchhoff_stress
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [fp_xx]
    type = RankTwoAux
    variable = fp_xx
    rank_two_tensor = plastic_deformation_gradient
    index_j = 0
    index_i = 0
    execute_on = timestep_end
  []
  [fp_yy]
    type = RankTwoAux
    variable = fp_yy
    rank_two_tensor = plastic_deformation_gradient
    index_j = 1
    index_i = 1
    execute_on = timestep_end
  []
  [fp_zz]
    type = RankTwoAux
    variable = fp_zz
    rank_two_tensor = plastic_deformation_gradient
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [e_xx]
    type = RankTwoAux
    variable = e_xx
    rank_two_tensor = total_lagrangian_strain
    index_j = 0
    index_i = 0
    execute_on = timestep_end
  []
  [e_yy]
    type = RankTwoAux
    variable = e_yy
    rank_two_tensor = total_lagrangian_strain
    index_j = 1
    index_i = 1
    execute_on = timestep_end
  []
  [e_zz]
    type = RankTwoAux
    variable = e_zz
    rank_two_tensor = total_lagrangian_strain
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [slip_increment_0]
   type = MaterialStdVectorAux
   variable = slip_increment_0
   property = slip_increment
   index = 0
   execute_on = timestep_end
  []
  [slip_increment_1]
   type = MaterialStdVectorAux
   variable = slip_increment_1
   property = slip_increment
   index = 1
   execute_on = timestep_end
  []
  [tau_0]
    type = MaterialStdVectorAux
    variable = resolved_shear_stress_0
    property = applied_shear_stress
    index = 0
    execute_on = timestep_end
  []
  [tau_1]
    type = MaterialStdVectorAux
    variable = resolved_shear_stress_1
    property = applied_shear_stress
    index = 1
    execute_on = timestep_end
  []
  [tau_2]
    type = MaterialStdVectorAux
    variable = resolved_shear_stress_2
    property = applied_shear_stress
    index = 2
    execute_on = timestep_end
  []
  [slip_resistance_0]
    type = MaterialStdVectorAux
    variable = slip_resistance_0
    property = slip_resistance
    index = 0
    execute_on = timestep_end
  []
  [slip_resistance_1]
    type = MaterialStdVectorAux
    variable = slip_resistance_1
    property = slip_resistance
    index = 1
    execute_on = timestep_end
  []
  [slip_resistance_2]
    type = MaterialStdVectorAux
    variable = slip_resistance_2
    property = slip_resistance
    index = 2
    execute_on = timestep_end
  []
[]
[BCs]
  [fix_y]
    type = DirichletBC
    variable = disp_y
    preset = true
    boundary = 'bottom'
    value = 0
  []
  [fix_x]
    type = DirichletBC
    variable = disp_x
    boundary = 'left'
    value = 0
  []
  [fix_z]
    type = DirichletBC
    variable = disp_z
    boundary = 'back'
    value = 0
  []
  [tdisp]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = '0.001*t'
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensorCP
    C_ijkl = '1.622e5 9.18e4 6.88e4 1.622e5 6.88e4 1.805e5 4.67e4 4.67e4 4.67e4' #alpha Ti, Alankar et al. Acta Materialia 59 (2011) 7003-7009
    fill_method = symmetric9
    # orient in approximately [011] to activate the basal slip planes
    euler_angle_1 = 120.0
    euler_angle_2 = 125.264
    euler_angle_3 =  45.0
  []
  [stress]
    type = ComputeMultipleCrystalPlasticityStress
    crystal_plasticity_models = 'trial_xtalpl'
    tan_mod_type = exact
  []
  [trial_xtalpl]
    type = CrystalPlasticityHCPDislocationSlipBeyerleinUpdate
    number_slip_systems = 3
    slip_sys_file_name = hcp_basal_slip_sys.txt
    unit_cell_dimension = '2.934e-7 2.934e-7 4.657e-7' #Ti, in mm, https://materialsproject.org/materials/mp-46/
    temperature = temperature
    initial_forest_dislocation_density = 15.0e5
    initial_substructure_density = 1.0e3
    slip_system_modes = 1
    number_slip_systems_per_mode = '3'
    lattice_friction_per_mode = '98' #Knezevic et al MSEA 654 (2013)
    effective_shear_modulus_per_mode = '4.7e4' #Ti, in MPa, https://materialsproject.org/materials/mp-46/
    burgers_vector_per_mode = '2.934e-7' #Ti, in mm, https://materialsproject.org/materials/mp-46/
    slip_generation_coefficient_per_mode = '5.7e6' #from Knezevic et al. 2015 AM
    normalized_slip_activiation_energy_per_mode = '0.002' #from Knezevic et al. 2015 AM
    slip_energy_proportionality_factor_per_mode = '700' ##from Knezevic et al. 2015 AM
    substructure_rate_coefficient_per_mode = '355' #from Capolungo et al MSEA (2009)
    applied_strain_rate = 0.001
    gamma_o = 1.0e-3
    Hall_Petch_like_constant_per_mode = '0.2' #Estimated to match graph in Capolungo et al MSEA (2009), Figure 2
    grain_size = 20.0e-3 #20 microns, Beyerlein and Tome IJP (2008)
  []
[]
[Postprocessors]
  [stress_zz]
    type = ElementAverageValue
    variable = stress_zz
  []
  [pk2_zz]
    type = ElementAverageValue
    variable = pk2_zz
  []
  [fp_xx]
    type = ElementAverageValue
    variable = fp_xx
  []
  [fp_yy]
    type = ElementAverageValue
    variable = fp_yy
  []
  [fp_zz]
    type = ElementAverageValue
    variable = fp_zz
  []
  [e_xx]
    type = ElementAverageValue
    variable = e_xx
  []
  [e_yy]
    type = ElementAverageValue
    variable = e_yy
  []
  [e_zz]
    type = ElementAverageValue
    variable = e_zz
  []
  [slip_increment_0]
    type = ElementAverageValue
    variable = slip_increment_0
  []
  [slip_increment_1]
    type = ElementAverageValue
    variable = slip_increment_1
  []
  [tau_0]
    type = ElementAverageValue
    variable = resolved_shear_stress_0
  []
  [tau_1]
    type = ElementAverageValue
    variable = resolved_shear_stress_1
  []
  [tau_2]
    type = ElementAverageValue
    variable = resolved_shear_stress_2
  []
  [slip_resistance_0]
    type = ElementAverageValue
    variable = slip_resistance_0
  []
  [slip_resistance_1]
    type = ElementAverageValue
    variable = slip_resistance_1
  []
  [slip_resistance_2]
    type = ElementAverageValue
    variable = slip_resistance_2
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
  petsc_options_value = ' asm      2              lu            gmres     200'
  nl_abs_tol = 1e-10
  nl_rel_tol = 1e-10
  nl_abs_step_tol = 1e-10
  dt = 0.5
  dtmin = 1.0e-2
  dtmax = 10.0
  end_time = 2.5
[]
[Outputs]
  csv = true
[]
(modules/solid_mechanics/test/tests/weak_plane_shear/small_deform_harden1.i)
# apply repeated stretches to observe cohesion hardening
[GlobalParams]
  displacements = 'x_disp y_disp z_disp'
[]
[Mesh]
  type = GeneratedMesh
  dim = 3
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  add_variables = true
  generate_output = 'stress_xz stress_zx stress_yz stress_zz'
[]
[BCs]
  [bottomx]
    type = DirichletBC
    variable = x_disp
    boundary = back
    value = 0.0
  []
  [bottomy]
    type = DirichletBC
    variable = y_disp
    boundary = back
    value = 0.0
  []
  [bottomz]
    type = DirichletBC
    variable = z_disp
    boundary = back
    value = 0.0
  []
  [topx]
    type = FunctionDirichletBC
    variable = x_disp
    boundary = front
    function = '0'
  []
  [topy]
    type = FunctionDirichletBC
    variable = y_disp
    boundary = front
    function = '0'
  []
  [topz]
    type = FunctionDirichletBC
    variable = z_disp
    boundary = front
    function = '2*t'
  []
[]
[AuxVariables]
  [wps_internal]
    order = CONSTANT
    family = MONOMIAL
  []
  [yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[AuxKernels]
  [wps_internal_auxk]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = wps_internal
  []
  [yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  []
[]
[Postprocessors]
  [s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  []
  [s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  []
  [s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  []
  [f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  []
  [int]
    type = PointValue
    point = '0 0 0'
    variable = wps_internal
  []
[]
[UserObjects]
  [coh]
    type = SolidMechanicsHardeningExponential
    value_0 = 1E3
    value_residual = 2E3
    rate = 4E4
  []
  [tanphi]
    type = SolidMechanicsHardeningConstant
    value = 1.0
  []
  [tanpsi]
    type = SolidMechanicsHardeningConstant
    value = 0.01745506
  []
  [wps]
    type = SolidMechanicsPlasticWeakPlaneShear
    cohesion = coh
    tan_friction_angle = tanphi
    tan_dilation_angle = tanpsi
    smoother = 500
    yield_function_tolerance = 1E-3
    internal_constraint_tolerance = 1E-3
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '1E9 0.5E9'
  []
  [mc]
    type = ComputeMultiPlasticityStress
    plastic_models = wps
    transverse_direction = '0 0 1'
    ep_plastic_tolerance = 1E-3
    debug_fspb = crash
  []
[]
[Executioner]
  end_time = 1E-6
  dt = 1E-7
  type = Transient
[]
[Outputs]
  csv = true
[]
(modules/solid_mechanics/test/tests/mean_cap/small_deform1.i)
# apply uniform stretch in x, y and z directions.
# With a = 1 and strength = 2, the algorithm should return to sigma_m = 2
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '1E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '1E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1E-6*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = f
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = f
  [../]
[]
[UserObjects]
  [./strength]
    type = SolidMechanicsHardeningConstant
    value = 2
  [../]
  [./cap]
    type = SolidMechanicsPlasticMeanCap
    a = 1
    strength = strength
    yield_function_tolerance = 1E-3
    internal_constraint_tolerance = 1E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./strain]
    type = ComputeIncrementalStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mean_cap]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = cap
    debug_fspb = crash
    debug_jac_at_stress = '10 0 0 0 10 0 0 0 10'
    debug_jac_at_pm = 1
    debug_jac_at_intnl = 1
    debug_stress_change = 1E-5
    debug_pm_change = 1E-6
    debug_intnl_change = 1E-6
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform1
  exodus = false
  [./csv]
    type = CSV
  [../]
[]
(modules/solid_mechanics/test/tests/mohr_coulomb/planar_hard3.i)
# apply repeated stretches in x z directions, and smaller stretches along the y direction,
# so that sigma_I = sigma_II,
# which means that lode angle = 30deg.
# Both return to the edge (lode angle = 30deg, ie 010100) and tip are experienced.
#
# It is checked that the yield functions are less than their tolerance values
# It is checked that the cohesion hardens correctly
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '1E-6*x*t'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0.05E-6*y*t'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1E-6*z*t'
  [../]
[]
[Functions]
  [./should_be_zero_fcn]
    type = ParsedFunction
    expression = 'if((a<1E-5)&(b<1E-5)&(c<1E-5)&(d<1E-5)&(g<1E-5)&(h<1E-5),0,abs(a)+abs(b)+abs(c)+abs(d)+abs(g)+abs(h))'
    symbol_names = 'a b c d g h'
    symbol_values = 'f0 f1 f2 f3 f4 f5'
  [../]
  [./coh_analytic]
    type = ParsedFunction
    expression = '20-10*exp(-1E5*intnl)'
    symbol_names = intnl
    symbol_values = internal
  [../]
  [./coh_from_yieldfcns]
    type = ParsedFunction
    expression = '(f0+f1-(sxx+syy)*sin(phi))/(-2)/cos(phi)'
    symbol_names = 'f0 f1 sxx syy phi'
    symbol_values = 'f0 f1 s_xx s_yy 0.8726646'
  [../]
  [./should_be_zero_coh]
    type = ParsedFunction
    expression = 'if(abs(a-b)<1E-6,0,1E6*abs(a-b))'
    symbol_names = 'a b'
    symbol_values = 'Coh_analytic Coh_moose'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_int]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn3]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn4]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn5]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./mc_int_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = mc_int
  [../]
  [./yield_fcn0]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn0
  [../]
  [./yield_fcn1]
    type = MaterialStdVectorAux
    index = 1
    property = plastic_yield_function
    variable = yield_fcn1
  [../]
  [./yield_fcn2]
    type = MaterialStdVectorAux
    index = 2
    property = plastic_yield_function
    variable = yield_fcn2
  [../]
  [./yield_fcn3]
    type = MaterialStdVectorAux
    index = 3
    property = plastic_yield_function
    variable = yield_fcn3
  [../]
  [./yield_fcn4]
    type = MaterialStdVectorAux
    index = 4
    property = plastic_yield_function
    variable = yield_fcn4
  [../]
  [./yield_fcn5]
    type = MaterialStdVectorAux
    index = 5
    property = plastic_yield_function
    variable = yield_fcn5
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./internal]
    type = PointValue
    point = '0 0 0'
    variable = mc_int
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn1
  [../]
  [./f2]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn2
  [../]
  [./f3]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn3
  [../]
  [./f4]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn4
  [../]
  [./f5]
   type = PointValue
    point = '0 0 0'
    variable = yield_fcn5
  [../]
  [./yfcns_should_be_zero]
    type = FunctionValuePostprocessor
    function = should_be_zero_fcn
  [../]
  [./Coh_analytic]
    type = FunctionValuePostprocessor
    function = coh_analytic
  [../]
  [./Coh_moose]
    type = FunctionValuePostprocessor
    function = coh_from_yieldfcns
  [../]
  [./cohesion_difference_should_be_zero]
    type = FunctionValuePostprocessor
    function = should_be_zero_coh
  [../]
[]
[UserObjects]
  [./mc_coh]
    type = SolidMechanicsHardeningExponential
    value_0 = 10
    value_residual = 20
    rate = 1E5
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 0.8726646
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 1 #0.8726646 # 50deg
  [../]
  [./mc]
    type = SolidMechanicsPlasticMohrCoulombMulti
    cohesion = mc_coh
    friction_angle = mc_phi
    dilation_angle = mc_psi
    yield_function_tolerance = 1E-5
    use_custom_returnMap = true
    internal_constraint_tolerance = 1E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-12
    plastic_models = mc
  [../]
[]
[Executioner]
  end_time = 5
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = planar_hard3
  exodus = false
  [./csv]
    type = CSV
    hide = 'f0 f1 f2 f3 f4 f5 s_xy s_xz s_yz Coh_analytic Coh_moose'
    execute_on = 'timestep_end'
  [../]
[]
(modules/porous_flow/examples/coal_mining/fine_with_fluid.i)
#################################################################
#
#  NOTE:
#  The mesh for this model is too large for the MOOSE repository
#  so is kept in the the large_media submodule
#
#################################################################
#
# Strata deformation and fluid flow aaround a coal mine - 3D model
#
# A "half model" is used.  The mine is 400m deep and
# just the roof is studied (-400<=z<=0).  The mining panel
# sits between 0<=x<=150, and 0<=y<=1000, so this simulates
# a coal panel that is 300m wide and 1000m long.  The outer boundaries
# are 1km from the excavation boundaries.
#
# The excavation takes 0.5 years.
#
# The boundary conditions for this simulation are:
#  - disp_x = 0 at x=0 and x=1150
#  - disp_y = 0 at y=-1000 and y=1000
#  - disp_z = 0 at z=-400, but there is a time-dependent
#               Young modulus that simulates excavation
#  - wc_x = 0 at y=-1000 and y=1000
#  - wc_y = 0 at x=0 and x=1150
#  - no flow at x=0, z=-400 and z=0
#  - fixed porepressure at y=-1000, y=1000 and x=1150
# That is, rollers on the sides, free at top,
# and prescribed at bottom in the unexcavated portion.
#
# A single-phase unsaturated fluid is used.
#
# The small strain formulation is used.
#
# All stresses are measured in MPa, and time units are measured in years.
#
# The initial porepressure is hydrostatic with P=0 at z=0, so
# Porepressure ~ - 0.01*z MPa, where the fluid has density 1E3 kg/m^3 and
# gravity = = 10 m.s^-2 = 1E-5 MPa m^2/kg.
# To be more accurate, i use
# Porepressure = -bulk * log(1 + g*rho0*z/bulk)
# where bulk=2E3 MPa and rho0=1Ee kg/m^3.
# The initial stress is consistent with the weight force from undrained
# density 2500 kg/m^3, and fluid porepressure, and a Biot coefficient of 0.7, ie,
# stress_zz^effective = 0.025*z + 0.7 * initial_porepressure
# The maximum and minimum principal horizontal effective stresses are
# assumed to be equal to 0.8*stress_zz.
#
# Material properties:
# Young's modulus = 8 GPa
# Poisson's ratio = 0.25
# Cosserat layer thickness = 1 m
# Cosserat-joint normal stiffness = large
# Cosserat-joint shear stiffness = 1 GPa
# MC cohesion = 2 MPa
# MC friction angle = 35 deg
# MC dilation angle = 8 deg
# MC tensile strength = 1 MPa
# MC compressive strength = 100 MPa
# WeakPlane cohesion = 0.1 MPa
# WeakPlane friction angle = 30 deg
# WeakPlane dilation angle = 10 deg
# WeakPlane tensile strength = 0.1 MPa
# WeakPlane compressive strength = 100 MPa softening to 1 MPa at strain = 1
# Fluid density at zero porepressure = 1E3 kg/m^3
# Fluid bulk modulus = 2E3 MPa
# Fluid viscosity = 1.1E-3 Pa.s = 1.1E-9 MPa.s = 3.5E-17 MPa.year
#
[GlobalParams]
  perform_finite_strain_rotations = false
  displacements = 'disp_x disp_y disp_z'
  Cosserat_rotations = 'wc_x wc_y wc_z'
  PorousFlowDictator = dictator
  biot_coefficient = 0.7
[]
[Mesh]
  [file]
    type = FileMeshGenerator
    file = fine.e
  []
  [xmin]
    type = SideSetsAroundSubdomainGenerator
     block = '2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30'
    new_boundary = xmin
    normal = '-1 0 0'
    input = file
  []
  [xmax]
    type = SideSetsAroundSubdomainGenerator
     block = '2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30'
    new_boundary = xmax
    normal = '1 0 0'
    input = xmin
  []
  [ymin]
    type = SideSetsAroundSubdomainGenerator
     block = '2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30'
    new_boundary = ymin
    normal = '0 -1 0'
    input = xmax
  []
  [ymax]
    type = SideSetsAroundSubdomainGenerator
     block = '2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30'
    new_boundary = ymax
    normal = '0 1 0'
    input = ymin
  []
  [zmax]
    type = SideSetsAroundSubdomainGenerator
    block = 30
    new_boundary = zmax
    normal = '0 0 1'
    input = ymax
  []
  [zmin]
    type = SideSetsAroundSubdomainGenerator
    block = 2
    new_boundary = zmin
    normal = '0 0 -1'
    input = zmax
  []
  [excav]
    type = SubdomainBoundingBoxGenerator
    input = zmin
    block_id = 1
    bottom_left = '0 0 -400'
    top_right = '150 1000 -397'
  []
  [roof]
    type = SideSetsBetweenSubdomainsGenerator
    primary_block = 3
    paired_block = 1
    input = excav
    new_boundary = roof
  []
[]
[Variables]
  [disp_x]
  []
  [disp_y]
  []
  [disp_z]
  []
  [wc_x]
  []
  [wc_y]
  []
  [porepressure]
    scaling = 1E-5
  []
[]
[ICs]
  [porepressure]
    type = FunctionIC
    variable = porepressure
    function = ini_pp
  []
[]
[Kernels]
  [cx_elastic]
    type = CosseratStressDivergenceTensors
    use_displaced_mesh = false
    variable = disp_x
    component = 0
  []
  [cy_elastic]
    type = CosseratStressDivergenceTensors
    use_displaced_mesh = false
    variable = disp_y
    component = 1
  []
  [cz_elastic]
    type = CosseratStressDivergenceTensors
    use_displaced_mesh = false
    variable = disp_z
    component = 2
  []
  [x_couple]
    type = StressDivergenceTensors
    use_displaced_mesh = false
    variable = wc_x
    displacements = 'wc_x wc_y wc_z'
    component = 0
    base_name = couple
  []
  [y_couple]
    type = StressDivergenceTensors
    use_displaced_mesh = false
    variable = wc_y
    displacements = 'wc_x wc_y wc_z'
    component = 1
    base_name = couple
  []
  [x_moment]
    type = MomentBalancing
    use_displaced_mesh = false
    variable = wc_x
    component = 0
  []
  [y_moment]
    type = MomentBalancing
    use_displaced_mesh = false
    variable = wc_y
    component = 1
  []
  [gravity]
    type = Gravity
    use_displaced_mesh = false
    variable = disp_z
    value = -10E-6 # remember this is in MPa
  []
  [poro_x]
    type = PorousFlowEffectiveStressCoupling
    use_displaced_mesh = false
    variable = disp_x
    component = 0
  []
  [poro_y]
    type = PorousFlowEffectiveStressCoupling
    use_displaced_mesh = false
    variable = disp_y
    component = 1
  []
  [poro_z]
    type = PorousFlowEffectiveStressCoupling
    use_displaced_mesh = false
    component = 2
    variable = disp_z
  []
  [poro_vol_exp]
    type = PorousFlowMassVolumetricExpansion
    use_displaced_mesh = false
     block = '2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30'
    variable = porepressure
    fluid_component = 0
  []
  [mass0]
    type = PorousFlowMassTimeDerivative
    use_displaced_mesh = false
    fluid_component = 0
    variable = porepressure
  []
  [flux]
    type = PorousFlowAdvectiveFlux
    use_displaced_mesh = false
    variable = porepressure
    gravity = '0 0 -10E-6'
    fluid_component = 0
  []
[]
[AuxVariables]
  [saturation]
    order = CONSTANT
    family = MONOMIAL
  []
  [darcy_x]
    order = CONSTANT
    family = MONOMIAL
  []
  [darcy_y]
    order = CONSTANT
    family = MONOMIAL
  []
  [darcy_z]
    order = CONSTANT
    family = MONOMIAL
  []
  [porosity]
    order = CONSTANT
    family = MONOMIAL
  []
  [wc_z]
  []
  [stress_xx]
    order = CONSTANT
    family = MONOMIAL
  []
  [stress_xy]
    order = CONSTANT
    family = MONOMIAL
  []
  [stress_xz]
    order = CONSTANT
    family = MONOMIAL
  []
  [stress_yx]
    order = CONSTANT
    family = MONOMIAL
  []
  [stress_yy]
    order = CONSTANT
    family = MONOMIAL
  []
  [stress_yz]
    order = CONSTANT
    family = MONOMIAL
  []
  [stress_zx]
    order = CONSTANT
    family = MONOMIAL
  []
  [stress_zy]
    order = CONSTANT
    family = MONOMIAL
  []
  [stress_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [total_strain_xx]
    order = CONSTANT
    family = MONOMIAL
  []
  [total_strain_xy]
    order = CONSTANT
    family = MONOMIAL
  []
  [total_strain_xz]
    order = CONSTANT
    family = MONOMIAL
  []
  [total_strain_yx]
    order = CONSTANT
    family = MONOMIAL
  []
  [total_strain_yy]
    order = CONSTANT
    family = MONOMIAL
  []
  [total_strain_yz]
    order = CONSTANT
    family = MONOMIAL
  []
  [total_strain_zx]
    order = CONSTANT
    family = MONOMIAL
  []
  [total_strain_zy]
    order = CONSTANT
    family = MONOMIAL
  []
  [total_strain_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [perm_xx]
    order = CONSTANT
    family = MONOMIAL
  []
  [perm_yy]
    order = CONSTANT
    family = MONOMIAL
  []
  [perm_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [mc_shear]
    order = CONSTANT
    family = MONOMIAL
  []
  [mc_tensile]
    order = CONSTANT
    family = MONOMIAL
  []
  [wp_shear]
    order = CONSTANT
    family = MONOMIAL
  []
  [wp_tensile]
    order = CONSTANT
    family = MONOMIAL
  []
  [wp_shear_f]
    order = CONSTANT
    family = MONOMIAL
  []
  [wp_tensile_f]
    order = CONSTANT
    family = MONOMIAL
  []
  [mc_shear_f]
    order = CONSTANT
    family = MONOMIAL
  []
  [mc_tensile_f]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[AuxKernels]
  [saturation_water]
    type = PorousFlowPropertyAux
    variable = saturation
    property = saturation
    phase = 0
    execute_on = timestep_end
  []
  [darcy_x]
    type = PorousFlowDarcyVelocityComponent
    variable = darcy_x
    gravity = '0 0 -10E-6'
    component = x
  []
  [darcy_y]
    type = PorousFlowDarcyVelocityComponent
    variable = darcy_y
    gravity = '0 0 -10E-6'
    component = y
  []
  [darcy_z]
    type = PorousFlowDarcyVelocityComponent
    variable = darcy_z
    gravity = '0 0 -10E-6'
    component = z
  []
  [porosity]
    type = PorousFlowPropertyAux
    property = porosity
    variable = porosity
    execute_on = timestep_end
  []
  [stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
    execute_on = timestep_end
  []
  [stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
    execute_on = timestep_end
  []
  [stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
    execute_on = timestep_end
  []
  [stress_yx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yx
    index_i = 1
    index_j = 0
    execute_on = timestep_end
  []
  [stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
    execute_on = timestep_end
  []
  [stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
    execute_on = timestep_end
  []
  [stress_zx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zx
    index_i = 2
    index_j = 0
    execute_on = timestep_end
  []
  [stress_zy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zy
    index_i = 2
    index_j = 1
    execute_on = timestep_end
  []
  [stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
    execute_on = timestep_end
  []
  [total_strain_xx]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = total_strain_xx
    index_i = 0
    index_j = 0
    execute_on = timestep_end
  []
  [total_strain_xy]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = total_strain_xy
    index_i = 0
    index_j = 1
    execute_on = timestep_end
  []
  [total_strain_xz]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = total_strain_xz
    index_i = 0
    index_j = 2
    execute_on = timestep_end
  []
  [total_strain_yx]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = total_strain_yx
    index_i = 1
    index_j = 0
    execute_on = timestep_end
  []
  [total_strain_yy]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = total_strain_yy
    index_i = 1
    index_j = 1
    execute_on = timestep_end
  []
  [total_strain_yz]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = total_strain_yz
    index_i = 1
    index_j = 2
    execute_on = timestep_end
  []
  [total_strain_zx]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = total_strain_zx
    index_i = 2
    index_j = 0
    execute_on = timestep_end
  []
  [total_strain_zy]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = total_strain_zy
    index_i = 2
    index_j = 1
    execute_on = timestep_end
  []
  [total_strain_zz]
    type = RankTwoAux
    rank_two_tensor = total_strain
    variable = total_strain_zz
    index_i = 2
    index_j = 2
    execute_on = timestep_end
  []
  [perm_xx]
    type = PorousFlowPropertyAux
    property = permeability
    variable = perm_xx
    row = 0
    column = 0
    execute_on = timestep_end
  []
  [perm_yy]
    type = PorousFlowPropertyAux
    property = permeability
    variable = perm_yy
    row = 1
    column = 1
    execute_on = timestep_end
  []
  [perm_zz]
    type = PorousFlowPropertyAux
    property = permeability
    variable = perm_zz
    row = 2
    column = 2
    execute_on = timestep_end
  []
  [mc_shear]
    type = MaterialStdVectorAux
    index = 0
    property = mc_plastic_internal_parameter
    variable = mc_shear
    execute_on = timestep_end
  []
  [mc_tensile]
    type = MaterialStdVectorAux
    index = 1
    property = mc_plastic_internal_parameter
    variable = mc_tensile
    execute_on = timestep_end
  []
  [wp_shear]
    type = MaterialStdVectorAux
    index = 0
    property = wp_plastic_internal_parameter
    variable = wp_shear
    execute_on = timestep_end
  []
  [wp_tensile]
    type = MaterialStdVectorAux
    index = 1
    property = wp_plastic_internal_parameter
    variable = wp_tensile
    execute_on = timestep_end
  []
  [mc_shear_f]
    type = MaterialStdVectorAux
    index = 6
    property = mc_plastic_yield_function
    variable = mc_shear_f
    execute_on = timestep_end
  []
  [mc_tensile_f]
    type = MaterialStdVectorAux
    index = 0
    property = mc_plastic_yield_function
    variable = mc_tensile_f
    execute_on = timestep_end
  []
  [wp_shear_f]
    type = MaterialStdVectorAux
    index = 0
    property = wp_plastic_yield_function
    variable = wp_shear_f
    execute_on = timestep_end
  []
  [wp_tensile_f]
    type = MaterialStdVectorAux
    index = 1
    property = wp_plastic_yield_function
    variable = wp_tensile_f
    execute_on = timestep_end
  []
[]
[BCs]
  [no_x]
    type = DirichletBC
    variable = disp_x
    boundary = 'xmin xmax'
    value = 0.0
  []
  [no_y]
    type = DirichletBC
    variable = disp_y
    boundary = 'ymin ymax'
    value = 0.0
  []
  [no_z]
    type = DirichletBC
    variable = disp_z
    boundary = zmin
    value = 0.0
  []
  [no_wc_x]
    type = DirichletBC
    variable = wc_x
    boundary = 'ymin ymax'
    value = 0.0
  []
  [no_wc_y]
    type = DirichletBC
    variable = wc_y
    boundary = 'xmin xmax'
    value = 0.0
  []
  [fix_porepressure]
    type = FunctionDirichletBC
    variable = porepressure
    boundary = 'ymin ymax xmax'
    function = ini_pp
  []
  [roof_porepressure]
    type = PorousFlowPiecewiseLinearSink
    variable = porepressure
    pt_vals = '-1E3 1E3'
    multipliers = '-1 1'
    fluid_phase = 0
    flux_function = roof_conductance
    boundary = roof
  []
  [roof]
    type = StickyBC
    variable = disp_z
    min_value = -3.0
    boundary = roof
  []
[]
[Functions]
  [ini_pp]
    type = ParsedFunction
    symbol_names = 'bulk p0 g    rho0'
    symbol_values = '2E3 0.0 1E-5 1E3'
    expression = '-bulk*log(exp(-p0/bulk)+g*rho0*z/bulk)'
  []
  [ini_xx]
    type = ParsedFunction
    symbol_names = 'bulk p0 g    rho0 biot'
    symbol_values = '2E3 0.0 1E-5 1E3  0.7'
    expression = '0.8*(2500*10E-6*z+biot*(-bulk*log(exp(-p0/bulk)+g*rho0*z/bulk)))'
  []
  [ini_zz]
    type = ParsedFunction
    symbol_names = 'bulk p0 g    rho0 biot'
    symbol_values = '2E3 0.0 1E-5 1E3  0.7'
    expression = '2500*10E-6*z+biot*(-bulk*log(exp(-p0/bulk)+g*rho0*z/bulk))'
  []
  [excav_sideways]
    type = ParsedFunction
    symbol_names = 'end_t ymin ymax  minval maxval slope'
    symbol_values = '0.5   0    1000.0 1E-9 1 10'
    # excavation face at ymin+(ymax-ymin)*min(t/end_t,1)
    # slope is the distance over which the modulus reduces from maxval to minval
    expression = 'if(y<ymin+(ymax-ymin)*min(t/end_t,1),minval,if(y<ymin+(ymax-ymin)*min(t/end_t,1)+slope,minval+(maxval-minval)*(y-(ymin+(ymax-ymin)*min(t/end_t,1)))/slope,maxval))'
  []
  [density_sideways]
    type = ParsedFunction
    symbol_names = 'end_t ymin ymax  minval maxval'
    symbol_values = '0.5   0    1000.0 0 2500'
    expression = 'if(y<ymin+(ymax-ymin)*min(t/end_t,1),minval,maxval)'
  []
  [roof_conductance]
    type = ParsedFunction
    symbol_names = 'end_t ymin ymax   maxval minval'
    symbol_values = '0.5   0    1000.0 1E7      0'
    expression = 'if(y<ymin+(ymax-ymin)*min(t/end_t,1),maxval,minval)'
  []
[]
[UserObjects]
  [dictator]
    type = PorousFlowDictator
    porous_flow_vars = 'porepressure disp_x disp_y disp_z'
    number_fluid_phases = 1
    number_fluid_components = 1
  []
  [pc]
    type = PorousFlowCapillaryPressureVG
    m = 0.5
    alpha = 1 # MPa^-1
  []
  [mc_coh_strong_harden]
    type = TensorMechanicsHardeningExponential
    value_0 = 1.99 # MPa
    value_residual = 2.01 # MPa
    rate = 1.0
  []
  [mc_fric]
    type = TensorMechanicsHardeningConstant
    value = 0.61 # 35deg
  []
  [mc_dil]
    type = TensorMechanicsHardeningConstant
    value = 0.15 # 8deg
  []
  [mc_tensile_str_strong_harden]
    type = TensorMechanicsHardeningExponential
    value_0 = 1.0 # MPa
    value_residual = 1.0 # MPa
    rate = 1.0
  []
  [mc_compressive_str]
    type = TensorMechanicsHardeningCubic
    value_0 = 100 # Large!
    value_residual = 100
    internal_limit = 0.1
  []
  [wp_coh_harden]
    type = TensorMechanicsHardeningCubic
    value_0 = 0.05
    value_residual = 0.05
    internal_limit = 10
  []
  [wp_tan_fric]
    type = TensorMechanicsHardeningConstant
    value = 0.26 # 15deg
  []
  [wp_tan_dil]
    type = TensorMechanicsHardeningConstant
    value = 0.18 # 10deg
  []
  [wp_tensile_str_harden]
    type = TensorMechanicsHardeningCubic
    value_0 = 0.05
    value_residual = 0.05
    internal_limit = 10
  []
  [wp_compressive_str_soften]
    type = TensorMechanicsHardeningCubic
    value_0 = 100
    value_residual = 1
    internal_limit = 1.0
  []
[]
[FluidProperties]
  [simple_fluid]
    type = SimpleFluidProperties
    bulk_modulus = 2E3
    density0 = 1000
    thermal_expansion = 0
    viscosity = 3.5E-17
  []
[]
[Materials]
  [temperature]
    type = PorousFlowTemperature
  []
  [eff_fluid_pressure]
    type = PorousFlowEffectiveFluidPressure
  []
  [vol_strain]
    type = PorousFlowVolumetricStrain
  []
  [ppss]
    type = PorousFlow1PhaseP
    porepressure = porepressure
    capillary_pressure = pc
  []
  [massfrac]
    type = PorousFlowMassFraction
  []
  [simple_fluid]
    type = PorousFlowSingleComponentFluid
    fp = simple_fluid
    phase = 0
  []
  [porosity_for_aux]
    type = PorousFlowPorosity
    at_nodes = false
    fluid = true
    mechanical = true
    ensure_positive = true
    porosity_zero = 0.02
    solid_bulk = 5.3333E3
  []
  [porosity_bulk]
    type = PorousFlowPorosity
    fluid = true
    mechanical = true
    block = '2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30'
    ensure_positive = true
    porosity_zero = 0.02
    solid_bulk = 5.3333E3
  []
  [porosity_excav]
    type = PorousFlowPorosityConst
    block = 1
    porosity = 1.0
  []
  [permeability_bulk]
    type = PorousFlowPermeabilityKozenyCarman
    block = '2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30'
    poroperm_function = kozeny_carman_phi0
    k0 = 1E-15
    phi0 = 0.02
    n = 2
    m = 2
  []
  [permeability_excav]
    type = PorousFlowPermeabilityConst
    block = 1
    permeability = '0 0 0   0 0 0   0 0 0'
  []
  [relperm]
    type = PorousFlowRelativePermeabilityCorey
    n = 4
    s_res = 0.4
    sum_s_res = 0.4
    phase = 0
  []
  [elasticity_tensor_0]
    type = ComputeLayeredCosseratElasticityTensor
     block = '2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30'
    young = 8E3 # MPa
    poisson = 0.25
    layer_thickness = 1.0
    joint_normal_stiffness = 1E9 # huge
    joint_shear_stiffness = 1E3 # MPa
  []
  [elasticity_tensor_1]
    type = ComputeLayeredCosseratElasticityTensor
    block = 1
    young = 8E3 # MPa
    poisson = 0.25
    layer_thickness = 1.0
    joint_normal_stiffness = 1E9 # huge
    joint_shear_stiffness = 1E3 # MPa
    elasticity_tensor_prefactor = excav_sideways
  []
  [strain]
    type = ComputeCosseratIncrementalSmallStrain
    eigenstrain_names = ini_stress
  []
  [ini_stress]
    type = ComputeEigenstrainFromInitialStress
    eigenstrain_name = ini_stress
    initial_stress = 'ini_xx 0 0  0 ini_xx 0  0 0 ini_zz'
  []
  [stress_0]
    type = ComputeMultipleInelasticCosseratStress
     block = '2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30'
    inelastic_models = 'mc wp'
    cycle_models = true
    relative_tolerance = 2.0
    absolute_tolerance = 1E6
    max_iterations = 1
    tangent_operator = nonlinear
    perform_finite_strain_rotations = false
  []
  [stress_1]
    type = ComputeMultipleInelasticCosseratStress
    block = 1
    inelastic_models = ''
    relative_tolerance = 2.0
    absolute_tolerance = 1E6
    max_iterations = 1
    tangent_operator = nonlinear
    perform_finite_strain_rotations = false
  []
  [mc]
    type = CappedMohrCoulombCosseratStressUpdate
    warn_about_precision_loss = false
    host_youngs_modulus = 8E3
    host_poissons_ratio = 0.25
    base_name = mc
    tensile_strength = mc_tensile_str_strong_harden
    compressive_strength = mc_compressive_str
    cohesion = mc_coh_strong_harden
    friction_angle = mc_fric
    dilation_angle = mc_dil
    max_NR_iterations = 100000
    smoothing_tol = 0.1 # MPa  # Must be linked to cohesion
    yield_function_tol = 1E-9 # MPa.  this is essentially the lowest possible without lots of precision loss
    perfect_guess = true
    min_step_size = 1.0
  []
  [wp]
    type = CappedWeakPlaneCosseratStressUpdate
    warn_about_precision_loss = false
    base_name = wp
    cohesion = wp_coh_harden
    tan_friction_angle = wp_tan_fric
    tan_dilation_angle = wp_tan_dil
    tensile_strength = wp_tensile_str_harden
    compressive_strength = wp_compressive_str_soften
    max_NR_iterations = 10000
    tip_smoother = 0.05
    smoothing_tol = 0.05 # MPa  # Note, this must be tied to cohesion, otherwise get no possible return at cone apex
    yield_function_tol = 1E-11 # MPa.  this is essentially the lowest possible without lots of precision loss
    perfect_guess = true
    min_step_size = 1.0E-3
  []
  [undrained_density_0]
    type = GenericConstantMaterial
     block = '2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30'
    prop_names = density
    prop_values = 2500
  []
  [undrained_density_1]
    type = GenericFunctionMaterial
    block = 1
    prop_names = density
    prop_values = density_sideways
  []
[]
[Preconditioning]
  [SMP]
    type = SMP
    full = true
  []
[]
[Postprocessors]
  [min_roof_disp]
    type = NodalExtremeValue
    boundary = roof
    value_type = min
    variable = disp_z
  []
  [min_roof_pp]
    type = NodalExtremeValue
    boundary = roof
    value_type = min
    variable = porepressure
  []
  [min_surface_disp]
    type = NodalExtremeValue
    boundary = zmax
    value_type = min
    variable = disp_z
  []
  [min_surface_pp]
    type = NodalExtremeValue
    boundary = zmax
    value_type = min
    variable = porepressure
  []
  [max_perm_zz]
    type = ElementExtremeValue
     block = '2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30'
    variable = perm_zz
  []
[]
[Executioner]
  type = Transient
  solve_type = 'NEWTON'
  petsc_options = '-snes_converged_reason'
  # best overall
  petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
  petsc_options_value = ' lu       mumps'
  # best if you don't have mumps:
  #petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
  #petsc_options_value = ' asm      2              lu            gmres     200'
  # very basic:
  #petsc_options_iname = '-pc_type -ksp_type -ksp_gmres_restart'
  #petsc_options_value = ' bjacobi  gmres     200'
  line_search = bt
  nl_abs_tol = 1e-3
  nl_rel_tol = 1e-5
  l_max_its = 200
  nl_max_its = 30
  start_time = 0.0
  dt = 0.0025
  end_time = 0.5
[]
[Outputs]
  time_step_interval = 1
  print_linear_residuals = true
  exodus = true
  csv = true
  console = true
[]
(modules/solid_mechanics/test/tests/tensile/planar7.i)
# A single unit element is stretched by (0.5, 0.4, 0.3)E-6m
# with Lame lambda = 0.6E6 and Lame mu (shear) = 1E6
# stress_xx = 1.72 Pa
# stress_yy = 1.52 Pa
# stress_zz = 1.32 Pa
# tensile_strength is set to 1.3Pa
#
# The return should be to the edge (the algorithm will first try the tip) with
# plastic_multiplier0 = 0, plastic_multiplier1 = 5E-8, plastic_multiplier2 = 1.5E-7
# internal = 2E-7
# stress_xx = stress_yy = 1.3
# stress_zz = 1.2
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    strain = finite
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0.5E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0.4E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '0.3E-6*z'
  [../]
[]
[AuxVariables]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./f0_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./intnl_auxk]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./f2]
    type = PointValue
    point = '0 0 0'
    variable = f2
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
  [./intnl]
    type = PointValue
    point = '0 0 0'
    variable = intnl
  [../]
[]
[UserObjects]
  [./hard]
    type = SolidMechanicsHardeningConstant
    value = 1.3
  [../]
  [./tens]
    type = SolidMechanicsPlasticTensileMulti
    tensile_strength = hard
    shift = 1E-6
    yield_function_tolerance = 1E-6
    internal_constraint_tolerance = 1E-5
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0.6E6 1E6'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-12
    plastic_models = tens
    debug_fspb = none
    debug_jac_at_stress = '1 2 3 2 -4 -5 3 -5 10'
    debug_jac_at_pm = '0.1 0.2 0.3'
    debug_jac_at_intnl = 1E-6
    debug_stress_change = 1E-6
    debug_pm_change = '1E-6 1E-6 1E-6'
    debug_intnl_change = 1E-6
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = planar7
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/drucker_prager/small_deform2_inner_edge.i)
# apply repeated stretches in x, y and z directions, so that mean_stress = 0
# This maps out the yield surface in the octahedral plane for zero mean stress
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '-1.5E-6*x+2E-6*x*sin(t)'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '2E-6*y*sin(2*t)'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '-2E-6*z*(sin(t)+sin(2*t))'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 10
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 20
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 0
  [../]
  [./mc]
    type = SolidMechanicsPlasticDruckerPragerHyperbolic
    mc_cohesion = mc_coh
    mc_friction_angle = mc_phi
    mc_dilation_angle = mc_psi
    smoother = 4
    mc_interpolation_scheme = inner_edge
    yield_function_tolerance = 1E-5
    internal_constraint_tolerance = 1E-11
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./strain]
    type = ComputeIncrementalStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-12
    plastic_models = mc
    debug_fspb = crash
  [../]
[]
[Executioner]
  end_time = 100
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform2_inner_edge
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/porous_flow/test/tests/infiltration_and_drainage/bw01.i)
[Mesh]
  type = GeneratedMesh
  dim = 2
  nx = 400
  ny = 1
  xmin = -10
  xmax = 10
  ymin = 0
  ymax = 0.05
[]
[GlobalParams]
  PorousFlowDictator = dictator
[]
[Functions]
  [dts]
    type = PiecewiseLinear
    y = '1E-5 1E-2 1E-2 1E-1'
    x = '0 1E-5 1 10'
  []
[]
[UserObjects]
  [dictator]
    type = PorousFlowDictator
    porous_flow_vars = pressure
    number_fluid_phases = 1
    number_fluid_components = 1
  []
  [pc]
    type = PorousFlowCapillaryPressureBW
    Sn = 0.0
    Ss = 1.0
    C = 1.5
    las = 2
  []
[]
[FluidProperties]
  [simple_fluid]
    type = SimpleFluidProperties
    bulk_modulus = 2e9
    viscosity = 4
    density0 = 10
    thermal_expansion = 0
  []
[]
[Materials]
  [massfrac]
    type = PorousFlowMassFraction
  []
  [temperature]
    type = PorousFlowTemperature
  []
  [simple_fluid]
    type = PorousFlowSingleComponentFluid
    fp = simple_fluid
    phase = 0
  []
  [ppss]
    type = PorousFlow1PhaseP
    porepressure = pressure
    capillary_pressure = pc
  []
  [relperm]
    type = PorousFlowRelativePermeabilityBW
    Sn = 0.0
    Ss = 1.0
    Kn = 0
    Ks = 1
    C = 1.5
    phase = 0
  []
  [porosity]
    type = PorousFlowPorosityConst
    porosity = 0.25
  []
  [permeability]
    type = PorousFlowPermeabilityConst
    permeability = '1 0 0  0 1 0  0 0 1'
  []
[]
[Variables]
  [pressure]
    initial_condition = -9E2
  []
[]
[Kernels]
  [mass0]
    type = PorousFlowMassTimeDerivative
    fluid_component = 0
    variable = pressure
  []
  [flux0]
    type = PorousFlowAdvectiveFlux
    fluid_component = 0
    variable = pressure
    gravity = '-0.1 0 0'
  []
[]
[AuxVariables]
  [SWater]
    family = MONOMIAL
    order = CONSTANT
  []
[]
[AuxKernels]
  [SWater]
    type = MaterialStdVectorAux
    property = PorousFlow_saturation_qp
    index = 0
    variable = SWater
  []
[]
[BCs]
  [recharge]
    type = PorousFlowSink
    variable = pressure
    boundary = right
    flux_function = -1.25 # corresponds to Rstar being 0.5 because i have to multiply by density*porosity
  []
[]
[Preconditioning]
  [andy]
    type = SMP
    full = true
    petsc_options = '-snes_converged_reason -ksp_diagonal_scale -ksp_diagonal_scale_fix -ksp_gmres_modifiedgramschmidt -snes_linesearch_monitor'
    petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap -snes_atol -snes_rtol -snes_max_it'
    petsc_options_value = 'gmres      asm      lu           NONZERO                   2               1E-10      1E-10      10000'
  []
[]
[VectorPostprocessors]
  [swater]
    type = LineValueSampler
    warn_discontinuous_face_values = false
    variable = SWater
    start_point = '-10 0 0'
    end_point = '10 0 0'
    sort_by = x
    num_points = 101
    execute_on = timestep_end
  []
[]
[Executioner]
  type = Transient
  solve_type = Newton
  petsc_options = '-snes_converged_reason'
  end_time = 8
  [TimeStepper]
    type = FunctionDT
    function = dts
  []
[]
[Outputs]
  file_base = bw01
  sync_times = '0.5 2 8'
  [exodus]
    type = Exodus
    sync_only = true
  []
  [along_line]
    type = CSV
    sync_only = true
  []
[]
(modules/solid_mechanics/test/tests/mohr_coulomb/uni_axial1.i)
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  # back = zmin
  # front = zmax
  # bottom = ymin
  # top = ymax
  # left = xmin
  # right = xmax
  [./xmin_xzero]
    type = DirichletBC
    variable = disp_x
    boundary = 'left'
    value = '0'
  [../]
  [./ymin_yzero]
    type = DirichletBC
    variable = disp_y
    boundary = 'bottom'
    value = '0'
  [../]
  [./zmin_zzero]
    type = DirichletBC
    variable = disp_z
    boundary = 'back'
    value = '0'
  [../]
  [./zmax_disp]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front'
    function = '-1E-3*t'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_int]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./mc_int_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = mc_int
  [../]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./mc_int]
    type = PointValue
    point = '0 0 0'
    variable = mc_int
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 10E6
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningExponential
    value_0 = 0
    value_residual = 0.6981317 # 40deg
    rate = 10000
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 0
  [../]
  [./mc]
    type = SolidMechanicsPlasticMohrCoulomb
    cohesion = mc_coh
    friction_angle = mc_phi
    dilation_angle = mc_psi
    mc_tip_smoother = 0
    mc_edge_smoother = 25
    yield_function_tolerance = 1E-3
    internal_constraint_tolerance = 1E-10
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '5.77E10 3.85E10' # young = 100Gpa, poisson = 0.3
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-10
    plastic_models = mc
    max_NR_iterations = 1000
    debug_fspb = crash
  [../]
[]
[Preconditioning]
  [./andy]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  end_time = 0.5
  dt = 0.05
  solve_type = PJFNK  # cannot use NEWTON because we are using ComputeFiniteStrain, and hence the Jacobian contributions will not be correct, even though ComputeMultiPlasticityStress will compute the correct consistent tangent operator for small strains
  type = Transient
  line_search = 'none'
  nl_rel_tol = 1E-10
  l_tol = 1E-3
  l_max_its = 200
  nl_max_its = 10
  petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
  petsc_options_value = ' asm      2              lu            gmres     200'
[]
[Outputs]
  file_base = uni_axial1
  exodus = true
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform9_cosserat.i)
# Using Cosserat with large layer thickness, so this should reduce to standard
# Using CappedMohrCoulombCosserat with tensile failure only
# A single unit element is stretched in a complicated way that
# the trial stress is
#        1.51515             0.8        0.666667
#            0.8        -3.74545    -1.85037e-17
#            0.7    -1.66533e-17        -1.27273
# with symmetric part
#        1.51515             0.8        0.6833
#            0.8        -3.74545    -1.85037e-17
#            0.6833  -1.66533e-17      -1.27273
#
# This has eigenvalues
# la = {-3.86844, 1.78368, -1.41827}
# and eigenvectors
#
# {0.15183, -0.987598, -0.03997},
# {-0.966321, -0.139815, -0.216044},
# {-0.207777, -0.0714259, 0.975565}}
#
# The tensile strength is 0.5 and Young=1 and Poisson=0.25,
# with E_0000/E_0011 = nu / (1 - nu) = 0.333333
# Using smoothing_tol=0.01, the return-map algorithm should
# return to stress_I = 0.5, which is a reduction of 1.28368, so
# stress_II = -1.41827 - 1.28368 * 0.33333 = -1.846
# stress_III = -3.86844 - 1.28368 * 0.33333 = -4.296
#
# The final stress symmetric stress is
#
# {0.29, 0.69, 0.51},
# {0.69, -4.19, -0.03},
# {0.51, -0.03, -1.74}
#
# and a final unsymmetric stress of
#
# {0.29, 0.69, 0.49},
# {0.69, -4.19, -0.03},
# {0.52, -0.03, -1.74}
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
  Cosserat_rotations = 'wc_x wc_y wc_z'
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
  [./wc_x]
  [../]
  [./wc_y]
  [../]
[]
[Kernels]
  [./cx_elastic]
    type = CosseratStressDivergenceTensors
    variable = disp_x
    component = 0
  [../]
  [./cy_elastic]
    type = CosseratStressDivergenceTensors
    variable = disp_y
    component = 1
  [../]
  [./cz_elastic]
    type = CosseratStressDivergenceTensors
    variable = disp_z
    component = 2
  [../]
  [./x_couple]
    type = StressDivergenceTensors
    variable = wc_x
    displacements = 'wc_x wc_y wc_z'
    component = 0
    base_name = couple
  [../]
  [./y_couple]
    type = StressDivergenceTensors
    variable = wc_y
    displacements = 'wc_x wc_y wc_z'
    component = 1
    base_name = couple
  [../]
  [./x_moment]
    type = MomentBalancing
    variable = wc_x
    component = 0
  [../]
  [./y_moment]
    type = MomentBalancing
    variable = wc_y
    component = 1
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '3*x-y+z'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '3*x-4*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = 'x-2*z'
  [../]
  [./wc_x]
    type = DirichletBC
    variable = wc_x
    boundary = 'front back'
    value = 0.0
  [../]
  [./wc_y]
    type = DirichletBC
    variable = wc_y
    boundary = 'front back'
    value = 0.0
  [../]
[]
[AuxVariables]
  [./wc_z]
  [../]
  [./stress_I]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_II]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_III]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_I]
    type = RankTwoScalarAux
    scalar_type = MaxPrincipal
    rank_two_tensor = stress
    variable = stress_I
    selected_qp = 0
  [../]
  [./stress_II]
    type = RankTwoScalarAux
    scalar_type = MidPrincipal
    rank_two_tensor = stress
    variable = stress_II
    selected_qp = 0
  [../]
  [./stress_III]
    type = RankTwoScalarAux
    scalar_type = MinPrincipal
    rank_two_tensor = stress
    variable = stress_III
    selected_qp = 0
  [../]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yx
    index_i = 1
    index_j = 0
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zx
    index_i = 2
    index_j = 0
  [../]
  [./stress_zy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zy
    index_i = 2
    index_j = 1
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f0_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./intnl_auxk]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 1
    variable = intnl
  [../]
[]
[Postprocessors]
  [./s_I]
    type = PointValue
    point = '0 0 0'
    variable = stress_I
  [../]
  [./s_II]
    type = PointValue
    point = '0 0 0'
    variable = stress_II
  [../]
  [./s_III]
    type = PointValue
    point = '0 0 0'
    variable = stress_III
  [../]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yx]
    type = PointValue
    point = '0 0 0'
    variable = stress_yx
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zx]
    type = PointValue
    point = '0 0 0'
    variable = stress_zx
  [../]
  [./s_zy]
    type = PointValue
    point = '0 0 0'
    variable = stress_zy
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./f2]
    type = PointValue
    point = '0 0 0'
    variable = f2
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
  [./intnl]
    type = PointValue
    point = '0 0 0'
    variable = intnl
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
  [./cs]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./coh]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./ang]
    type = SolidMechanicsHardeningConstant
    value = 30
    convert_to_radians = true
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeLayeredCosseratElasticityTensor
    young = 1
    poisson = 0.25
    layer_thickness = 1.0
    joint_normal_stiffness = 1.0
    joint_shear_stiffness = 2.0
  [../]
  [./strain]
    type = ComputeCosseratIncrementalSmallStrain
  [../]
  [./tensile]
    type = CappedMohrCoulombCosseratStressUpdate
    tensile_strength = ts
    compressive_strength = cs
    cohesion = coh
    friction_angle = ang
    dilation_angle = ang
    smoothing_tol = 0.001
    yield_function_tol = 1.0E-12
    host_youngs_modulus = 1.0
    host_poissons_ratio = 0.25
  [../]
  [./stress]
    type = ComputeMultipleInelasticCosseratStress
    inelastic_models = tensile
    perform_finite_strain_rotations = false
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  nl_abs_tol = 1E-10
  type = Transient
[]
[Outputs]
  file_base = small_deform9_cosserat
  csv = true
[]
(modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform_hard21.i)
# Mohr-Coulomb only
# apply stretches in x direction and smaller stretches in the y direction
# to observe return to the MC plane
# This tests uses hardening of the cohesion.  The returned configuration
# should obey
# 0 = 0.5 * (Smax - Smin) + 0.5 * (Smax + Smin) * sin(phi) - C cos(phi)
# which allows inference of C.
# The tensile internal parameter is recorded, to check that it is zero
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'max_principal_stress mid_principal_stress min_principal_stress stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0.4E-6*x*t'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0.1E-6*y*t'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '0'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 6
    property = plastic_yield_function
    variable = yield_fcn
  [../]
  [./iter_auxk]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./intnl_auxk]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl
  [../]
  [./intnl_tensile]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 1
    variable = intnl_tensile
  [../]
[]
[Postprocessors]
  [./s_max]
    type = PointValue
    point = '0 0 0'
    variable = max_principal_stress
  [../]
  [./s_mid]
    type = PointValue
    point = '0 0 0'
    variable = mid_principal_stress
  [../]
  [./s_min]
    type = PointValue
    point = '0 0 0'
    variable = min_principal_stress
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
  [./intnl]
    type = PointValue
    point = '0 0 0'
    variable = intnl
  [../]
  [./intnl_tensile]
    type = PointValue
    point = '0 0 0'
    variable = intnl_tensile
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./mc_coh]
    type = SolidMechanicsHardeningCubic
    value_0 = 10
    value_residual = 20
    internal_limit = 5E-6
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 30
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 30
    convert_to_radians = true
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 1E7
    poissons_ratio = 0.3
  [../]
  [./mc]
    type = CappedMohrCoulombStressUpdate
    tensile_strength = ts
    compressive_strength = ts
    cohesion = mc_coh
    friction_angle = mc_phi
    dilation_angle = mc_psi
    smoothing_tol = 0
    yield_function_tol = 1.0E-9
  [../]
  [./stress]
    type = ComputeMultipleInelasticStress
    inelastic_models = mc
    perform_finite_strain_rotations = false
  [../]
[]
[Executioner]
  end_time = 10
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform_hard21
  csv = true
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/twinning/non_coplanar_twin_hardening.i)
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
  [cube]
    type = GeneratedMeshGenerator
    dim = 3
    nx = 2
    ny = 2
    nz = 2
    elem_type = HEX8
  []
[]
[AuxVariables]
  [total_twin_volume_fraction]
    order = CONSTANT
    family = MONOMIAL
  []
  [twin_resistance_0]
    order = CONSTANT
    family = MONOMIAL
  []
  [twin_resistance_1]
    order = CONSTANT
    family = MONOMIAL
  []
  [twin_resistance_2]
    order = CONSTANT
    family = MONOMIAL
  []
  [twin_resistance_3]
    order = CONSTANT
    family = MONOMIAL
  []
  [twin_volume_fraction_0]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_1]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_2]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_volume_fraction_3]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_tau_0]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_tau_1]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_tau_2]
   order = CONSTANT
   family = MONOMIAL
  []
  [twin_tau_3]
   order = CONSTANT
   family = MONOMIAL
  []
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  add_variables = true
  generate_output = stress_zz
[]
[AuxKernels]
  [total_twin_volume_fraction]
    type = MaterialRealAux
    variable = total_twin_volume_fraction
    property = total_volume_fraction_twins
    execute_on = timestep_end
  []
  [twin_resistance_0]
   type = MaterialStdVectorAux
   variable = twin_resistance_0
   property = slip_resistance
   index = 0
   execute_on = timestep_end
  []
  [twin_resistance_1]
   type = MaterialStdVectorAux
   variable = twin_resistance_1
   property = slip_resistance
   index = 1
   execute_on = timestep_end
  []
  [twin_resistance_2]
   type = MaterialStdVectorAux
   variable = twin_resistance_2
   property = slip_resistance
   index = 2
   execute_on = timestep_end
  []
  [twin_resistance_3]
   type = MaterialStdVectorAux
   variable = twin_resistance_3
   property = slip_resistance
   index = 3
   execute_on = timestep_end
  []
  [twin_volume_fraction_0]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_0
   property = twin_system_volume_fraction
   index = 0
   execute_on = timestep_end
  []
  [twin_volume_fraction_1]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_1
   property = twin_system_volume_fraction
   index = 1
   execute_on = timestep_end
  []
  [twin_volume_fraction_2]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_2
   property = twin_system_volume_fraction
   index = 2
   execute_on = timestep_end
  []
  [twin_volume_fraction_3]
   type = MaterialStdVectorAux
   variable = twin_volume_fraction_3
   property = twin_system_volume_fraction
   index = 3
   execute_on = timestep_end
  []
  [twin_tau_0]
    type = MaterialStdVectorAux
    variable = twin_tau_0
    property = applied_shear_stress
    index = 0
    execute_on = timestep_end
  []
  [twin_tau_1]
    type = MaterialStdVectorAux
    variable = twin_tau_1
    property = applied_shear_stress
    index = 1
    execute_on = timestep_end
  []
  [twin_tau_2]
    type = MaterialStdVectorAux
    variable = twin_tau_2
    property = applied_shear_stress
    index = 2
    execute_on = timestep_end
  []
  [twin_tau_3]
    type = MaterialStdVectorAux
    variable = twin_tau_3
    property = applied_shear_stress
    index = 3
    execute_on = timestep_end
  []
[]
[BCs]
  [fix_y]
    type = DirichletBC
    variable = disp_y
    preset = true
    boundary = 'bottom'
    value = 0
  []
  [fix_x]
    type = DirichletBC
    variable = disp_x
    boundary = 'left'
    value = 0
  []
  [fix_z]
    type = DirichletBC
    variable = disp_z
    boundary = 'back'
    value = 0
  []
  [tdisp]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = '-1.0e-3*t'
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensorCP
    C_ijkl = '1.08e5 6.034e4 6.034e4 1.08e5 6.03e4 1.08e5 2.86e4 2.86e4 2.86e4' #Tallon and Wolfenden. J. Phys. Chem. Solids (1979)
    fill_method = symmetric9
  []
  [stress]
    type = ComputeMultipleCrystalPlasticityStress
    crystal_plasticity_models = 'twin_only_xtalpl'
    tan_mod_type = exact
  []
  [twin_only_xtalpl]
    type = CrystalPlasticityTwinningKalidindiUpdate
    number_slip_systems = 4
    slip_sys_file_name = 'select_twin_systems_verify_hardening.txt'
    initial_twin_lattice_friction = 6.0
    non_coplanar_coefficient_twin_hardening = 8e4
    non_coplanar_twin_hardening_exponent = 0.1
    coplanar_coefficient_twin_hardening = 0
  []
[]
[Postprocessors]
  [stress_zz]
    type = ElementAverageValue
    variable = stress_zz
  []
  [total_twin_volume_fraction]
    type = ElementAverageValue
    variable = total_twin_volume_fraction
  []
  [twin_resistance_0]
    type = ElementAverageValue
    variable = twin_resistance_0
  []
  [twin_resistance_1]
    type = ElementAverageValue
    variable = twin_resistance_1
  []
  [twin_resistance_2]
    type = ElementAverageValue
    variable = twin_resistance_2
  []
  [twin_resistance_3]
    type = ElementAverageValue
    variable = twin_resistance_3
  []
  [twin_volume_fraction_0]
    type = ElementAverageValue
    variable = twin_volume_fraction_0
  []
  [twin_volume_fraction_1]
    type = ElementAverageValue
    variable = twin_volume_fraction_1
  []
  [twin_volume_fraction_2]
    type = ElementAverageValue
    variable = twin_volume_fraction_2
  []
  [twin_volume_fraction_3]
    type = ElementAverageValue
    variable = twin_volume_fraction_3
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
  petsc_options_value = ' asm      2              lu            gmres     200'
  nl_abs_tol = 1e-10
  nl_rel_tol = 1e-10
  nl_abs_step_tol = 1e-10
  dt = 0.05
  dtmin = 1e-6
  dtmax = 10.0
  num_steps = 4
[]
[Outputs]
  csv = true
  perf_graph = true
[]
(modules/solid_mechanics/test/tests/mean_cap_TC/small_deform7.i)
# apply nonuniform stretch in x, y and z directions using
# Lame lambda = 0.7E7, Lame mu = 1.0E7,
# trial_stress(0, 0) = 2.9
# trial_stress(1, 1) = 10.9
# trial_stress(2, 2) = 14.9
# With tensile_strength = 2, decaying to zero at internal parameter = 4E-7
# via a Cubic, the algorithm should return to:
# internal parameter = 2.26829E-7
# trace(stress) = 0.799989 = tensile_strength
# stress(0, 0) = -6.4
# stress(1, 1) = 1.6
# stress(2, 2) = 5.6
# THEN apply a nonuniform compression in x, y, and z so that
# trial_stress(0, 0)
# With compressive_strength = -1, decaying to -0.5 at internal parameter 1E-8
# via a Cubic, the algorithm should return to
# trial_stress(0, 0) = -3.1
# trial_stress(1, 1) = -3.1
# trial_stress(2, 2) = 2.9
# the algorithm should return to trace(stress) = -0.5 = compressive_strength
# stress(0, 0) = -2.1667
# stress(1, 1) = -2.1667
# stress(2, 2) = 3.8333
# and internal parameter = 2.0406E-7
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = 'if(t<1.5,-1E-7*x,1E-7*x)'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = 'if(t<1.5,3E-7*y,1E-7*y)'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = 'if(t<1.5,5E-7*z,4E-7*z)'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = f
  [../]
  [./intnl]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = intnl
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = f
  [../]
  [./intnl]
    type = PointValue
    point = '0 0 0'
    variable = intnl
  [../]
[]
[UserObjects]
  [./tensile_strength]
    type = SolidMechanicsHardeningCubic
    value_0 = 2
    value_residual = 0
    internal_limit = 4E-7
  [../]
  [./compressive_strength]
    type = SolidMechanicsHardeningCubic
    value_0 = -1
    value_residual = -0.5
    internal_limit = 1E-8
  [../]
  [./cap]
    type = SolidMechanicsPlasticMeanCapTC
    tensile_strength = tensile_strength
    compressive_strength = compressive_strength
    yield_function_tolerance = 1E-5
    internal_constraint_tolerance = 1E-11
    use_custom_returnMap = true
    use_custom_cto = true
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0.7E7 1E7'
  [../]
  [./strain]
    type = ComputeIncrementalStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mean_cap]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-11
    plastic_models = cap
  [../]
[]
[Executioner]
  end_time = 2
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform7
  exodus = false
  [./csv]
    type = CSV
  [../]
[]
(modules/solid_mechanics/test/tests/multi/two_surface05.i)
# Plasticit models:
# SimpleTester with a = 0 and b = 1 and strength = 1
# SimpleTester with a = 1 and b = 1 and strength = 2
#
# Lame lambda = 0 (Poisson=0).  Lame mu = 0.5E6
#
# A single element is stretched by 3E-6m in y directions and 1.0E-6 in z direction.
# trial stress_zz = 1 and stress_yy = 3
#
# Then SimpleTester2 should activate and the algorithm will return to
# stress_zz = 0, stress_yy = 2
# internal0 should be zero, and internal1 should be 1
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '3E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1E-6*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int1]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./int0]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 0
    variable = int0
  [../]
  [./int1]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 1
    variable = int1
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./int0]
    type = PointValue
    point = '0 0 0'
    variable = int0
  [../]
  [./int1]
    type = PointValue
    point = '0 0 0'
    variable = int1
  [../]
[]
[UserObjects]
  [./simple1]
    type = SolidMechanicsPlasticSimpleTester
    a = 0
    b = 1
    strength = 1
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
  [./simple2]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 1
    strength = 2
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 0.5E6'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./multi]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = 'simple1 simple2'
    max_NR_iterations = 2
    min_stepsize = 1
    debug_fspb = crash
    debug_jac_at_stress = '10 0 0 0 10 0 0 0 10'
    debug_jac_at_pm = '1 1'
    debug_jac_at_intnl = '1 1'
    debug_stress_change = 1E-5
    debug_pm_change = '1E-6 1E-6'
    debug_intnl_change = '1E-6 1E-6'
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = two_surface05
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/drucker_prager/small_deform3_native.i)
# apply repeated stretches in x z directions, and smaller stretches along the y direction,
# so that sigma_I = sigma_II,
# which means that lode angle = 30deg.
# The allows yield surface in meridional plane to be mapped out
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '1E-6*x*t'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '-1.35E-6*y*t'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1E-6*z*t'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_int]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./mc_int_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = mc_int
  [../]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./internal]
    type = PointValue
    point = '0 0 0'
    variable = mc_int
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 10
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 35
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 5
    convert_to_radians = true
  [../]
  [./mc]
    type = SolidMechanicsPlasticDruckerPragerHyperbolic
    mc_cohesion = mc_coh
    mc_friction_angle = mc_phi
    mc_dilation_angle = mc_psi
    smoother = 8
    mc_interpolation_scheme = native
    yield_function_tolerance = 1E-7
    internal_constraint_tolerance = 1E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./strain]
    type = ComputeIncrementalStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-13
    plastic_models = mc
    debug_fspb = crash
  [../]
[]
[Executioner]
  end_time = 10
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform3_native
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform9.i)
# Using CappedMohrCoulomb with tensile failure only
# A single unit element is stretched in a complicated way
# that the trial stress is
#
#      1.16226      -0.0116587       0.0587872
#     -0.0116587         1.12695       0.0779428
#      0.0587872       0.0779428        0.710169
#
# This has eigenvalues
# la = {0.68849, 1.14101, 1.16987}
# and eigenvectors
#
# {-0.125484, -0.176871, 0.976202}
# {-0.0343704, -0.982614, -0.182451}
# {0.9915, -0.0564471, 0.117223}
#
# The tensile strength is 0.5 and Young=1 and Poisson=0.25.
# Using smoothing_tol=0.01, the return-map algorithm should
# return to, approximately, stress_I=stress_II=0.5.  This
# is a reduction of 0.66, so stress_III is approximately
# 0.68849 - v * 0.66 * 2 = 0.68849 - 0.25 * 0.66 * 2 = 0.36.
#
# E_22 = E(1-v)/(1+v)/(1-2v) = 1.2, and E_02 = E_22 v/(1-v)
# gamma_shear = ((smax-smin)^trial - (smax-smin)) / (E_22 - E_02)
# = (1-2v) * (smax^trial - smax) / (E_22(1 - 2v)/(1-v))
# = (1 - v) * (smax^trial - smax) / E_22
# Using psi = 30deg, sin(psi) = 1/2
# the shear correction to the tensile internal parameter is
# gamma_shear (E_22 + E_20) sin(psi) = gamma_shear E_22 sin(psi) / (1 - v)
# = gamma_shear E_22 / (1 - v) / 2
# Then the tensile internal parameter is
# (1 - v) * (reduction_of_(max+min)_principal - gamma_shear * E_22 / (1-v) / 2) / E_22
# = (1-v)(1+2v)(smax^trial - smax)/E_22 - gamma_shear / 2
# = 0.41 (approximately)
#
# The final stress is
#
# {0.498, -0.003, 0.017},
# {-0.003, 0.495, 0.024},
# {0.017, 0.024,  0.367}
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    strain = finite
    incremental = true
    generate_output = 'max_principal_stress mid_principal_stress min_principal_stress stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '3*x+2*y+z'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '3*x-4*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = 'x-2*z'
  [../]
[]
[AuxVariables]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./f0_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./intnl_auxk]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 1
    variable = intnl
  [../]
[]
[Postprocessors]
  [./s_I]
    type = PointValue
    point = '0 0 0'
    variable = max_principal_stress
  [../]
  [./s_II]
    type = PointValue
    point = '0 0 0'
    variable = mid_principal_stress
  [../]
  [./s_III]
    type = PointValue
    point = '0 0 0'
    variable = min_principal_stress
  [../]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./f2]
    type = PointValue
    point = '0 0 0'
    variable = f2
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
  [./intnl]
    type = PointValue
    point = '0 0 0'
    variable = intnl
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
  [./cs]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./coh]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./ang]
    type = SolidMechanicsHardeningConstant
    value = 30
    convert_to_radians = true
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 1
    poissons_ratio = 0.25
  [../]
  [./tensile]
    type = CappedMohrCoulombStressUpdate
    tensile_strength = ts
    compressive_strength = cs
    cohesion = coh
    friction_angle = ang
    dilation_angle = ang
    smoothing_tol = 0.001
    yield_function_tol = 1.0E-12
  [../]
  [./stress]
    type = ComputeMultipleInelasticStress
    inelastic_models = tensile
    perform_finite_strain_rotations = false
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform9
  csv = true
[]
(modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform6.i)
# Using CappedMohrCoulomb with tensile failure only
# A single element is incrementally stretched in the in the z direction
# This causes the return direction to be along the hypersurface sigma_II = sigma_III,
# and the resulting stresses are checked to lie on the expected yield surface
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    strain = finite
    incremental = true
    generate_output = 'max_principal_stress mid_principal_stress min_principal_stress stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '4*x*t'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = 'y*(t-0.5)'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = 'z*(t-0.5)'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_I]
    type = PointValue
    point = '0 0 0'
    variable = max_principal_stress
  [../]
  [./s_II]
    type = PointValue
    point = '0 0 0'
    variable = mid_principal_stress
  [../]
  [./s_III]
    type = PointValue
    point = '0 0 0'
    variable = min_principal_stress
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1
  [../]
  [./cs]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./coh]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./ang]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '0 2.0'
  [../]
  [./tensile]
    type = CappedMohrCoulombStressUpdate
    tensile_strength = ts
    compressive_strength = cs
    cohesion = coh
    friction_angle = ang
    dilation_angle = ang
    smoothing_tol = 0.5
    yield_function_tol = 1.0E-12
  [../]
  [./stress]
    type = ComputeMultipleInelasticStress
    inelastic_models = tensile
    perform_finite_strain_rotations = false
  [../]
[]
[Executioner]
  end_time = 1
  dt = 0.1
  type = Transient
[]
[Outputs]
  file_base = small_deform6
  csv = true
[]
(modules/solid_mechanics/test/tests/multi/three_surface05.i)
# Plasticit models:
# SimpleTester0 with a = 0 and b = 1 and strength = 1
# SimpleTester1 with a = 1 and b = 0 and strength = 1
# SimpleTester2 with a = 1 and b = 1 and strength = 1.5
#
# Lame lambda = 0 (Poisson=0).  Lame mu = 0.5E6
#
# A single element is stretched by 1E-6m in y direction and 1.1E-6 in z direction.
# trial stress_yy = 1 and stress_zz = 1.1
#
# Then SimpleTester0 and SimpleTester2 should activate and the algorithm will return to
# the corner stress_yy=0.5, stress_zz=1
# However, this will mean internal0 < 0, so SimpleTester0 will be deactivated and
# then the algorithm will return to
# stress_yy=0.7, stress_zz=0.8
# internal0 should be 0.0, and internal2 should be 0.3
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '1.0E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1.1E-6*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int2]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./int0]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 0
    variable = int0
  [../]
  [./int1]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 1
    variable = int1
  [../]
  [./int2]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 2
    variable = int2
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./f2]
    type = PointValue
    point = '0 0 0'
    variable = f2
  [../]
  [./int0]
    type = PointValue
    point = '0 0 0'
    variable = int0
  [../]
  [./int1]
    type = PointValue
    point = '0 0 0'
    variable = int1
  [../]
  [./int2]
    type = PointValue
    point = '0 0 0'
    variable = int2
  [../]
[]
[UserObjects]
  [./simple0]
    type = SolidMechanicsPlasticSimpleTester
    a = 0
    b = 1
    strength = 1
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
  [./simple1]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 0
    strength = 1
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
  [./simple2]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 1
    strength = 1.5
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 0.5E6'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./multi]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = 'simple0 simple1 simple2'
    max_NR_iterations = 2
    min_stepsize = 1
    debug_fspb = crash
    debug_jac_at_stress = '10 0 0 0 10 0 0 0 10'
    debug_jac_at_pm = '1 1'
    debug_jac_at_intnl = '1 1'
    debug_stress_change = 1E-5
    debug_pm_change = '1E-6 1E-6'
    debug_intnl_change = '1E-6 1E-6'
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = three_surface05
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform2.i)
# Using CappedMohrCoulomb with tensile failure only
# checking for small deformation
# A single element is stretched equally in all directions.
# This causes the return direction to be along the sigma_I = sigma_II = sigma_III line
# tensile_strength is set to 1Pa, and smoothing_tol = 0.1Pa
# The smoothed yield function comes from two smoothing operations.
# The first is on sigma_I and sigma_II (sigma_I >= sigma_II >= sigma_III):
# yf = sigma_I + ismoother(0) - tensile_strength
#    = sigma_I + (0.5 * smoothing_tol - smoothing_tol / Pi) - tensile_strength
#    = sigma_I + 0.018169 - 1
# The second has the argument of ismoother equal to -0.018169.
# ismoother(-0.018169) = 0.5 * (-0.018169 + 0.1) - 0.1 * cos (0.5 * Pi * -0.018169 / 0.1) / Pi
#                     = 0.010372
# So the final yield function is
# yf = sigma_I + 0.018169 + 0.010372 - 1 = sigma_I + 0.028541 - 1
# However, because of the asymmetry in smoothing (the yield function is obtained
# by first smoothing sigma_I-ts and sigma_II-ts, and then by smoothing this
# result with sigma_III-ts) the result is sigma_I = sigma_II > sigma_III
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    strain = finite
    incremental = true
    generate_output = 'max_principal_stress mid_principal_stress min_principal_stress stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '1E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '1E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1E-6*z'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_I]
    type = PointValue
    point = '0 0 0'
    variable = max_principal_stress
  [../]
  [./s_II]
    type = PointValue
    point = '0 0 0'
    variable = mid_principal_stress
  [../]
  [./s_III]
    type = PointValue
    point = '0 0 0'
    variable = min_principal_stress
  [../]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1
  [../]
  [./coh]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./ang]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 2.0E6'
  [../]
  [./tensile]
    type = CappedMohrCoulombStressUpdate
    tensile_strength = ts
    compressive_strength = ts
    cohesion = coh
    friction_angle = ang
    dilation_angle = ang
    smoothing_tol = 0.1
    yield_function_tol = 1.0E-12
  [../]
  [./stress]
    type = ComputeMultipleInelasticStress
    inelastic_models = tensile
    perform_finite_strain_rotations = false
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform2
  csv = true
[]
(modules/porous_flow/test/tests/infiltration_and_drainage/wli02.i)
[Mesh]
  type = GeneratedMesh
  dim = 2
  nx = 50
  ny = 1
  xmin = -1000
  xmax = 0
  ymin = 0
  ymax = 0.05
[]
[GlobalParams]
  PorousFlowDictator = dictator
[]
[UserObjects]
  [dictator]
    type = PorousFlowDictator
    porous_flow_vars = pressure
    number_fluid_phases = 1
    number_fluid_components = 1
  []
  [pc]
    type = PorousFlowCapillaryPressureBW
    Sn = 0.0
    Ss = 1.0
    C = 1.5
    las = 2
  []
[]
[FluidProperties]
  [simple_fluid]
    type = SimpleFluidProperties
    bulk_modulus = 2e9
    viscosity = 4
    density0 = 10
    thermal_expansion = 0
  []
[]
[Materials]
  [massfrac]
    type = PorousFlowMassFraction
  []
  [temperature]
    type = PorousFlowTemperature
  []
  [simple_fluid]
    type = PorousFlowSingleComponentFluid
    fp = simple_fluid
    phase = 0
  []
  [ppss]
    type = PorousFlow1PhaseP
    porepressure = pressure
    capillary_pressure = pc
  []
  [relperm]
    type = PorousFlowRelativePermeabilityBW
    Sn = 0.0
    Ss = 1.0
    Kn = 0
    Ks = 1
    C = 1.5
    phase = 0
  []
  [porosity]
    type = PorousFlowPorosityConst
    porosity = 0.25
  []
  [permeability]
    type = PorousFlowPermeabilityConst
    permeability = '1 0 0  0 1 0  0 0 1'
  []
[]
[Variables]
  [pressure]
    initial_condition = -1E-4
  []
[]
[Kernels]
  [mass0]
    type = PorousFlowMassTimeDerivative
    fluid_component = 0
    variable = pressure
  []
  [flux0]
    type = PorousFlowAdvectiveFlux
    fluid_component = 0
    variable = pressure
    gravity = '-0.1 0 0'
  []
[]
[AuxVariables]
  [SWater]
    family = MONOMIAL
    order = CONSTANT
  []
[]
[AuxKernels]
  [SWater]
    type = MaterialStdVectorAux
    property = PorousFlow_saturation_qp
    index = 0
    variable = SWater
  []
[]
[BCs]
  [base]
    type = DirichletBC
    boundary = 'left'
    value = -1E-4
    variable = pressure
  []
[]
[Preconditioning]
  [andy]
    type = SMP
    full = true
    petsc_options = '-snes_converged_reason -ksp_diagonal_scale -ksp_diagonal_scale_fix -ksp_gmres_modifiedgramschmidt -snes_linesearch_monitor'
    petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap -snes_atol -snes_rtol -snes_max_it'
    petsc_options_value = 'gmres      asm      lu           NONZERO                   2               1E-10      1E-10      10000'
  []
[]
[VectorPostprocessors]
  [swater]
    type = LineValueSampler
    warn_discontinuous_face_values = false
    variable = SWater
    start_point = '-1000 0 0'
    end_point = '0 0 0'
    sort_by = x
    num_points = 71
    execute_on = timestep_end
  []
[]
[Executioner]
  type = Transient
  solve_type = Newton
  petsc_options = '-snes_converged_reason'
  end_time = 100
  dt = 5
[]
[Outputs]
  file_base = wli02
  sync_times = '100 500 1000'
  [exodus]
    type = Exodus
    sync_only = true
  []
  [along_line]
    type = CSV
    sync_only = true
  []
[]
(modules/solid_mechanics/test/tests/mohr_coulomb/planar_hard5.i)
# apply repeated stretches in z direction, and smaller stretches along the y direction, and compression along x direction
# Both return to the plane and edge (lode angle = 30deg, ie 010100) are experienced.
#
# It is checked that the yield functions are less than their tolerance values
# It is checked that the cohesion hardens correctly
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '-1E-6*x*t'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0.05E-6*y*t'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1E-6*z*t'
  [../]
[]
[Functions]
  [./should_be_zero_fcn]
    type = ParsedFunction
    expression = 'if((a<1E-5)&(b<1E-5)&(c<1E-5)&(d<1E-5)&(g<1E-5)&(h<1E-5),0,abs(a)+abs(b)+abs(c)+abs(d)+abs(g)+abs(h))'
    symbol_names = 'a b c d g h'
    symbol_values = 'f0 f1 f2 f3 f4 f5'
  [../]
  [./coh_analytic]
    type = ParsedFunction
    expression = '20-10*exp(-1E6*intnl)'
    symbol_names = intnl
    symbol_values = internal
  [../]
  [./coh_from_yieldfcns]
    type = ParsedFunction
    expression = '(f0+f1-(sxx+syy)*sin(phi))/(-2)/cos(phi)'
    symbol_names = 'f0 f1 sxx syy phi'
    symbol_values = 'f0 f1 s_xx s_yy 0.8726646'
  [../]
  [./should_be_zero_coh]
    type = ParsedFunction
    expression = 'if(abs(a-b)<1E-6,0,1E6*abs(a-b))'
    symbol_names = 'a b'
    symbol_values = 'Coh_analytic Coh_moose'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_int]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn3]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn4]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn5]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./mc_int_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = mc_int
  [../]
  [./yield_fcn0]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn0
  [../]
  [./yield_fcn1]
    type = MaterialStdVectorAux
    index = 1
    property = plastic_yield_function
    variable = yield_fcn1
  [../]
  [./yield_fcn2]
    type = MaterialStdVectorAux
    index = 2
    property = plastic_yield_function
    variable = yield_fcn2
  [../]
  [./yield_fcn3]
    type = MaterialStdVectorAux
    index = 3
    property = plastic_yield_function
    variable = yield_fcn3
  [../]
  [./yield_fcn4]
    type = MaterialStdVectorAux
    index = 4
    property = plastic_yield_function
    variable = yield_fcn4
  [../]
  [./yield_fcn5]
    type = MaterialStdVectorAux
    index = 5
    property = plastic_yield_function
    variable = yield_fcn5
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./internal]
    type = PointValue
    point = '0 0 0'
    variable = mc_int
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn1
  [../]
  [./f2]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn2
  [../]
  [./f3]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn3
  [../]
  [./f4]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn4
  [../]
  [./f5]
   type = PointValue
    point = '0 0 0'
    variable = yield_fcn5
  [../]
  [./yfcns_should_be_zero]
    type = FunctionValuePostprocessor
    function = should_be_zero_fcn
  [../]
  [./Coh_analytic]
    type = FunctionValuePostprocessor
    function = coh_analytic
  [../]
  [./Coh_moose]
    type = FunctionValuePostprocessor
    function = coh_from_yieldfcns
  [../]
  [./cohesion_difference_should_be_zero]
    type = FunctionValuePostprocessor
    function = should_be_zero_coh
  [../]
[]
[UserObjects]
  [./mc_coh]
    type = SolidMechanicsHardeningExponential
    value_0 = 10
    value_residual = 20
    rate = 1E6
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 0.8726646
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 1 #0.8726646 # 50deg
  [../]
  [./mc]
    type = SolidMechanicsPlasticMohrCoulombMulti
    cohesion = mc_coh
    friction_angle = mc_phi
    dilation_angle = mc_psi
    use_custom_returnMap = true
    yield_function_tolerance = 1E-5
    internal_constraint_tolerance = 1E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-12
    plastic_models = mc
  [../]
[]
[Executioner]
  end_time = 5
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = planar_hard5
  exodus = false
  [./csv]
    type = CSV
    hide = 'f0 f1 f2 f3 f4 f5 s_xy s_xz s_yz Coh_analytic Coh_moose'
    execute_on = 'timestep_end'
  [../]
[]
(modules/solid_mechanics/test/tests/uel/tensile_umat_moose_umat.i)
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
  volumetric_locking_correction = true
[]
[Mesh]
  [mesh]
    type = GeneratedMeshGenerator
    dim = 3
    nx = 1
    ny = 1
    nz = 1
    elem_type = HEX8
  []
  [extra_nodeset]
    type = ExtraNodesetGenerator
    input = mesh
    new_boundary = 'master'
    coord = '1.0 1.0 1.0'
  []
[]
[AuxVariables]
  [temperature]
    initial_condition = 500
  []
  [state_var_one]
    family = MONOMIAL
    order = FIRST
  []
  [state_var_two]
    family = MONOMIAL
    order = FIRST
  []
[]
[Physics/SolidMechanics/QuasiStatic]
  [all]
    add_variables = true
    generate_output = 'vonmises_stress'
    strain = FINITE
  []
[]
[Functions]
  [function_pull]
    type = PiecewiseLinear
    x = '0 100'
    y = '0 0.1'
  []
[]
[AuxKernels]
  [state_ker_one]
    type = MaterialStdVectorAux
    variable = state_var_one
    property = 'state_var'
    index = 0
    execute_on = timestep_end
  []
  [state_ker_two]
    type = MaterialStdVectorAux
    variable = state_var_two
    property = 'state_var'
    index = 1
    execute_on = timestep_end
  []
[]
[Constraints]
  [one]
    type = LinearNodalConstraint
    variable = disp_x
    primary = '6'
    secondary_node_ids = '1 2 5'
    penalty = 1.0e8
    formulation = kinematic
    weights = '1'
  []
  [two]
    type = LinearNodalConstraint
    variable = disp_z
    primary = '6'
    secondary_node_ids = '4 5 7'
    penalty = 1.0e8
    formulation = kinematic
    weights = '1'
  []
[]
[BCs]
  [symmy]
    type = DirichletBC
    variable = disp_y
    boundary = bottom
    value = 0
  []
  [symmx]
    type = DirichletBC
    variable = disp_x
    boundary = left
    value = 0
  []
  [symmz]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = 0
  []
  # What's done below is to capture the weird constraints
  [axial_load]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'top'
    function = function_pull
  []
[]
# Something wrong in the input?
[Materials]
  [umat]
    type = AbaqusUMATStress
    constant_properties = '190.0 28.0 3.0 1.0 6.0 0.0 0.0 23.0 25.0 26.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 '
                          '0.0 0.0 0.0 0.0 0.0 31700000.0 0.32 6.67e-06 1e-08 5000.0 4.0' # 27 properties
    plugin = '../../../../tensor_mechanics/test/plugins/umat_hc40'
    num_state_vars = 177 # 141 + 6*6
    temperature = temperature
    use_one_based_indexing = true
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  l_max_its = 100
  l_tol = 1e-8
  nl_max_its = 50
  nl_rel_tol = 1e-8
  nl_abs_tol = 1e-8
  dtmin = 1
  dt = 5
  end_time = 100
[]
[Outputs]
  exodus = true
[]
(modules/solid_mechanics/test/tests/tensile/small_deform_hard3.i)
# checking for small deformation, with cubic hardening
# A single element is repeatedly stretched by in z direction
# tensile_strength is set to 1Pa, tensile_strength_residual = 0.5Pa, and limit value = 1E-5
# This allows the hardening of the tensile strength to be observed
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    strain = finite
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1E-6*z*t'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  [../]
  [./iter_auxk]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./intnl_auxk]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
  [./intnl]
    type = PointValue
    point = '0 0 0'
    variable = intnl
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningCubic
    value_0 = 1.0
    value_residual = 0.5
    internal_0 = 0
    internal_limit = 1E-5
  [../]
  [./mc]
    type = SolidMechanicsPlasticTensile
    tensile_strength = ts
    yield_function_tolerance = 1E-6
    tensile_tip_smoother = 0.0
    internal_constraint_tolerance = 1E-5
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 2.0E6'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-5
    plastic_models = mc
    debug_fspb = crash
    debug_jac_at_stress = '1 2 3 2 -4 -5 3 -5 10'
    debug_jac_at_pm = 0.8
    debug_jac_at_intnl = 1
    debug_stress_change = 1E-8
    debug_pm_change = 1E-5
    debug_intnl_change = 1E-5
  [../]
[]
[Executioner]
  end_time = 10
  dt = 1.0
  type = Transient
[]
[Outputs]
  file_base = small_deform_hard3
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/weak_plane_shear/small_deform_harden4.i)
# apply repeated stretches to observe cohesion hardening, with cubic
[GlobalParams]
  displacements = 'x_disp y_disp z_disp'
[]
[Mesh]
  type = GeneratedMesh
  dim = 3
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  add_variables = true
  generate_output = 'stress_xz stress_zx stress_yz stress_zz'
[]
[BCs]
  [bottomx]
    type = DirichletBC
    variable = x_disp
    boundary = back
    value = 0.0
  []
  [bottomy]
    type = DirichletBC
    variable = y_disp
    boundary = back
    value = 0.0
  []
  [bottomz]
    type = DirichletBC
    variable = z_disp
    boundary = back
    value = 0.0
  []
  [topx]
    type = FunctionDirichletBC
    variable = x_disp
    boundary = front
    function = '0'
  []
  [topy]
    type = FunctionDirichletBC
    variable = y_disp
    boundary = front
    function = '0'
  []
  [topz]
    type = FunctionDirichletBC
    variable = z_disp
    boundary = front
    function = '2*t'
  []
[]
[AuxVariables]
  [wps_internal]
    order = CONSTANT
    family = MONOMIAL
  []
  [yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[AuxKernels]
  [wps_internal_auxk]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = wps_internal
  []
  [yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  []
[]
[Postprocessors]
  [s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  []
  [s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  []
  [s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  []
  [f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  []
  [int]
    type = PointValue
    point = '0 0 0'
    variable = wps_internal
  []
[]
[UserObjects]
  [coh]
    type = SolidMechanicsHardeningCubic
    value_0 = 1E3
    value_residual = 2E3
    internal_limit = 0.00007
  []
  [tanphi]
    type = SolidMechanicsHardeningConstant
    value = 1
  []
  [tanpsi]
    type = SolidMechanicsHardeningConstant
    value = 0.01745506
  []
  [wps]
    type = SolidMechanicsPlasticWeakPlaneShear
    cohesion = coh
    tan_friction_angle = tanphi
    tan_dilation_angle = tanpsi
    smoother = 500
    yield_function_tolerance = 1E-3
    internal_constraint_tolerance = 1E-3
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '1E9 0.5E9'
  []
  [mc]
    type = ComputeMultiPlasticityStress
    plastic_models = wps
    transverse_direction = '0 0 1'
    ep_plastic_tolerance = 1E-3
    debug_fspb = crash
  []
[]
[Executioner]
  end_time = 1E-6
  dt = 1E-7
  type = Transient
[]
[Outputs]
  csv = true
[]
(modules/solid_mechanics/test/tests/capped_weak_plane/small_deform_inclined3.i)
# Plastic deformation, tensile failure, inclined normal = (0, 1, 0)
# With Young = 10, poisson=0.25 (Lame lambda=4, mu=4)
# applying the following
# deformation to the ymax surface of a unit cube:
# disp_x = 4*t
# disp_y = t
# disp_z = 3*t
# should yield trial stress:
# stress_yy = 12*t
# stress_yx = 16*t
# stress_yz = 12*t
# Use tensile strength = 6, we should return to stress_yy = 6,
# and stress_xx = stress_zz = 2*t up to t=1 when the system is completely
# plastic, so these stress components will not change
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz plastic_strain_xx plastic_strain_xy plastic_strain_xz plastic_strain_yy plastic_strain_yz plastic_strain_zz strain_xx strain_xy strain_xz strain_yy strain_yz strain_zz'
  [../]
[]
[BCs]
  [./bottomx]
    type = DirichletBC
    variable = disp_x
    boundary = bottom
    value = 0.0
  [../]
  [./bottomy]
    type = DirichletBC
    variable = disp_y
    boundary = bottom
    value = 0.0
  [../]
  [./bottomz]
    type = DirichletBC
    variable = disp_z
    boundary = bottom
    value = 0.0
  [../]
  [./topx]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = top
    function = 4*t
  [../]
  [./topy]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = top
    function = t
  [../]
  [./topz]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = top
    function = 3*t
  [../]
[]
[AuxVariables]
  [./f_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f_compressive]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./ls]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./f_shear]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f_shear
  [../]
  [./f_tensile]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f_tensile
  [../]
  [./f_compressive]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f_compressive
  [../]
  [./intnl_shear]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl_shear
  [../]
  [./intnl_tensile]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 1
    variable = intnl_tensile
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./ls]
    type = MaterialRealAux
    property = plastic_linesearch_needed
    variable = ls
  [../]
[]
[Postprocessors]
  [./stress_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./stress_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./stress_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./stress_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./stress_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./stress_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./strainp_xx]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_xx
  [../]
  [./strainp_xy]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_xy
  [../]
  [./strainp_xz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_xz
  [../]
  [./strainp_yy]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_yy
  [../]
  [./strainp_yz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_yz
  [../]
  [./strainp_zz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_strain_zz
  [../]
  [./straint_xx]
    type = PointValue
    point = '0 0 0'
    variable = strain_xx
  [../]
  [./straint_xy]
    type = PointValue
    point = '0 0 0'
    variable = strain_xy
  [../]
  [./straint_xz]
    type = PointValue
    point = '0 0 0'
    variable = strain_xz
  [../]
  [./straint_yy]
    type = PointValue
    point = '0 0 0'
    variable = strain_yy
  [../]
  [./straint_yz]
    type = PointValue
    point = '0 0 0'
    variable = strain_yz
  [../]
  [./straint_zz]
    type = PointValue
    point = '0 0 0'
    variable = strain_zz
  [../]
  [./f_shear]
    type = PointValue
    point = '0 0 0'
    variable = f_shear
  [../]
  [./f_tensile]
    type = PointValue
    point = '0 0 0'
    variable = f_tensile
  [../]
  [./f_compressive]
    type = PointValue
    point = '0 0 0'
    variable = f_compressive
  [../]
  [./intnl_shear]
    type = PointValue
    point = '0 0 0'
    variable = intnl_shear
  [../]
  [./intnl_tensile]
    type = PointValue
    point = '0 0 0'
    variable = intnl_tensile
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
  [./ls]
    type = PointValue
    point = '0 0 0'
    variable = ls
  [../]
[]
[UserObjects]
  [./coh]
    type = SolidMechanicsHardeningConstant
    value = 80
  [../]
  [./tanphi]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
  [./tanpsi]
    type = SolidMechanicsHardeningConstant
    value = 0.1111077
  [../]
  [./t_strength]
    type = SolidMechanicsHardeningConstant
    value = 6
  [../]
  [./c_strength]
    type = SolidMechanicsHardeningConstant
    value = 40
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '4 4'
  [../]
  [./admissible]
    type = ComputeMultipleInelasticStress
    inelastic_models = stress
    perform_finite_strain_rotations = false
  [../]
  [./stress]
    type = CappedWeakInclinedPlaneStressUpdate
    normal_vector = '0 1 0'
    cohesion = coh
    tan_friction_angle = tanphi
    tan_dilation_angle = tanpsi
    tensile_strength = t_strength
    compressive_strength = c_strength
    tip_smoother = 0
    smoothing_tol = 0
    yield_function_tol = 1E-5
  [../]
[]
[Executioner]
  end_time = 2
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform_inclined3
  csv = true
[]
(modules/solid_mechanics/test/tests/notched_plastic_block/cmc_smooth.i)
# Uses a multi-smoothed version of capped-Mohr-Coulomb (via CappedMohrCoulombStressUpdate and ComputeMultipleInelasticStress) to simulate the following problem.
# A cubical block is notched around its equator.
# All of its outer surfaces have roller BCs, but the notched region is free to move as needed
# The block is initialised with a high hydrostatic tensile stress
# Without the notch, the BCs do not allow contraction of the block, and this stress configuration is admissible
# With the notch, however, the interior parts of the block are free to move in order to relieve stress, and this causes plastic failure
# The top surface is then pulled upwards (the bottom is fixed because of the roller BCs)
# This causes more failure
[Mesh]
  [generated_mesh]
    type = GeneratedMeshGenerator
    dim = 3
    nx = 9
    ny = 9
    nz = 9
    xmin = 0
    xmax = 0.1
    ymin = 0
    ymax = 0.1
    zmin = 0
    zmax = 0.1
  []
  [block_to_remove_xmin]
    type = SubdomainBoundingBoxGenerator
    bottom_left = '-0.01 -0.01 0.045'
    top_right = '0.01 0.11 0.055'
    location = INSIDE
    block_id = 1
    input = generated_mesh
  []
  [block_to_remove_xmax]
    type = SubdomainBoundingBoxGenerator
    bottom_left = '0.09 -0.01 0.045'
    top_right = '0.11 0.11 0.055'
    location = INSIDE
    block_id = 1
    input = block_to_remove_xmin
  []
  [block_to_remove_ymin]
    type = SubdomainBoundingBoxGenerator
    bottom_left = '-0.01 -0.01 0.045'
    top_right = '0.11 0.01 0.055'
    location = INSIDE
    block_id = 1
    input = block_to_remove_xmax
  []
  [block_to_remove_ymax]
    type = SubdomainBoundingBoxGenerator
    bottom_left = '-0.01 0.09 0.045'
    top_right = '0.11 0.11 0.055'
    location = INSIDE
    block_id = 1
    input = block_to_remove_ymin
  []
  [remove_block]
    type = BlockDeletionGenerator
    block = 1
    input = block_to_remove_ymax
  []
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'max_principal_stress mid_principal_stress min_principal_stress stress_zz'
    eigenstrain_names = ini_stress
  [../]
[]
[Postprocessors]
  [./uz]
    type = PointValue
    point = '0 0 0.1'
    use_displaced_mesh = false
    variable = disp_z
  [../]
  [./s_zz]
    type = ElementAverageValue
    use_displaced_mesh = false
    variable = stress_zz
  [../]
  [./num_res]
    type = NumResidualEvaluations
  [../]
  [./nr_its] # num_iters is the average number of NR iterations encountered per element in this timestep
    type = ElementAverageValue
    variable = num_iters
  [../]
  [./max_nr_its] # max_num_iters is the maximum number of NR iterations encountered in the element during the whole simulation
    type = ElementExtremeValue
    variable = max_num_iters
  [../]
  [./runtime]
    type = PerfGraphData
    data_type = TOTAL
    section_name = 'Root'
  [../]
[]
[BCs]
  # back=zmin, front=zmax, bottom=ymin, top=ymax, left=xmin, right=xmax
  [./xmin_xzero]
    type = DirichletBC
    variable = disp_x
    boundary = left
    value = 0.0
  [../]
  [./xmax_xzero]
    type = DirichletBC
    variable = disp_x
    boundary = right
    value = 0.0
  [../]
  [./ymin_yzero]
    type = DirichletBC
    variable = disp_y
    boundary = bottom
    value = 0.0
  [../]
  [./ymax_yzero]
    type = DirichletBC
    variable = disp_y
    boundary = top
    value = 0.0
  [../]
  [./zmin_zzero]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = '0'
  [../]
  [./zmax_disp]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = '1E-6*max(t,0)'
  [../]
[]
[AuxVariables]
  [./mc_int]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./num_iters]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./max_num_iters]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./mc_int_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = mc_int
  [../]
  [./num_iters_auxk]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = num_iters
  [../]
  [./max_num_iters_auxk]
    type = MaterialRealAux
    property = max_plastic_NR_iterations
    variable = max_num_iters
  [../]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 3E6
  [../]
  [./cs]
    type = SolidMechanicsHardeningConstant
    value = 1E16
  [../]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 5E6
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 35
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 10
    convert_to_radians = true
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 16E9
    poissons_ratio = 0.25
  [../]
  [./mc]
    type = CappedMohrCoulombStressUpdate
    tensile_strength = ts
    compressive_strength = cs
    cohesion = mc_coh
    friction_angle = mc_phi
    dilation_angle = mc_psi
    smoothing_tol = 0.2E6
    yield_function_tol = 1E-5
    perfect_guess = false # this is so we can observe some Newton-Raphson iterations, for comparison with other models, and it is not optimal in any real-life simulations
  [../]
  [./stress]
    type = ComputeMultipleInelasticStress
    inelastic_models = mc
    perform_finite_strain_rotations = false
  [../]
  [./strain_from_initial_stress]
    type = ComputeEigenstrainFromInitialStress
    initial_stress = '2.5E6 0 0  0 2.5E6 0  0 0 2.5E6'
    eigenstrain_name = ini_stress
  [../]
[]
[Preconditioning]
  [./andy]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  start_time = -1
  end_time = 10
  dt = 1
  solve_type = NEWTON
  type = Transient
  l_tol = 1E-2
  nl_abs_tol = 1E-5
  nl_rel_tol = 1E-7
  l_max_its = 200
  nl_max_its = 400
  petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
  petsc_options_value = ' asm      2              lu            gmres     200'
[]
[Outputs]
  file_base = cmc_smooth
  perf_graph = true
  exodus = false
  csv = true
[]
(modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform8.i)
# Using CappedMohrCoulomb with tensile failure only
# A single unit element is stretched by 1E-6m in z direction.
# with Lame lambda = 0.6E6 and Lame mu (shear) = 1E6
# stress_zz = 2.6 Pa
# stress_xx = 0.6 Pa
# stress_yy = 0.6 Pa
# tensile_strength is set to 0.5Pa
#
# stress_zz = 0.5
# plastic multiplier = 2.1/2.6 E-6
# stress_xx = 0.6 - (2.1/2.6*0.6) = 0.115
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'max_principal_stress mid_principal_stress min_principal_stress stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1.0E-6*z'
  [../]
[]
[AuxVariables]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./f0_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./intnl_auxk]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl
  [../]
[]
[Postprocessors]
  [./s_I]
    type = PointValue
    point = '0 0 0'
    variable = max_principal_stress
  [../]
  [./s_II]
    type = PointValue
    point = '0 0 0'
    variable = mid_principal_stress
  [../]
  [./s_III]
    type = PointValue
    point = '0 0 0'
    variable = min_principal_stress
  [../]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./f2]
    type = PointValue
    point = '0 0 0'
    variable = f2
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
  [./intnl]
    type = PointValue
    point = '0 0 0'
    variable = intnl
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
  [./cs]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./coh]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./ang]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '0.6E6 1E6'
  [../]
  [./tensile]
    type = CappedMohrCoulombStressUpdate
    tensile_strength = ts
    compressive_strength = cs
    cohesion = coh
    friction_angle = ang
    dilation_angle = ang
    smoothing_tol = 0.0
    yield_function_tol = 1.0E-12
  [../]
  [./stress]
    type = ComputeMultipleInelasticStress
    inelastic_models = tensile
    perform_finite_strain_rotations = false
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform8
  csv = true
[]
(modules/solid_mechanics/test/tests/tensile/small_deform5_update_version.i)
# checking for small deformation
# A single element is incrementally stretched in the in the z and x directions
# This causes the return direction to be along the hypersurface sigma_I = sigma_II,
# and the resulting stresses are checked to lie on the expected yield surface
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    strain = finite
    generate_output = 'max_principal_stress mid_principal_stress min_principal_stress stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '4*x*t'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = 'z*(t-0.5)'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_I]
    type = PointValue
    point = '0 0 0'
    variable = max_principal_stress
  [../]
  [./s_II]
    type = PointValue
    point = '0 0 0'
    variable = mid_principal_stress
  [../]
  [./s_III]
    type = PointValue
    point = '0 0 0'
    variable = min_principal_stress
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '0 2.0'
  [../]
  [./tensile]
    type = TensileStressUpdate
    tensile_strength = ts
    smoothing_tol = 0.5
    yield_function_tol = 1.0E-12
  [../]
  [./stress]
    type = ComputeMultipleInelasticStress
    inelastic_models = tensile
    perform_finite_strain_rotations = false
  [../]
[]
[Executioner]
  end_time = 1
  dt = 0.1
  type = Transient
[]
[Outputs]
  file_base = small_deform5_update_version
  exodus = false
  [./csv]
    type = CSV
  [../]
[]
(modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform25.i)
# Mohr-Coulomb only
# apply equal stretches in x, y and z directions, to observe return to the MC tip
# Because of smoothing, the expected result is around
# Smax = Smid = Smin = 12.9
# The result is not exact because the smoothing is assymetrical.
# This test also employs a very small dilation angle, which makes return
# to the tip quite numerically difficult, so max_NR_iterations has been increased to 100
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'max_principal_stress mid_principal_stress min_principal_stress stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '1E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '1E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1E-6*z'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 6
    property = plastic_yield_function
    variable = yield_fcn
  [../]
  [./iter_auxk]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./intnl_auxk]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl
  [../]
[]
[Postprocessors]
  [./s_max]
    type = PointValue
    point = '0 0 0'
    variable = max_principal_stress
  [../]
  [./s_mid]
    type = PointValue
    point = '0 0 0'
    variable = mid_principal_stress
  [../]
  [./s_min]
    type = PointValue
    point = '0 0 0'
    variable = min_principal_stress
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
  [./intnl]
    type = PointValue
    point = '0 0 0'
    variable = intnl
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 10
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 30
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 1E-4
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 1E7
    poissons_ratio = 0.3
  [../]
  [./mc]
    type = CappedMohrCoulombStressUpdate
    tensile_strength = ts
    compressive_strength = ts
    cohesion = mc_coh
    friction_angle = mc_phi
    dilation_angle = mc_psi
    smoothing_tol = 5
    yield_function_tol = 1.0E-9
    max_NR_iterations = 100
  [../]
  [./stress]
    type = ComputeMultipleInelasticStress
    inelastic_models = mc
    perform_finite_strain_rotations = false
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform25
  csv = true
[]
(modules/solid_mechanics/examples/coal_mining/cosserat_elastic.i)
# Strata deformation and fracturing around a coal mine
#
# A 2D geometry is used that simulates a transverse section of
# the coal mine.  The model is actually 3D, but the "x"
# dimension is only 10m long, meshed with 1 element, and
# there is no "x" displacement.  The mine is 400m deep
# and just the roof is studied (0<=z<=400).  The model sits
# between 0<=y<=450.  The excavation sits in 0<=y<=150.  This
# is a "half model": the boundary conditions are such that
# the model simulates an excavation sitting in -150<=y<=150
# inside a model of the region -450<=y<=450.  The
# excavation height is 3m (ie, the excavation lies within
# 0<=z<=3).
#
# Time is meaningless in this example
# as quasi-static solutions are sought at each timestep, but
# the number of timesteps controls the resolution of the
# process.
#
# The boundary conditions for this elastic simulation are:
#  - disp_x = 0 everywhere
#  - disp_y = 0 at y=0 and y=450
#  - disp_z = 0 for y>150
#  - wc_x = 0 at y=0 and y=450.
# That is, rollers on the sides, free at top,
# and prescribed at bottom in the unexcavated portion.
#
# The small strain formulation is used.
#
# All stresses are measured in MPa.  The initial stress is consistent with
# the weight force from density 2500 kg/m^3, ie, stress_zz = -0.025*(300-z) MPa
# where gravity = 10 m.s^-2 = 1E-5 MPa m^2/kg.  The maximum and minimum
# principal horizontal stresses are assumed to be equal to 0.8*stress_zz.
#
# This is an elastic simulation, but the weak-plane and Drucker-Prager
# parameters and AuxVariables may be found below.  They are irrelevant
# in this simulation.  The weak-plane and Drucker-Prager cohesions,
# tensile strengths and compressive strengths have been set very high
#
# Material properties:
# Young's modulus = 8 GPa
# Poisson's ratio = 0.25
# Cosserat layer thickness = 1 m
# Cosserat-joint normal stiffness = large
# Cosserat-joint shear stiffness = 1 GPa
#
[Mesh]
  [generated_mesh]
    type = GeneratedMeshGenerator
    dim = 3
    nx = 1
    xmin = -5
    xmax = 5
    nz = 40
    zmin = 0
    zmax = 403.003
    bias_z = 1.1
    ny = 30 # make this a multiple of 3, so y=150 is at a node
    ymin = 0
    ymax = 450
  []
  [left]
    type = SideSetsAroundSubdomainGenerator
    new_boundary = 11
    normal = '0 -1 0'
    input = generated_mesh
  []
  [right]
    type = SideSetsAroundSubdomainGenerator
    new_boundary = 12
    normal = '0 1 0'
    input = left
  []
  [front]
    type = SideSetsAroundSubdomainGenerator
    new_boundary = 13
    normal = '-1 0 0'
    input = right
  []
  [back]
    type = SideSetsAroundSubdomainGenerator
    new_boundary = 14
    normal = '1 0 0'
    input = front
  []
  [top]
    type = SideSetsAroundSubdomainGenerator
    new_boundary = 15
    normal = '0 0 1'
    input = back
  []
  [bottom]
    type = SideSetsAroundSubdomainGenerator
    new_boundary = 16
    normal = '0 0 -1'
    input = top
  []
  [excav]
    type = SubdomainBoundingBoxGenerator
    block_id = 1
    bottom_left = '-5 0 0'
    top_right = '5 150 3'
    input = bottom
  []
  [roof]
    type = SideSetsBetweenSubdomainsGenerator
    new_boundary = 21
    primary_block = 0
    paired_block = 1
    input = excav
  []
  [hole]
    type = BlockDeletionGenerator
    block = 1
    input = roof
  []
[]
[GlobalParams]
  block = 0
  perform_finite_strain_rotations = false
  displacements = 'disp_x disp_y disp_z'
  Cosserat_rotations = 'wc_x wc_y wc_z'
[]
[Variables]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
  [./wc_x]
  [../]
[]
[Kernels]
  [./cy_elastic]
    type = CosseratStressDivergenceTensors
    use_displaced_mesh = false
    variable = disp_y
    component = 1
  [../]
  [./cz_elastic]
    type = CosseratStressDivergenceTensors
    use_displaced_mesh = false
    variable = disp_z
    component = 2
  [../]
  [./x_couple]
    type = StressDivergenceTensors
    use_displaced_mesh = false
    variable = wc_x
    displacements = 'wc_x wc_y wc_z'
    component = 0
    base_name = couple
  [../]
  [./x_moment]
    type = MomentBalancing
    use_displaced_mesh = false
    variable = wc_x
    component = 0
  [../]
  [./gravity]
    type = Gravity
    use_displaced_mesh = false
    variable = disp_z
    value = -10E-6 # remember this is in MPa
  [../]
[]
[AuxVariables]
  [./disp_x]
  [../]
  [./wc_y]
  [../]
  [./wc_z]
  [../]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./dp_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./dp_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./wp_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./wp_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./wp_shear_f]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./wp_tensile_f]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./dp_shear_f]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./dp_tensile_f]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yx
    index_i = 1
    index_j = 0
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zx
    index_i = 2
    index_j = 0
  [../]
  [./stress_zy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zy
    index_i = 2
    index_j = 1
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./dp_shear]
    type = MaterialStdVectorAux
    index = 0
    property = dp_plastic_internal_parameter
    variable = dp_shear
  [../]
  [./dp_tensile]
    type = MaterialStdVectorAux
    index = 1
    property = dp_plastic_internal_parameter
    variable = dp_tensile
  [../]
  [./wp_shear]
    type = MaterialStdVectorAux
    index = 0
    property = wp_plastic_internal_parameter
    variable = wp_shear
  [../]
  [./wp_tensile]
    type = MaterialStdVectorAux
    index = 1
    property = wp_plastic_internal_parameter
    variable = wp_tensile
  [../]
  [./dp_shear_f]
    type = MaterialStdVectorAux
    index = 0
    property = dp_plastic_yield_function
    variable = dp_shear_f
  [../]
  [./dp_tensile_f]
    type = MaterialStdVectorAux
    index = 1
    property = dp_plastic_yield_function
    variable = dp_tensile_f
  [../]
  [./wp_shear_f]
    type = MaterialStdVectorAux
    index = 0
    property = wp_plastic_yield_function
    variable = wp_shear_f
  [../]
  [./wp_tensile_f]
    type = MaterialStdVectorAux
    index = 1
    property = wp_plastic_yield_function
    variable = wp_tensile_f
  [../]
[]
[BCs]
  [./no_y]
    type = DirichletBC
    variable = disp_y
    boundary = '11 12'
    value = 0.0
  [../]
  [./no_z]
    type = DirichletBC
    variable = disp_z
    boundary = '16'
    value = 0.0
  [../]
  [./no_wc_x]
    type = DirichletBC
    variable = wc_x
    boundary = '11 12'
    value = 0.0
  [../]
[]
[Functions]
  [./ini_xx]
    type = ParsedFunction
    expression = '-0.8*2500*10E-6*(403.003-z)'
  [../]
  [./ini_zz]
    type = ParsedFunction
    expression = '-2500*10E-6*(403.003-z)'
  [../]
[]
[UserObjects]
  [./dp_coh_strong_harden]
    type = SolidMechanicsHardeningExponential
    value_0 = 2.9 # MPa
    value_residual = 3.1 # MPa
    rate = 1.0
  [../]
  [./dp_fric]
    type = SolidMechanicsHardeningConstant
    value = 0.65 # 37deg
  [../]
  [./dp_dil]
    type = SolidMechanicsHardeningConstant
    value = 0.65
  [../]
  [./dp_tensile_str_strong_harden]
    type = SolidMechanicsHardeningExponential
    value_0 = 1.0 # MPa
    value_residual = 1.4 # MPa
    rate = 1.0
  [../]
  [./dp_compressive_str]
    type = SolidMechanicsHardeningConstant
    value = 1.0E3 # Large!
  [../]
  [./drucker_prager_model]
    type = SolidMechanicsPlasticDruckerPrager
    mc_cohesion = dp_coh_strong_harden
    mc_friction_angle = dp_fric
    mc_dilation_angle = dp_dil
    internal_constraint_tolerance = 1 # irrelevant here
    yield_function_tolerance = 1      # irrelevant here
  [../]
  [./wp_coh]
    type = SolidMechanicsHardeningConstant
    value = 1E12
  [../]
  [./wp_tan_fric]
    type = SolidMechanicsHardeningConstant
    value = 0.36 # 20deg
  [../]
  [./wp_tan_dil]
    type = SolidMechanicsHardeningConstant
    value = 0.18 # 10deg
  [../]
  [./wp_tensile_str]
    type = SolidMechanicsHardeningConstant
    value = 1E12
  [../]
  [./wp_compressive_str]
    type = SolidMechanicsHardeningConstant
    value = 1E12
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeLayeredCosseratElasticityTensor
    young = 8E3 # MPa
    poisson = 0.25
    layer_thickness = 1.0
    joint_normal_stiffness = 1E9 # huge
    joint_shear_stiffness = 1E3 # MPa
  [../]
  [./strain]
    type = ComputeCosseratIncrementalSmallStrain
    eigenstrain_names = ini_stress
  [../]
  [./ini_stress]
    type = ComputeEigenstrainFromInitialStress
    initial_stress = 'ini_xx 0 0  0 ini_xx 0  0 0 ini_zz'
    eigenstrain_name = ini_stress
  [../]
  [./stress]
    # this is needed so as to correctly apply the initial stress
    type = ComputeMultipleInelasticCosseratStress
    block = 0
    inelastic_models = ''
    relative_tolerance = 2.0
    absolute_tolerance = 1E6
    max_iterations = 1
    tangent_operator = nonlinear
    perform_finite_strain_rotations = false
  [../]
  [./dp]
    type = CappedDruckerPragerCosseratStressUpdate
    block = 0
    warn_about_precision_loss = false
    host_youngs_modulus = 8E3
    host_poissons_ratio = 0.25
    base_name = dp
    DP_model = drucker_prager_model
    tensile_strength = dp_tensile_str_strong_harden
    compressive_strength = dp_compressive_str
    max_NR_iterations = 100000
    tip_smoother = 0.1E1
    smoothing_tol = 0.1E1 # MPa  # Must be linked to cohesion
    yield_function_tol = 1E-11 # MPa.  this is essentially the lowest possible without lots of precision loss
    perfect_guess = true
    min_step_size = 1.0
  [../]
  [./wp]
    type = CappedWeakPlaneCosseratStressUpdate
    block = 0
    warn_about_precision_loss = false
    base_name = wp
    cohesion = wp_coh
    tan_friction_angle = wp_tan_fric
    tan_dilation_angle = wp_tan_dil
    tensile_strength = wp_tensile_str
    compressive_strength = wp_compressive_str
    max_NR_iterations = 10000
    tip_smoother = 0.1
    smoothing_tol = 0.1 # MPa  # Note, this must be tied to cohesion, otherwise get no possible return at cone apex
    yield_function_tol = 1E-11 # MPa.  this is essentially the lowest possible without lots of precision loss
    perfect_guess = true
    min_step_size = 1.0E-3
  [../]
  [./density]
    type = GenericConstantMaterial
    prop_names = density
    prop_values = 2500
  [../]
[]
[Postprocessors]
  [./subs_max]
    type = PointValue
    point = '0 0 403.003'
    variable = disp_z
    use_displaced_mesh = false
  [../]
[]
[Preconditioning]
  [./SMP]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  solve_type = 'Linear'
  petsc_options = '-snes_converged_reason'
  petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
  petsc_options_value = ' asm      2              lu            gmres     200'
  line_search = bt
  nl_abs_tol = 1e-3
  nl_rel_tol = 1e-5
  l_max_its = 30
  nl_max_its = 1000
  start_time = 0.0
  dt = 1.0
  end_time = 1.0
[]
[Outputs]
  file_base = cosserat_elastic
  time_step_interval = 1
  print_linear_residuals = false
  exodus = true
  csv = true
  console = true
  #[./console]
  #  type = Console
  #  output_linear = false
  #[../]
[]
(modules/solid_mechanics/examples/coal_mining/cosserat_mc_wp_sticky_longitudinal.i)
# Strata deformation and fracturing around a coal mine
#
# A 2D geometry is used that simulates a longitudinal section of
# the coal mine.  The model is actually 3D, but the "x"
# dimension is only 10m long, meshed with 1 element, and
# there is no "x" displacement.  The mine is 400m deep
# and just the roof is studied (0<=z<=400).  The model sits
# between -300<=y<=1800.  The excavation sits in 0<=y<=1500.  The
# excavation height is 3m (ie, the excavation lies within
# 0<=z<=3).
#
# Time is meaningless in this example
# as quasi-static solutions are sought at each timestep, but
# the number of timesteps controls the resolution of the
# process.
#
# The boundary conditions for this elastic simulation are:
#  - disp_x = 0 everywhere
#  - disp_y = 0 at y=-300 and y=1800
#  - disp_z = 0 at z=0, but there is a time-dependent
#               Young's modulus that simulates excavation
#  - wc_x = 0 at y=300 and y=1800.
# That is, rollers on the sides, free at top,
# and prescribed at bottom in the unexcavated portion.
#
# The small strain formulation is used.
#
# All stresses are measured in MPa.  The initial stress is consistent with
# the weight force from density 2500 kg/m^3, ie, stress_zz = -0.025*(300-z) MPa
# where gravity = 10 m.s^-2 = 1E-5 MPa m^2/kg.  The maximum and minimum
# principal horizontal stresses are assumed to be equal to 0.8*stress_zz.
#
# Material properties:
# Young's modulus = 8 GPa
# Poisson's ratio = 0.25
# Cosserat layer thickness = 1 m
# Cosserat-joint normal stiffness = large
# Cosserat-joint shear stiffness = 1 GPa
# MC cohesion = 3 MPa
# MC friction angle = 37 deg
# MC dilation angle = 8 deg
# MC tensile strength = 1 MPa
# MC compressive strength = 100 MPa
#
[Mesh]
   [generated_mesh]
    type = GeneratedMeshGenerator
    dim = 3
    nx = 1
    xmin = -5
    xmax = 5
    nz = 40
    zmin = 0
    zmax = 400
    bias_z = 1.1
    ny = 140 # 15m elements
    ymin = -300
    ymax = 1800
  []
  [left]
    type = SideSetsAroundSubdomainGenerator
    block = 0
    new_boundary = 11
    normal = '0 -1 0'
    input = generated_mesh
  []
  [right]
    type = SideSetsAroundSubdomainGenerator
    block = 0
    new_boundary = 12
    normal = '0 1 0'
    input = left
  []
  [front]
    type = SideSetsAroundSubdomainGenerator
    block = 0
    new_boundary = 13
    normal = '-1 0 0'
    input = right
  []
  [back]
    type = SideSetsAroundSubdomainGenerator
    block = 0
    new_boundary = 14
    normal = '1 0 0'
    input = front
  []
  [top]
    type = SideSetsAroundSubdomainGenerator
    block = 0
    new_boundary = 15
    normal = '0 0 1'
    input = back
  []
  [bottom]
    type = SideSetsAroundSubdomainGenerator
    block = 0
    new_boundary = 16
    normal = '0 0 -1'
    input = top
  []
  [excav]
    type = SubdomainBoundingBoxGenerator
    block_id = 1
    bottom_left = '-5 0 0'
    top_right = '5 1500 3'
    input = bottom
  []
  [roof]
    type = SideSetsAroundSubdomainGenerator
    block = 1
    new_boundary = 18
    normal = '0 0 1'
    input = excav
  []
[]
[GlobalParams]
  perform_finite_strain_rotations = false
  displacements = 'disp_x disp_y disp_z'
  Cosserat_rotations = 'wc_x wc_y wc_z'
[]
[Variables]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
  [./wc_x]
  [../]
[]
[Kernels]
  [./cy_elastic]
    type = CosseratStressDivergenceTensors
    use_displaced_mesh = false
    variable = disp_y
    component = 1
  [../]
  [./cz_elastic]
    type = CosseratStressDivergenceTensors
    use_displaced_mesh = false
    variable = disp_z
    component = 2
  [../]
  [./x_couple]
    type = StressDivergenceTensors
    use_displaced_mesh = false
    variable = wc_x
    displacements = 'wc_x wc_y wc_z'
    component = 0
    base_name = couple
  [../]
  [./x_moment]
    type = MomentBalancing
    use_displaced_mesh = false
    variable = wc_x
    component = 0
  [../]
  [./gravity]
    type = Gravity
    use_displaced_mesh = false
    variable = disp_z
    value = -10E-6 # remember this is in MPa
  [../]
[]
[AuxVariables]
  [./disp_x]
  [../]
  [./wc_y]
  [../]
  [./wc_z]
  [../]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./wp_shear]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./wp_tensile]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./wp_shear_f]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./wp_tensile_f]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_shear_f]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_tensile_f]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yx
    index_i = 1
    index_j = 0
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zx
    index_i = 2
    index_j = 0
  [../]
  [./stress_zy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zy
    index_i = 2
    index_j = 1
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./mc_shear]
    type = MaterialStdVectorAux
    index = 0
    property = mc_plastic_internal_parameter
    variable = mc_shear
  [../]
  [./mc_tensile]
    type = MaterialStdVectorAux
    index = 1
    property = mc_plastic_internal_parameter
    variable = mc_tensile
  [../]
  [./wp_shear]
    type = MaterialStdVectorAux
    index = 0
    property = wp_plastic_internal_parameter
    variable = wp_shear
  [../]
  [./wp_tensile]
    type = MaterialStdVectorAux
    index = 1
    property = wp_plastic_internal_parameter
    variable = wp_tensile
  [../]
  [./mc_shear_f]
    type = MaterialStdVectorAux
    index = 6
    property = mc_plastic_yield_function
    variable = mc_shear_f
  [../]
  [./mc_tensile_f]
    type = MaterialStdVectorAux
    index = 0
    property = mc_plastic_yield_function
    variable = mc_tensile_f
  [../]
  [./wp_shear_f]
    type = MaterialStdVectorAux
    index = 0
    property = wp_plastic_yield_function
    variable = wp_shear_f
  [../]
  [./wp_tensile_f]
    type = MaterialStdVectorAux
    index = 1
    property = wp_plastic_yield_function
    variable = wp_tensile_f
  [../]
[]
[BCs]
  [./no_y]
    type = DirichletBC
    variable = disp_y
    boundary = '11 12'
    value = 0.0
  [../]
  [./no_z]
    type = DirichletBC
    variable = disp_z
    boundary = '16'
    value = 0.0
  [../]
  [./no_wc_x]
    type = DirichletBC
    variable = wc_x
    boundary = '11 12'
    value = 0.0
  [../]
  [./roof]
    type = StickyBC
    variable = disp_z
    min_value = -3.0
    boundary = '18'
  [../]
[]
[Functions]
  [./ini_xx]
    type = ParsedFunction
    expression = '-0.8*2500*10E-6*(400-z)'
  [../]
  [./ini_zz]
    type = ParsedFunction
    expression = '-2500*10E-6*(400-z)'
  [../]
  [./excav_sideways]
    type = ParsedFunction
    symbol_names = 'end_t ymin ymax  minval maxval slope'
    symbol_values = '1.0   0    1500.0 1E-9  1      15'
    # excavation face at ymin+(ymax-ymin)*min(t/end_t,1)
    # slope is the distance over which the modulus reduces from maxval to minval
    expression = 'if(y<ymin+(ymax-ymin)*min(t/end_t,1),minval,if(y<ymin+(ymax-ymin)*min(t/end_t,1)+slope,minval+(maxval-minval)*(y-(ymin+(ymax-ymin)*min(t/end_t,1)))/slope,maxval))'
  [../]
  [./density_sideways]
    type = ParsedFunction
    symbol_names = 'end_t ymin ymax  minval maxval'
    symbol_values = '1.0   0    1500.0 0     2500'
    expression = 'if(y<ymin+(ymax-ymin)*min(t/end_t,1),minval,maxval)'
  [../]
[]
[UserObjects]
  [./mc_coh_strong_harden]
    type = SolidMechanicsHardeningExponential
    value_0 = 2.99 # MPa
    value_residual = 3.01 # MPa
    rate = 1.0
  [../]
  [./mc_fric]
    type = SolidMechanicsHardeningConstant
    value = 0.65 # 37deg
  [../]
  [./mc_dil]
    type = SolidMechanicsHardeningConstant
    value = 0.15 # 8deg
  [../]
  [./mc_tensile_str_strong_harden]
    type = SolidMechanicsHardeningExponential
    value_0 = 1.0 # MPa
    value_residual = 1.0 # MPa
    rate = 1.0
  [../]
  [./mc_compressive_str]
    type = SolidMechanicsHardeningCubic
    value_0 = 100 # Large!
    value_residual = 100
    internal_limit = 0.1
  [../]
  [./wp_coh_harden]
    type = SolidMechanicsHardeningCubic
    value_0 = 0.1
    value_residual = 0.1
    internal_limit = 10
  [../]
  [./wp_tan_fric]
    type = SolidMechanicsHardeningConstant
    value = 0.36 # 20deg
  [../]
  [./wp_tan_dil]
    type = SolidMechanicsHardeningConstant
    value = 0.18 # 10deg
  [../]
  [./wp_tensile_str_harden]
    type = SolidMechanicsHardeningCubic
    value_0 = 0.1
    value_residual = 0.1
    internal_limit = 10
  [../]
  [./wp_compressive_str_soften]
    type = SolidMechanicsHardeningCubic
    value_0 = 100
    value_residual = 1.0
    internal_limit = 1.0
  [../]
[]
[Materials]
  [./elasticity_tensor_0]
    type = ComputeLayeredCosseratElasticityTensor
    block = 0
    young = 8E3 # MPa
    poisson = 0.25
    layer_thickness = 1.0
    joint_normal_stiffness = 1E9 # huge
    joint_shear_stiffness = 1E3 # MPa
  [../]
  [./elasticity_tensor_1]
    type = ComputeLayeredCosseratElasticityTensor
    block = 1
    young = 8E3 # MPa
    poisson = 0.25
    layer_thickness = 1.0
    joint_normal_stiffness = 1E9 # huge
    joint_shear_stiffness = 1E3 # MPa
    elasticity_tensor_prefactor = excav_sideways
  [../]
  [./strain]
    type = ComputeCosseratIncrementalSmallStrain
    eigenstrain_names = ini_stress
  [../]
  [./ini_stress]
    type = ComputeEigenstrainFromInitialStress
    eigenstrain_name = ini_stress
    initial_stress = 'ini_xx 0 0  0 ini_xx 0  0 0 ini_zz'
  [../]
  [./stress_0]
    type = ComputeMultipleInelasticCosseratStress
    block = 0
    inelastic_models = 'mc wp'
    cycle_models = true
    relative_tolerance = 2.0
    absolute_tolerance = 1E6
    max_iterations = 1
    tangent_operator = nonlinear
    perform_finite_strain_rotations = false
  [../]
  [./stress_1]
    # this is needed so as to correctly apply the initial stress
    type = ComputeMultipleInelasticCosseratStress
    block = 1
    inelastic_models = ''
    relative_tolerance = 2.0
    absolute_tolerance = 1E6
    max_iterations = 1
    tangent_operator = nonlinear
    perform_finite_strain_rotations = false
  [../]
  [./mc]
    type = CappedMohrCoulombCosseratStressUpdate
    warn_about_precision_loss = false
    host_youngs_modulus = 8E3
    host_poissons_ratio = 0.25
    base_name = mc
    tensile_strength = mc_tensile_str_strong_harden
    compressive_strength = mc_compressive_str
    cohesion = mc_coh_strong_harden
    friction_angle = mc_fric
    dilation_angle = mc_dil
    max_NR_iterations = 100000
    smoothing_tol = 0.1 # MPa  # Must be linked to cohesion
    yield_function_tol = 1E-9 # MPa.  this is essentially the lowest possible without lots of precision loss
    perfect_guess = true
    min_step_size = 1.0
  [../]
  [./wp]
    type = CappedWeakPlaneCosseratStressUpdate
    warn_about_precision_loss = false
    base_name = wp
    cohesion = wp_coh_harden
    tan_friction_angle = wp_tan_fric
    tan_dilation_angle = wp_tan_dil
    tensile_strength = wp_tensile_str_harden
    compressive_strength = wp_compressive_str_soften
    max_NR_iterations = 10000
    tip_smoother = 0.1
    smoothing_tol = 0.1 # MPa  # Note, this must be tied to cohesion, otherwise get no possible return at cone apex
    yield_function_tol = 1E-11 # MPa.  this is essentially the lowest possible without lots of precision loss
    perfect_guess = true
    min_step_size = 1.0E-3
  [../]
  [./density_0]
    type = GenericConstantMaterial
    block = 0
    prop_names = density
    prop_values = 2500
  [../]
  [./density_1]
    type = GenericFunctionMaterial
    block = 1
    prop_names = density
    prop_values = density_sideways
  [../]
[]
[Postprocessors]
  [./subs]
    type = PointValue
    point = '0 0 400'
    variable = disp_z
    use_displaced_mesh = false
  [../]
[]
[Preconditioning]
  [./SMP]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  solve_type = 'NEWTON'
  petsc_options = '-snes_converged_reason'
  petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
  petsc_options_value = ' asm      2              lu            gmres     200'
  line_search = bt
  nl_abs_tol = 1e-3
  nl_rel_tol = 1e-5
  l_max_its = 30
  nl_max_its = 100
  start_time = 0.0
  dt = 0.01 # 1 element per step
  end_time = 1.0
[]
[Outputs]
  file_base = cosserat_mc_wp_sticky_longitudinal
  time_step_interval = 1
  print_linear_residuals = false
  exodus = true
  csv = true
  console = true
  #[./console]
  #  type = Console
  #  output_linear = false
  #[../]
[]
(modules/solid_mechanics/test/tests/mohr_coulomb/small_deform4.i)
# apply repeated stretches in z direction, and smaller stretches in the x and y directions
# so that sigma_II = sigma_III,
# which means that lode angle = -30deg.
# The allows yield surface in meridional plane to be mapped out
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0.25E-6*x*sin(t)'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0.25E-6*y*sin(t)'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1E-6*z*t'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./mc_int]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./mc_int_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = mc_int
  [../]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./internal]
    type = PointValue
    point = '0 0 0'
    variable = mc_int
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 10
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 50
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningExponential
    value_0 = 0
    value_residual = 0.8726646 # 50deg
    rate = 3000.0
  [../]
  [./mc]
    type = SolidMechanicsPlasticMohrCoulomb
    cohesion = mc_coh
    friction_angle = mc_phi
    dilation_angle = mc_psi
    mc_tip_smoother = 4
    mc_edge_smoother = 20
    yield_function_tolerance = 1E-8
    internal_constraint_tolerance = 1E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = mc
    debug_fspb = crash
  [../]
[]
[Executioner]
  end_time = 30
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform4
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/user_object_based/use_substep_dt.i)
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 4
  ny = 4
  nz = 4
  elem_type = HEX8
  displacements = 'ux uy uz'
[]
[Variables]
  [ux]
  []
  [uy]
  []
  [uz]
  []
[]
[AuxVariables]
  [stress_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [pk2]
    order = CONSTANT
    family = MONOMIAL
  []
  [fp_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [rotout]
    order = CONSTANT
    family = MONOMIAL
  []
  [e_zz]
    order = CONSTANT
    family = MONOMIAL
  []
  [gss]
    order = CONSTANT
    family = MONOMIAL
  []
  [slip_increment]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[Kernels]
  [SolidMechanics]
    displacements = 'ux uy uz'
    use_displaced_mesh = true
  []
[]
[AuxKernels]
  [stress_zz]
    type = RankTwoAux
    variable = stress_zz
    rank_two_tensor = stress
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [pk2]
    type = RankTwoAux
    variable = pk2
    rank_two_tensor = pk2
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [fp_zz]
    type = RankTwoAux
    variable = fp_zz
    rank_two_tensor = fp
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [e_zz]
    type = RankTwoAux
    variable = e_zz
    rank_two_tensor = lage
    index_j = 2
    index_i = 2
    execute_on = timestep_end
  []
  [gss]
    type = MaterialStdVectorAux
    variable = gss
    property = state_var_gss
    index = 0
    execute_on = timestep_end
  []
  [slip_inc]
    type = MaterialStdVectorAux
    variable = slip_increment
    property = slip_rate_gss
    index = 0
    execute_on = timestep_end
  []
[]
[BCs]
  [symmy]
    type = DirichletBC
    variable = uy
    boundary = bottom
    value = 0
  []
  [symmx]
    type = DirichletBC
    variable = ux
    boundary = left
    value = 0
  []
  [symmz]
    type = DirichletBC
    variable = uz
    boundary = back
    value = 0
  []
  [pushy]
    type = FunctionDirichletBC
    variable = uy
    boundary = top
    function = '-0.1*t'
  []
  [pullz]
    type = FunctionDirichletBC
    variable = uz
    boundary = front
    function = '0.1*t'
  []
[]
[UserObjects]
  [slip_rate_gss]
    type = CrystalPlasticitySlipRateGSS
    variable_size = 12
    slip_sys_file_name = input_slip_sys.txt
    num_slip_sys_flowrate_props = 2
    flowprops = '1 4 0.001 0.1 5 8 0.001 0.1 9 12 0.001 0.1'
    uo_state_var_name = state_var_gss
  []
  [slip_resistance_gss]
    type = CrystalPlasticitySlipResistanceGSS
    variable_size = 12
    uo_state_var_name = state_var_gss
  []
  [state_var_gss]
    type = CrystalPlasticityStateVariable
    variable_size = 12
    groups = '0 4 8 12'
    group_values = '60.8 60.8 60.8'
    uo_state_var_evol_rate_comp_name = state_var_evol_rate_comp_gss
    scale_factor = 1.0
  []
  [state_var_evol_rate_comp_gss]
    type = CrystalPlasticityStateVarRateComponentGSS
    variable_size = 12
    hprops = '1.0 541.5 109.8 2.5'
    uo_slip_rate_name = slip_rate_gss
    uo_state_var_name = state_var_gss
  []
[]
[Materials]
  [crysp]
    type = FiniteStrainUObasedCP
    block = 0
    stol = 1e-2
    tan_mod_type = exact
    uo_slip_rates = 'slip_rate_gss'
    uo_slip_resistances = 'slip_resistance_gss'
    uo_state_vars = 'state_var_gss'
    uo_state_var_evol_rate_comps = 'state_var_evol_rate_comp_gss'
  []
  [strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'ux uy uz'
  []
  [elasticity_tensor]
    type = ComputeElasticityTensorCP
    block = 0
    C_ijkl = '1.684e5 1.214e5 1.214e5 1.684e5 1.214e5 1.684e5 0.754e5 0.754e5 0.754e5'
    fill_method = symmetric9
  []
[]
[Postprocessors]
  [stress_zz]
    type = ElementAverageValue
    variable = stress_zz
  []
  [pk2]
    type = ElementAverageValue
    variable = pk2
  []
  [fp_zz]
    type = ElementAverageValue
    variable = fp_zz
  []
  [e_zz]
    type = ElementAverageValue
    variable = e_zz
  []
  [gss]
    type = ElementAverageValue
    variable = gss
  []
  [slip_increment]
    type = ElementAverageValue
    variable = slip_increment
  []
  [uy_avg_top]
    type = SideAverageValue
    variable = uy
    boundary = top
  []
  [uz_avg_front]
    type = SideAverageValue
    variable = uz
    boundary = front
  []
[]
[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  dt = 0.05
  solve_type = 'NEWTON'
  petsc_options = '-snes_ksp_ew'
  petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
  petsc_options_value = ' lu       superlu_dist'
  line_search = 'none'
  nl_abs_tol = 1e-10
  nl_rel_step_tol = 1e-10
  dtmax = 10.0
  nl_rel_tol = 1e-10
  end_time = 1.0
  num_steps = 5
  dtmin = 0.001
  nl_abs_step_tol = 1e-10
[]
[Outputs]
  csv = true
[]
(modules/solid_mechanics/test/tests/capped_mohr_coulomb/small_deform24.i)
# apply repeated stretches in z directions, and smaller stretches along the x and y directions,
# so that sigma_mid = sigma_min (approximately),
# which means that lode angle = -30deg.
# The allows yield surface in meridional plane to be mapped out
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'max_principal_stress mid_principal_stress min_principal_stress stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0.25E-6*x*sin(t)'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0.25E-6*y*sin(t)'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1E-6*z*t'
  [../]
[]
[AuxVariables]
  [./mc_int]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./mc_int_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = mc_int
  [../]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 6
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./internal]
    type = PointValue
    point = '0 0 0'
    variable = mc_int
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  [../]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 10
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 30
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 0.5
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./mc]
    type = CappedMohrCoulombStressUpdate
    tensile_strength = ts
    compressive_strength = ts
    cohesion = mc_coh
    friction_angle = mc_phi
    dilation_angle = mc_psi
    smoothing_tol = 5.0
    yield_function_tol = 1.0E-7
  [../]
  [./stress]
    type = ComputeMultipleInelasticStress
    inelastic_models = mc
    perform_finite_strain_rotations = false
  [../]
[]
[Executioner]
  end_time = 30
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform24
  csv = true
[]
(modules/solid_mechanics/test/tests/capped_drucker_prager/small_deform2_inner_edge.i)
# apply repeated stretches in x, y and z directions, so that mean_stress = 0
# This maps out the yield surface in the octahedral plane for zero mean stress
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '-1.5E-6*x+2E-6*x*sin(t)'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '2E-6*y*sin(2*t)'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '-2E-6*z*(sin(t)+sin(2*t))'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1000
  [../]
  [./cs]
    type = SolidMechanicsHardeningConstant
    value = 1000
  [../]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 10
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 20
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 0
  [../]
  [./dp]
    type = SolidMechanicsPlasticDruckerPrager
    mc_cohesion = mc_coh
    mc_friction_angle = mc_phi
    mc_dilation_angle = mc_psi
    mc_interpolation_scheme = inner_edge
    internal_constraint_tolerance = 1 # irrelevant here
    yield_function_tolerance = 1      # irrelevant here
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeIsotropicElasticityTensor
    block = 0
    lambda = 0.0
    shear_modulus = 1.0e7
  [../]
  [./admissible]
    type = ComputeMultipleInelasticStress
    inelastic_models = cdp
    perform_finite_strain_rotations = false
  [../]
  [./cdp]
    type = CappedDruckerPragerStressUpdate
    DP_model = dp
    tensile_strength = ts
    compressive_strength = cs
    yield_function_tol = 1E-8
    tip_smoother = 4
    smoothing_tol = 1E-5
  [../]
[]
[Executioner]
  end_time = 100
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform2_inner_edge
  exodus = false
  [./csv]
    type = CSV
  [../]
[]
(modules/solid_mechanics/test/tests/j2_plasticity/hard1.i)
# UserObject J2 test, with hardening, but with rate=0
# apply uniform compression in x direction to give
# trial stress_xx = -5, so sqrt(3*J2) = 5
# with zero Poisson's ratio, this should return to
# stress_xx = -3, stress_yy = -1 = stress_zz,
# for strength = 2
# (note that stress_xx - stress_yy = stress_xx - stress_zz = -2, so sqrt(3*j2) = 2,
#  and that the mean stress remains = -5/3)
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '-2.5E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '0E-6*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = f
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = f
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
  [../]
[]
[UserObjects]
  [./str]
    type = SolidMechanicsHardeningConstant
    value = 2
  [../]
  [./j2]
    type = SolidMechanicsPlasticJ2
    yield_strength = str
    yield_function_tolerance = 1E-3
    internal_constraint_tolerance = 1E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E6'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = j2
    debug_fspb = crash
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = hard1
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/multi/three_surface14.i)
# Plasticit models:
# SimpleTester0 with a = 0 and b = 1 and strength = 1
# SimpleTester1 with a = 1 and b = 0 and strength = 1
# SimpleTester2 with a = 1 and b = 1 and strength = 3
#
# Lame lambda = 0 (Poisson=0).  Lame mu = 0.5E6
#
# A single element is stretched by 2.1E-6m in y direction and 3E-6 in z direction.
# trial stress_yy = 2.1 and stress_zz = 3.0
#
# Then all three will be active, but there is linear-dependence.
# SimpleTester1 will turn off, since it is closest,
# and the algorithm will return to stress_zz=1, stress_yy=2, but
# then SimpleTester1 will be positive, so it will be turned back
# on, and then SimpleTester0 or SimpleTester2 will be turned off
# (a random choice will be made).
# If SimpleTester2 is turned
# off then algorithm returns to stress_zz=1=stress_yy, but then
# SimpleTester2 violates Kuhn-Tucker (f<0 and pm>0), so the algorithm
# will restart, and return to stress_zz=1=stress_yy, with internal0=2
# and internal1=1.1
# If SimpleTester0 is turned off then the algorithm will return to
# stress_zz=2, stress_yy=1, where f0>0.  Once again, a random choice
# of turning off SimpleTester1 or SimpleTester2 can be made.  Hence,
# oscillations can occur.  If too many oscillations occur then the algorithm
# will fail
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '2.1E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '3.0E-6*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int2]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./int0]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 0
    variable = int0
  [../]
  [./int1]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 1
    variable = int1
  [../]
  [./int2]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 2
    variable = int2
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./f2]
    type = PointValue
    point = '0 0 0'
    variable = f2
  [../]
  [./int0]
    type = PointValue
    point = '0 0 0'
    variable = int0
  [../]
  [./int1]
    type = PointValue
    point = '0 0 0'
    variable = int1
  [../]
  [./int2]
    type = PointValue
    point = '0 0 0'
    variable = int2
  [../]
[]
[UserObjects]
  [./simple0]
    type = SolidMechanicsPlasticSimpleTester
    a = 0
    b = 1
    strength = 1
    yield_function_tolerance = 1.0E-6
    internal_constraint_tolerance = 1.0E-6
  [../]
  [./simple1]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 0
    strength = 1
    yield_function_tolerance = 1.0E-6
    internal_constraint_tolerance = 1.0E-6
  [../]
  [./simple2]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 1
    strength = 3
    yield_function_tolerance = 1.0E-6
    internal_constraint_tolerance = 1.0E-6
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 0.5E6'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./multi]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = 'simple0 simple1 simple2'
    max_NR_iterations = 4
    min_stepsize = 1
    debug_fspb = crash
    debug_jac_at_stress = '10 0 0 0 10 0 0 0 10'
    debug_jac_at_pm = '1 1 1'
    debug_jac_at_intnl = '1 1 1'
    debug_stress_change = 1E-5
    debug_pm_change = '1E-6 1E-6 1E-6'
    debug_intnl_change = '1E-6 1E-6 1E-6'
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = three_surface14
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/tensile/planar3.i)
# checking for small deformation
# A single element is stretched by 1E-6m in the z and x directions, with lame mu = 1E6, so trial stress is 2Pa in those directions
# tensile_strength is set to 1Pa
# Then the final stress should return to the z and x stresses being 1.0 (up to tolerance), and internal parameter = (0.5+0.5)E-6 = 1.0E-6
# Using 'planar' Tensile plasticity
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    strain = finite
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '1E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1E-6*z'
  [../]
[]
[AuxVariables]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./f0_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./intnl_auxk]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    index = 0
    variable = intnl
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./f2]
    type = PointValue
    point = '0 0 0'
    variable = f2
  [../]
  [./iter]
    type = PointValue
    point = '0 0 0'
    variable = iter
    outputs = console
  [../]
  [./intnl]
    type = PointValue
    point = '0 0 0'
    variable = intnl
  [../]
[]
[UserObjects]
  [./hard]
    type = SolidMechanicsHardeningConstant
    value = 1
  [../]
  [./tens]
    type = SolidMechanicsPlasticTensileMulti
    tensile_strength = hard
    yield_function_tolerance = 1E-6
    internal_constraint_tolerance = 1E-5
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E6'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-5
    max_NR_iterations = 4
    min_stepsize = 1
    plastic_models = tens
    debug_fspb = crash
    debug_jac_at_stress = '1 2 3 2 -4 -5 3 -5 10'
    debug_jac_at_pm = '0.1 0.2 0.3'
    debug_jac_at_intnl = 1E-6
    debug_stress_change = 1E-6
    debug_pm_change = '1E-6 1E-6 1E-6'
    debug_intnl_change = 1E-6
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = planar3
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/mean_cap_TC/random03.i)
# apply many random large deformations, checking that the algorithm returns correctly to
# the yield surface each time.
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1000
  ny = 125
  nz = 1
  xmin = 0
  xmax = 1000
  ymin = 0
  ymax = 125
  zmin = 0
  zmax = 1
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[ICs]
  [./x]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_x
  [../]
  [./y]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_y
  [../]
  [./z]
    type = RandomIC
    min = -0.1
    max = 0.1
    variable = disp_z
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '0'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '0'
  [../]
[]
[AuxVariables]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
[]
[Postprocessors]
  [./max_yield_fcn]
    type = ElementExtremeValue
    variable = yield_fcn
    outputs = 'console'
  [../]
  [./should_be_zero]
    type = FunctionValuePostprocessor
    function = should_be_zero_fcn
  [../]
  [./av_iter]
    type = ElementAverageValue
    variable = iter
    outputs = 'console'
  [../]
[]
[Functions]
  [./should_be_zero_fcn]
    type = ParsedFunction
    expression = 'if(a<1E-3,0,a)'
    symbol_names = 'a'
    symbol_values = 'max_yield_fcn'
  [../]
[]
[UserObjects]
  [./tensile_strength]
    type = SolidMechanicsHardeningCubic
    value_0 = 1
    value_residual = 0.1
    internal_limit = 0.1
  [../]
  [./compressive_strength]
    type = SolidMechanicsHardeningCubic
    value_0 = -1.5
    value_residual = 0
    internal_limit = 0.1
  [../]
  [./cap]
    type = SolidMechanicsPlasticMeanCapTC
    tensile_strength = tensile_strength
    compressive_strength = compressive_strength
    yield_function_tolerance = 1E-5
    internal_constraint_tolerance = 1E-11
    use_custom_returnMap = false
    use_custom_cto = false
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0.7E7 1E7'
  [../]
  [./strain]
    type = ComputeIncrementalStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    max_NR_iterations = 2
    ep_plastic_tolerance = 1E-8
    plastic_models = cap
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = random03
  exodus = false
  [./csv]
    type = CSV
  [../]
[]
(modules/solid_mechanics/test/tests/mean_cap_TC/small_deform2.i)
# apply uniform stretch in x, y and z directions.
# trial_stress(0, 0) = -2
# trial_stress(1, 1) = 6
# trial_stress(2, 2) = 10
# With tensile_strength = 2, the algorithm should return to trace(stress) = 2, or
# stress(0, 0) = -6
# stress(1, 1) = 2
# stress(2, 2) = 6
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '-1E-7*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '3E-7*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '5E-7*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = f
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = f
  [../]
[]
[UserObjects]
  [./tensile_strength]
    type = SolidMechanicsHardeningConstant
    value = 2
  [../]
  [./compressive_strength]
    type = SolidMechanicsHardeningConstant
    value = -1
  [../]
  [./cap]
    type = SolidMechanicsPlasticMeanCapTC
    tensile_strength = tensile_strength
    compressive_strength = compressive_strength
    yield_function_tolerance = 1E-3
    internal_constraint_tolerance = 1E-9
    use_custom_returnMap = true
    use_custom_cto = true
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./strain]
    type = ComputeIncrementalStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mean_cap]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = cap
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform2
  exodus = false
  [./csv]
    type = CSV
  [../]
[]
(modules/solid_mechanics/test/tests/multi/three_surface00.i)
# Plasticit models:
# SimpleTester0 with a = 0 and b = 1 and strength = 1
# SimpleTester1 with a = 1 and b = 0 and strength = 1
# SimpleTester2 with a = 1 and b = 1 and strength = 1.5
#
# Lame lambda = 0 (Poisson=0).  Lame mu = 0.5E6
#
# A single element is stretched by 1E-6m in y direction and 1E-6 in z direction.
# trial stress_yy = 1 and stress_zz = 1
#
# Then SimpleTester2 should activate and the algorithm will return to
# stress_yy = 0.75, stress_zz = 0.75
# internal2 should be 0.25
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '1E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1E-6*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int2]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./int0]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 0
    variable = int0
  [../]
  [./int1]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 1
    variable = int1
  [../]
  [./int2]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 2
    variable = int2
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./f2]
    type = PointValue
    point = '0 0 0'
    variable = f2
  [../]
  [./int0]
    type = PointValue
    point = '0 0 0'
    variable = int0
  [../]
  [./int1]
    type = PointValue
    point = '0 0 0'
    variable = int1
  [../]
  [./int2]
    type = PointValue
    point = '0 0 0'
    variable = int2
  [../]
[]
[UserObjects]
  [./simple0]
    type = SolidMechanicsPlasticSimpleTester
    a = 0
    b = 1
    strength = 1
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
  [./simple1]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 0
    strength = 1
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
  [./simple2]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 1
    strength = 1.5
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 0.5E6'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./multi]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = 'simple0 simple1 simple2'
    max_NR_iterations = 2
    min_stepsize = 1
    debug_fspb = crash
    debug_jac_at_stress = '10 0 0 0 10 0 0 0 10'
    debug_jac_at_pm = '1 1 1'
    debug_jac_at_intnl = '1 1 1'
    debug_stress_change = 1E-5
    debug_pm_change = '1E-6 1E-6 1E-6'
    debug_intnl_change = '1E-6 1E-6 1E-6'
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = three_surface00
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/isotropicSD_plasticity/powerRuleHardening.i)
# UserObject IsotropicSD test, with power rule hardening with rate 1e2.
# Linear strain is applied in the x and y direction.
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin =  -.5
  xmax = .5
  ymin = -.5
  ymax = .5
  zmin = -.5
  zmax = .5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./xdisp]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'right'
    function = '0.005*t'
  [../]
  [./ydisp]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'top'
    function = '0.005*t'
  [../]
  [./yfix]
    type = DirichletBC
    variable = disp_y
    #boundary = 'bottom top'
    boundary = 'bottom'
    value = 0
  [../]
  [./xfix]
    type = DirichletBC
    variable = disp_x
    boundary = 'left'
    value = 0
  [../]
  [./zfix]
    type = DirichletBC
    variable = disp_z
    #boundary = 'front back'
    boundary = 'back'
    value = 0
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./plastic_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./plastic_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./plastic_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./plastic_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./plastic_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./plastic_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./iter]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./intnl]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./sdev]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./sdet]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./plastic_xx]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = plastic_xx
    index_i = 0
    index_j = 0
  [../]
  [./plastic_xy]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = plastic_xy
    index_i = 0
    index_j = 1
  [../]
  [./plastic_xz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = plastic_xz
    index_i = 0
    index_j = 2
  [../]
  [./plastic_yy]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = plastic_yy
    index_i = 1
    index_j = 1
  [../]
  [./plastic_yz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = plastic_yz
    index_i = 1
    index_j = 2
  [../]
  [./plastic_zz]
    type = RankTwoAux
    rank_two_tensor = plastic_strain
    variable = plastic_zz
    index_i = 2
    index_j = 2
  [../]
  [./f]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = f
  [../]
  [./iter]
    type = MaterialRealAux
    property = plastic_NR_iterations
    variable = iter
  [../]
  [./intnl]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = intnl
  [../]
  [./sdev]
    type = RankTwoScalarAux
    variable = sdev
    rank_two_tensor = stress
    scalar_type = VonMisesStress
  [../]
[]
[Postprocessors]
  [./sdev]
    type = PointValue
    point = '0 0 0'
    variable = sdev
  [../]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./p_xx]
    type = PointValue
    point = '0 0 0'
    variable = plastic_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./p_xy]
    type = PointValue
    point = '0 0 0'
    variable = plastic_xy
  [../]
  [./p_xz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_xz
  [../]
  [./p_yz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_yz
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./p_yy]
    type = PointValue
    point = '0 0 0'
    variable = plastic_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./p_zz]
    type = PointValue
    point = '0 0 0'
    variable = plastic_zz
  [../]
  [./intnl]
    type = PointValue
    point = '0 0 0'
    variable = intnl
  [../]
[]
[UserObjects]
  [./str]
    type = SolidMechanicsHardeningPowerRule
    value_0 = 300
    epsilon0 = 1
    exponent = 1e2
  [../]
  [./IsotropicSD]
    type = SolidMechanicsPlasticIsotropicSD
    b = -0.2
    c = -0.779422863
    associative = true
    yield_strength = str
    yield_function_tolerance = 1e-5
    internal_constraint_tolerance = 1e-9
    use_custom_returnMap = false
    use_custom_cto = false
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '121e3 80e3'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1e-9
    plastic_models = IsotropicSD
    debug_fspb = crash
    tangent_operator = elastic
  [../]
[]
[Executioner]
  num_steps = 3
  dt = .5
  type = Transient
  nl_rel_tol = 1e-6
  nl_max_its = 10
  l_tol = 1e-4
  l_max_its = 50
  solve_type = PJFNK
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
[]
[Outputs]
  perf_graph = false
  csv = true
[]
[Preconditioning]
 [./smp]
   type = SMP
   full = true
 [../]
[]
(modules/solid_mechanics/test/tests/capped_drucker_prager/small_deform3_outer_tip.i)
# apply repeated stretches in x z directions, and smaller stretches along the y direction,
# so that sigma_I = sigma_II,
# which means that lode angle = 30deg.
# The allows yield surface in meridional plane to be mapped out
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_yz stress_zz'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '1E-6*x*t'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '-1.7E-6*y*t'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '1E-6*z*t'
  [../]
[]
[AuxVariables]
  [./mc_int]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./mc_int_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = mc_int
  [../]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./internal]
    type = PointValue
    point = '0 0 0'
    variable = mc_int
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 1E5
  [../]
  [./cs]
    type = SolidMechanicsHardeningConstant
    value = 1E5
  [../]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 10
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 35
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 5
    convert_to_radians = true
  [../]
  [./dp]
    type = SolidMechanicsPlasticDruckerPrager
    mc_cohesion = mc_coh
    mc_friction_angle = mc_phi
    mc_dilation_angle = mc_psi
    mc_interpolation_scheme = outer_tip
    yield_function_tolerance = 1      # irrelevant here
    internal_constraint_tolerance = 1 # irrelevant here
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./admissible]
    type = ComputeMultipleInelasticStress
    inelastic_models = mc
    perform_finite_strain_rotations = false
  [../]
  [./mc]
    type = CappedDruckerPragerStressUpdate
    DP_model = dp
    tensile_strength = ts
    compressive_strength = cs
    yield_function_tol = 1E-8
    tip_smoother = 8
    smoothing_tol = 1E-7
  [../]
[]
[Executioner]
  end_time = 10
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform3_outer_tip
  exodus = false
  [./csv]
    type = CSV
  [../]
[]
(modules/solid_mechanics/test/tests/notched_plastic_block/cmc_planar.i)
# Uses an unsmoothed version of capped-Mohr-Coulomb (via ComputeMultiPlasticityStress with SolidMechanicsPlasticTensileMulti and SolidMechanicsPlasticMohrCoulombMulti) to simulate the following problem.
# A cubical block is notched around its equator.
# All of its outer surfaces have roller BCs, but the notched region is free to move as needed
# The block is initialised with a high hydrostatic tensile stress
# Without the notch, the BCs do not allow contraction of the block, and this stress configuration is admissible
# With the notch, however, the interior parts of the block are free to move in order to relieve stress, and this causes plastic failure
# The top surface is then pulled upwards (the bottom is fixed because of the roller BCs)
# This causes more failure
[Mesh]
  [generated_mesh]
    type = GeneratedMeshGenerator
    dim = 3
    nx = 9
    ny = 9
    nz = 9
    xmin = 0
    xmax = 0.1
    ymin = 0
    ymax = 0.1
    zmin = 0
    zmax = 0.1
  []
  [block_to_remove_xmin]
    type = SubdomainBoundingBoxGenerator
    bottom_left = '-0.01 -0.01 0.045'
    top_right = '0.01 0.11 0.055'
    location = INSIDE
    block_id = 1
    input = generated_mesh
  []
  [block_to_remove_xmax]
    type = SubdomainBoundingBoxGenerator
    bottom_left = '0.09 -0.01 0.045'
    top_right = '0.11 0.11 0.055'
    location = INSIDE
    block_id = 1
    input = block_to_remove_xmin
  []
  [block_to_remove_ymin]
    type = SubdomainBoundingBoxGenerator
    bottom_left = '-0.01 -0.01 0.045'
    top_right = '0.11 0.01 0.055'
    location = INSIDE
    block_id = 1
    input = block_to_remove_xmax
  []
  [block_to_remove_ymax]
    type = SubdomainBoundingBoxGenerator
    bottom_left = '-0.01 0.09 0.045'
    top_right = '0.11 0.11 0.055'
    location = INSIDE
    block_id = 1
    input = block_to_remove_ymin
  []
  [remove_block]
    type = BlockDeletionGenerator
    block = 1
    input = block_to_remove_ymax
  []
[]
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
  [./all]
    add_variables = true
    incremental = true
    generate_output = 'max_principal_stress mid_principal_stress min_principal_stress stress_zz'
    eigenstrain_names = ini_stress
  [../]
[]
[Postprocessors]
  [./uz]
    type = PointValue
    point = '0 0 0.1'
    use_displaced_mesh = false
    variable = disp_z
  [../]
  [./s_zz]
    type = ElementAverageValue
    use_displaced_mesh = false
    variable = stress_zz
  [../]
  [./num_res]
    type = NumResidualEvaluations
  [../]
  [./nr_its]
    type = ElementAverageValue
    variable = num_iters
  [../]
  [./max_nr_its]
    type = ElementExtremeValue
    variable = num_iters
  [../]
  [./runtime]
    type = PerfGraphData
    data_type = TOTAL
    section_name = 'Root'
  [../]
[]
[BCs]
  # back=zmin, front=zmax, bottom=ymin, top=ymax, left=xmin, right=xmax
  [./xmin_xzero]
    type = DirichletBC
    variable = disp_x
    boundary = left
    value = 0.0
  [../]
  [./xmax_xzero]
    type = DirichletBC
    variable = disp_x
    boundary = right
    value = 0.0
  [../]
  [./ymin_yzero]
    type = DirichletBC
    variable = disp_y
    boundary = bottom
    value = 0.0
  [../]
  [./ymax_yzero]
    type = DirichletBC
    variable = disp_y
    boundary = top
    value = 0.0
  [../]
  [./zmin_zzero]
    type = DirichletBC
    variable = disp_z
    boundary = back
    value = '0'
  [../]
  [./zmax_disp]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = '1E-6*max(t,0)'
  [../]
[]
[AuxVariables]
  [./mc_int]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./plastic_strain]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./num_iters]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./mc_int_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_internal_parameter
    variable = mc_int
  [../]
  [./plastic_strain_aux]
    type = MaterialRankTwoTensorAux
    i = 2
    j = 2
    property = plastic_strain
    variable = plastic_strain
  [../]
  [./num_iters_auxk] # cannot use plastic_NR_iterations directly as this is zero, since no NR iterations are actually used, since we use a custom algorithm to do the return
    type = ParsedAux
    coupled_variables = plastic_strain
    expression = 'if(plastic_strain>0,1,0)'
    variable = num_iters
  [../]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./ts]
    type = SolidMechanicsHardeningConstant
    value = 3E6
  [../]
  [./tensile]
    type = SolidMechanicsPlasticTensileMulti
    tensile_strength = ts
    yield_function_tolerance = 1
    internal_constraint_tolerance = 1.0E-6
    #shift = 1
    use_custom_returnMap = false
    use_custom_cto = false
  [../]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 5E6
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 35
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 10
    convert_to_radians = true
  [../]
  [./mc]
    type = SolidMechanicsPlasticMohrCoulombMulti
    cohesion = mc_coh
    friction_angle = mc_phi
    dilation_angle = mc_psi
    yield_function_tolerance = 1E-5
    internal_constraint_tolerance = 1E-11
    use_custom_returnMap = false
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeIsotropicElasticityTensor
    youngs_modulus = 16E9
    poissons_ratio = 0.25
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    ep_plastic_tolerance = 1E-6
    plastic_models = 'tensile mc'
    max_NR_iterations = 50
    specialIC = rock
    deactivation_scheme = safe_to_dumb
    debug_fspb = crash
  [../]
  [./strain_from_initial_stress]
    type = ComputeEigenstrainFromInitialStress
    initial_stress = '2.5E6 0 0  0 2.5E6 0  0 0 2.5E6'
    eigenstrain_name = ini_stress
  [../]
[]
[Preconditioning]
  [./andy]
    type = SMP
    full = true
  [../]
[]
[Executioner]
  start_time = -1
  end_time = 10
  dt = 1
  solve_type = NEWTON
  type = Transient
  l_tol = 1E-2
  nl_abs_tol = 1E-5
  nl_rel_tol = 1E-7
  l_max_its = 200
  nl_max_its = 400
  petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
  petsc_options_value = ' asm      2              lu            gmres     200'
[]
[Outputs]
  file_base = cmc_planar
  perf_graph = true
  exodus = false
  csv = true
[]
(modules/solid_mechanics/test/tests/weak_plane_shear/large_deform2.i)
# large strain with weak-plane normal rotating with mesh
# First rotate mesh 45deg about x axis
# Then apply stretch in the y=z direction.
# This should create a pure tensile load (no shear), which
# should return to the yield surface.
#
# Since cohesion=1E6 and tan(friction_angle)=1, and
# wps_smoother = 0.5E6, the apex of the weak-plane cone is
# at normal_stress = 0.5E6.  So, the result should be
# s_yy = s_yz = s_zz = 0.25E6
[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
  type = GeneratedMesh
  dim = 3
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Physics/SolidMechanics/QuasiStatic/all]
  strain = FINITE
  add_variables = true
  generate_output = 'stress_xx stress_yy stress_yz stress_zz'
[]
[BCs]
  # rotate:
  # ynew = c*y + s*z.  znew = -s*y + c*z
  [bottomx]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = back
    function = '0'
  []
  [bottomy]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = back
    function = '0.70710678*y+0.70710678*z-y'
  []
  [bottomz]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = back
    function = '-0.70710678*y+0.70710678*z-z'
  []
  [topx]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = front
    function = '0'
  []
  [topy]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = front
    function = '0.70710678*y+0.70710678*z-y+if(t>0,1,0)'
  []
  [topz]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = front
    function = '-0.70710678*y+0.70710678*z-z+if(t>0,1,0)'
  []
[]
[AuxVariables]
  [yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  []
[]
[AuxKernels]
  [yield_fcn_auxk]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = yield_fcn
  []
[]
[Postprocessors]
  [s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  []
  [s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  []
  [s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  []
  [s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  []
  [f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  []
[]
[UserObjects]
  [coh]
    type = SolidMechanicsHardeningConstant
    value = 1E6
  []
  [tanphi]
    type = SolidMechanicsHardeningConstant
    value = 1
  []
  [tanpsi]
    type = SolidMechanicsHardeningConstant
    value = 0.111107723
  []
  [wps]
    type = SolidMechanicsPlasticWeakPlaneShear
    cohesion = coh
    tan_friction_angle = tanphi
    tan_dilation_angle = tanpsi
    smoother = 0.5E6
    yield_function_tolerance = 1E-9
    internal_constraint_tolerance = 1E-9
  []
[]
[Materials]
  [elasticity_tensor]
    type = ComputeElasticityTensor
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  []
  [mc]
    type = ComputeMultiPlasticityStress
    plastic_models = wps
    transverse_direction = '0 0 1'
    ep_plastic_tolerance = 1E-8
    debug_fspb = crash
  []
[]
[Executioner]
  start_time = -1
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  exodus = true
[]
(modules/solid_mechanics/test/tests/multi/three_surface07.i)
# Plasticit models:
# SimpleTester0 with a = 0 and b = 1 and strength = 1
# SimpleTester1 with a = 1 and b = 0 and strength = 1
# SimpleTester2 with a = 1 and b = 1 and strength = 1.5
#
# Lame lambda = 0 (Poisson=0).  Lame mu = 0.5E6
#
# A single element is stretched by 1.5E-6m in y direction and 0.8E-6 in z direction.
# trial stress_yy = 1.5 and stress_zz = 0.8
#
# Then SimpleTester1 and SimpleTester2 should activate and the algorithm will return to
# the corner stress_yy=1.0, stress_zz=0.5
# internal1 should be 0.2, and internal2 should be 0.3
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '0E-6*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '1.5E-6*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '0.8E-6*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f2]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int0]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int1]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./int2]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f0]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 0
    variable = f0
  [../]
  [./f1]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 1
    variable = f1
  [../]
  [./f2]
    type = MaterialStdVectorAux
    property = plastic_yield_function
    index = 2
    variable = f2
  [../]
  [./int0]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 0
    variable = int0
  [../]
  [./int1]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 1
    variable = int1
  [../]
  [./int2]
    type = MaterialStdVectorAux
    property = plastic_internal_parameter
    factor = 1E6
    index = 2
    variable = int2
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = f0
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = f1
  [../]
  [./f2]
    type = PointValue
    point = '0 0 0'
    variable = f2
  [../]
  [./int0]
    type = PointValue
    point = '0 0 0'
    variable = int0
  [../]
  [./int1]
    type = PointValue
    point = '0 0 0'
    variable = int1
  [../]
  [./int2]
    type = PointValue
    point = '0 0 0'
    variable = int2
  [../]
[]
[UserObjects]
  [./simple0]
    type = SolidMechanicsPlasticSimpleTester
    a = 0
    b = 1
    strength = 1
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
  [./simple1]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 0
    strength = 1
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
  [./simple2]
    type = SolidMechanicsPlasticSimpleTester
    a = 1
    b = 1
    strength = 1.5
    yield_function_tolerance = 1.0E-9
    internal_constraint_tolerance = 1.0E-9
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 0.5E6'
  [../]
  [./strain]
    type = ComputeFiniteStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./multi]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-9
    plastic_models = 'simple0 simple1 simple2'
    max_NR_iterations = 2
    min_stepsize = 1
    debug_fspb = crash
    debug_jac_at_stress = '10 0 0 0 10 0 0 0 10'
    debug_jac_at_pm = '1 1'
    debug_jac_at_intnl = '1 1'
    debug_stress_change = 1E-5
    debug_pm_change = '1E-6 1E-6'
    debug_intnl_change = '1E-6 1E-6'
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = three_surface07
  exodus = false
  [./csv]
    type = CSV
    [../]
[]
(modules/solid_mechanics/test/tests/mean_cap_TC/small_deform6.i)
# apply nonuniform stretch in x, y and z directions using
# Lame lambda = 0.7E7, Lame mu = 1.0E7,
# trial_stress(0, 0) = 2.9
# trial_stress(1, 1) = 10.9
# trial_stress(2, 2) = 14.9
# With tensile_strength = 2, decaying to zero at internal parameter = 4E-7
# via a Cubic, the algorithm should return to:
# internal parameter = 2.26829E-7
# trace(stress) = 0.799989 = tensile_strength
# stress(0, 0) = -6.4
# stress(1, 1) = 1.6
# stress(2, 2) = 5.6
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '-1E-7*x'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '3E-7*y'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '5E-7*z'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./f]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./f]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = f
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = f
  [../]
[]
[UserObjects]
  [./tensile_strength]
    type = SolidMechanicsHardeningCubic
    value_0 = 2
    value_residual = 0
    internal_limit = 4E-7
  [../]
  [./compressive_strength]
    type = SolidMechanicsHardeningCubic
    value_0 = -1
    value_residual = 0
    internal_limit = 1E-8
  [../]
  [./cap]
    type = SolidMechanicsPlasticMeanCapTC
    tensile_strength = tensile_strength
    compressive_strength = compressive_strength
    yield_function_tolerance = 1E-5
    internal_constraint_tolerance = 1E-11
    use_custom_returnMap = true
    use_custom_cto = true
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0.7E7 1E7'
  [../]
  [./strain]
    type = ComputeIncrementalStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mean_cap]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-11
    plastic_models = cap
  [../]
[]
[Executioner]
  end_time = 1
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform6
  exodus = false
  [./csv]
    type = CSV
  [../]
[]
(modules/solid_mechanics/test/tests/drucker_prager/small_deform2_inner_tip.i)
# apply repeated stretches in x, y and z directions, so that mean_stress = 0
# This maps out the yield surface in the octahedral plane for zero mean stress
[Mesh]
  type = GeneratedMesh
  dim = 3
  nx = 1
  ny = 1
  nz = 1
  xmin = -0.5
  xmax = 0.5
  ymin = -0.5
  ymax = 0.5
  zmin = -0.5
  zmax = 0.5
[]
[Variables]
  [./disp_x]
  [../]
  [./disp_y]
  [../]
  [./disp_z]
  [../]
[]
[Kernels]
  [SolidMechanics]
    displacements = 'disp_x disp_y disp_z'
  [../]
[]
[BCs]
  [./x]
    type = FunctionDirichletBC
    variable = disp_x
    boundary = 'front back'
    function = '-1.5E-6*x+2E-6*x*sin(t)'
  [../]
  [./y]
    type = FunctionDirichletBC
    variable = disp_y
    boundary = 'front back'
    function = '2E-6*y*sin(2*t)'
  [../]
  [./z]
    type = FunctionDirichletBC
    variable = disp_z
    boundary = 'front back'
    function = '-2E-6*z*(sin(t)+sin(2*t))'
  [../]
[]
[AuxVariables]
  [./stress_xx]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_xz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yy]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_yz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./stress_zz]
    order = CONSTANT
    family = MONOMIAL
  [../]
  [./yield_fcn]
    order = CONSTANT
    family = MONOMIAL
  [../]
[]
[AuxKernels]
  [./stress_xx]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xx
    index_i = 0
    index_j = 0
  [../]
  [./stress_xy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xy
    index_i = 0
    index_j = 1
  [../]
  [./stress_xz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_xz
    index_i = 0
    index_j = 2
  [../]
  [./stress_yy]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yy
    index_i = 1
    index_j = 1
  [../]
  [./stress_yz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_yz
    index_i = 1
    index_j = 2
  [../]
  [./stress_zz]
    type = RankTwoAux
    rank_two_tensor = stress
    variable = stress_zz
    index_i = 2
    index_j = 2
  [../]
  [./yield_fcn_auxk]
    type = MaterialStdVectorAux
    index = 0
    property = plastic_yield_function
    variable = yield_fcn
  [../]
[]
[Postprocessors]
  [./s_xx]
    type = PointValue
    point = '0 0 0'
    variable = stress_xx
  [../]
  [./s_xy]
    type = PointValue
    point = '0 0 0'
    variable = stress_xy
  [../]
  [./s_xz]
    type = PointValue
    point = '0 0 0'
    variable = stress_xz
  [../]
  [./s_yy]
    type = PointValue
    point = '0 0 0'
    variable = stress_yy
  [../]
  [./s_yz]
    type = PointValue
    point = '0 0 0'
    variable = stress_yz
  [../]
  [./s_zz]
    type = PointValue
    point = '0 0 0'
    variable = stress_zz
  [../]
  [./f]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
  [./f0]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
  [./f1]
    type = PointValue
    point = '0 0 0'
    variable = yield_fcn
  [../]
[]
[UserObjects]
  [./mc_coh]
    type = SolidMechanicsHardeningConstant
    value = 10
  [../]
  [./mc_phi]
    type = SolidMechanicsHardeningConstant
    value = 20
    convert_to_radians = true
  [../]
  [./mc_psi]
    type = SolidMechanicsHardeningConstant
    value = 0
  [../]
  [./mc]
    type = SolidMechanicsPlasticDruckerPragerHyperbolic
    mc_cohesion = mc_coh
    mc_friction_angle = mc_phi
    mc_dilation_angle = mc_psi
    smoother = 4
    mc_interpolation_scheme = inner_tip
    yield_function_tolerance = 1E-5
    internal_constraint_tolerance = 1E-11
  [../]
[]
[Materials]
  [./elasticity_tensor]
    type = ComputeElasticityTensor
    block = 0
    fill_method = symmetric_isotropic
    C_ijkl = '0 1E7'
  [../]
  [./strain]
    type = ComputeIncrementalStrain
    block = 0
    displacements = 'disp_x disp_y disp_z'
  [../]
  [./mc]
    type = ComputeMultiPlasticityStress
    block = 0
    ep_plastic_tolerance = 1E-12
    plastic_models = mc
    debug_fspb = crash
  [../]
[]
[Executioner]
  end_time = 100
  dt = 1
  type = Transient
[]
[Outputs]
  file_base = small_deform2_inner_tip
  exodus = false
  [./csv]
    type = CSV
    [../]
[]