www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CoupledMaterialDerivative Class Reference

This kernel adds the term (dFdv, test), where v is a coupled variable. More...

#include <CoupledMaterialDerivative.h>

Inheritance diagram for CoupledMaterialDerivative:
[legend]

Public Member Functions

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

Protected Member Functions

virtual Real computeQpResidual () override
 
virtual Real computeQpJacobian () override
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar) override
 

Protected Attributes

std::string _v_name
 name of the coupled variable the derivative is taken with respect to More...
 
unsigned int _v_var
 
const MaterialProperty< Real > & _dFdv
 Material property derivative w.r.t. v. More...
 
const MaterialProperty< Real > & _d2Fdvdu
 2nd order material property derivative w.r.t. v then u More...
 
const unsigned int _nvar
 Number of coupled variables. More...
 
std::vector< const MaterialProperty< Real > * > _d2Fdvdarg
 2nd order material property derivatives w.r.t. v and then all other coupled variables More...
 

Detailed Description

This kernel adds the term (dFdv, test), where v is a coupled variable.

Definition at line 26 of file CoupledMaterialDerivative.h.

Constructor & Destructor Documentation

◆ CoupledMaterialDerivative()

CoupledMaterialDerivative::CoupledMaterialDerivative ( const InputParameters &  parameters)

Definition at line 33 of file CoupledMaterialDerivative.C.

34  : DerivativeMaterialInterface<JvarMapKernelInterface<Kernel>>(parameters),
35  _v_name(getVar("v", 0)->name()),
36  _v_var(coupled("v")),
37  _dFdv(getMaterialPropertyDerivative<Real>("f_name", _v_name)),
38  _d2Fdvdu(getMaterialPropertyDerivative<Real>("f_name", _v_name, _var.name())),
39  _nvar(_coupled_moose_vars.size()),
41 {
42  // Get material property derivatives for all coupled variables
43  for (unsigned int i = 0; i < _nvar; ++i)
44  {
45  MooseVariableFEBase * ivar = _coupled_moose_vars[i];
46  _d2Fdvdarg[i] = &getMaterialPropertyDerivative<Real>("f_name", _v_name, ivar->name());
47  }
48 }
const MaterialProperty< Real > & _d2Fdvdu
2nd order material property derivative w.r.t. v then u
std::string _v_name
name of the coupled variable the derivative is taken with respect to
const unsigned int _nvar
Number of coupled variables.
std::vector< const MaterialProperty< Real > * > _d2Fdvdarg
2nd order material property derivatives w.r.t. v and then all other coupled variables ...
const MaterialProperty< Real > & _dFdv
Material property derivative w.r.t. v.

Member Function Documentation

◆ computeQpJacobian()

Real CoupledMaterialDerivative::computeQpJacobian ( )
overrideprotectedvirtual

Definition at line 63 of file CoupledMaterialDerivative.C.

64 {
65  return _d2Fdvdu[_qp] * _test[_i][_qp] * _phi[_j][_qp];
66 }
const MaterialProperty< Real > & _d2Fdvdu
2nd order material property derivative w.r.t. v then u

◆ computeQpOffDiagJacobian()

Real CoupledMaterialDerivative::computeQpOffDiagJacobian ( unsigned int  jvar)
overrideprotectedvirtual

Definition at line 69 of file CoupledMaterialDerivative.C.

70 {
71  const unsigned int cvar = mapJvarToCvar(jvar);
72  return (*_d2Fdvdarg[cvar])[_qp] * _test[_i][_qp] * _phi[_j][_qp];
73 }
std::vector< const MaterialProperty< Real > * > _d2Fdvdarg
2nd order material property derivatives w.r.t. v and then all other coupled variables ...

◆ computeQpResidual()

Real CoupledMaterialDerivative::computeQpResidual ( )
overrideprotectedvirtual

Definition at line 57 of file CoupledMaterialDerivative.C.

58 {
59  return _dFdv[_qp] * _test[_i][_qp];
60 }
const MaterialProperty< Real > & _dFdv
Material property derivative w.r.t. v.

◆ initialSetup()

void CoupledMaterialDerivative::initialSetup ( )
overridevirtual

Definition at line 51 of file CoupledMaterialDerivative.C.

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

Member Data Documentation

◆ _d2Fdvdarg

std::vector<const MaterialProperty<Real> *> CoupledMaterialDerivative::_d2Fdvdarg
protected

2nd order material property derivatives w.r.t. v and then all other coupled variables

Definition at line 51 of file CoupledMaterialDerivative.h.

Referenced by computeQpOffDiagJacobian(), and CoupledMaterialDerivative().

◆ _d2Fdvdu

const MaterialProperty<Real>& CoupledMaterialDerivative::_d2Fdvdu
protected

2nd order material property derivative w.r.t. v then u

Definition at line 45 of file CoupledMaterialDerivative.h.

Referenced by computeQpJacobian().

◆ _dFdv

const MaterialProperty<Real>& CoupledMaterialDerivative::_dFdv
protected

Material property derivative w.r.t. v.

Definition at line 42 of file CoupledMaterialDerivative.h.

Referenced by computeQpResidual().

◆ _nvar

const unsigned int CoupledMaterialDerivative::_nvar
protected

Number of coupled variables.

Definition at line 48 of file CoupledMaterialDerivative.h.

Referenced by CoupledMaterialDerivative().

◆ _v_name

std::string CoupledMaterialDerivative::_v_name
protected

name of the coupled variable the derivative is taken with respect to

Definition at line 38 of file CoupledMaterialDerivative.h.

Referenced by CoupledMaterialDerivative().

◆ _v_var

unsigned int CoupledMaterialDerivative::_v_var
protected

Definition at line 39 of file CoupledMaterialDerivative.h.


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