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

Protected Member Functions

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

Protected Attributes

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 23 of file WeakPlaneStress.h.

Constructor & Destructor Documentation

◆ WeakPlaneStress()

WeakPlaneStress::WeakPlaneStress ( const InputParameters &  parameters)

Definition at line 53 of file WeakPlaneStress.C.

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

Member Function Documentation

◆ computeQpJacobian()

Real WeakPlaneStress::computeQpJacobian ( )
overrideprotectedvirtual

Definition at line 92 of file WeakPlaneStress.C.

93 {
94  return _Jacobian_mult[_qp](_direction, _direction, _direction, _direction) * _test[_i][_qp] *
95  _phi[_j][_qp];
96 }
const MaterialProperty< RankFourTensor > & _Jacobian_mult
const unsigned int _direction

◆ computeQpOffDiagJacobian()

Real WeakPlaneStress::computeQpOffDiagJacobian ( unsigned int  jvar)
overrideprotectedvirtual

Definition at line 99 of file WeakPlaneStress.C.

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

◆ computeQpResidual()

Real WeakPlaneStress::computeQpResidual ( )
overrideprotectedvirtual

Definition at line 86 of file WeakPlaneStress.C.

87 {
88  return _stress[_qp](_direction, _direction) * _test[_i][_qp];
89 }
const MaterialProperty< RankTwoTensor > & _stress
const unsigned int _direction

Member Data Documentation

◆ _base_name

std::string WeakPlaneStress::_base_name
protected

Definition at line 33 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 49 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 41 of file WeakPlaneStress.h.

Referenced by computeQpOffDiagJacobian(), and WeakPlaneStress().

◆ _disp_var

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

Definition at line 43 of file WeakPlaneStress.h.

Referenced by computeQpOffDiagJacobian(), and WeakPlaneStress().

◆ _Jacobian_mult

const MaterialProperty<RankFourTensor>& WeakPlaneStress::_Jacobian_mult
protected

Definition at line 36 of file WeakPlaneStress.h.

Referenced by computeQpJacobian(), and computeQpOffDiagJacobian().

◆ _ndisp

unsigned int WeakPlaneStress::_ndisp
protected

Definition at line 42 of file WeakPlaneStress.h.

Referenced by computeQpOffDiagJacobian(), and WeakPlaneStress().

◆ _stress

const MaterialProperty<RankTwoTensor>& WeakPlaneStress::_stress
protected

Definition at line 35 of file WeakPlaneStress.h.

Referenced by computeQpResidual().

◆ _temp_coupled

const bool WeakPlaneStress::_temp_coupled
protected

Definition at line 45 of file WeakPlaneStress.h.

Referenced by computeQpOffDiagJacobian().

◆ _temp_var

const unsigned int WeakPlaneStress::_temp_var
protected

Definition at line 46 of file WeakPlaneStress.h.

Referenced by computeQpOffDiagJacobian().


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