https://mooseframework.inl.gov
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
LegacyTensorMechanicsAction Class Reference

#include <LegacyTensorMechanicsAction.h>

Inheritance diagram for LegacyTensorMechanicsAction:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 LegacyTensorMechanicsAction (const InputParameters &params)
 
virtual void act ()
 
void timedAct ()
 
virtual void addRelationshipManagers (Moose::RelationshipManagerType when_type)
 
MooseObjectName uniqueActionName () const
 
const std::string & specificTaskName () const
 
const std::set< std::string > & getAllTasks () const
 
void appendTask (const std::string &task)
 
MooseAppgetMooseApp () const
 
const std::string & type () const
 
const std::string & name () const
 
std::string typeAndName () const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
MooseObjectName uniqueName () const
 
const InputParametersparameters () const
 
const hit::Node * getHitNode () const
 
bool hasBase () const
 
const std::string & getBase () const
 
const TgetParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const TqueryParam (const std::string &name) const
 
const TgetRenamedParam (const std::string &old_name, const std::string &new_name) const
 
T getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &name) const
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void paramError (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramInfo (const std::string &param, Args... args) const
 
std::string messagePrefix (const bool hit_prefix=true) const
 
std::string errorPrefix (const std::string &) const
 
void mooseError (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseDeprecatedNoTrace (Args &&... args) const
 
void mooseInfo (Args &&... args) const
 
void callMooseError (std::string msg, const bool with_prefix, const hit::Node *node=nullptr, const bool show_trace=true) const
 
std::string getDataFileName (const std::string &param) const
 
std::string getDataFileNameByName (const std::string &relative_path) const
 
std::string getDataFilePath (const std::string &relative_path) const
 
PerfGraphperfGraph ()
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 

Static Public Member Functions

static InputParameters validParams ()
 
static MultiMooseEnum outputPropertiesType ()
 
static MultiMooseEnum materialOutputOrders ()
 
static MultiMooseEnum materialOutputFamilies ()
 
static void addCartesianComponentOutput (const std::string &name, const std::string &prop_name="")
 
static void callMooseError (MooseApp *const app, const InputParameters &params, std::string msg, const bool with_prefix, const hit::Node *node, const bool show_trace=true)
 

Public Attributes

 usingCombinedWarningSolutionWarnings
 
const ConsoleStream _console
 

Static Public Attributes

static const std::string unique_action_name_param
 
static const std::string type_param
 
static const std::string name_param
 
static const std::string unique_name_param
 
static const std::string app_param
 
static const std::string moose_base_param
 
static const std::string kokkos_object_param
 
static constexpr auto SYSTEM
 
static constexpr auto NAME
 
static const std::vector< char > _component_table = {'x', 'y', 'z'}
 table data for output generation More...
 
static const std::map< std::string, std::pair< std::string, std::vector< std::string > > > _rank_two_invariant_table
 
static const std::map< std::string, std::pair< std::string, std::vector< std::string > > > _rank_two_directional_component_table
 
static const std::map< std::string, std::pair< std::string, std::vector< std::string > > > _rank_two_cylindrical_component_table
 
static const std::map< std::string, std::pair< std::string, std::vector< std::string > > > _rank_two_spherical_component_table
 

Protected Types

enum  Strain { Strain::Small, Strain::Finite }
 strain formulation More...
 
enum  StrainAndIncrement { StrainAndIncrement::SmallTotal, StrainAndIncrement::FiniteTotal, StrainAndIncrement::SmallIncremental, StrainAndIncrement::FiniteIncremental }
 strain formulation More...
 
enum  PlanarFormulation { PlanarFormulation::None, PlanarFormulation::WeakPlaneStress, PlanarFormulation::PlaneStrain, PlanarFormulation::GeneralizedPlaneStrain }
 use an out of plane stress/strain formulation More...
 
enum  OutOfPlaneDirection { OutOfPlaneDirection::x, OutOfPlaneDirection::y, OutOfPlaneDirection::z }
 
enum  LKFormulation { LKFormulation::Total, LKFormulation::Updated }
 New kernel system kinematics types. More...
 

Protected Member Functions

void actSubdomainChecks ()
 
void actOutputGeneration ()
 
void actEigenstrainNames ()
 
void actOutputMatProp ()
 
void actGatherActionParameters ()
 
void verifyOrderAndFamilyOutputs ()
 
void actLagrangianKernelStrain ()
 
void actStressDivergenceTensorsStrain ()
 
virtual std::string getKernelType ()
 
virtual InputParameters getKernelParameters (std::string type)
 
std::string remapCompatOutputProp (const std::string &prop_name) const
 Apply compatibility_mode remapping to a property name pulled from the _rank_two_* output tables: in compat mode the NEW pipeline writes Cauchy stress + rotated mechanical strain under different names than the OLD pipeline. More...
 
template<typename T , typename T2 >
bool setupOutput (std::string out, T table, T2 setup)
 Helper function to decode generate_outputs options using a "table" of scalar output quantities and a "setup" lambda that performs the input parameter setup for the output material object. More...
 
bool addRelationshipManagers (Moose::RelationshipManagerType when_type, const InputParameters &moose_object_pars)
 
void associateWithParameter (const std::string &param_name, InputParameters &params) const
 
void associateWithParameter (const InputParameters &from_params, const std::string &param_name, InputParameters &params) const
 
const TgetMeshProperty (const std::string &data_name, const std::string &prefix)
 
const TgetMeshProperty (const std::string &data_name)
 
bool hasMeshProperty (const std::string &data_name, const std::string &prefix) const
 
bool hasMeshProperty (const std::string &data_name, const std::string &prefix) const
 
bool hasMeshProperty (const std::string &data_name) const
 
bool hasMeshProperty (const std::string &data_name) const
 
std::string meshPropertyName (const std::string &data_name) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level, const std::string &live_message, const bool print_dots=true) const
 
std::string timedSectionName (const std::string &section_name) const
 
void flagInvalidSolutionInternal (const InvalidSolutionID invalid_solution_id) const
 
InvalidSolutionID registerInvalidSolutionInternal (const std::string &message, const bool warning) const
 

Static Protected Member Functions

static std::string meshPropertyName (const std::string &data_name, const std::string &prefix)
 

Protected Attributes

Moose::CoordinateSystemType _coord_system
 
std::vector< SubdomainName > _subdomain_names
 if this vector is not empty the variables, kernels and materials are restricted to these subdomains More...
 
std::set< SubdomainID_subdomain_ids
 set generated from the passed in vector of subdomain names More...
 
std::set< SubdomainID_subdomain_id_union
 set generated from the combined block restrictions of all SolidMechanics/Master action blocks More...
 
enum QuasiStaticSolidMechanicsPhysics::Strain _strain
 
enum QuasiStaticSolidMechanicsPhysics::StrainAndIncrement _strain_and_increment
 
enum QuasiStaticSolidMechanicsPhysics::PlanarFormulation _planar_formulation
 
const OutOfPlaneDirection _out_of_plane_direction
 
const std::string _base_name
 base name for the current master action block More...
 
bool _use_displaced_mesh
 use displaced mesh (true unless _strain is SMALL) More...
 
std::vector< std::string > _generate_output
 output materials to generate scalar stress/strain tensor quantities More...
 
MultiMooseEnum _material_output_order
 
MultiMooseEnum _material_output_family
 
bool _cylindrical_axis_point1_valid
 booleans used to determine if cylindrical axis points are passed More...
 
bool _cylindrical_axis_point2_valid
 
bool _direction_valid
 
bool _verbose
 
Point _cylindrical_axis_point1
 points used to determine axis of rotation for cylindrical stress/strain quantities More...
 
Point _cylindrical_axis_point2
 
Point _direction
 
bool _spherical_center_point_valid
 booleans used to determine if spherical center point is passed More...
 
Point _spherical_center_point
 center point for spherical stress/strain quantities More...
 
const bool _auto_eigenstrain
 automatically gather names of eigenstrain tensors provided by simulation objects More...
 
std::vector< MaterialPropertyName > _eigenstrain_names
 
const bool _compatibility_mode
 OLD-compat shim: auto-configures the Lagrangian kernel system to reproduce StressDivergenceTensors + ComputeFiniteStrain + ComputeStressBase bit-for-bit when set. More...
 
const bool _lagrangian_kernels
 New or old kernel system. True if new_system = true OR compatibility_mode = true. More...
 
const bool _lk_large_kinematics
 Simplified flag for small/large deformations, Lagrangian kernel system. More...
 
const LKFormulation _lk_formulation
 
const bool _lk_locking
 Simplified volumetric locking correction flag for new kernels. More...
 
bool _lk_homogenization
 Flag indicating if the homogenization system is present for new kernels. More...
 
const std::string _hname = "hvar"
 
const std::string _integrator_name = "integrator"
 
const std::string _homogenization_strain_name = "homogenization_gradient"
 
MultiMooseEnum _constraint_types
 
std::vector< FunctionName > _targets
 
const bool _lk_h_off_jac
 Whether to use the off diagonal scalar jacobian for the homogenization system. More...
 
const bool _use_ad
 
std::string _registered_identifier
 
std::string _specific_task_name
 
std::set< std::string > _all_tasks
 
ActionWarehouse_awh
 
const std::string & _current_task
 
std::shared_ptr< MooseMesh > & _mesh
 
std::shared_ptr< MooseMesh > & _displaced_mesh
 
std::shared_ptr< FEProblemBase > & _problem
 
PerfID _act_timer
 
MooseApp_app
 
Factory_factory
 
ActionFactory_action_factory
 
const std::string & _type
 
const std::string & _name
 
const InputParameters_pars
 
MooseApp_pg_moose_app
 
const std::string _prefix
 
const Parallel::Communicator & _communicator
 
std::vector< VariableName > _displacements
 displacement variables More...
 
unsigned int _ndisp
 Number of displacement variables. More...
 
std::vector< VariableName > _coupled_displacements
 Coupled displacement variables. More...
 
std::vector< AuxVariableName > _save_in
 residual debugging More...
 
std::vector< AuxVariableName > _diag_save_in
 

Static Protected Attributes

static const std::map< unsigned int, std::string > _order_mapper
 
static std::map< std::string, std::string > _rank_two_cartesian_component_table
 

Detailed Description

Definition at line 14 of file LegacyTensorMechanicsAction.h.

Member Enumeration Documentation

◆ LKFormulation

enum QuasiStaticSolidMechanicsPhysics::LKFormulation
strongprotectedinherited

New kernel system kinematics types.

Enumerator
Total 
Updated 

Definition at line 154 of file QuasiStaticSolidMechanicsPhysics.h.

155  {
156  Total,
157  Updated
158  };

◆ OutOfPlaneDirection

Enumerator

Definition at line 101 of file QuasiStaticSolidMechanicsPhysics.h.

102  {
103  x,
104  y,
105  z
106  };
const std::vector< double > y
const std::vector< double > x

◆ PlanarFormulation

use an out of plane stress/strain formulation

Enumerator
None 
WeakPlaneStress 
PlaneStrain 
GeneralizedPlaneStrain 

Definition at line 93 of file QuasiStaticSolidMechanicsPhysics.h.

94  {
95  None,
97  PlaneStrain,
enum QuasiStaticSolidMechanicsPhysics::PlanarFormulation _planar_formulation

◆ Strain

enum QuasiStaticSolidMechanicsPhysics::Strain
strongprotectedinherited

strain formulation

Enumerator
Small 
Finite 

Definition at line 77 of file QuasiStaticSolidMechanicsPhysics.h.

78  {
79  Small,
80  Finite
81  } _strain;
enum QuasiStaticSolidMechanicsPhysics::Strain _strain

◆ StrainAndIncrement

strain formulation

Enumerator
SmallTotal 
FiniteTotal 
SmallIncremental 
FiniteIncremental 

Definition at line 84 of file QuasiStaticSolidMechanicsPhysics.h.

85  {
86  SmallTotal,
87  FiniteTotal,
88  SmallIncremental,
89  FiniteIncremental
enum QuasiStaticSolidMechanicsPhysics::StrainAndIncrement _strain_and_increment

Constructor & Destructor Documentation

◆ LegacyTensorMechanicsAction()

LegacyTensorMechanicsAction::LegacyTensorMechanicsAction ( const InputParameters params)

Definition at line 29 of file LegacyTensorMechanicsAction.C.

31 {
32 }
QuasiStaticSolidMechanicsPhysics(const InputParameters &params)

Member Function Documentation

◆ act()

void LegacyTensorMechanicsAction::act ( )
virtual

Reimplemented from QuasiStaticSolidMechanicsPhysics.

Definition at line 35 of file LegacyTensorMechanicsAction.C.

36 {
37  if (_current_task == "add_kernel" || _current_task == "validate_coordinate_systems")
39 }
const std::string & _current_task

◆ actEigenstrainNames()

void QuasiStaticSolidMechanicsPhysics::actEigenstrainNames ( )
protectedinherited

Definition at line 695 of file QuasiStaticSolidMechanicsPhysics.C.

Referenced by QuasiStaticSolidMechanicsPhysics::act().

696 {
697  // Create containers for collecting blockIDs and eigenstrain names from materials
698  std::map<std::string, std::set<SubdomainID>> material_eigenstrain_map;
699  std::set<std::string> eigenstrain_set;
700 
701  std::set<MaterialPropertyName> verified_eigenstrain_names;
702 
703  std::map<std::string, std::string> remove_add_map;
704  std::set<std::string> remove_reduced_set;
705 
706  // Loop over all the materials(eigenstrains) already created
707  auto materials = _problem->getMaterialWarehouse().getObjects();
708  for (auto & mat : materials)
709  {
710  std::shared_ptr<BlockRestrictable> blk = std::dynamic_pointer_cast<BlockRestrictable>(mat);
711  const InputParameters & mat_params = mat->parameters();
712  auto & mat_name = mat->type();
713 
714  // Check for eigenstrain names, only deal with those materials
715  if (mat_params.isParamValid("eigenstrain_name"))
716  {
717  std::shared_ptr<MaterialData> mat_dat;
718  auto name = mat_params.get<std::string>("eigenstrain_name");
719 
720  // Check for base_name prefix
721  if (mat_params.isParamValid("base_name"))
722  name = mat_params.get<std::string>("base_name") + '_' + name;
723 
724  // Check block restrictions
725  if (!blk)
726  mooseError("Internal error, Material object that does not inherit form BlockRestricted");
727  const std::set<SubdomainID> & blocks =
728  blk->blockRestricted() ? blk->blockIDs() : blk->meshBlockIDs();
729 
730  if (std::includes(blocks.begin(), blocks.end(), _subdomain_ids.begin(), _subdomain_ids.end()))
731  {
732  material_eigenstrain_map[name].insert(blocks.begin(), blocks.end());
733  eigenstrain_set.insert(name);
734  }
735  }
736 
737  // Account for reduced eigenstrains and CompositeEigenstrains
738  if (mat_name == "ComputeReducedOrderEigenstrain")
739  {
740  auto input_eigenstrain_names =
741  mat_params.get<std::vector<MaterialPropertyName>>("input_eigenstrain_names");
742  remove_reduced_set.insert(input_eigenstrain_names.begin(), input_eigenstrain_names.end());
743  }
744  // Account for CompositeEigenstrains
745  if (mat_name == "CompositeEigenstrain")
746  {
747  auto remove_list = mat_params.get<std::vector<MaterialPropertyName>>("tensors");
748  for (auto i : remove_list)
749  remove_reduced_set.insert(i);
750  }
751 
752  // Account for MaterialADConverter , add or remove later
753  if (mat_name == "RankTwoTensorMaterialADConverter")
754  {
755  std::vector<MaterialPropertyName> remove_list;
756  std::vector<MaterialPropertyName> add_list;
757 
758  if (mat_params.isParamValid("ad_props_out") && mat_params.isParamValid("reg_props_in") &&
759  _use_ad)
760  {
761  remove_list = mat_params.get<std::vector<MaterialPropertyName>>("reg_props_in");
762  add_list = mat_params.get<std::vector<MaterialPropertyName>>("ad_props_out");
763  }
764  if (mat_params.isParamValid("ad_props_in") && mat_params.isParamValid("reg_props_out") &&
765  !_use_ad)
766  {
767  remove_list = mat_params.get<std::vector<MaterialPropertyName>>("ad_props_in");
768  add_list = mat_params.get<std::vector<MaterialPropertyName>>("reg_props_out");
769  }
770 
771  // These vectors are the same size as checked in MaterialADConverter
772  for (unsigned int index = 0; index < remove_list.size(); index++)
773  remove_add_map.emplace(remove_list[index], add_list[index]);
774  }
775  }
776  // All the materials have been accounted for, now remove or add parts
777 
778  // Remove names which aren't eigenstrains (converter properties)
779  for (auto remove_add_index : remove_add_map)
780  {
781  const bool is_in = eigenstrain_set.find(remove_add_index.first) != eigenstrain_set.end();
782  if (is_in)
783  {
784  eigenstrain_set.erase(remove_add_index.first);
785  eigenstrain_set.insert(remove_add_index.second);
786  }
787  }
788  for (auto index : remove_reduced_set)
789  eigenstrain_set.erase(index);
790 
791  // Compare the blockIDs set of eigenstrain names with the vector of _eigenstrain_names for the
792  // current subdomainID
793  std::set_union(eigenstrain_set.begin(),
794  eigenstrain_set.end(),
795  _eigenstrain_names.begin(),
796  _eigenstrain_names.end(),
797  std::inserter(verified_eigenstrain_names, verified_eigenstrain_names.begin()));
798 
799  // Ensure the eigenstrain names previously passed include any missing names
800  _eigenstrain_names.resize(verified_eigenstrain_names.size());
801  std::copy(verified_eigenstrain_names.begin(),
802  verified_eigenstrain_names.end(),
803  _eigenstrain_names.begin());
804 
805  Moose::out << COLOR_CYAN << "*** Automatic Eigenstrain Names ***"
806  << "\n"
807  << _name << ": " << Moose::stringify(_eigenstrain_names) << "\n"
808  << COLOR_DEFAULT << std::flush;
809 }
const std::string & _name
char ** blocks
std::set< SubdomainID > _subdomain_ids
set generated from the passed in vector of subdomain names
const std::string & name() const
std::string stringify(const T &t)
std::vector< MaterialPropertyName > _eigenstrain_names
void mooseError(Args &&... args) const
std::shared_ptr< FEProblemBase > & _problem

◆ actGatherActionParameters()

void QuasiStaticSolidMechanicsPhysics::actGatherActionParameters ( )
protectedinherited

Definition at line 989 of file QuasiStaticSolidMechanicsPhysics.C.

Referenced by QuasiStaticSolidMechanicsPhysics::act().

990 {
991  // Gather info about all other solid mechanics physics when we add variables
992  if (_current_task == "validate_coordinate_systems" && getParam<bool>("add_variables"))
993  {
995  for (const auto & action : actions)
996  {
997  const auto size_before = _subdomain_id_union.size();
998  const auto added_size = action->_subdomain_ids.size();
999  _subdomain_id_union.insert(action->_subdomain_ids.begin(), action->_subdomain_ids.end());
1000  const auto size_after = _subdomain_id_union.size();
1001 
1002  if (size_after != size_before + added_size)
1003  mooseError("The block restrictions in the SolidMechanics/QuasiStatic actions must be "
1004  "non-overlapping.");
1005 
1006  if (added_size == 0 && actions.size() > 1)
1007  mooseError(
1008  "No SolidMechanics/QuasiStatic action can be block unrestricted if more than one "
1009  "SolidMechanics/QuasiStatic action is specified.");
1010  }
1011  }
1012 }
std::set< SubdomainID > _subdomain_id_union
set generated from the combined block restrictions of all SolidMechanics/Master action blocks ...
ActionWarehouse & _awh
const std::string & _current_task
void mooseError(Args &&... args) const
std::vector< const T *> getActions()

◆ actLagrangianKernelStrain()

void QuasiStaticSolidMechanicsPhysics::actLagrangianKernelStrain ( )
protectedinherited

Definition at line 1015 of file QuasiStaticSolidMechanicsPhysics.C.

Referenced by QuasiStaticSolidMechanicsPhysics::act().

1016 {
1017  std::string type;
1019  type = "ComputeLagrangianStrain";
1020  else if (_coord_system == Moose::COORD_RZ)
1021  type = "ComputeLagrangianStrainAxisymmetricCylindrical";
1023  type = "ComputeLagrangianStrainCentrosymmetricSpherical";
1024  else
1025  mooseError("Unsupported coordinate system");
1026 
1027  auto params = _factory.getValidParams(type);
1028 
1029  if (isParamValid("strain_base_name"))
1030  params.set<std::string>("base_name") = getParam<std::string>("strain_base_name");
1031 
1032  params.set<std::vector<VariableName>>("displacements") = _coupled_displacements;
1033  params.set<std::vector<MaterialPropertyName>>("eigenstrain_names") = _eigenstrain_names;
1034  params.set<bool>("large_kinematics") = _lk_large_kinematics;
1035  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
1036 
1037  // Error if volumetric locking correction is on for higher-order elements
1038  if (_problem->mesh().hasSecondOrderElements() && _lk_locking)
1039  mooseError("Volumetric locking correction should not be used for "
1040  "higher-order elements.");
1041 
1042  params.set<bool>("stabilize_strain") = _lk_locking;
1043 
1044  // Forward the strain time-integration options. In compatibility mode kinematic_approximation
1045  // and F_bar_mode are overridden below (and the action errors if the user also set them).
1046  params.set<MooseEnum>("kinematic_approximation") = getParam<MooseEnum>("kinematic_approximation");
1047  params.set<Real>("alpha") = getParam<Real>("generalized_midpoint_alpha");
1048  params.set<MooseEnum>("F_bar_mode") = getParam<MooseEnum>("volumetric_locking_correction_mode");
1049 
1050  if (_lk_homogenization)
1051  {
1052  params.set<std::vector<MaterialPropertyName>>("homogenization_gradient_names") = {
1054  }
1055 
1056  // OLD-compat configuration: map decomposition_method -> kinematic_approximation, switch the
1057  // F-bar to incremental mode (matches OLD `ComputeFiniteStrain`'s `_Fhat` F-bar), and have
1058  // the strain calc publish a real rotation_increment so the wrapped ComputeStressBase
1059  // material's FSR rotates correctly across steps.
1060  if (_compatibility_mode)
1061  {
1063  {
1064  const std::string decomp = getParam<MooseEnum>("decomposition_method");
1065  if (decomp == "TaylorExpansion")
1066  params.set<MooseEnum>("kinematic_approximation") = "rashid_approximate";
1067  else if (decomp == "EigenSolution")
1068  params.set<MooseEnum>("kinematic_approximation") = "rashid_eigen";
1069  // HughesWinget rejected in the ctor; SMALL strain ignores kinematic_approximation.
1070  }
1071 
1072  // OLD's `volumetric_locking_correction = true` in incremental finite strain maps to
1073  // `F_bar_mode = incremental` on the NEW strain calc. The strain calc rejects
1074  // `incremental` for small kinematics -- for SMALL + locking we leave `F_bar_mode` at its
1075  // default (`total`), which is the additive trace correction (matches OLD's small-strain
1076  // B-bar in the locked-flag-equivalent form).
1078  params.set<MooseEnum>("F_bar_mode") = "incremental";
1079 
1080  // Only meaningful with FINITE -- in SMALL the wrap runs in passthrough-off mode and the
1081  // rotation increment isn't consumed downstream.
1082  params.set<bool>("publish_rotation_increment") = _lk_large_kinematics;
1083  }
1084 
1085  _problem->addMaterial(type, name() + "_strain", params);
1086 
1087  // OLD-compat configuration: auto-add ComputeLagrangianWrappedStress around the user's
1088  // ComputeStressBase-style stress material. `input_stress = "stress"` and
1089  // `input_jacobian = "Jacobian_mult"` default to the property names every
1090  // ComputeStressBase descendant publishes.
1091  if (_compatibility_mode)
1092  {
1093  const std::string wrap_type = "ComputeLagrangianWrappedStress";
1094  auto wrap_params = _factory.getValidParams(wrap_type);
1095  if (isParamValid("base_name"))
1096  wrap_params.set<std::string>("base_name") = getParam<std::string>("base_name");
1097  wrap_params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
1098  // large_kinematics is derived from the strain calculator's LARGE_KINEMATICS guarantee.
1099  wrap_params.set<MooseEnum>("objective_rate") = "rashid";
1100  // FINITE: the wrap runs in passthrough mode (the wrapped material's FSR already produced
1101  // the correctly-rotated cumulative Cauchy stress, fed by our published rotation_increment).
1102  // SMALL: nothing to rotate, plain Cauchy passthrough via the rate's small-kinematics branch.
1103  wrap_params.set<bool>("rotate_old_stress") = _lk_large_kinematics;
1104  _problem->addMaterial(wrap_type, name() + "_compatibility_wrap", wrap_params);
1105  }
1106 
1107  // Add the homogenization strain calculator
1108  if (_lk_homogenization)
1109  {
1110  std::string type = "ComputeHomogenizedLagrangianStrain";
1111  auto params = _factory.getValidParams(type);
1112 
1113  params.set<MaterialPropertyName>("homogenization_gradient_name") = _homogenization_strain_name;
1114  params.set<std::vector<VariableName>>("macro_gradient") = {_hname};
1115  params.set<MultiMooseEnum>("constraint_types") = _constraint_types;
1116  params.set<std::vector<FunctionName>>("targets") = _targets;
1117 
1118  _problem->addMaterial(type, name() + "_compute_" + _homogenization_strain_name, params);
1119  }
1120 }
const bool _lk_large_kinematics
Simplified flag for small/large deformations, Lagrangian kernel system.
const bool _compatibility_mode
OLD-compat shim: auto-configures the Lagrangian kernel system to reproduce StressDivergenceTensors + ...
Factory & _factory
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
COORD_RSPHERICAL
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & name() const
std::vector< VariableName > _coupled_displacements
Coupled displacement variables.
const std::string & type() const
std::vector< MaterialPropertyName > _eigenstrain_names
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const bool _lk_locking
Simplified volumetric locking correction flag for new kernels.
void mooseError(Args &&... args) const
std::shared_ptr< FEProblemBase > & _problem
bool isParamValid(const std::string &name) const
bool _lk_homogenization
Flag indicating if the homogenization system is present for new kernels.

◆ actOutputGeneration()

void QuasiStaticSolidMechanicsPhysics::actOutputGeneration ( )
protectedinherited

Definition at line 614 of file QuasiStaticSolidMechanicsPhysics.C.

Referenced by QuasiStaticSolidMechanicsPhysics::act().

615 {
616  if (_current_task == "add_material")
618 
619  // Add variables (optional)
620  if (_current_task == "add_aux_variable")
621  {
622  unsigned int index = 0;
623  for (auto out : _generate_output)
624  {
625  const auto & order = _material_output_order[index];
626  const auto & family = _material_output_family[index];
627 
628  std::string type = (order == "CONSTANT" && family == "MONOMIAL")
629  ? "MooseVariableConstMonomial"
630  : "MooseVariable";
631 
632  // Create output helper aux variables
633  auto params = _factory.getValidParams(type);
634  params.set<MooseEnum>("order") = order;
635  params.set<MooseEnum>("family") = family;
636 
637  if (family == "MONOMIAL")
638  _problem->addAuxVariable(type, _base_name + out, params);
639  else
640  _problem->addVariable(type, _base_name + out, params);
641 
642  index++;
643  }
644  }
645 
646  // Add output AuxKernels
647  else if (_current_task == "add_aux_kernel")
648  {
649  std::string ad_prepend = _use_ad ? "AD" : "";
650  // Loop through output aux variables
651  unsigned int index = 0;
652  for (auto out : _generate_output)
653  {
654  if (_material_output_family[index] == "MONOMIAL")
655  {
657 
658  params = _factory.getValidParams("MaterialRealAux");
659  params.applyParameters(parameters());
660  params.set<MaterialPropertyName>("property") = _base_name + out;
661  params.set<AuxVariableName>("variable") = _base_name + out;
662  params.set<ExecFlagEnum>("execute_on") = EXEC_TIMESTEP_END;
663 
664  _problem->addAuxKernel(
665  ad_prepend + "MaterialRealAux", _base_name + out + '_' + name(), params);
666  }
667  index++;
668  }
669  }
670  else if (_current_task == "add_kernel")
671  {
672  std::string ad_prepend = _use_ad ? "AD" : "";
673  // Loop through output aux variables
674  unsigned int index = 0;
675  for (auto out : _generate_output)
676  {
677  if (_material_output_family[index] != "MONOMIAL")
678  {
680 
681  params = _factory.getValidParams("MaterialPropertyValue");
682  params.applyParameters(parameters());
683  params.set<MaterialPropertyName>("prop_name") = _base_name + out;
684  params.set<NonlinearVariableName>("variable") = _base_name + out;
685 
686  _problem->addKernel(
687  ad_prepend + "MaterialPropertyValue", _base_name + out + '_' + name(), params);
688  }
689  index++;
690  }
691  }
692 }
Factory & _factory
const InputParameters & parameters() const
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
void applyParameters(const InputParameters &common, const std::vector< std::string > &exclude={}, const bool allow_private=false)
std::vector< std::string > _generate_output
output materials to generate scalar stress/strain tensor quantities
InputParameters emptyInputParameters()
const std::string & name() const
const std::string & type() const
const std::string & _current_task
std::shared_ptr< FEProblemBase > & _problem
const std::string _base_name
base name for the current master action block

◆ actOutputMatProp()

void QuasiStaticSolidMechanicsPhysics::actOutputMatProp ( )
protectedinherited

Definition at line 879 of file QuasiStaticSolidMechanicsPhysics.C.

Referenced by QuasiStaticSolidMechanicsPhysics::actOutputGeneration().

880 {
881  std::string ad_prepend = _use_ad ? "AD" : "";
882 
883  if (_current_task == "add_material")
884  {
885  // Add output Materials
886  for (auto out : _generate_output)
887  {
889 
890  // RankTwoCartesianComponent
891  if (
892  [&]()
893  {
894  for (const auto & r2q : _rank_two_cartesian_component_table)
895  for (unsigned int a = 0; a < 3; ++a)
896  for (unsigned int b = 0; b < 3; ++b)
897  if (r2q.first + '_' + _component_table[a] + _component_table[b] == out)
898  {
899  auto type = ad_prepend + "RankTwoCartesianComponent";
900  params = _factory.getValidParams(type);
901  params.set<MaterialPropertyName>("rank_two_tensor") =
902  _base_name + remapCompatOutputProp(r2q.second);
903  params.set<unsigned int>("index_i") = a;
904  params.set<unsigned int>("index_j") = b;
905 
906  params.applyParameters(parameters());
907  params.set<MaterialPropertyName>("property_name") = _base_name + out;
908  _problem->addMaterial(type, _base_name + out + '_' + name(), params);
909  return true;
910  }
911  return false;
912  }())
913  continue;
914 
915  // RankTwoDirectionalComponent
916  if (setupOutput(out,
918  [&](std::string prop_name, std::string invariant)
919  {
920  auto type = ad_prepend + "RankTwoDirectionalComponent";
921  params = _factory.getValidParams(type);
922  params.set<MaterialPropertyName>("rank_two_tensor") =
923  _base_name + remapCompatOutputProp(prop_name);
924  params.set<MooseEnum>("invariant") = invariant;
925  params.applyParameters(parameters());
926  params.set<MaterialPropertyName>("property_name") = _base_name + out;
927  _problem->addMaterial(type, _base_name + out + '_' + name(), params);
928  }))
929  continue;
930 
931  // RankTwoInvariant
932  if (setupOutput(out,
934  [&](std::string prop_name, std::string invariant)
935  {
936  auto type = ad_prepend + "RankTwoInvariant";
937  params = _factory.getValidParams(type);
938  params.set<MaterialPropertyName>("rank_two_tensor") =
939  _base_name + remapCompatOutputProp(prop_name);
940  params.set<MooseEnum>("invariant") = invariant;
941  params.applyParameters(parameters());
942  params.set<MaterialPropertyName>("property_name") = _base_name + out;
943  _problem->addMaterial(type, _base_name + out + '_' + name(), params);
944  }))
945  continue;
946 
947  // RankTwoCylindricalComponent
948  if (setupOutput(
949  out,
951  [&](std::string prop_name, std::string component)
952  {
954  mooseError(
955  "Cannot use cylindrical component output in a spherical coordinate system.");
956  auto type = ad_prepend + "RankTwoCylindricalComponent";
957  params = _factory.getValidParams(type);
958  params.set<MaterialPropertyName>("rank_two_tensor") =
959  _base_name + remapCompatOutputProp(prop_name);
960  params.set<MooseEnum>("cylindrical_component") = component;
961  params.applyParameters(parameters());
962  params.set<MaterialPropertyName>("property_name") = _base_name + out;
963  _problem->addMaterial(type, _base_name + out + '_' + name(), params);
964  }))
965  continue;
966 
967  // RankTwoSphericalComponent
968  if (setupOutput(out,
970  [&](std::string prop_name, std::string component)
971  {
972  auto type = ad_prepend + "RankTwoSphericalComponent";
973  params = _factory.getValidParams(type);
974  params.set<MaterialPropertyName>("rank_two_tensor") =
975  _base_name + remapCompatOutputProp(prop_name);
976  params.set<MooseEnum>("spherical_component") = component;
977  params.applyParameters(parameters());
978  params.set<MaterialPropertyName>("property_name") = _base_name + out;
979  _problem->addMaterial(type, _base_name + out + '_' + name(), params);
980  }))
981  continue;
982 
983  paramError("generate_output", "Unable to add output Material for '", out, "'");
984  }
985  }
986 }
bool setupOutput(std::string out, T table, T2 setup)
Helper function to decode generate_outputs options using a "table" of scalar output quantities and a ...
void paramError(const std::string &param, Args... args) const
static const std::map< std::string, std::pair< std::string, std::vector< std::string > > > _rank_two_invariant_table
Factory & _factory
static const std::string component
Definition: NS.h:157
const InputParameters & parameters() const
static const std::map< std::string, std::pair< std::string, std::vector< std::string > > > _rank_two_cylindrical_component_table
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
void applyParameters(const InputParameters &common, const std::vector< std::string > &exclude={}, const bool allow_private=false)
COORD_RSPHERICAL
std::vector< std::string > _generate_output
output materials to generate scalar stress/strain tensor quantities
static const std::vector< char > _component_table
table data for output generation
InputParameters emptyInputParameters()
const std::string & name() const
const std::string & type() const
const std::string & _current_task
static const std::map< std::string, std::pair< std::string, std::vector< std::string > > > _rank_two_directional_component_table
static std::map< std::string, std::string > _rank_two_cartesian_component_table
void mooseError(Args &&... args) const
std::shared_ptr< FEProblemBase > & _problem
const std::string _base_name
base name for the current master action block
static const std::map< std::string, std::pair< std::string, std::vector< std::string > > > _rank_two_spherical_component_table
std::string remapCompatOutputProp(const std::string &prop_name) const
Apply compatibility_mode remapping to a property name pulled from the _rank_two_* output tables: in c...

◆ actStressDivergenceTensorsStrain()

void QuasiStaticSolidMechanicsPhysics::actStressDivergenceTensorsStrain ( )
protectedinherited

Definition at line 1123 of file QuasiStaticSolidMechanicsPhysics.C.

Referenced by QuasiStaticSolidMechanicsPhysics::act().

1124 {
1125  std::string ad_prepend = _use_ad ? "AD" : "";
1126 
1127  std::string type;
1128 
1129  // no plane strain
1131  {
1132  std::map<std::pair<Moose::CoordinateSystemType, StrainAndIncrement>, std::string> type_map = {
1133  {{Moose::COORD_XYZ, StrainAndIncrement::SmallTotal}, "ComputeSmallStrain"},
1134  {{Moose::COORD_XYZ, StrainAndIncrement::SmallIncremental}, "ComputeIncrementalStrain"},
1135  {{Moose::COORD_XYZ, StrainAndIncrement::FiniteIncremental}, "ComputeFiniteStrain"},
1136  {{Moose::COORD_RZ, StrainAndIncrement::SmallTotal}, "ComputeAxisymmetricRZSmallStrain"},
1138  "ComputeAxisymmetricRZIncrementalStrain"},
1140  "ComputeAxisymmetricRZFiniteStrain"},
1141  {{Moose::COORD_RSPHERICAL, StrainAndIncrement::SmallTotal}, "ComputeRSphericalSmallStrain"},
1143  "ComputeRSphericalIncrementalStrain"},
1145  "ComputeRSphericalFiniteStrain"}};
1146 
1147  auto type_it = type_map.find(std::make_pair(_coord_system, _strain_and_increment));
1148  if (type_it != type_map.end())
1149  type = type_it->second;
1150  else
1151  mooseError("Unsupported strain formulation");
1152  }
1156  {
1159  paramError("use_automatic_differentiation",
1160  "AD not setup for use with PlaneStrain or GeneralizedPlaneStrain");
1161 
1162  std::map<std::pair<Moose::CoordinateSystemType, StrainAndIncrement>, std::string> type_map = {
1163  {{Moose::COORD_XYZ, StrainAndIncrement::SmallTotal}, "ComputePlaneSmallStrain"},
1164  {{Moose::COORD_XYZ, StrainAndIncrement::SmallIncremental}, "ComputePlaneIncrementalStrain"},
1165  {{Moose::COORD_XYZ, StrainAndIncrement::FiniteIncremental}, "ComputePlaneFiniteStrain"},
1166  {{Moose::COORD_RZ, StrainAndIncrement::SmallTotal}, "ComputeAxisymmetric1DSmallStrain"},
1168  "ComputeAxisymmetric1DIncrementalStrain"},
1170  "ComputeAxisymmetric1DFiniteStrain"}};
1171 
1172  // choose kernel type based on coordinate system
1173  auto type_it = type_map.find(std::make_pair(_coord_system, _strain_and_increment));
1174  if (type_it != type_map.end())
1175  type = type_it->second;
1176  else
1177  mooseError("Unsupported coordinate system for plane strain.");
1178  }
1179  else
1180  mooseError("Unsupported planar formulation");
1181 
1182  // set material parameters
1183  auto params = _factory.getValidParams(ad_prepend + type);
1184  params.applyParameters(
1185  parameters(),
1186  {"displacements", "use_displaced_mesh", "out_of_plane_strain", "scalar_out_of_plane_strain"});
1187 
1188  if (isParamValid("strain_base_name"))
1189  params.set<std::string>("base_name") = getParam<std::string>("strain_base_name");
1190 
1191  params.set<std::vector<VariableName>>("displacements") = _coupled_displacements;
1192  params.set<bool>("use_displaced_mesh") = false;
1193 
1194  if (isParamValid("scalar_out_of_plane_strain"))
1195  params.set<std::vector<VariableName>>("scalar_out_of_plane_strain") = {
1196  getParam<VariableName>("scalar_out_of_plane_strain")};
1197 
1198  if (isParamValid("out_of_plane_strain"))
1199  params.set<std::vector<VariableName>>("out_of_plane_strain") = {
1200  getParam<VariableName>("out_of_plane_strain")};
1201 
1202  params.set<std::vector<MaterialPropertyName>>("eigenstrain_names") = _eigenstrain_names;
1203 
1204  _problem->addMaterial(ad_prepend + type, name() + "_strain", params);
1205 }
enum QuasiStaticSolidMechanicsPhysics::StrainAndIncrement _strain_and_increment
void paramError(const std::string &param, Args... args) const
Factory & _factory
const InputParameters & parameters() const
InputParameters getValidParams(const std::string &name) const
void applyParameters(const InputParameters &common, const std::vector< std::string > &exclude={}, const bool allow_private=false)
COORD_RSPHERICAL
enum QuasiStaticSolidMechanicsPhysics::PlanarFormulation _planar_formulation
const std::string & name() const
std::vector< VariableName > _coupled_displacements
Coupled displacement variables.
const std::string & type() const
std::vector< MaterialPropertyName > _eigenstrain_names
void mooseError(Args &&... args) const
std::shared_ptr< FEProblemBase > & _problem
bool isParamValid(const std::string &name) const

