<commit_before>//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html

#include "TensorMechanicsActionBase.h"
#include "CommonTensorMechanicsAction.h"
#include "ActionWarehouse.h"
#include "ComputeFiniteStrain.h"

// map tensor name shortcuts to tensor material property names
const std::map<std::string, std::string>
    TensorMechanicsActionBase::_rank_two_cartesian_component_table = {
        {"strain", "total_strain"},
        {"stress", "stress"},
        {"elastic_strain", "elastic_strain"},
        {"plastic_strain", "plastic_strain"},
        {"creep_strain", "creep_strain"},
        {"creep_stress", "creep_stress"}};
const std::vector<char> TensorMechanicsActionBase::_component_table = {'x', 'y', 'z'};

// map aux variable name prefixes to RankTwoInvariant option and list of permitted tensor name
// shortcuts
const std::map<std::string, std::pair<std::string, std::vector<std::string>>>
    TensorMechanicsActionBase::_rank_two_invariant_table = {
        {"vonmises", {"VonMisesStress", {"stress"}}},
        {"effective", {"EffectiveStrain", {"plastic_strain", "creep_strain"}}},
        {"hydrostatic", {"Hydrostatic", {"stress"}}},
        {"l2norm",
         {"L2norm", {"stress", "strain", "elastic_strain", "plastic_strain", "creep_strain"}}},
        {"volumetric", {"VolumetricStrain", {"strain"}}},
        {"firstinv", {"FirstInvariant", {"stress", "strain"}}},
        {"secondinv", {"SecondInvariant", {"stress", "strain"}}},
        {"thirdinv", {"ThirdInvariant", {"stress", "strain"}}},
        {"triaxiality", {"TriaxialityStress", {"stress"}}},
        {"maxshear", {"MaxShear", {"stress"}}},
        {"intensity", {"StressIntensity", {"stress"}}},
        {"max_principal", {"MaxPrincipal", {"stress", "strain"}}},
        {"mid_principal", {"MidPrincipal", {"stress", "strain"}}},
        {"min_principal", {"MinPrincipal", {"stress", "strain"}}}};

const std::map<std::string, std::pair<std::string, std::vector<std::string>>>
    TensorMechanicsActionBase::_rank_two_directional_component_table = {
        {"directional", {"Direction", {"stress", "strain"}}}};

const std::map<std::string, std::pair<std::string, std::vector<std::string>>>
    TensorMechanicsActionBase::_rank_two_cylindrical_component_table = {
        {"axial", {"AxialStress", {"stress", "strain"}}},
        {"hoop", {"HoopStress", {"stress", "strain"}}},
        {"radial", {"RadialStress", {"stress", "strain"}}}};

