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

#include <GeneralizedPlaneStrainOffDiag.h>

Inheritance diagram for GeneralizedPlaneStrainOffDiag:
[legend]

Public Types

typedef DerivativeMaterialPropertyNameInterface::SymbolName SymbolName
 

Public Member Functions

 GeneralizedPlaneStrainOffDiag (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

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

const std::string _base_name
 Base name of the material system that this kernel applies to. More...
 
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
 Variable number of the out-of-plane strain scalar variable. More...
 
const SubblockIndexProvider *const _subblock_id_provider
 A Userobject that carries the subblock ID for all elements. More...
 
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
 The direction of the out-of-plane strain. More...
 
DenseMatrix< Number_ke_copy
 Member variable to avoid constant dense matrix heap allocations. More...
 

Detailed Description

Definition at line 19 of file GeneralizedPlaneStrainOffDiag.h.

Constructor & Destructor Documentation

◆ GeneralizedPlaneStrainOffDiag()

GeneralizedPlaneStrainOffDiag::GeneralizedPlaneStrainOffDiag ( const InputParameters parameters)

Definition at line 52 of file GeneralizedPlaneStrainOffDiag.C.

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(isCoupled("temperature") ? getVar("temperature", 0) : nullptr),
66  _num_disp_var(getParam<std::vector<VariableName>>("displacements").size()),
67  _scalar_out_of_plane_strain_direction(getParam<MooseEnum>("out_of_plane_direction"))
68 {
69  const std::vector<VariableName> & nl_vnames(getParam<std::vector<VariableName>>("displacements"));
70 
72  mooseError("For 1D axisymmetric or 2D cartesian simulations where the out-of-plane direction "
73  "is z, the number of supplied displacements to GeneralizedPlaneStrainOffDiag must "
74  "be less than three.");
76  mooseError("For 2D cartesian simulations where the out-of-plane direction is x or y the number "
77  "of supplied displacements must be three.");
78 
79  for (unsigned int i = 0; i < _num_disp_var; ++i)
80  _disp_var.push_back(&_subproblem.getStandardVariable(_tid, nl_vnames[i]));
81 
82  for (unsigned int i = 0; i < _deigenstrain_dT.size(); ++i)
83  _deigenstrain_dT[i] = &getMaterialPropertyDerivative<RankTwoTensor>(
85 
86  if (isParamValid("scalar_variable_index_provider") &&
87  !isParamValid("scalar_out_of_plane_strain_index"))
88  paramError("scalar_out_of_plane_index",
89  "scalar_out_of_plane_strain_index should be provided if more "
90  "than one is available");
91  if (coupledComponents("temperature") > 1)
92  paramError("temperature", "Only one variable my be specified in 'temperature'");
93 }
const std::vector< MaterialPropertyName > _eigenstrain_names
unsigned int _scalar_out_of_plane_strain_var
Variable number of the out-of-plane strain scalar variable.
void mooseError(Args &&... args)
const std::string & name() const override
const std::string _base_name
Base name of the material system that this kernel applies to.
std::vector< MooseVariable * > _disp_var
std::vector< const MaterialProperty< RankTwoTensor > * > _deigenstrain_dT
const SubblockIndexProvider *const _subblock_id_provider
A Userobject that carries the subblock ID for all elements.
const MaterialProperty< RankFourTensor > & _Jacobian_mult
unsigned int _scalar_out_of_plane_strain_direction
The direction of the out-of-plane strain.

Member Function Documentation

◆ computeDispOffDiagJacobianScalar()

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

Definition at line 116 of file GeneralizedPlaneStrainOffDiag.C.

Referenced by computeOffDiagJacobianScalar().

118 {
120  {
121  prepareMatrixTag(_assembly, _var.number(), jvar);
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  _local_ke(_i, _j) += _JxW[_qp] * _coord[_qp] *
137  component,
138  component) *
139  _grad_test[_i][_qp](component);
140  accumulateTaggedLocalMatrix();
141  _ke_copy = _local_ke;
142 
143  prepareMatrixTag(_assembly, jvar, _var.number());
144  _ke_copy.get_transpose(_local_ke);
145  accumulateTaggedLocalMatrix();
146  }
147 }
unsigned int _scalar_out_of_plane_strain_var
Variable number of the out-of-plane strain scalar variable.
static const std::string component
Definition: NS.h:138
DenseMatrix< Number > _ke_copy
Member variable to avoid constant dense matrix heap allocations.
void get_transpose(DenseMatrix< Number > &dest) const
const MaterialProperty< RankFourTensor > & _Jacobian_mult
unsigned int _scalar_out_of_plane_strain_direction
The direction of the out-of-plane strain.

◆ 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 96 of file GeneralizedPlaneStrainOffDiag.C.

97 {
98  const unsigned int elem_scalar_var_id =
100 
101  if (elem_scalar_var_id == _scalar_var_id)
102  {
103  if (_assembly.coordSystem() == Moose::COORD_RZ)
105 
106  if (_var.number() == _disp_var[0]->number())
108  else if (_num_disp_var == 2 && _var.number() == _disp_var[1]->number())
110  else if (_temp_var && _var.number() == _temp_var->number())
112  }
113 }
unsigned int number() const
virtual void computeDispOffDiagJacobianScalar(unsigned int component, unsigned int jvar)
std::vector< MooseVariable * > _disp_var
virtual void computeTempOffDiagJacobianScalar(unsigned int jvar)
const SubblockIndexProvider *const _subblock_id_provider
A Userobject that carries the subblock ID for all elements.
virtual unsigned int getSubblockIndex(const Elem &) const =0
The index of subblock this element is on.
unsigned int _scalar_out_of_plane_strain_direction
The direction of the out-of-plane strain.

◆ computeQpResidual()

Real GeneralizedPlaneStrainOffDiag::computeQpResidual ( )
inlineoverrideprotected

Definition at line 27 of file GeneralizedPlaneStrainOffDiag.h.

27 { return 0; }

◆ computeTempOffDiagJacobianScalar()

void GeneralizedPlaneStrainOffDiag::computeTempOffDiagJacobianScalar ( unsigned int  jvar)
protectedvirtual

Definition at line 150 of file GeneralizedPlaneStrainOffDiag.C.

Referenced by computeOffDiagJacobianScalar().

151 {
153  {
154  prepareMatrixTag(_assembly, _var.number(), jvar);
155  MooseVariableScalar & jv = _sys.getScalarVariable(_tid, jvar);
156  unsigned int n_eigenstrains = _deigenstrain_dT.size();
157 
158  for (_i = 0; _i < _test.size(); ++_i)
159  for (_j = 0; _j < jv.order(); ++_j)
160  for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
161  for (unsigned int ies = 0; ies < n_eigenstrains; ++ies)
162  _local_ke(_i, _j) +=
163  _JxW[_qp] * _coord[_qp] *
164  (_Jacobian_mult[_qp] * (*_deigenstrain_dT[ies])[_qp])(
166  _test[_i][_qp];
167  accumulateTaggedLocalMatrix();
168  }
169 }
unsigned int _scalar_out_of_plane_strain_var
Variable number of the out-of-plane strain scalar variable.
std::vector< const MaterialProperty< RankTwoTensor > * > _deigenstrain_dT
const MaterialProperty< RankFourTensor > & _Jacobian_mult
unsigned int _scalar_out_of_plane_strain_direction
The direction of the out-of-plane strain.

◆ validParams()

InputParameters GeneralizedPlaneStrainOffDiag::validParams ( )
static

Definition at line 26 of file GeneralizedPlaneStrainOffDiag.C.

27 {
29  params.addClassDescription("Generalized Plane Strain kernel to provide contribution of the "
30  "out-of-plane strain to other kernels");
31  params.addRequiredParam<std::vector<VariableName>>("displacements",
32  "Variable for the displacements");
33  params.addCoupledVar("temperature", "Variable for the temperature");
34 
35  params.addCoupledVar("scalar_out_of_plane_strain",
36  "Scalar variable for generalized plane strain");
37  MooseEnum outOfPlaneDirection("x y z", "z");
38  params.addParam<MooseEnum>(
39  "out_of_plane_direction", outOfPlaneDirection, "The direction of the out-of-plane strain.");
40  params.addParam<UserObjectName>("subblock_index_provider",
41  "SubblockIndexProvider user object name");
42  params.addParam<unsigned int>(
43  "scalar_out_of_plane_strain_index",
44  "The index number of scalar_out_of_plane_strain this kernel acts on");
45  params.addParam<std::string>("base_name", "Material property base name");
46  params.addParam<std::vector<MaterialPropertyName>>(
47  "eigenstrain_names", {}, "List of eigenstrains to be applied in this strain calculation");
48 
49  return params;
50 }
static InputParameters validParams()
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
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 GeneralizedPlaneStrainOffDiag::_base_name
protected

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

Definition at line 41 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 44 of file GeneralizedPlaneStrainOffDiag.h.

Referenced by GeneralizedPlaneStrainOffDiag().

◆ _Jacobian_mult

const MaterialProperty<RankFourTensor>& GeneralizedPlaneStrainOffDiag::_Jacobian_mult
protected

◆ _ke_copy

DenseMatrix<Number> GeneralizedPlaneStrainOffDiag::_ke_copy
protected

Member variable to avoid constant dense matrix heap allocations.

Definition at line 63 of file GeneralizedPlaneStrainOffDiag.h.

Referenced by computeDispOffDiagJacobianScalar().

◆ _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

Variable number of the out-of-plane strain scalar variable.

Definition at line 48 of file GeneralizedPlaneStrainOffDiag.h.

Referenced by computeDispOffDiagJacobianScalar(), and computeTempOffDiagJacobianScalar().

◆ _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* const GeneralizedPlaneStrainOffDiag::_subblock_id_provider
protected

A Userobject that carries the subblock ID for all elements.

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: