https://mooseframework.inl.gov
ADWeakPlaneStress.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #include "ADWeakPlaneStress.h"
11 
12 registerMooseObject("SolidMechanicsApp", ADWeakPlaneStress);
13 
16 {
18  params.addClassDescription("Plane stress kernel to provide out-of-plane strain contribution.");
19  params.addParam<std::string>("base_name", "Material property base name");
20  MooseEnum direction("x y z", "z");
21  params.addParam<MooseEnum>("out_of_plane_strain_direction",
22  direction,
23  "The direction of the out-of-plane strain variable");
24  params.set<bool>("use_displaced_mesh") = false;
25 
26  return params;
27 }
28 
30  : ADKernelValue(parameters),
31  _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
32  _stress(getADMaterialProperty<RankTwoTensor>(_base_name + "stress")),
33  _direction(getParam<MooseEnum>("out_of_plane_strain_direction"))
34 {
35 }
36 
37 ADReal
39 {
40  return _stress[_qp](_direction, _direction);
41 }
ADWeakPlaneStress(const InputParameters &parameters)
const ADMaterialProperty< RankTwoTensor > & _stress
The stress tensor that provides the out-of-plane stress.
static InputParameters validParams()
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
T & set(const std::string &name, bool quiet_mode=false)
const unsigned int _direction
The direction of the out-of-plane strain variable.
registerMooseObject("SolidMechanicsApp", ADWeakPlaneStress)
DualNumber< Real, DNDerivativeType, true > ADReal
ADReal precomputeQpResidual() override
ADWeakPlaneStress is the automatic differentiation version of WeakPlaneStress.
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
unsigned int _qp