www.mooseframework.org
CylindricalRankTwoAux.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
10 #include "CylindricalRankTwoAux.h"
11 
12 registerMooseObject("SolidMechanicsApp", CylindricalRankTwoAux);
13 
16 {
18  params.addClassDescription(
19  "Takes RankTwoTensor material and outputs component in cylindrical coordinates");
20  params.addRequiredParam<MaterialPropertyName>("rank_two_tensor",
21  "The rank two material tensor name");
22  params.addRequiredRangeCheckedParam<unsigned int>(
23  "index_i",
24  "index_i >= 0 & index_i <= 2",
25  "The index i of ij for the tensor to output (0, 1, 2)");
26  params.addRequiredRangeCheckedParam<unsigned int>(
27  "index_j",
28  "index_j >= 0 & index_j <= 2",
29  "The index j of ij for the tensor to output (0, 1, 2)");
30  params.addRequiredParam<Point>("center_point",
31  "Location of the center point of the cylindrical coordinates");
32  return params;
33 }
34 
36  : AuxKernel(parameters),
37  _tensor(getMaterialProperty<RankTwoTensor>("rank_two_tensor")),
38  _i(getParam<unsigned int>("index_i")),
39  _j(getParam<unsigned int>("index_j")),
40  _center_point(getParam<Point>("center_point"))
41 {
42 }
43 
44 Real
46 {
47  Point loc_from_center = _q_point[_qp] - _center_point;
48 
49  Real theta = std::atan2(loc_from_center(1), loc_from_center(0));
51  R(0, 0) = std::cos(theta);
52  R(0, 1) = std::sin(theta);
53  R(1, 0) = -std::sin(theta);
54  R(1, 1) = std::cos(theta);
55 
56  RankTwoTensor rotated_tensor = R * _tensor[_qp] * R.transpose();
57 
58  return rotated_tensor(_i, _j);
59 }
void addRequiredRangeCheckedParam(const std::string &name, const std::string &parsed_function, const std::string &doc_string)
CylindricalRankTwoAux is designed to take the data in the CylindricalRankTwoTensor material property...
void addRequiredParam(const std::string &name, const std::string &doc_string)
static const std::string R
Definition: NS.h:147
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
static InputParameters validParams()
const MooseArray< Point > & _q_point
CylindricalRankTwoAux(const InputParameters &parameters)
const MaterialProperty< RankTwoTensor > & _tensor
void ErrorVector unsigned int
registerMooseObject("SolidMechanicsApp", CylindricalRankTwoAux)