https://mooseframework.inl.gov
QuasiStaticSolidMechanicsPhysics.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
13 #include "libmesh/point.h"
14 
16 {
17 public:
19 
21 
22  virtual void act();
23 
24 protected:
25  void actSubdomainChecks();
26  void actOutputGeneration();
27  void actEigenstrainNames();
28  void actOutputMatProp();
33 
34  virtual std::string getKernelType();
35  virtual InputParameters getKernelParameters(std::string type);
36 
40  std::string remapCompatOutputProp(const std::string & prop_name) const;
41 
47  template <typename T, typename T2>
48  bool setupOutput(std::string out, T table, T2 setup);
49 
51  std::vector<VariableName> _displacements;
52 
54  unsigned int _ndisp;
55 
57  std::vector<VariableName> _coupled_displacements;
59 
61  std::vector<AuxVariableName> _save_in;
62  std::vector<AuxVariableName> _diag_save_in;
64 
66 
68  std::vector<SubdomainName> _subdomain_names;
69 
71  std::set<SubdomainID> _subdomain_ids;
72 
74  std::set<SubdomainID> _subdomain_id_union;
75 
77  enum class Strain
78  {
79  Small,
80  Finite
81  } _strain;
82 
84  enum class StrainAndIncrement
85  {
86  SmallTotal,
91 
93  enum class PlanarFormulation
94  {
95  None,
100 
102  {
103  x,
104  y,
105  z
106  };
107 
109 
111  const std::string _base_name;
112 
115 
117  std::vector<std::string> _generate_output;
120 
125  bool _verbose;
126 
130  Point _direction;
131 
134 
137 
139  const bool _auto_eigenstrain;
140 
141  std::vector<MaterialPropertyName> _eigenstrain_names;
142 
146 
149 
152 
154  enum class LKFormulation
155  {
156  Total,
157  Updated
158  };
160 
162  const bool _lk_locking;
163 
166 
167  // Helper to translate into MOOSE talk
168  static const std::map<unsigned int, std::string> _order_mapper;
169  // Name of the homogenization scalar variable
170  const std::string _hname = "hvar";
171  // Name of the integrator
172  const std::string _integrator_name = "integrator";
173  // Name of the homogenization strain
174  const std::string _homogenization_strain_name = "homogenization_gradient";
175  // Other homogenization info
177  std::vector<FunctionName> _targets;
179  const bool _lk_h_off_jac;
180 };
181 
182 template <typename T, typename T2>
183 bool
184 QuasiStaticSolidMechanicsPhysics::setupOutput(std::string out, T table, T2 setup)
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 }
const bool _lk_large_kinematics
Simplified flag for small/large deformations, Lagrangian kernel system.
static const std::map< unsigned int, std::string > _order_mapper
std::set< SubdomainID > _subdomain_id_union
set generated from the combined block restrictions of all SolidMechanics/Master action blocks ...
enum QuasiStaticSolidMechanicsPhysics::StrainAndIncrement _strain_and_increment
std::vector< AuxVariableName > _save_in
residual debugging
virtual InputParameters getKernelParameters(std::string type)
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 ...
const bool _compatibility_mode
OLD-compat shim: auto-configures the Lagrangian kernel system to reproduce StressDivergenceTensors + ...
const double T
std::vector< AuxVariableName > _diag_save_in
std::set< SubdomainID > _subdomain_ids
set generated from the passed in vector of subdomain names
unsigned int _ndisp
Number of displacement variables.
LKFormulation
New kernel system kinematics types.
const bool _auto_eigenstrain
automatically gather names of eigenstrain tensors provided by simulation objects
std::vector< VariableName > _displacements
displacement variables
std::vector< std::string > _generate_output
output materials to generate scalar stress/strain tensor quantities
enum QuasiStaticSolidMechanicsPhysics::PlanarFormulation _planar_formulation
QuasiStaticSolidMechanicsPhysics(const InputParameters &params)
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
bool _use_displaced_mesh
use displaced mesh (true unless _strain is SMALL)
enum QuasiStaticSolidMechanicsPhysics::Strain _strain
std::vector< VariableName > _coupled_displacements
Coupled displacement variables.
bool _cylindrical_axis_point1_valid
booleans used to determine if cylindrical axis points are passed
const std::string & type() const
static std::map< std::string, std::string > _rank_two_cartesian_component_table
std::vector< MaterialPropertyName > _eigenstrain_names
CoordinateSystemType
OStreamProxy out
const bool _lagrangian_kernels
New or old kernel system. True if new_system = true OR compatibility_mode = true. ...
void setup(EquationSystems &systems, Mesh &mesh, GetPot &args)
const bool _lk_locking
Simplified volumetric locking correction flag for new kernels.
void mooseError(Args &&... args) const
Point _spherical_center_point
center point for spherical stress/strain quantities
bool _spherical_center_point_valid
booleans used to determine if spherical center point is passed
const std::string _base_name
base name for the current master action block
PlanarFormulation
use an out of plane stress/strain formulation
Point _cylindrical_axis_point1
points used to determine axis of rotation for cylindrical stress/strain quantities ...
const bool _lk_h_off_jac
Whether to use the off diagonal scalar jacobian for the homogenization system.
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...
bool _lk_homogenization
Flag indicating if the homogenization system is present for new kernels.