www.mooseframework.org
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
WeakPlaneStress Class Reference

#include <WeakPlaneStress.h>

Inheritance diagram for WeakPlaneStress:
[legend]

Public Types

typedef DerivativeMaterialPropertyNameInterface::SymbolName SymbolName
 

Public Member Functions

 WeakPlaneStress (const InputParameters &parameters)
 
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialProperty (const std::string &name)
 
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialPropertyByName (const std::string &name)
 
void validateDerivativeMaterialPropertyBase (const std::string &base)
 
const MaterialPropertyName derivativePropertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName derivativePropertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName derivativePropertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName derivativePropertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, unsigned int v2, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, unsigned int v1, unsigned int v2=libMesh::invalid_uint, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, unsigned int v2, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, unsigned int v1, unsigned int v2=libMesh::invalid_uint, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
void validateCoupling (const MaterialPropertyName &base, const std::vector< VariableName > &c, bool validate_aux=true)
 
void validateCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateCoupling (const MaterialPropertyName &base, const std::vector< VariableName > &c, bool validate_aux=true)
 
void validateCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateNonlinearCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateNonlinearCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Member Functions

virtual Real computeQpResidual () override
 
virtual Real computeQpJacobian () override
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar) override
 

Protected Attributes

const std::string _base_name
 Base name of the material system that this kernel applies to. More...
 
const MaterialProperty< RankTwoTensor > & _stress
 The stress tensor that provides the out-of-plane stress. More...
 
const MaterialProperty< RankFourTensor > & _Jacobian_mult
 
const unsigned int _direction
 The direction of the out-of-plane strain variable. More...
 
const bool _disp_coupled
 Coupled displacement variables. More...
 
unsigned int _ndisp
 Number of displacement variables. More...
 
std::vector< unsigned int_disp_var
 Variable numbers of the displacement variables. More...
 
const bool _temp_coupled
 
const unsigned int _temp_var
 
std::vector< const MaterialProperty< RankTwoTensor > * > _deigenstrain_dT
 d(strain)/d(temperature), if computed by ComputeThermalExpansionEigenstrain More...
 

Detailed Description

Definition at line 17 of file WeakPlaneStress.h.

Constructor & Destructor Documentation

◆ WeakPlaneStress()

WeakPlaneStress::WeakPlaneStress ( const InputParameters parameters)

Definition at line 48 of file WeakPlaneStress.C.

50  _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
51  _stress(getMaterialProperty<RankTwoTensor>(_base_name + "stress")),
52  _Jacobian_mult(getMaterialProperty<RankFourTensor>(_base_name + "Jacobian_mult")),
53  _direction(getParam<MooseEnum>("out_of_plane_strain_direction")),
54  _disp_coupled(isCoupled("displacements")),
55  _ndisp(_disp_coupled ? coupledComponents("displacements") : 0),
57  _temp_coupled(isCoupled("temperature")),
58  _temp_var(_temp_coupled ? coupled("temperature") : 0)
59 {
60  if (_disp_coupled)
61  for (unsigned int i = 0; i < _ndisp; ++i)
62  _disp_var[i] = coupled("displacements", i);
63 
64  if (_temp_coupled)
65  {
66  for (auto eigenstrain_name : getParam<std::vector<MaterialPropertyName>>("eigenstrain_names"))
67  _deigenstrain_dT.push_back(&getMaterialPropertyDerivative<RankTwoTensor>(
68  eigenstrain_name, coupledName("temperature", 0)));
69  }
70 
71  // Checking for consistency between mesh size and length of the provided displacements vector
72  if (_disp_coupled && _ndisp != _mesh.dimension())
73  mooseError("The number of displacement variables supplied must match the mesh dimension.");
74 }
void mooseError(Args &&... args)
const MaterialProperty< RankFourTensor > & _Jacobian_mult
std::vector< const MaterialProperty< RankTwoTensor > * > _deigenstrain_dT
d(strain)/d(temperature), if computed by ComputeThermalExpansionEigenstrain
std::vector< unsigned int > _disp_var
Variable numbers of the displacement variables.
const unsigned int _temp_var
unsigned int _ndisp
Number of displacement variables.
const MaterialProperty< RankTwoTensor > & _stress
The stress tensor that provides the out-of-plane stress.
const bool _temp_coupled
const unsigned int _direction
The direction of the out-of-plane strain variable.
const std::string _base_name
Base name of the material system that this kernel applies to.
const bool _disp_coupled
Coupled displacement variables.

