www.mooseframework.org
Kernel.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
12 #include "KernelBase.h"
13 #include "MooseVariableInterface.h"
14 
15 class Kernel;
16 
17 template <>
19 
20 class Kernel : public KernelBase, public MooseVariableInterface<Real>
21 {
22 public:
24 
26  virtual void computeResidual() override;
27 
29  virtual void computeJacobian() override;
30 
32  virtual void computeOffDiagJacobian(MooseVariableFEBase & jvar) override;
33 
37  virtual void computeOffDiagJacobian(unsigned jvar);
38 
43  virtual void computeOffDiagJacobianScalar(unsigned int jvar) override;
44 
45  virtual MooseVariable & variable() override { return _var; }
46 
50  virtual Real computeQpResidual() = 0;
51 
52 protected:
55 
58 
61 
64 
67 
69  const VariableValue & _u;
70 
73 };
74 
virtual void computeResidual() override
Compute this Kernel&#39;s contribution to the residual.
Definition: Kernel.C:92
const VariableGradient & _grad_u
Holds the solution gradient at the current quadrature points.
Definition: Kernel.h:72
virtual Real computeQpResidual()=0
Compute this Kernel&#39;s contribution to the residual at the current quadrature point.
MooseVariable & _var
This is a regular kernel so we cast to a regular MooseVariable.
Definition: Kernel.h:54
const VariablePhiGradient & _grad_phi
gradient of the shape function
Definition: Kernel.h:66
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
OutputTools< Real >::VariablePhiValue VariablePhiValue
Definition: MooseTypes.h:201
Kernel(const InputParameters &parameters)
Definition: Kernel.C:31
virtual void computeOffDiagJacobian(MooseVariableFEBase &jvar) override
Computes d-residual / d-jvar... storing the result in Ke.
Definition: Kernel.C:138
const VariableTestValue & _test
the current test function
Definition: Kernel.h:57
This is the common base class for the two main kernel types implemented in MOOSE, EigenKernel and Ker...
Definition: KernelBase.h:44
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:65
OutputTools< Real >::VariableTestValue VariableTestValue
Definition: MooseTypes.h:205
virtual void computeJacobian() override
Compute this Kernel&#39;s contribution to the diagonal Jacobian entries.
Definition: Kernel.C:112
OutputTools< Real >::VariableValue VariableValue
Definition: MooseTypes.h:197
InputParameters validParams< Kernel >()
Definition: Kernel.C:24
forward declarations
Definition: MooseArray.h:16
const VariableTestGradient & _grad_test
gradient of the test function
Definition: Kernel.h:60
virtual MooseVariable & variable() override
Returns the variable number that this Kernel operates on.
Definition: Kernel.h:45
Interface for objects that need to get values of MooseVariables.
Definition: Kernel.h:20
OutputTools< Real >::VariableTestGradient VariableTestGradient
Definition: MooseTypes.h:206
const VariablePhiValue & _phi
the current shape functions
Definition: Kernel.h:63
virtual void computeOffDiagJacobianScalar(unsigned int jvar) override
Computes jacobian block with respect to a scalar variable.
Definition: Kernel.C:182
const VariableValue & _u
Holds the solution at current quadrature points.
Definition: Kernel.h:69