https://mooseframework.inl.gov
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
MatBodyForce Class Reference

#include <MatBodyForce.h>

Inheritance diagram for MatBodyForce:
[legend]

Public Member Functions

 MatBodyForce (const InputParameters &parameters)
 
virtual void initialSetup () override
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Member Functions

virtual Real computeQpJacobian () override
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar) override
 
virtual GenericReal< is_ad > computeQpResidual () override
 

Protected Attributes

const MaterialProperty< Real > & _dpropertydv
 derivative of the property wrt the kernel's nonlinear variable More...
 
std::vector< const MaterialProperty< Real > * > _dpropertydarg
 Reaction rate derivatives w.r.t. other coupled variables. More...
 
const GenericMaterialProperty< Real, is_ad > & _property
 
 usingGenericKernelMembers
 

Detailed Description

Definition at line 40 of file MatBodyForce.h.

Constructor & Destructor Documentation

◆ MatBodyForce()

MatBodyForce::MatBodyForce ( const InputParameters parameters)

Definition at line 40 of file MatBodyForce.C.

41  : MatBodyForceParent(parameters),
42  _dpropertydv(getMaterialPropertyDerivative<Real>("material_property", _var.name())),
43  _dpropertydarg(_n_args)
44 {
45  // Get derivatives of property wrt coupled variables
46  for (unsigned int i = 0; i < _n_args; ++i)
47  _dpropertydarg[i] = &getMaterialPropertyDerivative<Real>("material_property", i);
48 }
MatBodyForceTempl< false, DerivativeMaterialInterface< JvarMapKernelInterface< BodyForce > >> MatBodyForceParent
Definition: MatBodyForce.h:38
const MaterialProperty< Real > & _dpropertydv
derivative of the property wrt the kernel&#39;s nonlinear variable
Definition: MatBodyForce.h:51
std::vector< const MaterialProperty< Real > * > _dpropertydarg
Reaction rate derivatives w.r.t. other coupled variables.
Definition: MatBodyForce.h:54

Member Function Documentation

◆ computeQpJacobian()

Real MatBodyForce::computeQpJacobian ( )
overrideprotectedvirtual

Definition at line 57 of file MatBodyForce.C.

58 {
59  return _dpropertydv[_qp] * BodyForce::computeQpResidual() * _phi[_j][_qp];
60 }
virtual GenericReal< is_ad > computeQpResidual() override
Compute this Kernel&#39;s contribution to the residual at the current quadrature point.
Definition: BodyForce.C:48
const MaterialProperty< Real > & _dpropertydv
derivative of the property wrt the kernel&#39;s nonlinear variable
Definition: MatBodyForce.h:51

◆ computeQpOffDiagJacobian()

Real MatBodyForce::computeQpOffDiagJacobian ( unsigned int  jvar)
overrideprotectedvirtual

Definition at line 63 of file MatBodyForce.C.

64 {
65  const unsigned int cvar = mapJvarToCvar(jvar);
66  return (*_dpropertydarg[cvar])[_qp] * BodyForce::computeQpResidual() * _phi[_j][_qp];
67 }
virtual GenericReal< is_ad > computeQpResidual() override
Compute this Kernel&#39;s contribution to the residual at the current quadrature point.
Definition: BodyForce.C:48
std::vector< const MaterialProperty< Real > * > _dpropertydarg
Reaction rate derivatives w.r.t. other coupled variables.
Definition: MatBodyForce.h:54

◆ computeQpResidual()

template<bool is_ad, class Parent >
GenericReal< is_ad > MatBodyForceTempl< is_ad, Parent >::computeQpResidual ( )
overrideprotectedvirtualinherited

Definition at line 35 of file MatBodyForce.C.

36 {
37  return Parent::computeQpResidual() * _property[_qp];
38 }
const GenericMaterialProperty< Real, is_ad > & _property
Definition: MatBodyForce.h:32

◆ initialSetup()

void MatBodyForce::initialSetup ( )
overridevirtual

Definition at line 51 of file MatBodyForce.C.

52 {
53  validateNonlinearCoupling<Real>("material_property");
54 }

◆ validParams()

template<bool is_ad, class Parent >
InputParameters MatBodyForceTempl< is_ad, Parent >::validParams ( )
staticinherited

Definition at line 17 of file MatBodyForce.C.

18 {
20  params.addClassDescription("Kernel that defines a body force modified by a material property");
21  params.addRequiredParam<MaterialPropertyName>("material_property",
22  "Material property defining the body force");
23  return params;
24 }
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
InputParameters validParams()
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...
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...

Member Data Documentation

◆ _dpropertydarg

std::vector<const MaterialProperty<Real> *> MatBodyForce::_dpropertydarg
protected

Reaction rate derivatives w.r.t. other coupled variables.

Definition at line 54 of file MatBodyForce.h.

Referenced by computeQpOffDiagJacobian(), and MatBodyForce().

◆ _dpropertydv

const MaterialProperty<Real>& MatBodyForce::_dpropertydv
protected

derivative of the property wrt the kernel's nonlinear variable

Definition at line 51 of file MatBodyForce.h.

Referenced by computeQpJacobian().

◆ _property

template<bool is_ad, class Parent >
const GenericMaterialProperty<Real, is_ad>& MatBodyForceTempl< is_ad, Parent >::_property
protectedinherited

Definition at line 32 of file MatBodyForce.h.

◆ usingGenericKernelMembers

template<bool is_ad, class Parent >
MatBodyForceTempl< is_ad, Parent >::usingGenericKernelMembers
protectedinherited

Definition at line 34 of file MatBodyForce.h.


The documentation for this class was generated from the following files: