www.mooseframework.org
MaterialDerivativeTestKernel.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("Class used for testing derivatives of a scalar material property.");
23  return params;
24 }
25 
27  : MaterialDerivativeTestKernelBase<Real>(parameters)
28 {
29 }
30 
31 Real
33 {
34  return _p[_qp] * _test[_i][_qp];
35 }
36 
37 Real
39 {
40  return _p_diag_derivative[_qp] * _phi[_j][_qp] * _test[_i][_qp];
41 }
42 
43 Real
45 {
46  // get the coupled variable number corresponding to jvar
47  const unsigned int cvar = mapJvarToCvar(jvar);
48  return (*_p_off_diag_derivatives[cvar])[_qp] * _phi[_j][_qp] * _test[_i][_qp];
49 }
virtual Real computeQpResidual() override
Compute this Kernel&#39;s contribution to the residual at the current quadrature point.
const VariableTestValue & _test
the current test function
Definition: KernelBase.h:152
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.
This kernel is used for testing derivatives of a material property.
const MaterialProperty< Real > & _p
material property for which to test derivatives
const MaterialProperty< Real > & _p_diag_derivative
material property for the diagonal derivative of the tested property
MaterialDerivativeTestKernel(const InputParameters &parameters)
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
This is the virtual that derived classes should override for computing an off-diagonal Jacobian compo...
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...
InputParameters validParams< MaterialDerivativeTestKernel >()
std::vector< const MaterialProperty< Real > * > _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