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

#include <GeneralizedPlaneStrainOffDiag.h>

Inheritance diagram for GeneralizedPlaneStrainOffDiag:
[legend]

Public Member Functions

 GeneralizedPlaneStrainOffDiag (const InputParameters &parameters)
 

Protected Member Functions

Real computeQpResidual () override
 
void computeOffDiagJacobianScalar (unsigned int jvar) override
 These methods are used to compute the off-diagonal jacobian for the coupling between scalar variable strain_yy or strain_zz and nonlinear variables displacements and temperature. More...
 
virtual void computeDispOffDiagJacobianScalar (unsigned int component, unsigned int jvar)
 
virtual void computeTempOffDiagJacobianScalar (unsigned int jvar)
 

Protected Attributes

std::string _base_name
 
const MaterialProperty< RankFourTensor > & _Jacobian_mult
 
const std::vector< MaterialPropertyName > _eigenstrain_names
 
std::vector< const MaterialProperty< RankTwoTensor > * > _deigenstrain_dT
 
unsigned int _scalar_out_of_plane_strain_var
 
const SubblockIndexProvider_subblock_id_provider
 
const unsigned int _scalar_var_id
 
MooseVariable * _temp_var
 
const unsigned int _num_disp_var
 
std::vector< MooseVariable * > _disp_var
 
unsigned int _scalar_out_of_plane_strain_direction
 

Detailed Description

Definition at line 25 of file GeneralizedPlaneStrainOffDiag.h.

Constructor & Destructor Documentation

◆ GeneralizedPlaneStrainOffDiag()

GeneralizedPlaneStrainOffDiag::GeneralizedPlaneStrainOffDiag ( const InputParameters &  parameters)

Definition at line 52 of file GeneralizedPlaneStrainOffDiag.C.

53  : DerivativeMaterialInterface<Kernel>(parameters),
54  _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
55  _Jacobian_mult(getMaterialProperty<RankFourTensor>(_base_name + "Jacobian_mult")),
56  _eigenstrain_names(getParam<std::vector<MaterialPropertyName>>("eigenstrain_names")),
58  _scalar_out_of_plane_strain_var(coupledScalar("scalar_out_of_plane_strain")),
59  _subblock_id_provider(isParamValid("subblock_index_provider")
60  ? &getUserObject<SubblockIndexProvider>("subblock_index_provider")
61  : nullptr),
62  _scalar_var_id(isParamValid("scalar_out_of_plane_strain_index")
63  ? getParam<unsigned int>("scalar_out_of_plane_strain_index")
64  : 0),
65  _temp_var(
66  isParamValid("temperature")
67  ? &_subproblem.getStandardVariable(_tid, getParam<NonlinearVariableName>("temperature"))
68  : NULL),
69  _num_disp_var(getParam<std::vector<NonlinearVariableName>>("displacements").size()),
70  _scalar_out_of_plane_strain_direction(getParam<MooseEnum>("out_of_plane_direction"))
71 {
72  const std::vector<NonlinearVariableName> & nl_vnames(
73  getParam<std::vector<NonlinearVariableName>>("displacements"));
74 
76  mooseError("For 1D axisymmetric or 2D cartesian simulations where the out-of-plane direction "
77  "is z, the number of supplied displacements to GeneralizedPlaneStrainOffDiag must "
78  "be less than three.");
80  mooseError("For 2D cartesian simulations where the out-of-plane direction is x or y the number "
81  "of supplied displacements must be three.");
82 
83  for (unsigned int i = 0; i < _num_disp_var; ++i)
84  _disp_var.push_back(&_subproblem.getStandardVariable(_tid, nl_vnames[i]));
85 
86  for (unsigned int i = 0; i < _deigenstrain_dT.size(); ++i)
87  _deigenstrain_dT[i] = &getMaterialPropertyDerivative<RankTwoTensor>(
89 
90  if (isParamValid("scalar_variable_index_provider") &&
91  !isParamValid("scalar_out_of_plane_strain_index"))
92  mooseError("scalar_out_of_plane_strain_index should be provided if more "
93  "than one is available");
94 }
const std::vector< MaterialPropertyName > _eigenstrain_names
std::vector< MooseVariable * > _disp_var
std::vector< const MaterialProperty< RankTwoTensor > * > _deigenstrain_dT
const MaterialProperty< RankFourTensor > & _Jacobian_mult
const SubblockIndexProvider * _subblock_id_provider

Member Function Documentation

◆ computeDispOffDiagJacobianScalar()

void GeneralizedPlaneStrainOffDiag::computeDispOffDiagJacobianScalar ( unsigned int  component,
unsigned int  jvar 
)
protectedvirtual

Definition at line 117 of file GeneralizedPlaneStrainOffDiag.C.

Referenced by computeOffDiagJacobianScalar().

119 {
121  {
122  DenseMatrix<Number> & ken = _assembly.jacobianBlock(_var.number(), jvar);
123  DenseMatrix<Number> & kne = _assembly.jacobianBlock(jvar, _var.number());
124  MooseVariableScalar & jv = _sys.getScalarVariable(_tid, jvar);
125 
126  // Set appropriate components for scalar kernels, including in the cases where a planar model is
127  // running in planes other than the x-y plane (defined by _out_of_plane_strain_direction).
129  component += 1;
130  else if (_scalar_out_of_plane_strain_direction == 1 && component == 1)
131  component += 1;
132 
133  for (_i = 0; _i < _test.size(); ++_i)
134  for (_j = 0; _j < jv.order(); ++_j)
135  for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
136  {
137  ken(_i, _j) += _JxW[_qp] * _coord[_qp] *
140  component,
141  component) *
142  _grad_test[_i][_qp](component);
143  kne(_j, _i) += _JxW[_qp] * _coord[_qp] *
146  component,
147  component) *
148  _grad_test[_i][_qp](component);
149  }
150  }
151 }
Real component(const SymmTensor &symm_tensor, unsigned int index)
const MaterialProperty< RankFourTensor > & _Jacobian_mult

