https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
15
18{
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: ",
49 ". The component index of a shell local vector must be 0, 1, or 2.");
50}
51
52Real
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}
registerMooseObject("SolidMechanicsApp", ShellLocalCoordinatesAux)
void ErrorVector unsigned int
static InputParameters validParams()
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)
void mooseError(Args &&... args) const
ShellLocalCoordinatesAux(const InputParameters &parameters)
const std::string _base_name
Base name of the material system used to calculate the elastic energy.
virtual Real computeValue() override
enum ShellLocalCoordinatesAux::PropertyType _property
const MaterialProperty< RankTwoTensor > * _local_coordinates
The local stress tensor.
static InputParameters validParams()