www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ADStressDivergenceTensors< compute_stage > Class Template Reference

ADStressDivergenceTensors is the automatic differentiation version of StressDivergenceTensors. More...

#include <ADStressDivergenceTensors.h>

Inheritance diagram for ADStressDivergenceTensors< compute_stage >:
[legend]

Public Member Functions

 ADStressDivergenceTensors (const InputParameters &parameters)
 

Protected Member Functions

void initialSetup () override
 
ADResidual computeQpResidual () override
 
void precalculateResidual () override
 
const ADMaterialProperty (RankTwoTensor) &_stress
 

Protected Attributes

const std::string _base_name
 
const unsigned int _component
 
const unsigned int _ndisp
 Coupled displacement variables. More...
 
std::vector< unsigned int > _disp_var
 
std::vector< ADReal > _avg_grad_test
 Gradient of test function averaged over the element. Used in volumetric locking correction calculation. More...
 
const bool _volumetric_locking_correction
 Flag for volumetric locking correction. More...
 
 usingKernelMembers
 

Detailed Description

template<ComputeStage compute_stage>
class ADStressDivergenceTensors< compute_stage >

ADStressDivergenceTensors is the automatic differentiation version of StressDivergenceTensors.

Definition at line 27 of file ADStressDivergenceTensors.h.

Constructor & Destructor Documentation

◆ ADStressDivergenceTensors()

template<ComputeStage compute_stage>
ADStressDivergenceTensors< compute_stage >::ADStressDivergenceTensors ( const InputParameters &  parameters)

Definition at line 34 of file ADStressDivergenceTensors.C.

36  : ADKernel<compute_stage>(parameters),
37  _base_name(isParamValid("base_name") ? adGetParam<std::string>("base_name") + "_" : ""),
38  _stress(adGetADMaterialProperty<RankTwoTensor>(_base_name + "stress")),
39  _component(adGetParam<unsigned int>("component")),
40  _ndisp(coupledComponents("displacements")),
43  _volumetric_locking_correction(adGetParam<bool>("volumetric_locking_correction"))
44 {
45  for (unsigned int i = 0; i < _ndisp; ++i)
46  // the next line should be _disp_var[i] = coupled("displacements", i);
47  // but the Coupleable:: is required to avoid triggering an internal Intel compiler bug
48  _disp_var[i] = Coupleable::coupled("displacements", i);
49 
50  // Error if volumetric locking correction is turned on for 1D problems
52  mooseError("Volumetric locking correction should be set to false for 1-D problems.");
53 }
std::vector< ADReal > _avg_grad_test
Gradient of test function averaged over the element. Used in volumetric locking correction calculatio...
const unsigned int _ndisp
Coupled displacement variables.
const bool _volumetric_locking_correction
Flag for volumetric locking correction.
std::vector< unsigned int > _disp_var

Member Function Documentation

◆ ADMaterialProperty()

template<ComputeStage compute_stage>
const ADStressDivergenceTensors< compute_stage >::ADMaterialProperty ( RankTwoTensor  ) &
protected

◆ computeQpResidual()

template<ComputeStage compute_stage>
ADResidual ADStressDivergenceTensors< compute_stage >::computeQpResidual ( )
overrideprotected

Definition at line 66 of file ADStressDivergenceTensors.C.

67 {
68  ADResidual residual = _stress[_qp].row(_component) * _grad_test[_i][_qp];
69 
70  // volumetric locking correction
72  residual += (_avg_grad_test[_i] - _grad_test[_i][_qp](_component)) / 3.0 * _stress[_qp].trace();
73 
74  return residual;
75 }
std::vector< ADReal > _avg_grad_test
Gradient of test function averaged over the element. Used in volumetric locking correction calculatio...
const bool _volumetric_locking_correction
Flag for volumetric locking correction.

◆ initialSetup()

template<ComputeStage compute_stage>
void ADStressDivergenceTensors< compute_stage >::initialSetup ( )
overrideprotected

Definition at line 57 of file ADStressDivergenceTensors.C.

58 {
59  if (getBlockCoordSystem() != Moose::COORD_XYZ)
60  mooseError(
61  "The coordinate system in the Problem block must be set to XYZ for cartesian geometries.");
62 }

◆ precalculateResidual()

template<ComputeStage compute_stage>
void ADStressDivergenceTensors< compute_stage >::precalculateResidual ( )
overrideprotected

Definition at line 79 of file ADStressDivergenceTensors.C.

80 {
82  return;
83 
84  // Calculate volume averaged value of shape function derivative
85  _avg_grad_test.resize(_test.size());
86  for (_i = 0; _i < _test.size(); ++_i)
87  {
88  _avg_grad_test[_i] = 0.0;
89  for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
90  _avg_grad_test[_i] += _grad_test[_i][_qp](_component) * _JxW[_qp] * _coord[_qp];
91 
92  _avg_grad_test[_i] /= _current_elem_volume;
93  }
94 }
std::vector< ADReal > _avg_grad_test
Gradient of test function averaged over the element. Used in volumetric locking correction calculatio...
const bool _volumetric_locking_correction
Flag for volumetric locking correction.

Member Data Documentation

◆ _avg_grad_test

template<ComputeStage compute_stage>
std::vector<ADReal> ADStressDivergenceTensors< compute_stage >::_avg_grad_test
protected

Gradient of test function averaged over the element. Used in volumetric locking correction calculation.

Definition at line 60 of file ADStressDivergenceTensors.h.

◆ _base_name

template<ComputeStage compute_stage>
const std::string ADStressDivergenceTensors< compute_stage >::_base_name
protected

Definition at line 50 of file ADStressDivergenceTensors.h.

◆ _component

template<ComputeStage compute_stage>
const unsigned int ADStressDivergenceTensors< compute_stage >::_component
protected

Definition at line 53 of file ADStressDivergenceTensors.h.

◆ _disp_var

template<ComputeStage compute_stage>
std::vector<unsigned int> ADStressDivergenceTensors< compute_stage >::_disp_var
protected

◆ _ndisp

template<ComputeStage compute_stage>
const unsigned int ADStressDivergenceTensors< compute_stage >::_ndisp
protected

Coupled displacement variables.

Definition at line 56 of file ADStressDivergenceTensors.h.

Referenced by ADStressDivergenceTensors< compute_stage >::ADStressDivergenceTensors().

◆ _volumetric_locking_correction

template<ComputeStage compute_stage>
const bool ADStressDivergenceTensors< compute_stage >::_volumetric_locking_correction
protected

Flag for volumetric locking correction.

Definition at line 63 of file ADStressDivergenceTensors.h.

Referenced by ADStressDivergenceTensors< compute_stage >::ADStressDivergenceTensors().

◆ usingKernelMembers

template<ComputeStage compute_stage>
ADStressDivergenceTensors< compute_stage >::usingKernelMembers
protected

Definition at line 65 of file ADStressDivergenceTensors.h.


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