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
 
unsigned int _v_var
 
const MaterialProperty< Real > & _dFdv
 Free Energy derivative w.r.t. v. More...
 
const MaterialProperty< Real > & _d2Fdvdu
 Free energy 2nd order derivative w.r.t. v then u. More...
 
const MaterialProperty< Real > & _d2Fdv2
 Free energy 2nd order derivative w.r.t. v. More...
 
const unsigned int _nvar
 Number of coupled variables. More...
 
std::vector< const MaterialProperty< Real > * > _d2Fdvdarg
 Reaction rate derivatives w.r.t. other coupled variables. More...
 

Detailed Description

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

Definition at line 23 of file CoupledMaterialDerivative.h.

Constructor & Destructor Documentation

CoupledMaterialDerivative::CoupledMaterialDerivative ( const InputParameters &  parameters)

Definition at line 22 of file CoupledMaterialDerivative.C.

23  : DerivativeMaterialInterface<JvarMapKernelInterface<Kernel>>(parameters),
24  _v_name(getVar("v", 0)->name()),
25  _v_var(coupled("v")),
26  _dFdv(getMaterialPropertyDerivative<Real>("f_name", _v_name)),
27  _d2Fdvdu(getMaterialPropertyDerivative<Real>("f_name", _v_name, _var.name())),
28  _d2Fdv2(getMaterialPropertyDerivative<Real>("f_name", _v_name, _v_name)),
29  _nvar(_coupled_moose_vars.size()),
31 {
32  // Get free energy derivatives for other coupled variables besides v
33  for (unsigned int i = 0; i < _nvar; ++i)
34  {
35  MooseVariable * ivar = _coupled_moose_vars[i];
36  _d2Fdvdarg[i] = &getMaterialPropertyDerivative<Real>("mob_name", _v_name, ivar->name());
37  }
38 }
const MaterialProperty< Real > & _d2Fdvdu
Free energy 2nd order derivative w.r.t. v then u.
const unsigned int _nvar
Number of coupled variables.
const MaterialProperty< Real > & _d2Fdv2
Free energy 2nd order derivative w.r.t. v.
std::vector< const MaterialProperty< Real > * > _d2Fdvdarg
Reaction rate derivatives w.r.t. other coupled variables.
const MaterialProperty< Real > & _dFdv
Free Energy derivative w.r.t. v.

Member Function Documentation

Real CoupledMaterialDerivative::computeQpJacobian ( )
overrideprotectedvirtual

Definition at line 53 of file CoupledMaterialDerivative.C.

54 {
55  return _d2Fdvdu[_qp] * _test[_i][_qp] * _phi[_j][_qp];
56 }
const MaterialProperty< Real > & _d2Fdvdu
Free energy 2nd order derivative w.r.t. v then u.
Real CoupledMaterialDerivative::computeQpOffDiagJacobian ( unsigned int  jvar)
overrideprotectedvirtual

Definition at line 59 of file CoupledMaterialDerivative.C.

60 {
61  // Jacobian w.r.t. v
62  if (jvar == _v_var)
63  return _d2Fdv2[_qp] * _test[_i][_qp] * _phi[_j][_qp];
64 
65  // for all other vars get the coupled variable jvar is referring to
66  const unsigned int cvar = mapJvarToCvar(jvar);
67 
68  return (*_d2Fdvdarg[cvar])[_qp] * _test[_i][_qp] * _phi[_j][_qp];
69 }
const MaterialProperty< Real > & _d2Fdv2
Free energy 2nd order derivative w.r.t. v.
std::vector< const MaterialProperty< Real > * > _d2Fdvdarg
Reaction rate derivatives w.r.t. other coupled variables.
Real CoupledMaterialDerivative::computeQpResidual ( )
overrideprotectedvirtual

Definition at line 47 of file CoupledMaterialDerivative.C.

48 {
49  return _dFdv[_qp] * _test[_i][_qp];
50 }
const MaterialProperty< Real > & _dFdv
Free Energy derivative w.r.t. v.
void CoupledMaterialDerivative::initialSetup ( )
overridevirtual

Definition at line 41 of file CoupledMaterialDerivative.C.

42 {
43  validateNonlinearCoupling<Real>("f_name");
44 }

Member Data Documentation

const MaterialProperty<Real>& CoupledMaterialDerivative::_d2Fdv2
protected

Free energy 2nd order derivative w.r.t. v.

Definition at line 44 of file CoupledMaterialDerivative.h.

Referenced by computeQpOffDiagJacobian().

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

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

Definition at line 50 of file CoupledMaterialDerivative.h.

Referenced by computeQpOffDiagJacobian(), and CoupledMaterialDerivative().

const MaterialProperty<Real>& CoupledMaterialDerivative::_d2Fdvdu
protected

Free energy 2nd order derivative w.r.t. v then u.

Definition at line 41 of file CoupledMaterialDerivative.h.

Referenced by computeQpJacobian().

const MaterialProperty<Real>& CoupledMaterialDerivative::_dFdv
protected

Free Energy derivative w.r.t. v.

Definition at line 38 of file CoupledMaterialDerivative.h.

Referenced by computeQpResidual().

const unsigned int CoupledMaterialDerivative::_nvar
protected

Number of coupled variables.

Definition at line 47 of file CoupledMaterialDerivative.h.

Referenced by CoupledMaterialDerivative().

std::string CoupledMaterialDerivative::_v_name
protected

Definition at line 34 of file CoupledMaterialDerivative.h.

Referenced by CoupledMaterialDerivative().

unsigned int CoupledMaterialDerivative::_v_var
protected

Definition at line 35 of file CoupledMaterialDerivative.h.

Referenced by computeQpOffDiagJacobian().


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