Member Function Documentation

◆ computeQpJacobian()

Real WeakPlaneStress::computeQpJacobian ( )
overrideprotectedvirtual

Definition at line 83 of file WeakPlaneStress.C.

84 {
85  return _Jacobian_mult[_qp](_direction, _direction, _direction, _direction) * _test[_i][_qp] *
86  _phi[_j][_qp];
87 }
const MaterialProperty< RankFourTensor > & _Jacobian_mult
const unsigned int _direction
The direction of the out-of-plane strain variable.

◆ computeQpOffDiagJacobian()

Real WeakPlaneStress::computeQpOffDiagJacobian ( unsigned int  jvar)
overrideprotectedvirtual

Definition at line 90 of file WeakPlaneStress.C.

91 {
92  Real val = 0.0;
93 
94  // off-diagonal Jacobian with respect to a coupled displacement component
95  if (_disp_coupled)
96  {
97  for (unsigned int coupled_direction = 0; coupled_direction < _ndisp; ++coupled_direction)
98  {
99  if (jvar == _disp_var[coupled_direction])
100  {
101  unsigned int coupled_direction_index = 0;
102  switch (_direction)
103  {
104  case 0: // x
105  {
106  if (coupled_direction == 0)
107  coupled_direction_index = 1;
108  else
109  coupled_direction_index = 2;
110  break;
111  }
112  case 1: // y
113  {
114  if (coupled_direction == 0)
115  coupled_direction_index = 0;
116  else
117  coupled_direction_index = 2;
118  break;
119  }
120  default: // z
121  {
122  coupled_direction_index = coupled_direction;
123  break;
124  }
125  }
126 
127  val = _Jacobian_mult[_qp](
128  _direction, _direction, coupled_direction_index, coupled_direction_index) *
129  _test[_i][_qp] * _grad_phi[_j][_qp](coupled_direction_index);
130  }
131  }
132  }
133 
134  // off-diagonal Jacobian with respect to a coupled temperature variable
135  if (_temp_coupled && jvar == _temp_var)
136  {
137  RankTwoTensor total_deigenstrain_dT;
138  for (const auto deigenstrain_dT : _deigenstrain_dT)
139  total_deigenstrain_dT += (*deigenstrain_dT)[_qp];
140 
141  Real sum = 0.0;
142  for (unsigned int i = 0; i < 3; ++i)
143  sum += _Jacobian_mult[_qp](_direction, _direction, i, i) * total_deigenstrain_dT(i, i);
144 
145  val = -sum * _test[_i][_qp] * _phi[_j][_qp];
146  }
147 
148  return val;
149 }
const MaterialProperty< RankFourTensor > & _Jacobian_mult
std::vector< const MaterialProperty< RankTwoTensor > * > _deigenstrain_dT
d(strain)/d(temperature), if computed by ComputeThermalExpansionEigenstrain
std::vector< unsigned int > _disp_var
Variable numbers of the displacement variables.
const unsigned int _temp_var
unsigned int _ndisp
Number of displacement variables.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const bool _temp_coupled
const unsigned int _direction
The direction of the out-of-plane strain variable.
const bool _disp_coupled
Coupled displacement variables.

◆ computeQpResidual()

Real WeakPlaneStress::computeQpResidual ( )
overrideprotectedvirtual

Definition at line 77 of file WeakPlaneStress.C.

