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("TensorMechanicsApp", CylindricalRankTwoAux);
13 
15 
16 InputParameters
18 {
19  InputParameters params = AuxKernel::validParams();
20  params.addClassDescription(
21  "Takes RankTwoTensor material and outputs component in cylindrical coordinates");
22  params.addRequiredParam<MaterialPropertyName>("rank_two_tensor",
23  "The rank two material tensor name");
24  params.addRequiredRangeCheckedParam<unsigned int>(
25  "index_i",
26  "index_i >= 0 & index_i <= 2",
27  "The index i of ij for the tensor to output (0, 1, 2)");
28  params.addRequiredRangeCheckedParam<unsigned int>(
29  "index_j",
30  "index_j >= 0 & index_j <= 2",
31  "The index j of ij for the tensor to output (0, 1, 2)");
32  params.addRequiredParam<Point>("center_point",
33  "Location of the center point of the cylindrical coordinates");
34  return params;
35 }
36 
37 CylindricalRankTwoAux::CylindricalRankTwoAux(const InputParameters & parameters)
38  : AuxKernel(parameters),
39  _tensor(getMaterialProperty<RankTwoTensor>("rank_two_tensor")),
40  _i(getParam<unsigned int>("index_i")),
41  _j(getParam<unsigned int>("index_j")),
42  _center_point(getParam<Point>("center_point"))
43 {
44 }
45 
46 Real
48 {
49  Point loc_from_center = _q_point[_qp] - _center_point;
50 
51  Real theta = std::atan2(loc_from_center(1), loc_from_center(0));
52  RankTwoTensor R;
53  R(0, 0) = std::cos(theta);
54  R(0, 1) = std::sin(theta);
55  R(1, 0) = -std::sin(theta);
56  R(1, 1) = std::cos(theta);
57 
58  RankTwoTensor rotated_tensor = R * _tensor[_qp] * R.transpose();
59 
60  return rotated_tensor(_i, _j);
61 }
CylindricalRankTwoAux.h
CylindricalRankTwoAux
Definition: CylindricalRankTwoAux.h:26
CylindricalRankTwoAux::validParams
static InputParameters validParams()
Definition: CylindricalRankTwoAux.C:17
CylindricalRankTwoAux::_tensor
const MaterialProperty< RankTwoTensor > & _tensor
Definition: CylindricalRankTwoAux.h:36
registerMooseObject
registerMooseObject("TensorMechanicsApp", CylindricalRankTwoAux)
CylindricalRankTwoAux::computeValue
virtual Real computeValue()
Definition: CylindricalRankTwoAux.C:47
validParams
InputParameters validParams()
CylindricalRankTwoAux::_j
const unsigned int _j
Definition: CylindricalRankTwoAux.h:38
CylindricalRankTwoAux::_i
const unsigned int _i
Definition: CylindricalRankTwoAux.h:37
CylindricalRankTwoAux::CylindricalRankTwoAux
CylindricalRankTwoAux(const InputParameters &parameters)
Definition: CylindricalRankTwoAux.C:37
CylindricalRankTwoAux::_center_point
const Point _center_point
Definition: CylindricalRankTwoAux.h:39
RankTwoTensorTempl< Real >
defineLegacyParams
defineLegacyParams(CylindricalRankTwoAux)