https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
15
16template <bool is_ad>
19{
22 "Compute components of a rank-2 tensor in a cylindrical coordinate system");
23 params.addRequiredParam<MaterialPropertyName>("rank_two_tensor",
24 "The rank two material property tensor name");
25 params.addRequiredParam<MaterialPropertyName>(
26 "property_name", "Name of the material property computed by this model");
27 MooseEnum cylindricalTypes("AxialStress HoopStress RadialStress");
28 params.addParam<MooseEnum>(
29 "cylindrical_component", cylindricalTypes, "Type of cylindrical scalar output");
30 params.addParam<Point>(
31 "cylindrical_axis_point1",
32 "Start point for determining axis of rotation for cylindrical stress/strain components");
33 params.addParam<Point>(
34 "cylindrical_axis_point2",
35 "End point for determining axis of rotation for cylindrical stress/strain components");
36 return params;
37}
38
39template <bool is_ad>
41 const InputParameters & parameters)
42 : Material(parameters),
43 _tensor(getGenericMaterialProperty<RankTwoTensor, is_ad>("rank_two_tensor")),
44 _property(declareGenericProperty<Real, is_ad>("property_name")),
45 _cylindrical_component(getParam<MooseEnum>("cylindrical_component")
46 .template getEnum<RankTwoScalarTools::CylindricalComponent>()),
47 _cylindrical_axis_point1(isParamValid("cylindrical_axis_point1")
48 ? getParam<Point>("cylindrical_axis_point1")
49 : Point(0, 0, 0)),
50 _cylindrical_axis_point2(isParamValid("cylindrical_axis_point2")
51 ? getParam<Point>("cylindrical_axis_point2")
52 : Point(0, 1, 0))
53{
54}
55
56template <bool is_ad>
57void
62
63template <bool is_ad>
64void
66{
67 Point dummy_direction;
68
69 _property[_qp] = RankTwoScalarTools::getCylindricalComponent(_tensor[_qp],
70 _cylindrical_component,
71 _cylindrical_axis_point1,
72 _cylindrical_axis_point2,
73 _q_point[_qp],
74 dummy_direction);
75}
76
registerMooseObject("SolidMechanicsApp", RankTwoCylindricalComponent)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
RankTwoCylindricalComponent computes cylindrical scalar values from Rank-2 tensors.
RankTwoCylindricalComponentTempl(const InputParameters &parameters)
T getCylindricalComponent(const RankTwoTensorTempl< T > &tensor, const CylindricalComponent &scalar_type, const Point &point1, const Point &point2, const Point &curr_point, Point &direction)