www.mooseframework.org
MaterialDerivativeRankTwoTestKernel.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 two tensor material property.");
24  params.addRequiredParam<unsigned int>("i", "Tensor component");
25  params.addRequiredParam<unsigned int>("j", "Tensor component");
26  return params;
27 }
28 
30  const InputParameters & parameters)
32  _component_i(getParam<unsigned int>("i")),
33  _component_j(getParam<unsigned int>("j"))
34 {
35 }
36 
37 Real
39 {
40  return _p[_qp](_component_i, _component_j) * _test[_i][_qp];
41 }
42 
43 Real
45 {
47 }
48 
49 Real
51 {
52  // get the coupled variable number corresponding to jvar
53  const unsigned int cvar = mapJvarToCvar(jvar);
55  _test[_i][_qp];
56 }
InputParameters validParams< MaterialDerivativeRankTwoTestKernel >()
const VariableTestValue & _test
the current test function
Definition: KernelBase.h:152
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
This is the virtual that derived classes should override for computing an off-diagonal Jacobian compo...
virtual Real computeQpResidual() override
Compute this Kernel&#39;s contribution to the residual at the current quadrature point.
MaterialDerivativeRankTwoTestKernel(const InputParameters &parameters)
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual Real computeQpJacobian() override
Compute this Kernel&#39;s contribution to the Jacobian at the current quadrature point.
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< RankTwoTensor > & _p
material property for which to test derivatives
const MaterialProperty< RankTwoTensor > & _p_diag_derivative
material property for the diagonal derivative of the tested property
RankTwoTensor is designed to handle the Stress or Strain Tensor for a fully anisotropic material...
Definition: RankTwoTensor.h:45
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
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...
std::vector< const MaterialProperty< RankTwoTensor > * > _p_off_diag_derivatives
material properties for the off-diagonal derivatives of the tested property
unsigned int _qp
The current quadrature point index.
Definition: KernelBase.h:131