www.mooseframework.org
RankFourAux.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 "RankFourAux.h"
11 
12 #include "metaphysicl/raw_type.h"
13 
14 registerMooseObject("SolidMechanicsApp", RankFourAux);
15 registerMooseObject("SolidMechanicsApp", ADRankFourAux);
16 
17 template <bool is_ad>
20 {
22  params.addClassDescription("Access a component of a RankFourTensor");
23 
24  // add stuff here
25  params.addRequiredParam<MaterialPropertyName>("rank_four_tensor",
26  "The rank four material tensor name");
27  params.addRequiredRangeCheckedParam<unsigned int>(
28  "index_i",
29  "index_i >= 0 & index_i <= 2",
30  "The index i of ijkl for the tensor to output (0, 1, 2)");
31  params.addRequiredRangeCheckedParam<unsigned int>(
32  "index_j",
33  "index_j >= 0 & index_j <= 2",
34  "The index j of ijkl for the tensor to output (0, 1, 2)");
35  params.addRequiredRangeCheckedParam<unsigned int>(
36  "index_k",
37  "index_k >= 0 & index_k <= 2",
38  "The index k of ijkl for the tensor to output (0, 1, 2)");
39  params.addRequiredRangeCheckedParam<unsigned int>(
40  "index_l",
41  "index_l >= 0 & index_l <= 2",
42  "The index l of ijkl for the tensor to output (0, 1, 2)");
43 
44  return params;
45 }
46 
47 template <bool is_ad>
49  : AuxKernel(parameters),
50  _tensor(getGenericMaterialProperty<RankFourTensor, is_ad>("rank_four_tensor")),
51  _i(getParam<unsigned int>("index_i")),
52  _j(getParam<unsigned int>("index_j")),
53  _k(getParam<unsigned int>("index_k")),
54  _l(getParam<unsigned int>("index_l"))
55 {
56 }
57 
58 template <bool is_ad>
59 Real
61 {
62  return MetaPhysicL::raw_value(_tensor[_qp](_i, _j, _k, _l));
63 }
64 
65 template class RankFourAuxTempl<false>;
66 template class RankFourAuxTempl<true>;
void addRequiredRangeCheckedParam(const std::string &name, const std::string &parsed_function, const std::string &doc_string)
registerMooseObject("SolidMechanicsApp", RankFourAux)
auto raw_value(const Eigen::Map< T > &in)
virtual Real computeValue()
Definition: RankFourAux.C:60
RankFourAux is designed to take the data in the RankFourTensor material property, for example stiffne...
Definition: RankFourAux.h:21
void addRequiredParam(const std::string &name, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static InputParameters validParams()
Definition: RankFourAux.C:19
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
RankFourAuxTempl(const InputParameters &parameters)
Definition: RankFourAux.C:48
void ErrorVector unsigned int