https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MaterialDerivativeRankTwoTestKernel.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
11
13
16{
17 InputParameters params = MaterialDerivativeTestKernelBase<RankTwoTensor>::validParams();
19 "Class used for testing derivatives of a rank two tensor material property.");
20 params.addRequiredParam<unsigned int>("i", "Tensor component");
21 params.addRequiredParam<unsigned int>("j", "Tensor component");
22 return params;
23}
24
26 const InputParameters & parameters)
27 : MaterialDerivativeTestKernelBase<RankTwoTensor>(parameters),
28 _component_i(getParam<unsigned int>("i")),
29 _component_j(getParam<unsigned int>("j"))
30{
31}
32
33Real
38
39Real
41{
42 return _p_diag_derivative[_qp](_component_i, _component_j) * _phi[_j][_qp] * _test[_i][_qp];
43}
44
45Real
47{
48 // get the coupled variable number corresponding to jvar
49 const unsigned int cvar = mapJvarToCvar(jvar);
50 return (*_p_off_diag_derivatives[cvar])[_qp](_component_i, _component_j) * _phi[_j][_qp] *
51 _test[_i][_qp];
52}
registerMooseObject("CombinedTestApp", MaterialDerivativeRankTwoTestKernel)
void ErrorVector unsigned int
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
This kernel is used for testing derivatives of a material property.
MaterialDerivativeRankTwoTestKernel(const InputParameters &parameters)
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override