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

#include <MatGradSquareCoupled.h>

Inheritance diagram for MatGradSquareCoupled:
[legend]

Public Member Functions

 MatGradSquareCoupled (const InputParameters &parameters)
 
virtual void initialSetup ()
 

Protected Member Functions

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

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
 

Detailed Description

Definition at line 29 of file MatGradSquareCoupled.h.

Constructor & Destructor Documentation

◆ MatGradSquareCoupled()

MatGradSquareCoupled::MatGradSquareCoupled ( const InputParameters &  parameters)

Definition at line 29 of file MatGradSquareCoupled.C.

30  : DerivativeMaterialInterface<JvarMapKernelInterface<Kernel>>(parameters),
31  _grad_elec_potential(coupledGradient("elec_potential")),
32  _elec_potential_var(coupled("elec_potential")),
33  _prefactor(getMaterialProperty<Real>("prefactor")),
34  _dprefactor_dphi(getMaterialPropertyDerivative<Real>("prefactor", _var.name())),
35  _dprefactor_darg(_coupled_moose_vars.size())
36 {
37  for (unsigned int i = 0; i < _dprefactor_darg.size(); ++i)
38  _dprefactor_darg[i] =
39  &getMaterialPropertyDerivative<Real>("prefactor", _coupled_moose_vars[i]->name());
40 }
std::vector< const MaterialProperty< Real > * > _dprefactor_darg
const VariableGradient & _grad_elec_potential
const MaterialProperty< Real > & _prefactor
const std::string name
Definition: Setup.h:22
const unsigned int _elec_potential_var
const MaterialProperty< Real > & _dprefactor_dphi

Member Function Documentation

◆ computeQpJacobian()

Real MatGradSquareCoupled::computeQpJacobian ( )
protectedvirtual

Definition at line 55 of file MatGradSquareCoupled.C.

56 {
58  _phi[_j][_qp] * _test[_i][_qp];
59 }
const VariableGradient & _grad_elec_potential
const MaterialProperty< Real > & _dprefactor_dphi

◆ computeQpOffDiagJacobian()

Real MatGradSquareCoupled::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Definition at line 62 of file MatGradSquareCoupled.C.

63 {
64  const unsigned int cvar = mapJvarToCvar(jvar);
65 
66  if (jvar == _elec_potential_var)
67  return -2 * _prefactor[_qp] * _grad_elec_potential[_qp] * _grad_phi[_j][_qp] * _test[_i][_qp] -
68  (*_dprefactor_darg[cvar])[_qp] * _grad_elec_potential[_qp] * _grad_elec_potential[_qp] *
69  _phi[_j][_qp] * _test[_i][_qp];
70 
71  return -(*_dprefactor_darg[cvar])[_qp] * _grad_elec_potential[_qp] * _grad_elec_potential[_qp] *
72  _phi[_j][_qp] * _test[_i][_qp];
73 }
std::vector< const MaterialProperty< Real > * > _dprefactor_darg
const VariableGradient & _grad_elec_potential
const MaterialProperty< Real > & _prefactor
const unsigned int _elec_potential_var

◆ computeQpResidual()

Real MatGradSquareCoupled::computeQpResidual ( )
protectedvirtual

Definition at line 49 of file MatGradSquareCoupled.C.

50 {
51  return -_prefactor[_qp] * _grad_elec_potential[_qp] * _grad_elec_potential[_qp] * _test[_i][_qp];
52 }
const VariableGradient & _grad_elec_potential
const MaterialProperty< Real > & _prefactor

◆ initialSetup()

void MatGradSquareCoupled::initialSetup ( )
virtual

Definition at line 43 of file MatGradSquareCoupled.C.

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

Member Data Documentation

◆ _dprefactor_darg

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

Definition at line 46 of file MatGradSquareCoupled.h.

Referenced by computeQpOffDiagJacobian(), and MatGradSquareCoupled().

◆ _dprefactor_dphi

const MaterialProperty<Real>& MatGradSquareCoupled::_dprefactor_dphi
private

Definition at line 45 of file MatGradSquareCoupled.h.

Referenced by computeQpJacobian().

◆ _elec_potential_var

const unsigned int MatGradSquareCoupled::_elec_potential_var
private

Definition at line 42 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 44 of file MatGradSquareCoupled.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().


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