◆ actSubdomainChecks()

void QuasiStaticSolidMechanicsPhysics::actSubdomainChecks ( )
protectedinherited

Definition at line 565 of file QuasiStaticSolidMechanicsPhysics.C.

Referenced by QuasiStaticSolidMechanicsPhysics::act().

566 {
567  // Do the coordinate system check only once the problem is created
568  if (_current_task == "setup_mesh_complete")
569  {
570  // get subdomain IDs
571  for (auto & name : _subdomain_names)
572  {
573  auto id = _mesh->getSubdomainID(name);
574  if (id == Moose::INVALID_BLOCK_ID)
575  paramError("block", "Subdomain \"" + name + "\" not found in mesh.");
576  else
577  _subdomain_ids.insert(id);
578  }
579  }
580 
581  if (_current_task == "validate_coordinate_systems")
582  {
583  // use either block restriction list or list of all subdomains in the mesh
584  const auto & check_subdomains =
585  _subdomain_ids.empty() ? _problem->mesh().meshSubdomains() : _subdomain_ids;
586  if (check_subdomains.empty())
587  mooseError("No subdomains found");
588 
589  // make sure all subdomains are using the same coordinate system
590  _coord_system = _problem->getCoordSystem(*check_subdomains.begin());
591  for (auto subdomain : check_subdomains)
592  if (_problem->getCoordSystem(subdomain) != _coord_system)
593  mooseError("The SolidMechanics action requires all subdomains to have the same coordinate "
594  "system.");
595 
597  {
599  mooseError("'out_of_plane_direction' must be 'z' for axisymmetric simulations");
600  }
602  {
604  mooseError(
605  "Must specify two displacements for plane strain when the out of plane direction is z");
607  mooseError("Must specify three displacements for plane strain when the out of plane "
608  "direction is x or y");
609  }
610  }
611 }
void paramError(const std::string &param, Args... args) const
std::set< SubdomainID > _subdomain_ids
set generated from the passed in vector of subdomain names
unsigned int _ndisp
Number of displacement variables.
enum QuasiStaticSolidMechanicsPhysics::PlanarFormulation _planar_formulation
const SubdomainID INVALID_BLOCK_ID
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & name() const
const std::string & _current_task
std::shared_ptr< MooseMesh > & _mesh
void mooseError(Args &&... args) const
std::shared_ptr< FEProblemBase > & _problem

