https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
MatGradSquareCoupled Class Reference

#include <MatGradSquareCoupled.h>

Inheritance diagram for MatGradSquareCoupled:
[legend]

Public Types

typedef DerivativeMaterialPropertyNameInterface::SymbolName SymbolName
 

Public Member Functions

 MatGradSquareCoupled (const InputParameters &parameters)
 
virtual void initialSetup ()
 
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 ()
 
virtual Real computeQpJacobian ()
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar)
 

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

const VariableGradient_grad_elec_potential
 
const unsigned int _elec_potential_var
 
const MaterialProperty< Real > & _prefactor
 
const MaterialProperty< Real > & _dprefactor_dphi
 
std::vector< const MaterialProperty< Real > * > _dprefactor_darg
 
FEProblemBase_dmi_fe_problem
 

Detailed Description

Definition at line 24 of file MatGradSquareCoupled.h.

Constructor & Destructor Documentation

◆ MatGradSquareCoupled()

MatGradSquareCoupled::MatGradSquareCoupled ( const InputParameters parameters)

Definition at line 28 of file MatGradSquareCoupled.C.

30 _grad_elec_potential(coupledGradient("elec_potential")),
31 _elec_potential_var(coupled("elec_potential")),
32 _prefactor(getMaterialProperty<Real>("prefactor")),
33 _dprefactor_dphi(getMaterialPropertyDerivative<Real>("prefactor", _var.name())),
34 _dprefactor_darg(_n_args)
35{
36 for (unsigned int i = 0; i < _n_args; ++i)
37 _dprefactor_darg[i] = &getMaterialPropertyDerivative<Real>("prefactor", i);
38}
const MaterialProperty< Real > & _prefactor
const VariableGradient & _grad_elec_potential
std::vector< const MaterialProperty< Real > * > _dprefactor_darg
const unsigned int _elec_potential_var
const MaterialProperty< Real > & _dprefactor_dphi

Member Function Documentation

◆ computeQpJacobian()

Real MatGradSquareCoupled::computeQpJacobian ( )
protectedvirtual

Definition at line 53 of file MatGradSquareCoupled.C.

54{
56 _phi[_j][_qp] * _test[_i][_qp];
57}

◆ computeQpOffDiagJacobian()

Real MatGradSquareCoupled::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Definition at line 60 of file MatGradSquareCoupled.C.

61{
62 const unsigned int cvar = mapJvarToCvar(jvar);
63
64 if (jvar == _elec_potential_var)
65 return -2 * _prefactor[_qp] * _grad_elec_potential[_qp] * _grad_phi[_j][_qp] * _test[_i][_qp] -
67 _phi[_j][_qp] * _test[_i][_qp];
68
69 return -(*_dprefactor_darg[cvar])[_qp] * _grad_elec_potential[_qp] * _grad_elec_potential[_qp] *
70 _phi[_j][_qp] * _test[_i][_qp];
71}

◆ computeQpResidual()

Real MatGradSquareCoupled::computeQpResidual ( )
protectedvirtual

Definition at line 47 of file MatGradSquareCoupled.C.

48{
49 return -_prefactor[_qp] * _grad_elec_potential[_qp] * _grad_elec_potential[_qp] * _test[_i][_qp];
50}

◆ initialSetup()

void MatGradSquareCoupled::initialSetup ( )
virtual

Definition at line 41 of file MatGradSquareCoupled.C.

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

◆ validParams()

InputParameters MatGradSquareCoupled::validParams ( )
static

Definition at line 15 of file MatGradSquareCoupled.C.

16{
18 params.addClassDescription("Gradient square of a coupled variable.");
19 params.addCoupledVar("elec_potential", "Electric potential");
20 params.addCoupledVar("coupled_variables", "Vector of variable arguments to prefactor");
21 params.addParam<MaterialPropertyName>(
22 "prefactor",
23 "prefactor",
24 "Material property providing a prefactor of electric potential contribution");
25 return params;
26}
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)
void addCoupledVar(const std::string &name, const std::string &doc_string)
static InputParameters validParams()

Member Data Documentation

◆ _dprefactor_darg

std::vector<const MaterialProperty<Real> *> MatGradSquareCoupled::_dprefactor_darg
private

Definition at line 43 of file MatGradSquareCoupled.h.

Referenced by computeQpOffDiagJacobian(), and MatGradSquareCoupled().

◆ _dprefactor_dphi

const MaterialProperty<Real>& MatGradSquareCoupled::_dprefactor_dphi
private

Definition at line 42 of file MatGradSquareCoupled.h.

Referenced by computeQpJacobian().

◆ _elec_potential_var

const unsigned int MatGradSquareCoupled::_elec_potential_var
private

Definition at line 39 of file MatGradSquareCoupled.h.

Referenced by computeQpOffDiagJacobian().

◆ _grad_elec_potential

const VariableGradient& MatGradSquareCoupled::_grad_elec_potential
private

◆ _prefactor

const MaterialProperty<Real>& MatGradSquareCoupled::_prefactor
private

Definition at line 41 of file MatGradSquareCoupled.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().


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