https://mooseframework.inl.gov
Loading...
Searching...
No Matches
InterfaceKernel.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
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// local includes
13#include "InterfaceKernelBase.h"
14
15#define TemplateVariableValue typename OutputTools<T>::VariableValue
16#define TemplateVariableGradient typename OutputTools<T>::VariableGradient
17#define TemplateVariablePhiValue typename OutputTools<T>::VariablePhiValue
18#define TemplateVariablePhiGradient typename OutputTools<T>::VariablePhiGradient
19#define TemplateVariableTestValue typename OutputTools<T>::VariableTestValue
20#define TemplateVariableTestGradient typename OutputTools<T>::VariableTestGradient
21
22// Forward Declarations
23template <typename T>
25
28
33template <typename T>
35{
36public:
38
40
42 virtual const MooseVariableFE<T> & variable() const override { return _var; }
43
45 virtual const MooseVariableFE<T> & neighborVariable() const override { return _neighbor_var; }
46
52
58
64 virtual void computeOffDiagElemNeighJacobian(Moose::DGJacobianType type, unsigned int jvar);
65
67 virtual void computeElementOffDiagJacobian(unsigned int jvar) override;
68
70 virtual void computeNeighborOffDiagJacobian(unsigned int jvar) override;
71
73 virtual void computeResidual() override;
74
76 virtual void computeJacobian() override;
77
79 virtual void computeResidualAndJacobian() override;
80
83
87 virtual void initQpResidual(Moose::DGResidualType /* type */) {}
88
92 virtual void initQpJacobian(Moose::DGJacobianType /* type */) {}
93
98 virtual void initQpOffDiagJacobian(Moose::DGJacobianType /* type */, unsigned int /* jvar */) {}
99
100protected:
103
106
108 const TemplateVariableValue & _u;
109
111 const TemplateVariableGradient & _grad_u;
112
114 const TemplateVariablePhiValue & _phi;
115
117 const TemplateVariablePhiGradient & _grad_phi;
118
120 const TemplateVariableTestValue & _test;
121
123 const TemplateVariableTestGradient & _grad_test;
124
127
129 const TemplateVariableValue & _neighbor_value;
130
132 const TemplateVariableGradient & _grad_neighbor_value;
133
135 const TemplateVariablePhiValue & _phi_neighbor;
136
138 const TemplateVariablePhiGradient & _grad_phi_neighbor;
139
141 const TemplateVariableTestValue & _test_neighbor;
142
144 const TemplateVariableTestGradient & _grad_test_neighbor;
145
148 const bool _same_system;
149
152 DenseMatrix<Number> _local_kxx;
153};
InterfaceKernelTempl< RealVectorValue > VectorInterfaceKernel
InterfaceKernelTempl< Real > InterfaceKernel
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
InterfaceKernelBase is the base class for all InterfaceKernel type classes.
InterfaceKernel and VectorInterfaceKernel is responsible for interfacing physics across subdomains.
const TemplateVariablePhiGradient & _grad_phi_neighbor
Gradient of side neighbor shape function.
const TemplateVariableGradient & _grad_u
Holds the current solution gradient at the current quadrature point on the face.
const TemplateVariablePhiGradient & _grad_phi
Shape function gradient.
virtual Real computeQpResidual(Moose::DGResidualType type)=0
Compute residuals at quadrature points.
const TemplateVariableValue & _u
Holds the current solution at the current quadrature point on the face.
const bool _same_system
Whether the variable and the neighbor variables are part of the same system (whether from two differe...
virtual void computeElementOffDiagJacobian(unsigned int jvar) override
Selects the correct Jacobian type and routine to call for the primary variable jacobian.
virtual void computeResidualAndJacobian() override
Computes the residual and Jacobian for the current side.
const TemplateVariableTestGradient & _grad_test_neighbor
Gradient of side neighbor shape function.
virtual void computeOffDiagElemNeighJacobian(Moose::DGJacobianType type, unsigned int jvar)
Using the passed DGJacobian type, selects the correct test function and trial function spaces and jac...
const TemplateVariableValue & _neighbor_value
Coupled neighbor variable value.
DenseMatrix< Number > _local_kxx
Holds residual entries as they are accumulated by this InterfaceKernel This variable is temporarily r...
virtual void initQpOffDiagJacobian(Moose::DGJacobianType, unsigned int)
Put necessary evaluations depending on qp but independent on test and shape functions here for off-di...
virtual const MooseVariableFE< T > & neighborVariable() const override
The neighbor variable number that this interface kernel operates on.
virtual void computeElemNeighResidual(Moose::DGResidualType type)
Using the passed DGResidual type, selects the correct test function space and residual block,...
const TemplateVariableTestGradient & _grad_test
Gradient of side shape function.
virtual void computeResidual() override
Computes the residual for the current side.
const TemplateVariableGradient & _grad_neighbor_value
Coupled neighbor variable gradient.
static InputParameters validParams()
const TemplateVariableTestValue & _test_neighbor
Side neighbor test function.
const TemplateVariablePhiValue & _phi
shape function
virtual void initQpResidual(Moose::DGResidualType)
Put necessary evaluations depending on qp but independent on test functions here.
virtual void initQpJacobian(Moose::DGJacobianType)
Put necessary evaluations depending on qp but independent on test and shape functions here.
virtual const MooseVariableFE< T > & variable() const override
The primary variable that this interface kernel operates on.
MooseVariableFE< T > & _var
The primary side MooseVariable.
const MooseArray< Point > & _normals
Normal vectors at the quadrature points.
virtual void computeNeighborOffDiagJacobian(unsigned int jvar) override
Selects the correct Jacobian type and routine to call for the secondary variable jacobian.
const MooseVariableFE< T > & _neighbor_var
Coupled neighbor variable.
const TemplateVariableTestValue & _test
Side shape function.
virtual void computeElemNeighJacobian(Moose::DGJacobianType type)
Using the passed DGJacobian type, selects the correct test function and trial function spaces and jac...
virtual void computeJacobian() override
Computes the jacobian for the current side.
const TemplateVariablePhiValue & _phi_neighbor
Side neighbor shape function.
forward declarations
Definition MooseArray.h:18
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
const std::string & type() const
Get the type of this class.
Definition MooseBase.h:93
Class for stuff related to variables.
Enhances MooseVariableInterface interface provide values from neighbor elements.
DGResidualType
Definition MooseTypes.h:798
DGJacobianType
Definition MooseTypes.h:804