◆ computeOffDiagJacobianScalar()

void GeneralizedPlaneStrainOffDiag::computeOffDiagJacobianScalar ( unsigned int  jvar)
overrideprotected

These methods are used to compute the off-diagonal jacobian for the coupling between scalar variable strain_yy or strain_zz and nonlinear variables displacements and temperature.

disp indicates the coupling is between displacements and strain_yy or strain_zz and temp is for temperature and strain_yy or strain_zz

Definition at line 97 of file GeneralizedPlaneStrainOffDiag.C.

98 {
99  const unsigned int elem_scalar_var_id =
101 
102  if (elem_scalar_var_id == _scalar_var_id)
103  {
104  if (_assembly.coordSystem() == Moose::COORD_RZ)
106 
107  if (_var.number() == _disp_var[0]->number())
109  else if (_num_disp_var == 2 && _var.number() == _disp_var[1]->number())
111  else if (isParamValid("temperature") ? _var.number() == _temp_var->number() : 0)
113  }
114 }
virtual void computeDispOffDiagJacobianScalar(unsigned int component, unsigned int jvar)
std::vector< MooseVariable * > _disp_var
virtual void computeTempOffDiagJacobianScalar(unsigned int jvar)
virtual unsigned int getSubblockIndex(const Elem &) const =0
The index of subblock this element is on.
const SubblockIndexProvider * _subblock_id_provider

◆ computeQpResidual()

Real GeneralizedPlaneStrainOffDiag::computeQpResidual ( )
inlineoverrideprotected

Definition at line 31 of file GeneralizedPlaneStrainOffDiag.h.

31 { return 0; }

◆ computeTempOffDiagJacobianScalar()

void GeneralizedPlaneStrainOffDiag::computeTempOffDiagJacobianScalar ( unsigned int  jvar)
protectedvirtual

Definition at line 154 of file GeneralizedPlaneStrainOffDiag.C.

Referenced by computeOffDiagJacobianScalar().

155 {
157  {
158  DenseMatrix<Number> & kne = _assembly.jacobianBlock(jvar, _var.number());
159  MooseVariableScalar & jv = _sys.getScalarVariable(_tid, jvar);
160  unsigned int n_eigenstrains = _deigenstrain_dT.size();
161 
162  for (_i = 0; _i < _test.size(); ++_i)
163  for (_j = 0; _j < jv.order(); ++_j)
164  for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
165  for (unsigned int ies = 0; ies < n_eigenstrains; ++ies)
166  kne(_j, _i) +=
167  _JxW[_qp] * _coord[_qp] *
168  (_Jacobian_mult[_qp] * (*_deigenstrain_dT[ies])[_qp])(
170  _test[_i][_qp];
171  }
172 }
std::vector< const MaterialProperty< RankTwoTensor > * > _deigenstrain_dT
const MaterialProperty< RankFourTensor > & _Jacobian_mult

Member Data Documentation

◆ _base_name

std::string GeneralizedPlaneStrainOffDiag::_base_name
protected

Definition at line 44 of file GeneralizedPlaneStrainOffDiag.h.

Referenced by GeneralizedPlaneStrainOffDiag().

◆ _deigenstrain_dT

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

◆ _disp_var

std::vector<MooseVariable *> GeneralizedPlaneStrainOffDiag::_disp_var
protected

◆ _eigenstrain_names

const std::vector<MaterialPropertyName> GeneralizedPlaneStrainOffDiag::_eigenstrain_names
protected

Definition at line 47 of file GeneralizedPlaneStrainOffDiag.h.

Referenced by GeneralizedPlaneStrainOffDiag().

◆ _Jacobian_mult

const MaterialProperty<RankFourTensor>& GeneralizedPlaneStrainOffDiag::_Jacobian_mult
protected

◆ _num_disp_var

const unsigned int GeneralizedPlaneStrainOffDiag::_num_disp_var
protected

◆ _scalar_out_of_plane_strain_direction

unsigned int GeneralizedPlaneStrainOffDiag::_scalar_out_of_plane_strain_direction
protected

◆ _scalar_out_of_plane_strain_var

unsigned int GeneralizedPlaneStrainOffDiag::_scalar_out_of_plane_strain_var
protected

◆ _scalar_var_id

const unsigned int GeneralizedPlaneStrainOffDiag::_scalar_var_id
protected

Definition at line 52 of file GeneralizedPlaneStrainOffDiag.h.

Referenced by computeOffDiagJacobianScalar().

◆ _subblock_id_provider

const SubblockIndexProvider* GeneralizedPlaneStrainOffDiag::_subblock_id_provider
protected

Definition at line 51 of file GeneralizedPlaneStrainOffDiag.h.

Referenced by computeOffDiagJacobianScalar().

◆ _temp_var

MooseVariable* GeneralizedPlaneStrainOffDiag::_temp_var
protected

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