https://mooseframework.inl.gov
RankTwoCylindricalComponent.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 
11 #include "RankTwoScalarTools.h"
12 
13 #include "metaphysicl/raw_type.h"
14 
17 
18 template <bool is_ad>
21 {
23  params.addClassDescription(
24  "Compute components of a rank-2 tensor in a cylindrical coordinate system");
25  params.addRequiredParam<MaterialPropertyName>("rank_two_tensor",
26  "The rank two material property tensor name");
27  params.addRequiredParam<MaterialPropertyName>(
28  "property_name", "Name of the material property computed by this model");
29  MooseEnum cylindricalTypes("AxialStress HoopStress RadialStress");
30  params.addParam<MooseEnum>(
31  "cylindrical_component", cylindricalTypes, "Type of cylindrical scalar output");
32  params.addParam<Point>(
33  "cylindrical_axis_point1",
34  "Start point for determining axis of rotation for cylindrical stress/strain components");
35  params.addParam<Point>(
36  "cylindrical_axis_point2",
37  "End point for determining axis of rotation for cylindrical stress/strain components");
38  return params;
39 }
40 
41 template <bool is_ad>
43  const InputParameters & parameters)
44  : Material(parameters),
45  _tensor(getGenericMaterialProperty<RankTwoTensor, is_ad>("rank_two_tensor")),
46  _property(declareGenericProperty<Real, is_ad>("property_name")),
47  _cylindrical_component(getParam<MooseEnum>("cylindrical_component")
48  .template getEnum<RankTwoScalarTools::CylindricalComponent>()),
49  _cylindrical_axis_point1(isParamValid("cylindrical_axis_point1")
50  ? getParam<Point>("cylindrical_axis_point1")
51  : Point(0, 0, 0)),
52  _cylindrical_axis_point2(isParamValid("cylindrical_axis_point2")
53  ? getParam<Point>("cylindrical_axis_point2")
54  : Point(0, 1, 0))
55 {
56 }
57 
58 template <bool is_ad>
59 void
61 {
62  _property[_qp] = 0.0;
63 }
64 
65 template <bool is_ad>
66 void
68 {
69  Point dummy_direction;
70 
72  _cylindrical_component,
73  _cylindrical_axis_point1,
74  _cylindrical_axis_point2,
75  _q_point[_qp],
76  dummy_direction);
77 }
78 
virtual void initQpStatefulProperties() override
RankTwoCylindricalComponent computes cylindrical scalar values from Rank-2 tensors.
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
auto raw_value(const Eigen::Map< T > &in)
RankTwoCylindricalComponentTempl(const InputParameters &parameters)
registerMooseObject("SolidMechanicsApp", RankTwoCylindricalComponent)
void addRequiredParam(const std::string &name, const std::string &doc_string)
T getCylindricalComponent(const RankTwoTensorTempl< T > &tensor, const CylindricalComponent &scalar_type, const Point &point1, const Point &point2, const Point &curr_point, Point &direction)
static InputParameters validParams()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)