78 {
79  return _stress[_qp](_direction, _direction) * _test[_i][_qp];
80 }
const MaterialProperty< RankTwoTensor > & _stress
The stress tensor that provides the out-of-plane stress.
const unsigned int _direction
The direction of the out-of-plane strain variable.

◆ validParams()

InputParameters WeakPlaneStress::validParams ( )
static

Definition at line 21 of file WeakPlaneStress.C.

22 {
24  params.addClassDescription("Plane stress kernel to provide out-of-plane strain contribution.");
25  params.addCoupledVar("displacements",
26  "The string of displacements suitable for the problem statement");
27  params.addCoupledVar("temperature",
28  "The name of the temperature variable used in the "
29  "ComputeThermalExpansionEigenstrain. (Not required for "
30  "simulations without temperature coupling.)");
31  params.addParam<std::vector<MaterialPropertyName>>(
32  "eigenstrain_names",
33  {},
34  "List of eigenstrains used in the strain calculation. Used for computing their derivaties "
35  "for off-diagonal Jacobian terms.");
36  params.addParam<std::string>("base_name", "Material property base name");
37 
38  MooseEnum direction("x y z", "z");
39  params.addParam<MooseEnum>("out_of_plane_strain_direction",
40  direction,
41  "The direction of the out-of-plane strain variable");
42 
43  params.set<bool>("use_displaced_mesh") = false;
44 
45  return params;
46 }
static InputParameters validParams()
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
T & set(const std::string &name, bool quiet_mode=false)
void addCoupledVar(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)

Member Data Documentation

◆ _base_name

const std::string WeakPlaneStress::_base_name
protected

Base name of the material system that this kernel applies to.

Definition at line 30 of file WeakPlaneStress.h.

◆ _deigenstrain_dT

std::vector<const MaterialProperty<RankTwoTensor> *> WeakPlaneStress::_deigenstrain_dT
protected

d(strain)/d(temperature), if computed by ComputeThermalExpansionEigenstrain

Definition at line 52 of file WeakPlaneStress.h.

Referenced by computeQpOffDiagJacobian(), and WeakPlaneStress().

◆ _direction

const unsigned int WeakPlaneStress::_direction
protected

The direction of the out-of-plane strain variable.

Definition at line 37 of file WeakPlaneStress.h.

Referenced by computeQpJacobian(), computeQpOffDiagJacobian(), and computeQpResidual().

◆ _disp_coupled

const bool WeakPlaneStress::_disp_coupled
protected

Coupled displacement variables.

Definition at line 40 of file WeakPlaneStress.h.

Referenced by computeQpOffDiagJacobian(), and WeakPlaneStress().

◆ _disp_var

std::vector<unsigned int> WeakPlaneStress::_disp_var
protected

Variable numbers of the displacement variables.

Definition at line 46 of file WeakPlaneStress.h.

Referenced by computeQpOffDiagJacobian(), and WeakPlaneStress().

◆ _Jacobian_mult

const MaterialProperty<RankFourTensor>& WeakPlaneStress::_Jacobian_mult
protected

Definition at line 34 of file WeakPlaneStress.h.

Referenced by computeQpJacobian(), and computeQpOffDiagJacobian().

◆ _ndisp

unsigned int WeakPlaneStress::_ndisp
protected

Number of displacement variables.

Definition at line 43 of file WeakPlaneStress.h.

Referenced by computeQpOffDiagJacobian(), and WeakPlaneStress().

◆ _stress

const MaterialProperty<RankTwoTensor>& WeakPlaneStress::_stress
protected

The stress tensor that provides the out-of-plane stress.

Definition at line 33 of file WeakPlaneStress.h.

Referenced by computeQpResidual().

◆ _temp_coupled

const bool WeakPlaneStress::_temp_coupled
protected

Definition at line 48 of file WeakPlaneStress.h.

Referenced by computeQpOffDiagJacobian(), and WeakPlaneStress().

◆ _temp_var

const unsigned int WeakPlaneStress::_temp_var
protected

Definition at line 49 of file WeakPlaneStress.h.

Referenced by computeQpOffDiagJacobian().


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