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 17 of file GradientComponent.h.

Constructor & Destructor Documentation

GradientComponent::GradientComponent ( const InputParameters &  parameters)

Definition at line 22 of file GradientComponent.C.

23  : Kernel(parameters),
24  _v_var(coupled("v")),
25  _grad_v(coupledGradient("v")),
26  _component(getParam<unsigned int>("component"))
27 {
28  if (_component >= LIBMESH_DIM)
29  mooseError("Component too large for LIBMESH_DIM");
30 }
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

Real GradientComponent::computeQpJacobian ( )
protectedvirtual

Definition at line 39 of file GradientComponent.C.

40 {
41  return _phi[_j][_qp] * _test[_i][_qp];
42 }
Real GradientComponent::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Definition at line 45 of file GradientComponent.C.

46 {
47  if (jvar == _v_var)
48  return -_grad_phi[_j][_qp](_component) * _test[_i][_qp];
49  return 0.0;
50 }
const unsigned int _component
Component of the gradient vector to match.
const unsigned int _v_var
Identity of the coupled variable.
Real GradientComponent::computeQpResidual ( )
protectedvirtual

Definition at line 33 of file GradientComponent.C.

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

Member Data Documentation

const unsigned int GradientComponent::_component
protected

Component of the gradient vector to match.

Definition at line 34 of file GradientComponent.h.

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

const VariableGradient& GradientComponent::_grad_v
protected

Gradient of the coupled variable.

Definition at line 31 of file GradientComponent.h.

Referenced by computeQpResidual().

const unsigned int GradientComponent::_v_var
protected

Identity of the coupled variable.

Definition at line 28 of file GradientComponent.h.

Referenced by computeQpOffDiagJacobian().


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