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 
42  template <typename T, typename T2>
43  bool setupOutput(std::string out, T table, T2 setup);
44 
46  std::vector<VariableName> _displacements;
47 
49  unsigned int _ndisp;
50 
52  std::vector<VariableName> _coupled_displacements;
54 
56  std::vector<AuxVariableName> _save_in;
57  std::vector<AuxVariableName> _diag_save_in;
59 
61 
63  std::vector<SubdomainName> _subdomain_names;
64 
66  std::set<SubdomainID> _subdomain_ids;
67 
69  std::set<SubdomainID> _subdomain_id_union;
70 
72  enum class Strain
73  {
74  Small,
75  Finite
76  } _strain;
77 
79  enum class StrainAndIncrement
80  {
81  SmallTotal,
86 
88  enum class PlanarFormulation
89  {
90  None,
95 
97  {
98  x,
99  y,
100  z
101  };
102 
104 
106  const std::string _base_name;
107 
110 
112  std::vector<std::string> _generate_output;
115 
120  bool _verbose;
121 
125  Point _direction;
126 
129 
132 
134  const bool _auto_eigenstrain;
135 
136  std::vector<MaterialPropertyName> _eigenstrain_names;
137 
140 
143 
145  enum class LKFormulation
146  {
147  Total,
148  Updated
149  };
151 
154 
157 
158  // Helper to translate into MOOSE talk
159  static const std::map<unsigned int, std::string> _order_mapper;
160  // Name of the homogenization scalar variable
161  const std::string _hname = "hvar";
162  // Name of the integrator
163  const std::string _integrator_name = "integrator";
164  // Name of the homogenization strain
165  const std::string _homogenization_strain_name = "homogenization_gradient";
166  // Other homogenization info
168  std::vector<FunctionName> _targets;
169 };
170 
171 template <typename T, typename T2>
172 bool
173 QuasiStaticSolidMechanicsPhysics::setupOutput(std::string out, T table, T2 setup)
174 {
175  for (const auto & t1 : table)
176  {
177  // find the officially supported properties
178  for (const auto & t2 : t1.second.second)
179  if (t1.first + '_' + t2 == out)
180  {
181  const auto it = _rank_two_cartesian_component_table.find(t2);
182  if (it != _rank_two_cartesian_component_table.end())
183  {
184  setup(it->second, t1.second.first);
185  return true;
186  }
187  else
188  mooseError("Internal error. The permitted tensor shortcuts must be keys in the "
189  "'_rank_two_cartesian_component_table'.");
190  }
191 
192  // check for custom properties
193  auto prefix = t1.first + '_';
194  if (out.substr(0, prefix.length()) == prefix)
195  {
196  setup(out.substr(prefix.length()), t1.second.first);
197  return true;
198  }
199  }
200 
201  return false;
202 }
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 ...
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
bool _lk_locking
Simplified volumetric locking correction flag for new kernels.
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.
void setup(EquationSystems &systems, Mesh &mesh, GetPot &args)
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 ...
bool _lk_homogenization
Flag indicating if the homogenization system is present for new kernels.