www.mooseframework.org
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 Member Functions

 WeakPlaneStress (const InputParameters &parameters)
 

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
 
const MaterialProperty< RankTwoTensor > & _stress
 
const MaterialProperty< RankFourTensor > & _Jacobian_mult
 
const unsigned int _direction
 
const bool _disp_coupled
 Coupled displacement variables. More...
 
unsigned int _ndisp
 
std::vector< unsigned int > _disp_var
 
const bool _temp_coupled
 
const unsigned int _temp_var
 
const MaterialProperty< RankTwoTensor > *const _deigenstrain_dT
 d(strain)/d(temperature), if computed by ComputeThermalExpansionEigenstrain More...
 

Detailed Description

Definition at line 26 of file WeakPlaneStress.h.

Constructor & Destructor Documentation

◆ WeakPlaneStress()

WeakPlaneStress::WeakPlaneStress ( const InputParameters &  parameters)

Definition at line 54 of file WeakPlaneStress.C.

55  : DerivativeMaterialInterface<Kernel>(parameters),
56  _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
57  _stress(getMaterialProperty<RankTwoTensor>(_base_name + "stress")),
58  _Jacobian_mult(getMaterialProperty<RankFourTensor>(_base_name + "Jacobian_mult")),
59  _direction(parameters.isParamSetByUser("direction")
60  ? getParam<MooseEnum>("direction")
61  : getParam<MooseEnum>("out_of_plane_strain_direction")),
62  _disp_coupled(isCoupled("displacements")),
63  _ndisp(_disp_coupled ? coupledComponents("displacements") : 0),
65  _temp_coupled(isCoupled("temperature")),
66  _temp_var(_temp_coupled ? coupled("temperature") : 0),
67  _deigenstrain_dT(_temp_coupled ? &getMaterialPropertyDerivative<RankTwoTensor>(
68  getParam<std::string>("thermal_eigenstrain_name"),
69  getVar("temperature", 0)->name())
70  : nullptr)
71 {
72  if (_disp_coupled)
73  for (unsigned int i = 0; i < _ndisp; ++i)
74  _disp_var[i] = coupled("displacements", i);
75 
76  if (parameters.isParamSetByUser("direction") &&
77  parameters.isParamSetByUser("out_of_plane_strain_direction"))
78  mooseError("Cannot specify both 'direction' and 'out_of_plane_strain_direction'! Use "
79  "'out_of_plane_strain_direction'.");
80 
81  // Checking for consistency between mesh size and length of the provided displacements vector
82  if (_disp_coupled && _ndisp != _mesh.dimension())
83  mooseError("The number of displacement variables supplied must match the mesh dimension.");
84 }

Member Function Documentation

◆ computeQpJacobian()

Real WeakPlaneStress::computeQpJacobian ( )
overrideprotectedvirtual

Definition at line 93 of file WeakPlaneStress.C.

94 {
95  return _Jacobian_mult[_qp](_direction, _direction, _direction, _direction) * _test[_i][_qp] *
96  _phi[_j][_qp];
97 }

◆ computeQpOffDiagJacobian()

Real WeakPlaneStress::computeQpOffDiagJacobian ( unsigned int  jvar)
overrideprotectedvirtual

Definition at line 100 of file WeakPlaneStress.C.

101 {
102  Real val = 0.0;
103 
104  // off-diagonal Jacobian with respect to a coupled displacement component
105  if (_disp_coupled)
106  {
107  for (unsigned int coupled_direction = 0; coupled_direction < _ndisp; ++coupled_direction)
108  {
109  if (jvar == _disp_var[coupled_direction])
110  {
111  unsigned int coupled_direction_index = 0;
112  switch (_direction)
113  {
114  case 0: // x
115  {
116  if (coupled_direction == 0)
117  coupled_direction_index = 1;
118  else
119  coupled_direction_index = 2;
120  break;
121  }
122  case 1: // y
123  {
124  if (coupled_direction == 0)
125  coupled_direction_index = 0;
126  else
127  coupled_direction_index = 2;
128  break;
129  }
130  default: // z
131  {
132  coupled_direction_index = coupled_direction;
133  break;
134  }
135  }
136 
137  val = _Jacobian_mult[_qp](
138  _direction, _direction, coupled_direction_index, coupled_direction_index) *
139  _test[_i][_qp] * _grad_phi[_j][_qp](coupled_direction_index);
140  }
141  }
142  }
143 
144  // off-diagonal Jacobian with respect to a coupled temperature variable
145  if (_temp_coupled && jvar == _temp_var)
146  {
147  Real sum = 0.0;
148  for (unsigned int i = 0; i < 3; ++i)
149  sum += _Jacobian_mult[_qp](_direction, _direction, i, i) * (*_deigenstrain_dT)[_qp](i, i);
150 
151  val = -sum * _test[_i][_qp] * _phi[_j][_qp];
152  }
153 
154  return val;
155 }

◆ computeQpResidual()

