https://mooseframework.inl.gov
Loading...
Searching...
No Matches
RankFourAux.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
10#include "RankFourAux.h"
11
12#include "metaphysicl/raw_type.h"
13
14registerMooseObject("SolidMechanicsApp", RankFourAux);
15registerMooseObject("SolidMechanicsApp", ADRankFourAux);
16
17template <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
47template <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
58template <bool is_ad>
59Real
61{
62 return MetaPhysicL::raw_value(_tensor[_qp](_i, _j, _k, _l));
63}
64
65template class RankFourAuxTempl<false>;
66template class RankFourAuxTempl<true>;
registerMooseObject("SolidMechanicsApp", RankFourAux)
void ErrorVector unsigned int
static InputParameters validParams()
void addRequiredRangeCheckedParam(const std::string &name, const std::string &parsed_function, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
RankFourAux is designed to take the data in the RankFourTensor material property, for example stiffne...
Definition RankFourAux.h:22
virtual Real computeValue()
Definition RankFourAux.C:60
static InputParameters validParams()
Definition RankFourAux.C:19
RankFourAuxTempl(const InputParameters &parameters)
Definition RankFourAux.C:48
auto raw_value(const Eigen::Map< T > &in)