www.mooseframework.org
MaterialDerivativeRankFourTestKernel.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
16 
17 template <>
20 {
22  params.addClassDescription(
23  "Class used for testing derivatives of a rank four tensor material property.");
24  params.addRequiredParam<unsigned int>("i", "Tensor component");
25  params.addRequiredParam<unsigned int>("j", "Tensor component");
26  params.addRequiredParam<unsigned int>("k", "Tensor component");
27  params.addRequiredParam<unsigned int>("l", "Tensor component");
28  return params;
29 }
30 
32  const InputParameters & parameters)
34  _component_i(getParam<unsigned int>("i")),
35  _component_j(getParam<unsigned int>("j")),
36  _component_k(getParam<unsigned int>("k")),
37  _component_l(getParam<unsigned int>("l"))
38 {
39 }
40 
41 Real
43 {
45 }
46 
47 Real
49 {
51  _phi[_j][_qp] * _test[_i][_qp];
52 }
53 
54 Real
56 {
57  // get the coupled variable number corresponding to jvar
58  const unsigned int cvar = mapJvarToCvar(jvar);
59  return (*_p_off_diag_derivatives[cvar])[_qp](
61  _phi[_j][_qp] * _test[_i][_qp];
62 }
const VariableTestValue & _test
the current test function
Definition: KernelBase.h:152
InputParameters validParams< MaterialDerivativeRankFourTestKernel >()
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
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:146
unsigned int mapJvarToCvar(unsigned int jvar)
Return index into the _coupled_moose_vars array for a given jvar.
const VariablePhiValue & _phi
the current shape functions
Definition: KernelBase.h:158
unsigned int _j
current index for the shape function
Definition: KernelBase.h:149
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
This is the virtual that derived classes should override for computing an off-diagonal Jacobian compo...
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.
std::vector< const MaterialProperty< RankFourTensor > * > _p_off_diag_derivatives
material properties for the off-diagonal derivatives of the tested property
RankFourTensor is designed to handle any N-dimensional fourth order tensor, C.
unsigned int _qp
The current quadrature point index.
Definition: KernelBase.h:131