◆ addCartesianComponentOutput()

void QuasiStaticSolidMechanicsPhysicsBase::addCartesianComponentOutput ( const std::string &  name,
const std::string &  prop_name = "" 
)
staticinherited

Definition at line 372 of file QuasiStaticSolidMechanicsPhysicsBase.C.

374 {
375  if (prop_name.empty())
376  // the enum name is the actual tensor material property name
377  _rank_two_cartesian_component_table.emplace(enum_name, enum_name);
378  else
379  // supply a different name for the enum options (this is done for
380  // 'strain' -> 'mechanical_strain' in the TMA)
381  _rank_two_cartesian_component_table.emplace(enum_name, prop_name);
382 }
static std::map< std::string, std::string > _rank_two_cartesian_component_table

◆ getKernelParameters()

InputParameters QuasiStaticSolidMechanicsPhysics::getKernelParameters ( std::string  type)
protectedvirtualinherited

Reimplemented in DynamicSolidMechanicsPhysics.

Definition at line 1267 of file QuasiStaticSolidMechanicsPhysics.C.

Referenced by QuasiStaticSolidMechanicsPhysics::act(), and DynamicSolidMechanicsPhysics::getKernelParameters().

1268 {
1270  params.applyParameters(
1271  parameters(),
1272  {"displacements", "use_displaced_mesh", "save_in", "diag_save_in", "out_of_plane_strain"});
1273 
1274  params.set<std::vector<VariableName>>("displacements") = _coupled_displacements;
1275 
1276  if (_lagrangian_kernels)
1277  {
1278  params.set<bool>("use_displaced_mesh") =
1280  // large_kinematics is derived from the strain calculator's LARGE_KINEMATICS guarantee.
1281  params.set<bool>("stabilize_strain") = _lk_locking;
1282  params.set<MooseEnum>("F_bar_mode") = getParam<MooseEnum>("volumetric_locking_correction_mode");
1283  if (_lk_homogenization)
1284  params.set<bool>("off_diagonal_jacobian") = _lk_h_off_jac;
1285  // Match the strain calc's F-bar mode on the kernel -- the TL kernel's OLD-compat B-bar
1286  // residual is gated on `F_bar_mode = incremental && stabilize_strain`. Setting it on
1287  // both keeps the kernel and the strain material on the same F-bar formulation. Only
1288  // applicable to large kinematics (the strain calc rejects `incremental` for small).
1290  params.set<MooseEnum>("F_bar_mode") = "incremental";
1291  }
1292  else
1293  params.set<bool>("use_displaced_mesh") = _use_displaced_mesh;
1294 
1295  return params;
1296 }
const bool _lk_large_kinematics
Simplified flag for small/large deformations, Lagrangian kernel system.
const bool _compatibility_mode
OLD-compat shim: auto-configures the Lagrangian kernel system to reproduce StressDivergenceTensors + ...
Factory & _factory
const InputParameters & parameters() const
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
void applyParameters(const InputParameters &common, const std::vector< std::string > &exclude={}, const bool allow_private=false)
bool _use_displaced_mesh
use displaced mesh (true unless _strain is SMALL)
std::vector< VariableName > _coupled_displacements
Coupled displacement variables.
const std::string & type() const
const bool _lagrangian_kernels
New or old kernel system. True if new_system = true OR compatibility_mode = true. ...
const bool _lk_locking
Simplified volumetric locking correction flag for new kernels.
const bool _lk_h_off_jac
Whether to use the off diagonal scalar jacobian for the homogenization system.
bool _lk_homogenization
Flag indicating if the homogenization system is present for new kernels.