Real WeakPlaneStress::computeQpResidual ( )
overrideprotectedvirtual

Definition at line 87 of file WeakPlaneStress.C.

88 {
89  return _stress[_qp](_direction, _direction) * _test[_i][_qp];
90 }

◆ validParams()

InputParameters WeakPlaneStress::validParams ( )
static

Definition at line 23 of file WeakPlaneStress.C.

24 {
25  InputParameters params = Kernel::validParams();
26  params.addClassDescription("Plane stress kernel to provide out-of-plane strain contribution.");
27  params.addCoupledVar("displacements",
28  "The string of displacements suitable for the problem statement");
29  params.addCoupledVar("temperature",
30  "The name of the temperature variable used in the "
31  "ComputeThermalExpansionEigenstrain. (Not required for "
32  "simulations without temperature coupling.)");
33  params.addParam<std::string>(
34  "thermal_eigenstrain_name",
35  "thermal_eigenstrain",
36  "The eigenstrain_name used in the ComputeThermalExpansionEigenstrain.");
37  params.addParam<std::string>("base_name", "Material property base name");
38 
39  MooseEnum direction("x y z", "z");
40  params.addDeprecatedParam<MooseEnum>(
41  "direction",
42  direction,
43  "The direction of the out-of-plane strain variable",
44  "Use the new parameter name 'out_of_plane_strain_direction'");
45  params.addParam<MooseEnum>("out_of_plane_strain_direction",
46  direction,
47  "The direction of the out-of-plane strain variable");
48 
49  params.set<bool>("use_displaced_mesh") = false;
50 
51  return params;
52 }

Member Data Documentation

◆ _base_name

const std::string WeakPlaneStress::_base_name
protected

Definition at line 38 of file WeakPlaneStress.h.

◆ _deigenstrain_dT

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

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

Definition at line 54 of file WeakPlaneStress.h.

◆ _direction

const unsigned int WeakPlaneStress::_direction
protected

◆ _disp_coupled

const bool WeakPlaneStress::_disp_coupled
protected

Coupled displacement variables.

Definition at line 46 of file WeakPlaneStress.h.

Referenced by computeQpOffDiagJacobian(), and WeakPlaneStress().

◆ _disp_var

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

Definition at line 48 of file WeakPlaneStress.h.

Referenced by computeQpOffDiagJacobian(), and WeakPlaneStress().

◆ _Jacobian_mult

const MaterialProperty<RankFourTensor>& WeakPlaneStress::_Jacobian_mult
protected

Definition at line 41 of file WeakPlaneStress.h.

Referenced by computeQpJacobian(), and computeQpOffDiagJacobian().

◆ _ndisp

unsigned int WeakPlaneStress::_ndisp
protected

Definition at line 47 of file WeakPlaneStress.h.

Referenced by computeQpOffDiagJacobian(), and WeakPlaneStress().

◆ _stress

const MaterialProperty<RankTwoTensor>& WeakPlaneStress::_stress
protected

Definition at line 40 of file WeakPlaneStress.h.

Referenced by computeQpResidual().

◆ _temp_coupled

const bool WeakPlaneStress::_temp_coupled
protected

Definition at line 50 of file WeakPlaneStress.h.

Referenced by computeQpOffDiagJacobian().

◆ _temp_var

const unsigned int WeakPlaneStress::_temp_var
protected

Definition at line 51 of file WeakPlaneStress.h.

Referenced by computeQpOffDiagJacobian().


The documentation for this class was generated from the following files:
WeakPlaneStress::_disp_coupled
const bool _disp_coupled
Coupled displacement variables.
Definition: WeakPlaneStress.h:46
WeakPlaneStress::_temp_coupled
const bool _temp_coupled
Definition: WeakPlaneStress.h:50
WeakPlaneStress::_base_name
const std::string _base_name
Definition: WeakPlaneStress.h:38
WeakPlaneStress::_ndisp
unsigned int _ndisp
Definition: WeakPlaneStress.h:47
WeakPlaneStress::_disp_var
std::vector< unsigned int > _disp_var
Definition: WeakPlaneStress.h:48
WeakPlaneStress::_deigenstrain_dT
const MaterialProperty< RankTwoTensor > *const _deigenstrain_dT
d(strain)/d(temperature), if computed by ComputeThermalExpansionEigenstrain
Definition: WeakPlaneStress.h:54
WeakPlaneStress::_temp_var
const unsigned int _temp_var
Definition: WeakPlaneStress.h:51
validParams
InputParameters validParams()
name
const std::string name
Definition: Setup.h:21
WeakPlaneStress::_Jacobian_mult
const MaterialProperty< RankFourTensor > & _Jacobian_mult
Definition: WeakPlaneStress.h:41
WeakPlaneStress::_direction
const unsigned int _direction
Definition: WeakPlaneStress.h:43
WeakPlaneStress::_stress
const MaterialProperty< RankTwoTensor > & _stress
Definition: WeakPlaneStress.h:40
RankTwoTensorTempl< Real >