https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private 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 Types

typedef DerivativeMaterialPropertyNameInterface::SymbolName SymbolName
 

Public Member Functions

 CoupledMaterialDerivative (const InputParameters &parameters)
 
virtual void initialSetup () override
 
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialProperty (const std::string &name)
 
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialPropertyByName (const std::string &name)
 
void validateDerivativeMaterialPropertyBase (const std::string &base)
 
const MaterialPropertyName derivativePropertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName derivativePropertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName derivativePropertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName derivativePropertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, unsigned int v2, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, unsigned int v1, unsigned int v2=libMesh::invalid_uint, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, unsigned int v2, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, unsigned int v1, unsigned int v2=libMesh::invalid_uint, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
void validateCoupling (const MaterialPropertyName &base, const std::vector< VariableName > &c, bool validate_aux=true)
 
void validateCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateCoupling (const MaterialPropertyName &base, const std::vector< VariableName > &c, bool validate_aux=true)
 
void validateCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateNonlinearCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateNonlinearCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 

Static Public Member Functions

static InputParameters validParams ()
 

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
 
unsigned int _v_var
 
const MaterialProperty< Real > & _dFdv
 Material property derivative w.r.t. v.
 
const MaterialProperty< Real > & _d2Fdvdu
 2nd order material property derivative w.r.t. v then u
 
std::vector< const MaterialProperty< Real > * > _d2Fdvdarg
 2nd order material property derivatives w.r.t. v and then all other coupled variables
 

Private Member Functions

bool haveMaterialProperty (const std::string &prop_name)
 
std::vector< VariableName > buildVariableVector (const VariableName &c1, const VariableName &c2, const VariableName &c3)
 
void validateCouplingHelper (const MaterialPropertyName &base, const std::vector< VariableName > &c, const System &system, std::vector< VariableName > &missing)
 
bool isNotObjectVariable (const VariableName &name)
 

Private Attributes

FEProblemBase_dmi_fe_problem
 

Detailed Description

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

Definition at line 19 of file CoupledMaterialDerivative.h.

Constructor & Destructor Documentation

◆ CoupledMaterialDerivative()

CoupledMaterialDerivative::CoupledMaterialDerivative ( const InputParameters parameters)

Definition at line 29 of file CoupledMaterialDerivative.C.

31 _v_name(coupledName("v", 0)),
32 _v_var(coupled("v")),
33 _dFdv(getMaterialPropertyDerivative<Real>("f_name", _v_name)),
34 _d2Fdvdu(getMaterialPropertyDerivative<Real>("f_name", _v_name, _var.name())),
35 _d2Fdvdarg(_n_args)
36{
37 // Get material property derivatives for all coupled variables
38 for (unsigned int i = 0; i < _n_args; ++i)
39 _d2Fdvdarg[i] = &getMaterialPropertyDerivative<Real>("f_name", _v_name, i);
40}
const MaterialProperty< Real > & _dFdv
Material property derivative w.r.t. v.
std::string _v_name
name of the coupled variable the derivative is taken with respect to
const MaterialProperty< Real > & _d2Fdvdu
2nd order material property derivative w.r.t. v then u
std::vector< const MaterialProperty< Real > * > _d2Fdvdarg
2nd order material property derivatives w.r.t. v and then all other coupled variables

Member Function Documentation

◆ computeQpJacobian()

Real CoupledMaterialDerivative::computeQpJacobian ( )
overrideprotectedvirtual

Definition at line 55 of file CoupledMaterialDerivative.C.

56{
57 return _d2Fdvdu[_qp] * _test[_i][_qp] * _phi[_j][_qp];
58}

◆ computeQpOffDiagJacobian()

Real CoupledMaterialDerivative::computeQpOffDiagJacobian ( unsigned int  jvar)
overrideprotectedvirtual

Definition at line 61 of file CoupledMaterialDerivative.C.

62{
63 const unsigned int cvar = mapJvarToCvar(jvar);
64 return (*_d2Fdvdarg[cvar])[_qp] * _test[_i][_qp] * _phi[_j][_qp];
65}

◆ computeQpResidual()

Real CoupledMaterialDerivative::computeQpResidual ( )
overrideprotectedvirtual

Definition at line 49 of file CoupledMaterialDerivative.C.

50{
51 return _dFdv[_qp] * _test[_i][_qp];
52}

◆ initialSetup()

void CoupledMaterialDerivative::initialSetup ( )
overridevirtual

Definition at line 43 of file CoupledMaterialDerivative.C.

44{
45 validateNonlinearCoupling<Real>("f_name");
46}

◆ validParams()

InputParameters CoupledMaterialDerivative::validParams ( )
static

Definition at line 15 of file CoupledMaterialDerivative.C.

16{
18 params.addClassDescription("Kernel that implements the first derivative of a function material "
19 "property with respect to a coupled variable.");
20 params.addRequiredCoupledVar("v", "Variable to take the derivative with respect to");
21 params.addParam<MaterialPropertyName>("f_name",
22 "F",
23 "Function material to take the derivative of (should "
24 "provide derivative properties - such as a "
25 "DerivativeParsedMaterial)");
26 return params;
27}
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()

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 43 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 40 of file CoupledMaterialDerivative.h.

Referenced by computeQpJacobian().

◆ _dFdv

const MaterialProperty<Real>& CoupledMaterialDerivative::_dFdv
protected

Material property derivative w.r.t. v.

Definition at line 37 of file CoupledMaterialDerivative.h.

Referenced by computeQpResidual().

◆ _v_name

std::string CoupledMaterialDerivative::_v_name
protected

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

Definition at line 33 of file CoupledMaterialDerivative.h.

Referenced by CoupledMaterialDerivative().

◆ _v_var

unsigned int CoupledMaterialDerivative::_v_var
protected

Definition at line 34 of file CoupledMaterialDerivative.h.


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