◆ getKernelType()

std::string QuasiStaticSolidMechanicsPhysics::getKernelType ( )
protectedvirtualinherited

Reimplemented in DynamicSolidMechanicsPhysics.

Definition at line 1208 of file QuasiStaticSolidMechanicsPhysics.C.

Referenced by QuasiStaticSolidMechanicsPhysics::act().

1209 {
1210  if (_lagrangian_kernels)
1211  {
1212  std::string type;
1214  {
1215  if (_lk_homogenization)
1216  type = "HomogenizedTotalLagrangianStressDivergence";
1218  type = "TotalLagrangianStressDivergence";
1220  type = "UpdatedLagrangianStressDivergence";
1221  else
1222  mooseError("Unknown formulation type");
1223  }
1224  else if (_coord_system == Moose::COORD_RZ)
1225  {
1226  if (_lk_homogenization)
1227  mooseError("The Lagrangian mechanics kernels do not yet support homogenization in "
1228  "coordinate systems other than Cartesian.");
1230  type = "TotalLagrangianStressDivergenceAxisymmetricCylindrical";
1232  mooseError("The Lagrangian mechanics kernels do not yet support the updated Lagrangian "
1233  "formulation in RZ coordinates.");
1234  }
1236  {
1237  if (_lk_homogenization)
1238  mooseError("The Lagrangian mechanics kernels do not yet support homogenization in "
1239  "coordinate systems other than Cartesian.");
1241  type = "TotalLagrangianStressDivergenceCentrosymmetricSpherical";
1243  mooseError("The Lagrangian mechanics kernels do not yet support the updated Lagrangian "
1244  "formulation in RZ coordinates.");
1245  }
1246  else
1247  mooseError("Unsupported coordinate system");
1248  return type;
1249  }
1250  else
1251  {
1252  std::map<Moose::CoordinateSystemType, std::string> type_map = {
1253  {Moose::COORD_XYZ, "StressDivergenceTensors"},
1254  {Moose::COORD_RZ, "StressDivergenceRZTensors"},
1255  {Moose::COORD_RSPHERICAL, "StressDivergenceRSphericalTensors"}};
1256 
1257  // choose kernel type based on coordinate system
1258  auto type_it = type_map.find(_coord_system);
1259  if (type_it != type_map.end())
1260  return type_it->second;
1261  else
1262  mooseError("Unsupported coordinate system");
1263  }
1264 }
COORD_RSPHERICAL
const std::string & type() const
const bool _lagrangian_kernels
New or old kernel system. True if new_system = true OR compatibility_mode = true. ...
void mooseError(Args &&... args) const
bool _lk_homogenization
Flag indicating if the homogenization system is present for new kernels.

