https://mooseframework.inl.gov
ShellLocalCoordinatesAux.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 "libmesh/utility.h"
12 #include "libmesh/string_to_enum.h"
13 
14 registerMooseObject("SolidMechanicsApp", ShellLocalCoordinatesAux);
15 
18 {
20  params.addClassDescription(
21  "This AuxKernel stores a specific component of a shell element's local coordinate "
22  "vector in an auxiliary variable.");
23  params.addParam<std::string>("base_name", "Mechanical property base name");
24 
25  MooseEnum property("first_local_vector second_local_vector normal_local_vector");
27  "property",
28  property,
29  "The local axis to output: first_local_vector, second_local_vector or normal_local_vector");
30  params.addRequiredParam<unsigned int>(
31  "component", "The vector component of the local coordinate vector: 0, 1 or 2");
32 
33  return params;
34 }
35 
37  : AuxKernel(parameters),
38  _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
39  _property(getParam<MooseEnum>("property").getEnum<PropertyType>()),
40  _component(getParam<unsigned int>("component"))
41 
42 {
44  &getMaterialProperty<RankTwoTensor>(_base_name + "local_transformation_t_points_0");
45 
46  if (_component > 2)
47  mooseError("Invalid component: ",
48  _component,
49  ". The component index of a shell local vector must be 0, 1, or 2.");
50 }
51 
52 Real
54 {
55  Real output_value = 0.0;
56 
57  switch (_property)
58  {
60  output_value = (*_local_coordinates)[_qp](0, _component);
61  break;
63  output_value = (*_local_coordinates)[_qp](1, _component);
64  break;
66  output_value = (*_local_coordinates)[_qp](2, _component);
67  break;
68  }
69 
70  return output_value;
71 }
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
registerMooseObject("SolidMechanicsApp", ShellLocalCoordinatesAux)
void addRequiredParam(const std::string &name, const std::string &doc_string)
const MaterialProperty< RankTwoTensor > * _local_coordinates
The local stress tensor.
static InputParameters validParams()
enum ShellLocalCoordinatesAux::PropertyType _property
const std::string _base_name
Base name of the material system used to calculate the elastic energy.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void mooseError(Args &&... args) const
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
virtual Real computeValue() override
void ErrorVector unsigned int
ShellLocalCoordinatesAux(const InputParameters &parameters)