https://mooseframework.inl.gov
RankTwoSphericalComponent.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 spherical coordinate system");
25  params.addRequiredParam<MaterialPropertyName>("rank_two_tensor",
26  "The rank two material tensor name");
27  params.addRequiredParam<MaterialPropertyName>(
28  "property_name", "Name of the material property computed by this model");
29  MooseEnum sphericalTypes("HoopStress RadialStress");
30  params.addParam<MooseEnum>(
31  "spherical_component", sphericalTypes, "Type of spherical scalar output");
32  params.addParam<Point>("spherical_center_point",
33  "Center point of the spherical coordinate system.");
34  return params;
35 }
36 
37 template <bool is_ad>
39  const InputParameters & parameters)
40  : Material(parameters),
41  _tensor(getGenericMaterialProperty<RankTwoTensor, is_ad>("rank_two_tensor")),
42  _property(declareGenericProperty<Real, is_ad>("property_name")),
43  _spherical_component(getParam<MooseEnum>("spherical_component")
44  .template getEnum<RankTwoScalarTools::SphericalComponent>()),
45  _center(isParamValid("spherical_center_point") ? getParam<Point>("spherical_center_point")
46  : Point(0, 0, 0))
47 {
48 }
49 
50 template <bool is_ad>
51 void
53 {
54  _property[_qp] = 0.0;
55 }
56 
57 template <bool is_ad>
58 void
60 {
61  Point dummy_direction;
62 
64  _spherical_component,
65  _center,
66  _q_point[_qp],
67  dummy_direction);
68 }
69 
T getSphericalComponent(const RankTwoTensorTempl< T > &tensor, const SphericalComponent &scalar_type, const Point &center, const Point &curr_point, Point &direction)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
registerMooseObject("SolidMechanicsApp", RankTwoSphericalComponent)
auto raw_value(const Eigen::Map< T > &in)
void addRequiredParam(const std::string &name, const std::string &doc_string)
virtual void computeQpProperties() override
RankTwoSphericalComponent computes spherical scalar values from Rank-2 tensors.
static InputParameters validParams()
RankTwoSphericalComponentTempl(const InputParameters &parameters)
virtual void initQpStatefulProperties() override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)