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
15
16template <bool is_ad>
19{
22 "Compute components of a rank-2 tensor in a spherical coordinate system");
23 params.addRequiredParam<MaterialPropertyName>("rank_two_tensor",
24 "The rank two material tensor name");
25 params.addRequiredParam<MaterialPropertyName>(
26 "property_name", "Name of the material property computed by this model");
27 MooseEnum sphericalTypes("HoopStress RadialStress");
28 params.addParam<MooseEnum>(
29 "spherical_component", sphericalTypes, "Type of spherical scalar output");
30 params.addParam<Point>("spherical_center_point",
31 "Center point of the spherical coordinate system.");
32 return params;
33}
34
35template <bool is_ad>
37 const InputParameters & parameters)
38 : Material(parameters),
39 _tensor(getGenericMaterialProperty<RankTwoTensor, is_ad>("rank_two_tensor")),
40 _property(declareGenericProperty<Real, is_ad>("property_name")),
41 _spherical_component(getParam<MooseEnum>("spherical_component")
42 .template getEnum<RankTwoScalarTools::SphericalComponent>()),
43 _center(isParamValid("spherical_center_point") ? getParam<Point>("spherical_center_point")
44 : Point(0, 0, 0))
45{
46}
47
48template <bool is_ad>
49void
54
55template <bool is_ad>
56void
58{
59 Point dummy_direction;
60
62 _tensor[_qp], _spherical_component, _center, _q_point[_qp], dummy_direction);
63}
64
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
T getSphericalComponent(const RankTwoTensorTempl< T > &tensor, const SphericalComponent &scalar_type, const Point &center, const Point &curr_point, Point &direction)