InputParameters
TensorMechanicsActionBase::validParams()
{
  InputParameters params = Action::validParams();

  params.addRequiredParam<std::vector<VariableName>>(
      "displacements", "The nonlinear displacement variables for the problem");
  params.addParam<std::vector<VariableName>>("temperature", "The temperature");

  MooseEnum strainType("SMALL FINITE", "SMALL");
  params.addParam<MooseEnum>("strain", strainType, "Strain formulation");
  params.addParam<bool>("incremental", "Use incremental or total strain");

  params.addParam<std::string>("base_name", "Material property base name");
  params.addParam<bool>(
      "volumetric_locking_correction", false, "Flag to correct volumetric locking");
  params.addParam<bool>(
      "use_finite_deform_jacobian", false, "Jacobian for corrotational finite strain");
  params.addParam<bool>(
      "use_displaced_mesh", false, "Whether to use displaced mesh in the kernels");
  params.addParam<bool>("add_variables", false, "Add the displacement variables");
  params.addParam<std::vector<MaterialPropertyName>>(
      "eigenstrain_names", "List of eigenstrains to be applied in this strain calculation");
  params.addParam<bool>("use_automatic_differentiation",
                        false,
                        "Flag to use automatic differentiation (AD) objects when possible");
  // Global Strain
  params.addParam<MaterialPropertyName>(
      "global_strain",<commit_msg>New stress/strain combinations for TM Master Action Refs #14736<commit_after>//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html

#include "TensorMechanicsActionBase.h"
#include "CommonTensorMechanicsAction.h"
#include "ActionWarehouse.h"
#include "ComputeFiniteStrain.h"

// map tensor name shortcuts to tensor material property names
const std::map<std::string, std::string>
    TensorMechanicsActionBase::_rank_two_cartesian_component_table = {
        {"strain", "total_strain"},
        {"stress", "stress"},
        {"elastic_strain", "elastic_strain"},
        {"plastic_strain", "plastic_strain"},
        {"creep_strain", "creep_strain"},
        {"creep_stress", "creep_stress"}};
const std::vector<char> TensorMechanicsActionBase::_component_table = {'x', 'y', 'z'};

// map aux variable name prefixes to RankTwoInvariant option and list of permitted tensor name
// shortcuts
const std::map<std::string, std::pair<std::string, std::vector<std::string>>>
    TensorMechanicsActionBase::_rank_two_invariant_table = {
        {"vonmises", {"VonMisesStress", {"stress"}}},
        {"effective", {"EffectiveStrain", {"plastic_strain", "creep_strain"}}},
        {"hydrostatic", {"Hydrostatic", {"stress"}}},
        {"l2norm",
         {"L2norm", {"stress", "strain", "elastic_strain", "plastic_strain", "creep_strain"}}},
        {"volumetric", {"VolumetricStrain", {"strain"}}},
        {"firstinv", {"FirstInvariant", {"stress", "strain"}}},
        {"secondinv", {"SecondInvariant", {"stress", "strain"}}},
        {"thirdinv", {"ThirdInvariant", {"stress", "strain"}}},
        {"triaxiality", {"TriaxialityStress", {"stress"}}},
        {"maxshear", {"MaxShear", {"stress"}}},
        {"intensity", {"StressIntensity", {"stress"}}},
        {"max_principal", {"MaxPrincipal", {"stress", "strain"}}},
        {"mid_principal", {"MidPrincipal", {"stress", "strain"}}},
        {"min_principal", {"MinPrincipal", {"stress", "strain"}}}};

const std::map<std::string, std::pair<std::string, std::vector<std::string>>>
    TensorMechanicsActionBase::_rank_two_directional_component_table = {
        {"directional", {"Direction", {"stress", "strain"}}}};

const std::map<std::string, std::pair<std::string, std::vector<std::string>>>
    TensorMechanicsActionBase::_rank_two_cylindrical_component_table = {
        {"axial",
         {"AxialStress",
          {"stress", "strain", "plasitic_strain", "creep_strain", "elastic_strain"}}},
        {"hoop",
         {"HoopStress", {"stress", "strain", "plasitic_strain", "creep_strain", "elastic_strain"}}},
        {"radial", {"RadialStress", {"stress", "strain"}}}};

InputParameters
TensorMechanicsActionBase::validParams()
{
  InputParameters params = Action::validParams();

  params.addRequiredParam<std::vector<VariableName>>(
      "displacements", "The nonlinear displacement variables for the problem");
  params.addParam<std::vector<VariableName>>("temperature", "The temperature");

  MooseEnum strainType("SMALL FINITE", "SMALL");
  params.addParam<MooseEnum>("strain", strainType, "Strain formulation");
  params.addParam<bool>("incremental", "Use incremental or total strain");

  params.addParam<std::string>("base_name", "Material property base name");
  params.addParam<bool>(
      "volumetric_locking_correction", false, "Flag to correct volumetric locking");
  params.addParam<bool>(
      "use_finite_deform_jacobian", false, "Jacobian for corrotational finite strain");
  params.addParam<bool>(
      "use_displaced_mesh", false, "Whether to use displaced mesh in the kernels");
  params.addParam<bool>("add_variables", false, "Add the displacement variables");
  params.addParam<std::vector<MaterialPropertyName>>(
      "eigenstrain_names", "List of eigenstrains to be applied in this strain calculation");
  params.addParam<bool>("use_automatic_differentiation",
                        false,
                        "Flag to use automatic differentiation (AD) objects when possible");
  // Global Strain
  params.addParam<MaterialPropertyName>(
      "global_strain",
{'fraction_non_alphanumeric': 0.1722340677564558, 'fraction_numerical': 0.0020137408197109688, 'mean_word_length': 4.9625706214689265, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 55, 'https://': 6, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1087676', 'n_tokens_mistral': 2701, 'n_tokens_neox': 2464, 'n_words': 539}