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 29 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(isParamValid("temperature")
66  ? &_subproblem.getStandardVariable(_tid, getParam<VariableName>("temperature"))
67  : NULL),
68  _num_disp_var(getParam<std::vector<VariableName>>("displacements").size()),
69  _scalar_out_of_plane_strain_direction(getParam<MooseEnum>("out_of_plane_direction"))
70 {
71  const std::vector<VariableName> & nl_vnames(getParam<std::vector<VariableName>>("displacements"));
72 
74  mooseError("For 1D axisymmetric or 2D cartesian simulations where the out-of-plane direction "
75  "is z, the number of supplied displacements to GeneralizedPlaneStrainOffDiag must "
76  "be less than three.");
78  mooseError("For 2D cartesian simulations where the out-of-plane direction is x or y the number "
79  "of supplied displacements must be three.");
80 
81  for (unsigned int i = 0; i < _num_disp_var; ++i)
82  _disp_var.push_back(&_subproblem.getStandardVariable(_tid, nl_vnames[i]));
83 
84  for (unsigned int i = 0; i < _deigenstrain_dT.size(); ++i)
85  _deigenstrain_dT[i] = &getMaterialPropertyDerivative<RankTwoTensor>(
87 
88  if (isParamValid("scalar_variable_index_provider") &&
89  !isParamValid("scalar_out_of_plane_strain_index"))
90  mooseError("scalar_out_of_plane_strain_index should be provided if more "
91  "than one is available");
92 }
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 115 of file GeneralizedPlaneStrainOffDiag.C.

Referenced by computeOffDiagJacobianScalar().

117 {
119  {
120  DenseMatrix<Number> & ken = _assembly.jacobianBlock(_var.number(), jvar);
121  DenseMatrix<Number> & kne = _assembly.jacobianBlock(jvar, _var.number());
122  MooseVariableScalar & jv = _sys.getScalarVariable(_tid, jvar);
123 
124  // Set appropriate components for scalar kernels, including in the cases where a planar model is
125  // running in planes other than the x-y plane (defined by _out_of_plane_strain_direction).
127  component += 1;
128  else if (_scalar_out_of_plane_strain_direction == 1 && component == 1)
129  component += 1;
130 
131  for (_i = 0; _i < _test.size(); ++_i)
132  for (_j = 0; _j < jv.order(); ++_j)
133  for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
134  {
135  ken(_i, _j) += _JxW[_qp] * _coord[_qp] *
138  component,
139  component) *
140  _grad_test[_i][_qp](component);
141  kne(_j, _i) += _JxW[_qp] * _coord[_qp] *
144  component,
145  component) *
146  _grad_test[_i][_qp](component);
147  }
148  }
149 }
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 95 of file GeneralizedPlaneStrainOffDiag.C.

96 {
97  const unsigned int elem_scalar_var_id =
99 
100  if (elem_scalar_var_id == _scalar_var_id)
101  {
102  if (_assembly.coordSystem() == Moose::COORD_RZ)
104 
105  if (_var.number() == _disp_var[0]->number())
107  else if (_num_disp_var == 2 && _var.number() == _disp_var[1]->number())
109  else if (isParamValid("temperature") ? _var.number() == _temp_var->number() : 0)
111  }
112 }
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 35 of file GeneralizedPlaneStrainOffDiag.h.

35 { return 0; }

◆ computeTempOffDiagJacobianScalar()

void GeneralizedPlaneStrainOffDiag::computeTempOffDiagJacobianScalar ( unsigned int  jvar)
protectedvirtual

Definition at line 152 of file GeneralizedPlaneStrainOffDiag.C.

Referenced by computeOffDiagJacobianScalar().

153 {
155  {
156  DenseMatrix<Number> & kne = _assembly.jacobianBlock(jvar, _var.number());
157  MooseVariableScalar & jv = _sys.getScalarVariable(_tid, jvar);
158  unsigned int n_eigenstrains = _deigenstrain_dT.size();
159 
160  for (_i = 0; _i < _test.size(); ++_i)
161  for (_j = 0; _j < jv.order(); ++_j)
162  for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
163  for (unsigned int ies = 0; ies < n_eigenstrains; ++ies)
164  kne(_j, _i) +=
165  _JxW[_qp] * _coord[_qp] *
166  (_Jacobian_mult[_qp] * (*_deigenstrain_dT[ies])[_qp])(
168  _test[_i][_qp];
169  }
170 }
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 48 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 51 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 56 of file GeneralizedPlaneStrainOffDiag.h.

Referenced by computeOffDiagJacobianScalar().

◆ _subblock_id_provider

const SubblockIndexProvider* GeneralizedPlaneStrainOffDiag::_subblock_id_provider
protected

Definition at line 55 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: