https://mooseframework.inl.gov
Loading...
Searching...
No Matches
DGKernelBase.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 "MooseArray.h"
15#include "BlockRestrictable.h"
19#include "ElementIDInterface.h"
20
21#include "Assembly.h"
22
23#define usingDGKernelBaseMembers \
24 usingNeighborCoupleableMembers; \
25 usingFunctionInterfaceMembers; \
26 usingBlockRestrictableMembers; \
27 usingTransientInterfaceMembers
28
33 public BlockRestrictable,
38{
39public:
46
48
53
57 virtual void computeResidual() override;
58
63
67 virtual void computeJacobian() override;
68
73 const MooseVariableFEBase & jvar) = 0;
74
78 virtual void computeOffDiagJacobian(unsigned int jvar) override;
79
80 void prepareShapes(unsigned int var_num) override final;
81
82protected:
84 const Elem * const & _current_elem;
85
88
90 const Elem * const & _neighbor_elem;
91
94
96 const unsigned int & _current_side;
98 const Elem * const & _current_side_elem;
101
107 const QBase * const & _qrule;
114
117 std::vector<MooseVariableFEBase *> _save_in;
118 std::vector<AuxVariableName> _save_in_strings;
119
122 std::vector<MooseVariableFEBase *> _diag_save_in;
123 std::vector<AuxVariableName> _diag_save_in_strings;
124
126 const Real & getNeighborElemVolume() const { return _assembly.neighborVolume(); }
127
128public:
129 // boundary id used for internal edges (all DG kernels lives on this boundary id -- a made-up
130 // number)
132
133protected:
134 unsigned int _qp;
135
136 unsigned int _i, _j;
137
139
141 bool excludeBoundary() const;
142
143private:
145 std::set<BoundaryID> _excluded_boundaries;
146
147 friend class ADDGKernel;
148};
boundary_id_type BoundaryID
const Real & neighborVolume()
Returns the reference to the current neighbor volume.
Definition Assembly.h:508
An interface that restricts an object to subdomains via the 'blocks' input parameter.
/class BoundaryRestrictable /brief Provides functionality for limiting the object to certain boundary...
Serves as a base class for DGKernel and ADDGKernel.
const QBase *const & _qrule
Quadrature rule.
const Elem *const & _current_side_elem
Current side element.
static const BoundaryID InternalBndId
std::vector< AuxVariableName > _save_in_strings
const Moose::CoordinateSystemType & _coord_sys
Coordinate system.
virtual void computeJacobian() override
Computes the jacobian for the current side.
const Real & getNeighborElemVolume() const
The volume (or length) of the current neighbor.
std::set< BoundaryID > _excluded_boundaries
Broken boundaries.
std::vector< MooseVariableFEBase * > _diag_save_in
virtual void computeOffDiagElemNeighJacobian(Moose::DGJacobianType type, const MooseVariableFEBase &jvar)=0
Computes the element-element off-diagonal Jacobian.
const Real & _neighbor_elem_volume
The neighboring element volume.
virtual void computeElemNeighResidual(Moose::DGResidualType type)=0
Computes the residual for this element or the neighbor.
const MooseArray< Real > & _JxW
Jacobian det times quadrature weighting on quadrature points.
unsigned int _i
virtual void computeResidual() override
Computes the residual for the current side.
std::vector< AuxVariableName > _diag_save_in_strings
unsigned int _qp
const unsigned int & _current_side
Current side.
BoundaryID _boundary_id
bool _has_diag_save_in
The aux variables to save the diagonal Jacobian contributions to.
virtual void computeOffDiagJacobian(unsigned int jvar) override
Computes d-residual / d-jvar...
bool excludeBoundary() const
Check current element if it contains broken boundary.
std::vector< MooseVariableFEBase * > _save_in
const Real & _current_elem_volume
The volume (or length) of the current element.
const MooseArray< Point > & _q_point
Quadrature points.
static InputParameters validParams()
Factory constructor initializes all internal references needed for residual computation.
unsigned int _j
const Real & _current_side_volume
The volume (or length) of the current side.
const MooseArray< Real > & _coord
Coordinate transform mainly for curvilinear coordinates.
bool _has_save_in
The aux variables to save the residual contributions to.
const Elem *const & _current_elem
Current element.
virtual void computeElemNeighJacobian(Moose::DGJacobianType type)=0
Computes the element/neighbor-element/neighbor Jacobian.
const Elem *const & _neighbor_elem
The neighboring element.
const MooseArray< Point > & _normals
Normal vectors at the quadrature points.
void prepareShapes(unsigned int var_num) override final
Prepare shape functions.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
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
This class provides an interface for common operations on field variables of both FE and FV types wit...
Intermediate base class that ties together all the interfaces for getting MooseVariables with the Moo...
This is a base class for objects that can provide residual contributions for both local and neighbor ...
Assembly & _assembly
Reference to this Kernel's assembly object.
This interface is designed for DGKernel, InternalSideUserObject, InterfaceUserObject,...
DGResidualType
Definition MooseTypes.h:798
CoordinateSystemType
Definition MooseTypes.h:864
DGJacobianType
Definition MooseTypes.h:804