www.mooseframework.org
DiracKernel.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 // MOOSE includes
13 #include "DiracKernelInfo.h"
14 #include "MooseVariableInterface.h"
15 #include "DiracKernelBase.h"
16 
17 // forward declarations
18 template <typename>
20 
23 
31 template <typename T>
33 {
34 public:
36 
38 
42  virtual void computeResidual() override;
43 
47  virtual void computeJacobian() override;
48 
52  virtual Real computeQpOffDiagJacobian(unsigned int jvar) override;
53 
57  virtual void computeOffDiagJacobian(unsigned int jvar) override;
58 
59  virtual const MooseVariableField<T> & variable() const override { return _var; }
60 
65  virtual void addPoints() override = 0;
66 
67 protected:
71  virtual Real computeQpResidual() = 0;
72 
76  virtual Real computeQpJacobian();
77 
80 
81  // shape functions
82 
87 
88  // test functions
89 
94 
99 
102 
103  // @{ Point-not-found behavior
105  {
106  ERROR,
107  WARNING,
108  IGNORE
109  };
111  // @}
112 };
DiracKernelTempl(const InputParameters &parameters)
Definition: DiracKernel.C:37
const OutputTools< T >::VariableValue & _u
Holds the solution at current quadrature points.
Definition: DiracKernel.h:96
virtual const MooseVariableField< T > & variable() const override
Returns the variable that this object operates on.
Definition: DiracKernel.h:59
const OutputTools< T >::VariableTestValue & _test
Values of test functions at QPs.
Definition: DiracKernel.h:91
const OutputTools< T >::VariablePhiValue & _phi
Values of shape functions at QPs.
Definition: DiracKernel.h:84
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual Real computeQpJacobian()
This is the virtual that derived classes should override for computing the Jacobian.
Definition: DiracKernel.C:154
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
This gets called by computeOffDiagJacobian() at each quadrature point.
Definition: DiracKernel.C:161
virtual void computeOffDiagJacobian(unsigned int jvar) override
Computes the off-diagonal Jacobian for variable jvar.
Definition: DiracKernel.C:119
const OutputTools< T >::VariableTestGradient & _grad_test
Gradients of test functions at QPs.
Definition: DiracKernel.h:93
virtual void addPoints() override=0
This is where the DiracKernel should call addPoint() for each point it needs to have a value distribu...
const OutputTools< T >::VariablePhiGradient & _grad_phi
Gradients of shape functions at QPs.
Definition: DiracKernel.h:86
MooseVariableField< T > & _var
Variable this kernel acts on.
Definition: DiracKernel.h:79
const PointNotFoundBehavior _point_not_found_behavior
Definition: DiracKernel.h:110
A DiracKernel is used when you need to add contributions to the residual by means of multiplying some...
Definition: DiracKernel.h:19
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual Real computeQpResidual()=0
This is the virtual that derived classes should override for computing the residual.
virtual void computeJacobian() override
Computes the jacobian for the current element.
Definition: DiracKernel.C:91
Interface for objects that need to get values of MooseVariables.
const InputParameters & parameters() const
Get the parameters of the object.
const OutputTools< T >::VariableGradient & _grad_u
Holds the solution gradient at the current quadrature points.
Definition: DiracKernel.h:98
const bool _drop_duplicate_points
drop duplicate points or consider them in residual and Jacobian
Definition: DiracKernel.h:101
DiracKernelBase is the base class for all DiracKernel type classes.
virtual void computeResidual() override
Computes the residual for the current element.
Definition: DiracKernel.C:64
static InputParameters validParams()
Definition: DiracKernel.C:24