◆ materialOutputFamilies()

MultiMooseEnum QuasiStaticSolidMechanicsPhysicsBase::materialOutputFamilies ( )
staticinherited

◆ materialOutputOrders()

MultiMooseEnum QuasiStaticSolidMechanicsPhysicsBase::materialOutputOrders ( )
staticinherited

Definition at line 329 of file QuasiStaticSolidMechanicsPhysicsBase.C.

Referenced by QuasiStaticSolidMechanicsPhysicsBase::validParams(), and QuasiStaticSolidMechanicsPhysics::validParams().

330 {
332 
333  return MultiMooseEnum(orders);
334 }
std::string getRawNames() const
static MooseEnum getAuxVariableOrders()

◆ outputPropertiesType()

MultiMooseEnum QuasiStaticSolidMechanicsPhysicsBase::outputPropertiesType ( )
staticinherited

Definition at line 343 of file QuasiStaticSolidMechanicsPhysicsBase.C.

Referenced by QuasiStaticSolidMechanicsPhysicsBase::validParams(), and QuasiStaticSolidMechanicsPhysics::validParams().

344 {
345  std::string options = "";
346  for (auto & r2tc : _rank_two_cartesian_component_table)
347  for (unsigned int a = 0; a < 3; ++a)
348  for (unsigned int b = 0; b < 3; ++b)
349  options += (options == "" ? "" : " ") + r2tc.first + '_' + _component_table[a] +
351 
352  for (auto & r2i : _rank_two_invariant_table)
353  for (auto & t : r2i.second.second)
354  options += " " + r2i.first + "_" + t;
355 
356  for (auto & r2sdc : _rank_two_directional_component_table)
357  for (auto & r : r2sdc.second.second)
358  options += " " + r2sdc.first + "_" + r;
359 
360  for (auto & r2cc : _rank_two_cylindrical_component_table)
361  for (auto & r : r2cc.second.second)
362  options += " " + r2cc.first + "_" + r;
363 
364  for (auto & r2sc : _rank_two_spherical_component_table)
365  for (auto & r : r2sc.second.second)
366  options += " " + r2sc.first + "_" + r;
367 
368  return MultiMooseEnum(options, "", true);
369 }
static const std::map< std::string, std::pair< std::string, std::vector< std::string > > > _rank_two_invariant_table
static const std::map< std::string, std::pair< std::string, std::vector< std::string > > > _rank_two_cylindrical_component_table
static const std::vector< char > _component_table
table data for output generation
static const std::map< std::string, std::pair< std::string, std::vector< std::string > > > _rank_two_directional_component_table
static std::map< std::string, std::string > _rank_two_cartesian_component_table
static const std::map< std::string, std::pair< std::string, std::vector< std::string > > > _rank_two_spherical_component_table

