www.mooseframework.org
MaterialDerivativeRankFourTestKernel.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 
11 
13 
16 {
18  params.addClassDescription(
19  "Class used for testing derivatives of a rank four tensor material property.");
20  params.addRequiredParam<unsigned int>("i", "Tensor component");
21  params.addRequiredParam<unsigned int>("j", "Tensor component");
22  params.addRequiredParam<unsigned int>("k", "Tensor component");
23  params.addRequiredParam<unsigned int>("l", "Tensor component");
24  return params;
25 }
26 
28  const InputParameters & parameters)
30  _component_i(getParam<unsigned int>("i")),
31  _component_j(getParam<unsigned int>("j")),
32  _component_k(getParam<unsigned int>("k")),
33  _component_l(getParam<unsigned int>("l"))
34 {
35 }
36 
37 Real
39 {
41 }
42 
43 Real
45 {
47  _phi[_j][_qp] * _test[_i][_qp];
48 }
49 
50 Real
52 {
53  // get the coupled variable number corresponding to jvar
54  const unsigned int cvar = mapJvarToCvar(jvar);
55  return (*_p_off_diag_derivatives[cvar])[_qp](
57  _phi[_j][_qp] * _test[_i][_qp];
58 }
RankFourTensorTempl is designed to handle any N-dimensional fourth order tensor, C.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
This kernel is used for testing derivatives of a material property.
const MaterialProperty< RankFourTensor > & _p
material property for which to test derivatives
const MaterialProperty< RankFourTensor > & _p_diag_derivative
material property for the diagonal derivative of the tested property
const VariableTestValue & _test
the current test function
Definition: Kernel.h:75
MaterialDerivativeRankFourTestKernel(const InputParameters &parameters)
virtual Real computeQpResidual() override
Compute this Kernel&#39;s contribution to the residual at the current quadrature point.
unsigned int _i
current index for the test function
Definition: KernelBase.h:57
This kernel is used for testing derivatives of a material property.
unsigned int mapJvarToCvar(unsigned int jvar)
Return index into the _coupled_moose_vars array for a given jvar.
unsigned int _j
current index for the shape function
Definition: KernelBase.h:60
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
For coupling standard variables.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump...
virtual Real computeQpJacobian() override
Compute this Kernel&#39;s contribution to the Jacobian at the current quadrature point.
const VariablePhiValue & _phi
the current shape functions
Definition: Kernel.h:81
std::vector< const MaterialProperty< RankFourTensor > *> _p_off_diag_derivatives
material properties for the off-diagonal derivatives of the tested property
registerMooseObject("MooseApp", MaterialDerivativeRankFourTestKernel)
void ErrorVector unsigned int
unsigned int _qp
The current quadrature point index.
Definition: KernelBase.h:42