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

#include <GradientComponent.h>

Inheritance diagram for GradientComponent:
[legend]

Public Member Functions

 GradientComponent (const InputParameters &parameters)
 

Protected Member Functions

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

Protected Attributes

const unsigned int _v_var
 Identity of the coupled variable. More...
 
const VariableGradient & _grad_v
 Gradient of the coupled variable. More...
 
const unsigned int _component
 Component of the gradient vector to match. More...
 

Detailed Description

Definition at line 20 of file GradientComponent.h.

Constructor & Destructor Documentation

◆ GradientComponent()

GradientComponent::GradientComponent ( const InputParameters &  parameters)

Definition at line 27 of file GradientComponent.C.

28  : Kernel(parameters),
29  _v_var(coupled("v")),
30  _grad_v(coupledGradient("v")),
31  _component(getParam<unsigned int>("component"))
32 {
33  if (_component >= LIBMESH_DIM)
34  paramError("component", "Component too large for LIBMESH_DIM");
35 }
const VariableGradient & _grad_v
Gradient of the coupled variable.
const unsigned int _component
Component of the gradient vector to match.
const unsigned int _v_var
Identity of the coupled variable.

Member Function Documentation

◆ computeQpJacobian()

Real GradientComponent::computeQpJacobian ( )
protectedvirtual

Definition at line 44 of file GradientComponent.C.

45 {
46  return _phi[_j][_qp] * _test[_i][_qp];
47 }

◆ computeQpOffDiagJacobian()

Real GradientComponent::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Definition at line 50 of file GradientComponent.C.

51 {
52  if (jvar == _v_var)
53  return -_grad_phi[_j][_qp](_component) * _test[_i][_qp];
54  return 0.0;
55 }
const unsigned int _component
Component of the gradient vector to match.
const unsigned int _v_var
Identity of the coupled variable.

◆ computeQpResidual()

Real GradientComponent::computeQpResidual ( )
protectedvirtual

Definition at line 38 of file GradientComponent.C.

39 {
40  return (_u[_qp] - _grad_v[_qp](_component)) * _test[_i][_qp];
41 }
const VariableGradient & _grad_v
Gradient of the coupled variable.
const unsigned int _component
Component of the gradient vector to match.

Member Data Documentation

◆ _component

const unsigned int GradientComponent::_component
protected

Component of the gradient vector to match.

Definition at line 37 of file GradientComponent.h.

Referenced by computeQpOffDiagJacobian(), computeQpResidual(), and GradientComponent().

◆ _grad_v

const VariableGradient& GradientComponent::_grad_v
protected

Gradient of the coupled variable.

Definition at line 34 of file GradientComponent.h.

Referenced by computeQpResidual().

◆ _v_var

const unsigned int GradientComponent::_v_var
protected

Identity of the coupled variable.

Definition at line 31 of file GradientComponent.h.

Referenced by computeQpOffDiagJacobian().


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