◆ remapCompatOutputProp()

std::string QuasiStaticSolidMechanicsPhysics::remapCompatOutputProp ( const std::string &  prop_name) const
protectedinherited

Apply compatibility_mode remapping to a property name pulled from the _rank_two_* output tables: in compat mode the NEW pipeline writes Cauchy stress + rotated mechanical strain under different names than the OLD pipeline.

Outside compat mode this is the identity.

Definition at line 862 of file QuasiStaticSolidMechanicsPhysics.C.

Referenced by QuasiStaticSolidMechanicsPhysics::actOutputMatProp().

863 {
864  // The OLD pipeline publishes `stress` and `mechanical_strain` directly. The NEW pipeline
865  // publishes Cauchy stress under `cauchy_stress` and (when the strain calc is configured for
866  // OLD compatibility) the OLD-equivalent mechanical strain under `rotated_mechanical_strain`.
867  // Redirect the underlying property name so user output requests like `stress_xx` keep their
868  // OLD-style aux variable name but read from the NEW-style source.
869  if (!_compatibility_mode)
870  return prop_name;
871  if (prop_name == "stress")
872  return "cauchy_stress";
873  if (prop_name == "mechanical_strain")
874  return "rotated_mechanical_strain";
875  return prop_name;
876 }
const bool _compatibility_mode
OLD-compat shim: auto-configures the Lagrangian kernel system to reproduce StressDivergenceTensors + ...

