https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
18template <bool is_ad>
21{
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
37template <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
50template <bool is_ad>
51void
56
57template <bool is_ad>
58void
60{
61 Point dummy_direction;
62
64 _spherical_component,
65 _center,
66 _q_point[_qp],
67 dummy_direction);
68}
69
registerMooseObject("SolidMechanicsApp", RankTwoSphericalComponent)
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()
RankTwoSphericalComponent computes spherical scalar values from Rank-2 tensors.
RankTwoSphericalComponentTempl(const InputParameters &parameters)
virtual void computeQpProperties() override
virtual void initQpStatefulProperties() override
auto raw_value(const Eigen::Map< T > &in)
T getSphericalComponent(const RankTwoTensorTempl< T > &tensor, const SphericalComponent &scalar_type, const Point &center, const Point &curr_point, Point &direction)