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

#include <GeneralizedPlaneStrainUserObject.h>

Inheritance diagram for GeneralizedPlaneStrainUserObject:
[legend]

Public Member Functions

 GeneralizedPlaneStrainUserObject (const InputParameters &parameters)
 
void initialize () override
 
void execute () override
 
void threadJoin (const UserObject &uo) override
 
void finalize () override
 
virtual Real returnResidual (unsigned int scalar_var_id=0) const
 
virtual Real returnJacobian (unsigned int scalar_var_id=0) const
 

Protected Attributes

std::string _base_name
 
const MaterialProperty< RankFourTensor > & _Cijkl
 
const MaterialProperty< RankTwoTensor > & _stress
 
const SubblockIndexProvider_subblock_id_provider
 
Function & _out_of_plane_pressure
 
const Real _factor
 
unsigned int _scalar_out_of_plane_strain_direction
 
std::vector< Real > _residual
 
std::vector< Real > _jacobian
 

Detailed Description

Definition at line 21 of file GeneralizedPlaneStrainUserObject.h.

Constructor & Destructor Documentation

GeneralizedPlaneStrainUserObject::GeneralizedPlaneStrainUserObject ( const InputParameters &  parameters)

Definition at line 35 of file GeneralizedPlaneStrainUserObject.C.

37  : ElementUserObject(parameters),
38  _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
39  _Cijkl(getMaterialProperty<RankFourTensor>(_base_name + "elasticity_tensor")),
40  _stress(getMaterialProperty<RankTwoTensor>(_base_name + "stress")),
41  _subblock_id_provider(nullptr),
42  _out_of_plane_pressure(getFunction("out_of_plane_pressure")),
43  _factor(getParam<Real>("factor"))
44 {
45 }
const MaterialProperty< RankTwoTensor > & _stress
const SubblockIndexProvider * _subblock_id_provider
const MaterialProperty< RankFourTensor > & _Cijkl

Member Function Documentation

void GeneralizedPlaneStrainUserObject::execute ( )
override

Definition at line 65 of file GeneralizedPlaneStrainUserObject.C.

66 {
67  const unsigned int subblock_id =
69 
70  for (unsigned int _qp = 0; _qp < _qrule->n_points(); _qp++)
71  {
72  // residual, integral of stress_zz for COORD_XYZ
73  _residual[subblock_id] +=
74  _JxW[_qp] * _coord[_qp] * (_stress[_qp](_scalar_out_of_plane_strain_direction,
76  _out_of_plane_pressure.value(_t, _q_point[_qp]) * _factor);
77  // diagonal jacobian, integral of C(2, 2, 2, 2) for COORD_XYZ
78  _jacobian[subblock_id] +=
79  _JxW[_qp] * _coord[_qp] * _Cijkl[_qp](_scalar_out_of_plane_strain_direction,
83  }
84 }
const MaterialProperty< RankTwoTensor > & _stress
virtual unsigned int getSubblockIndex(const Elem &) const =0
The index of subblock this element is on.
const SubblockIndexProvider * _subblock_id_provider
const MaterialProperty< RankFourTensor > & _Cijkl
void GeneralizedPlaneStrainUserObject::finalize ( )
override

Definition at line 99 of file GeneralizedPlaneStrainUserObject.C.

100 {
101  gatherSum(_residual);
102  gatherSum(_jacobian);
103 }
void GeneralizedPlaneStrainUserObject::initialize ( )
override

Definition at line 48 of file GeneralizedPlaneStrainUserObject.C.

49 {
50  if (isParamValid("subblock_index_provider"))
51  _subblock_id_provider = &getUserObject<SubblockIndexProvider>("subblock_index_provider");
52  if (_assembly.coordSystem() == Moose::COORD_XYZ)
54  else if (_assembly.coordSystem() == Moose::COORD_RZ)
56  else
57  mooseError("Unsupported coordinate system for generalized plane strain formulation");
58 
59  unsigned int max_size = _subblock_id_provider ? _subblock_id_provider->getMaxSubblockIndex() : 1;
60  _residual.assign(max_size, 0.0);
61  _jacobian.assign(max_size, 0.0);
62 }
const SubblockIndexProvider * _subblock_id_provider
virtual unsigned int getMaxSubblockIndex() const =0
The max index of subblock.
Real GeneralizedPlaneStrainUserObject::returnJacobian ( unsigned int  scalar_var_id = 0) const
virtual

Definition at line 115 of file GeneralizedPlaneStrainUserObject.C.

Referenced by GeneralizedPlaneStrain::computeJacobian().

116 {
117  if (_jacobian.size() < scalar_var_id)
118  mooseError("Index out of bounds!");
119 
120  return _jacobian[scalar_var_id];
121 }
Real GeneralizedPlaneStrainUserObject::returnResidual ( unsigned int  scalar_var_id = 0) const
virtual

Definition at line 106 of file GeneralizedPlaneStrainUserObject.C.

Referenced by GeneralizedPlaneStrain::computeResidual().

107 {
108  if (_residual.size() < scalar_var_id)
109  mooseError("Index out of bounds!");
110 
111  return _residual[scalar_var_id];
112 }
void GeneralizedPlaneStrainUserObject::threadJoin ( const UserObject &  uo)
override

Definition at line 87 of file GeneralizedPlaneStrainUserObject.C.

88 {
89  const GeneralizedPlaneStrainUserObject & gpsuo =
90  static_cast<const GeneralizedPlaneStrainUserObject &>(uo);
91  for (unsigned int i = 0; i < _residual.size(); ++i)
92  {
93  _residual[i] += gpsuo._residual[i];
94  _jacobian[i] += gpsuo._jacobian[i];
95  }
96 }

Member Data Documentation

std::string GeneralizedPlaneStrainUserObject::_base_name
protected

Definition at line 34 of file GeneralizedPlaneStrainUserObject.h.

const MaterialProperty<RankFourTensor>& GeneralizedPlaneStrainUserObject::_Cijkl
protected

Definition at line 36 of file GeneralizedPlaneStrainUserObject.h.

Referenced by execute().

const Real GeneralizedPlaneStrainUserObject::_factor
protected

Definition at line 42 of file GeneralizedPlaneStrainUserObject.h.

Referenced by execute().

std::vector<Real> GeneralizedPlaneStrainUserObject::_jacobian
protected
Function& GeneralizedPlaneStrainUserObject::_out_of_plane_pressure
protected

Definition at line 41 of file GeneralizedPlaneStrainUserObject.h.

Referenced by execute().

std::vector<Real> GeneralizedPlaneStrainUserObject::_residual
protected
unsigned int GeneralizedPlaneStrainUserObject::_scalar_out_of_plane_strain_direction
protected

Definition at line 43 of file GeneralizedPlaneStrainUserObject.h.

Referenced by execute(), and initialize().

const MaterialProperty<RankTwoTensor>& GeneralizedPlaneStrainUserObject::_stress
protected

Definition at line 37 of file GeneralizedPlaneStrainUserObject.h.

Referenced by execute().

const SubblockIndexProvider* GeneralizedPlaneStrainUserObject::_subblock_id_provider
protected

Definition at line 39 of file GeneralizedPlaneStrainUserObject.h.

Referenced by execute(), and initialize().


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