◆ setupOutput()

template<typename T , typename T2 >
bool QuasiStaticSolidMechanicsPhysics::setupOutput ( std::string  out,
T  table,
T2  setup 
)
protectedinherited

Helper function to decode generate_outputs options using a "table" of scalar output quantities and a "setup" lambda that performs the input parameter setup for the output material object.

Definition at line 184 of file QuasiStaticSolidMechanicsPhysics.h.

Referenced by QuasiStaticSolidMechanicsPhysics::actOutputMatProp().

185 {
186  for (const auto & t1 : table)
187  {
188  // find the officially supported properties
189  for (const auto & t2 : t1.second.second)
190  if (t1.first + '_' + t2 == out)
191  {
192  const auto it = _rank_two_cartesian_component_table.find(t2);
193  if (it != _rank_two_cartesian_component_table.end())
194  {
195  setup(it->second, t1.second.first);
196  return true;
197  }
198  else
199  mooseError("Internal error. The permitted tensor shortcuts must be keys in the "
200  "'_rank_two_cartesian_component_table'.");
201  }
202 
203  // check for custom properties
204  auto prefix = t1.first + '_';
205  if (out.substr(0, prefix.length()) == prefix)
206  {
207  setup(out.substr(prefix.length()), t1.second.first);
208  return true;
209  }
210  }
211 
212  return false;
213 }
static std::map< std::string, std::string > _rank_two_cartesian_component_table
OStreamProxy out
void setup(EquationSystems &systems, Mesh &mesh, GetPot &args)
void mooseError(Args &&... args) const

◆ validParams()

InputParameters LegacyTensorMechanicsAction::validParams ( )
static

Definition at line 21 of file LegacyTensorMechanicsAction.C.

22 {
24  params.addParam<bool>(
25  "use_displaced_mesh", false, "Whether to use displaced mesh in the kernels");
26  return params;
27 }
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)

◆ verifyOrderAndFamilyOutputs()

void QuasiStaticSolidMechanicsPhysics::verifyOrderAndFamilyOutputs ( )
protectedinherited

Definition at line 812 of file QuasiStaticSolidMechanicsPhysics.C.

Referenced by QuasiStaticSolidMechanicsPhysics::QuasiStaticSolidMechanicsPhysics().

813 {
814  // Ensure material output order and family vectors are same size as generate output
815 
816  // check number of supplied orders and families
818  paramError("material_output_order",
819  "The number of orders assigned to material outputs must be: 0 to be assigned "
820  "CONSTANT; 1 to assign all outputs the same value, or the same size as the number "
821  "of generate outputs listed.");
822 
823  if (_material_output_family.size() > 1 &&
825  paramError("material_output_family",
826  "The number of families assigned to material outputs must be: 0 to be assigned "
827  "MONOMIAL; 1 to assign all outputs the same value, or the same size as the number "
828  "of generate outputs listed.");
829 
830  // if no value was provided, chose the default CONSTANT
831  if (_material_output_order.size() == 0)
833 
834  // For only one order, make all orders the same magnitude
835  if (_material_output_order.size() == 1)
837  std::vector<std::string>(_generate_output.size(), _material_output_order[0]);
838 
839  if (_verbose)
840  Moose::out << COLOR_CYAN << "*** Automatic applied material output orders ***"
841  << "\n"
842  << _name << ": " << Moose::stringify(_material_output_order) << "\n"
843  << COLOR_DEFAULT << std::flush;
844 
845  // if no value was provided, chose the default MONOMIAL
846  if (_material_output_family.size() == 0)
848 
849  // For only one family, make all families that value
850  if (_material_output_family.size() == 1)
852  std::vector<std::string>(_generate_output.size(), _material_output_family[0]);
853 
854  if (_verbose)
855  Moose::out << COLOR_CYAN << "*** Automatic applied material output families ***"
856  << "\n"
857  << _name << ": " << Moose::stringify(_material_output_family) << "\n"
858  << COLOR_DEFAULT << std::flush;
859 }
const std::string & _name
void paramError(const std::string &param, Args... args) const
void setAdditionalValue(const std::string &names)
unsigned int size() const
std::vector< std::string > _generate_output
output materials to generate scalar stress/strain tensor quantities
std::string stringify(const T &t)

Member Data Documentation

◆ _auto_eigenstrain

const bool QuasiStaticSolidMechanicsPhysics::_auto_eigenstrain
protectedinherited

automatically gather names of eigenstrain tensors provided by simulation objects

Definition at line 139 of file QuasiStaticSolidMechanicsPhysics.h.

Referenced by QuasiStaticSolidMechanicsPhysics::act().

◆ _base_name

const std::string QuasiStaticSolidMechanicsPhysics::_base_name
protectedinherited

base name for the current master action block

Definition at line 111 of file QuasiStaticSolidMechanicsPhysics.h.

Referenced by QuasiStaticSolidMechanicsPhysics::actOutputGeneration(), and QuasiStaticSolidMechanicsPhysics::actOutputMatProp().

◆ _compatibility_mode

const bool QuasiStaticSolidMechanicsPhysics::_compatibility_mode
protectedinherited

◆ _component_table

const std::vector< char > QuasiStaticSolidMechanicsPhysicsBase::_component_table = {'x', 'y', 'z'}
staticinherited

◆ _constraint_types

MultiMooseEnum QuasiStaticSolidMechanicsPhysics::_constraint_types
protectedinherited

◆ _coord_system

Moose::CoordinateSystemType QuasiStaticSolidMechanicsPhysics::_coord_system
protectedinherited

◆ _coupled_displacements

std::vector<VariableName> QuasiStaticSolidMechanicsPhysics::_coupled_displacements
protectedinherited

◆ _cylindrical_axis_point1

Point QuasiStaticSolidMechanicsPhysics::_cylindrical_axis_point1
protectedinherited

points used to determine axis of rotation for cylindrical stress/strain quantities

Definition at line 128 of file QuasiStaticSolidMechanicsPhysics.h.

Referenced by QuasiStaticSolidMechanicsPhysics::QuasiStaticSolidMechanicsPhysics().

◆ _cylindrical_axis_point1_valid

bool QuasiStaticSolidMechanicsPhysics::_cylindrical_axis_point1_valid
protectedinherited

booleans used to determine if cylindrical axis points are passed

Definition at line 122 of file QuasiStaticSolidMechanicsPhysics.h.

Referenced by QuasiStaticSolidMechanicsPhysics::QuasiStaticSolidMechanicsPhysics().

◆ _cylindrical_axis_point2

Point QuasiStaticSolidMechanicsPhysics::_cylindrical_axis_point2
protectedinherited

◆ _cylindrical_axis_point2_valid

bool QuasiStaticSolidMechanicsPhysics::_cylindrical_axis_point2_valid
protectedinherited

◆ _diag_save_in

std::vector<AuxVariableName> QuasiStaticSolidMechanicsPhysics::_diag_save_in
protectedinherited

◆ _direction

Point QuasiStaticSolidMechanicsPhysics::_direction
protectedinherited

◆ _direction_valid

bool QuasiStaticSolidMechanicsPhysics::_direction_valid
protectedinherited

◆ _displacements

std::vector<VariableName> QuasiStaticSolidMechanicsPhysics::_displacements
protectedinherited

◆ _eigenstrain_names

std::vector<MaterialPropertyName> QuasiStaticSolidMechanicsPhysics::_eigenstrain_names
protectedinherited

◆ _generate_output

std::vector<std::string> QuasiStaticSolidMechanicsPhysics::_generate_output
protectedinherited

◆ _hname

const std::string QuasiStaticSolidMechanicsPhysics::_hname = "hvar"
protectedinherited

◆ _homogenization_strain_name

const std::string QuasiStaticSolidMechanicsPhysics::_homogenization_strain_name = "homogenization_gradient"
protectedinherited

◆ _integrator_name

const std::string QuasiStaticSolidMechanicsPhysics::_integrator_name = "integrator"
protectedinherited

Definition at line 172 of file QuasiStaticSolidMechanicsPhysics.h.

◆ _lagrangian_kernels

const bool QuasiStaticSolidMechanicsPhysics::_lagrangian_kernels
protectedinherited

◆ _lk_formulation

const LKFormulation QuasiStaticSolidMechanicsPhysics::_lk_formulation
protectedinherited

◆ _lk_h_off_jac

const bool QuasiStaticSolidMechanicsPhysics::_lk_h_off_jac
protectedinherited

Whether to use the off diagonal scalar jacobian for the homogenization system.

Definition at line 179 of file QuasiStaticSolidMechanicsPhysics.h.

Referenced by QuasiStaticSolidMechanicsPhysics::getKernelParameters().

◆ _lk_homogenization

bool QuasiStaticSolidMechanicsPhysics::_lk_homogenization
protectedinherited

◆ _lk_large_kinematics

const bool QuasiStaticSolidMechanicsPhysics::_lk_large_kinematics
protectedinherited

◆ _lk_locking

const bool QuasiStaticSolidMechanicsPhysics::_lk_locking
protectedinherited

◆ _material_output_family

MultiMooseEnum QuasiStaticSolidMechanicsPhysics::_material_output_family
protectedinherited

◆ _material_output_order

MultiMooseEnum QuasiStaticSolidMechanicsPhysics::_material_output_order
protectedinherited

◆ _ndisp

unsigned int QuasiStaticSolidMechanicsPhysics::_ndisp
protectedinherited

◆ _order_mapper

const std::map<unsigned int, std::string> QuasiStaticSolidMechanicsPhysics::_order_mapper
staticprotectedinherited

Definition at line 168 of file QuasiStaticSolidMechanicsPhysics.h.

◆ _out_of_plane_direction

const OutOfPlaneDirection QuasiStaticSolidMechanicsPhysics::_out_of_plane_direction
protectedinherited

◆ _planar_formulation

enum QuasiStaticSolidMechanicsPhysics::PlanarFormulation QuasiStaticSolidMechanicsPhysics::_planar_formulation
protectedinherited

◆ _rank_two_cartesian_component_table

std::map< std::string, std::string > QuasiStaticSolidMechanicsPhysicsBase::_rank_two_cartesian_component_table
staticprotectedinherited
Initial value:
= {
{"strain", "total_strain"},
{"mechanical_strain", "mechanical_strain"},
{"stress", "stress"},
{"cauchy_stress", "cauchy_stress"},
{"deformation_gradient", "deformation_gradient"},
{"pk1_stress", "pk1_stress"},
{"pk2_stress", "pk2_stress"},
{"small_stress", "small_stress"},
{"elastic_strain", "elastic_strain"},
{"plastic_strain", "plastic_strain"},
{"creep_strain", "creep_strain"},
{"creep_stress", "creep_stress"}}

Definition at line 42 of file QuasiStaticSolidMechanicsPhysicsBase.h.

Referenced by QuasiStaticSolidMechanicsPhysics::actOutputMatProp(), QuasiStaticSolidMechanicsPhysicsBase::addCartesianComponentOutput(), QuasiStaticSolidMechanicsPhysicsBase::outputPropertiesType(), and QuasiStaticSolidMechanicsPhysics::setupOutput().

◆ _rank_two_cylindrical_component_table

const std::map< std::string, std::pair< std::string, std::vector< std::string > > > QuasiStaticSolidMechanicsPhysicsBase::_rank_two_cylindrical_component_table
staticinherited
Initial value:
= {
{"axial",
{"AxialStress", {"stress", "strain", "plastic_strain", "creep_strain", "elastic_strain"}}},
{"hoop",
{"HoopStress", {"stress", "strain", "plastic_strain", "creep_strain", "elastic_strain"}}},
{"radial", {"RadialStress", {"stress", "strain"}}}}

Definition at line 33 of file QuasiStaticSolidMechanicsPhysicsBase.h.

Referenced by QuasiStaticSolidMechanicsPhysics::actOutputMatProp(), and QuasiStaticSolidMechanicsPhysicsBase::outputPropertiesType().

◆ _rank_two_directional_component_table

const std::map< std::string, std::pair< std::string, std::vector< std::string > > > QuasiStaticSolidMechanicsPhysicsBase::_rank_two_directional_component_table
staticinherited
Initial value:
= {
{"directional", {"Direction", {"stress", "strain"}}}}

Definition at line 31 of file QuasiStaticSolidMechanicsPhysicsBase.h.

Referenced by QuasiStaticSolidMechanicsPhysics::actOutputMatProp(), and QuasiStaticSolidMechanicsPhysicsBase::outputPropertiesType().

◆ _rank_two_invariant_table

const std::map< std::string, std::pair< std::string, std::vector< std::string > > > QuasiStaticSolidMechanicsPhysicsBase::_rank_two_invariant_table
staticinherited

◆ _rank_two_spherical_component_table

const std::map< std::string, std::pair< std::string, std::vector< std::string > > > QuasiStaticSolidMechanicsPhysicsBase::_rank_two_spherical_component_table
staticinherited
Initial value:
= {
{"spherical_hoop",
{"HoopStress", {"stress", "strain", "plastic_strain", "creep_strain", "elastic_strain"}}},
{"spherical_radial", {"RadialStress", {"stress", "strain"}}}}

Definition at line 35 of file QuasiStaticSolidMechanicsPhysicsBase.h.

Referenced by QuasiStaticSolidMechanicsPhysics::actOutputMatProp(), and QuasiStaticSolidMechanicsPhysicsBase::outputPropertiesType().

◆ _save_in

std::vector<AuxVariableName> QuasiStaticSolidMechanicsPhysics::_save_in
protectedinherited

◆ _spherical_center_point

Point QuasiStaticSolidMechanicsPhysics::_spherical_center_point
protectedinherited

center point for spherical stress/strain quantities

Definition at line 136 of file QuasiStaticSolidMechanicsPhysics.h.

Referenced by QuasiStaticSolidMechanicsPhysics::QuasiStaticSolidMechanicsPhysics().

◆ _spherical_center_point_valid

bool QuasiStaticSolidMechanicsPhysics::_spherical_center_point_valid
protectedinherited

booleans used to determine if spherical center point is passed

Definition at line 133 of file QuasiStaticSolidMechanicsPhysics.h.

Referenced by QuasiStaticSolidMechanicsPhysics::QuasiStaticSolidMechanicsPhysics().

◆ _strain

enum QuasiStaticSolidMechanicsPhysics::Strain QuasiStaticSolidMechanicsPhysics::_strain
protectedinherited

◆ _strain_and_increment

enum QuasiStaticSolidMechanicsPhysics::StrainAndIncrement QuasiStaticSolidMechanicsPhysics::_strain_and_increment
protectedinherited

◆ _subdomain_id_union

std::set<SubdomainID> QuasiStaticSolidMechanicsPhysics::_subdomain_id_union
protectedinherited

set generated from the combined block restrictions of all SolidMechanics/Master action blocks

Definition at line 74 of file QuasiStaticSolidMechanicsPhysics.h.

Referenced by QuasiStaticSolidMechanicsPhysics::actGatherActionParameters().

◆ _subdomain_ids

std::set<SubdomainID> QuasiStaticSolidMechanicsPhysics::_subdomain_ids
protectedinherited

set generated from the passed in vector of subdomain names

Definition at line 71 of file QuasiStaticSolidMechanicsPhysics.h.

Referenced by QuasiStaticSolidMechanicsPhysics::actEigenstrainNames(), and QuasiStaticSolidMechanicsPhysics::actSubdomainChecks().

◆ _subdomain_names

std::vector<SubdomainName> QuasiStaticSolidMechanicsPhysics::_subdomain_names
protectedinherited

if this vector is not empty the variables, kernels and materials are restricted to these subdomains

Definition at line 68 of file QuasiStaticSolidMechanicsPhysics.h.

Referenced by QuasiStaticSolidMechanicsPhysics::actLagrangianKernelStrain(), and QuasiStaticSolidMechanicsPhysics::actSubdomainChecks().

◆ _targets

std::vector<FunctionName> QuasiStaticSolidMechanicsPhysics::_targets
protectedinherited

◆ _use_ad

const bool QuasiStaticSolidMechanicsPhysicsBase::_use_ad
protectedinherited

◆ _use_displaced_mesh

bool QuasiStaticSolidMechanicsPhysics::_use_displaced_mesh
protectedinherited

◆ _verbose

bool QuasiStaticSolidMechanicsPhysics::_verbose
protectedinherited

The documentation for this class was generated from the following files: