18#include "libmesh/dof_map.h"
19#include "libmesh/dense_vector.h"
20#include "libmesh/numeric_vector.h"
21#include "libmesh/dense_subvector.h"
22#include "libmesh/libmesh_common.h"
23#include "libmesh/quadrature.h"
32 params.
addParam<
bool>(
"use_displaced_mesh",
34 "Whether or not this object should use the "
35 "displaced mesh for computation. Note that in "
36 "the case this is true but no displacements "
37 "are provided in the Mesh block the "
38 "undisplaced mesh will still be used.");
41 params.
addParam<std::vector<AuxVariableName>>(
44 "The name of auxiliary variables to save this Kernel's residual contributions to. "
45 " Everything about that variable must match everything about this variable (the "
46 "type, what blocks it's on, etc.)");
47 params.
addParam<std::vector<AuxVariableName>>(
50 "The name of auxiliary variables to save this Kernel's diagonal Jacobian "
51 "contributions to. Everything about that variable must match everything "
52 "about this variable (the type, what blocks it's on, etc.)");
61 params.
addParam<std::vector<BoundaryName>>(
62 "exclude_boundary",
"The internal side sets to be excluded from this kernel.");
76 _current_elem(_assembly.elem()),
77 _current_elem_volume(_assembly.elemVolume()),
79 _neighbor_elem(_assembly.neighbor()),
80 _neighbor_elem_volume(_assembly.neighborVolume()),
82 _current_side(_assembly.side()),
83 _current_side_elem(_assembly.sideElem()),
84 _current_side_volume(_assembly.sideElemVolume()),
86 _coord_sys(_assembly.coordSystem()),
87 _q_point(_assembly.qPointsFace()),
88 _qrule(_assembly.qRuleFace()),
89 _JxW(_assembly.JxWFace()),
90 _coord(_assembly.coordTransformation()),
91 _normals(_assembly.normals()),
93 _save_in_strings(parameters.get<
std::vector<AuxVariableName>>(
"save_in")),
94 _diag_save_in_strings(parameters.get<
std::vector<AuxVariableName>>(
"diag_save_in"))
97 std::vector<BoundaryName> bnd =
isParamValid(
"exclude_boundary")
98 ? getParam<std::vector<BoundaryName>>(
"exclude_boundary")
99 : std::vector<BoundaryName>(0);
104 std::vector<BoundaryName> diff;
105 for (
unsigned int i = 0; i < bnd_ids.size(); ++i)
106 if (valid_ids.find(bnd_ids[i]) == valid_ids.end())
107 diff.push_back(bnd[i]);
110 auto msg =
"DGKernel '" +
name() +
111 "' contains the following boundary names that do not exist on the mesh: " +
162 if (jvar_num ==
variable().number())
190 for (
auto bid : boundary_ids)
197 for (
auto bid : boundary_ids)
An interface that restricts an object to subdomains via the 'blocks' input parameter.
static InputParameters validParams()
/class BoundaryRestrictable /brief Provides functionality for limiting the object to certain boundary...
static InputParameters validParams()
virtual void computeJacobian() override
Computes the jacobian for the current side.
std::set< BoundaryID > _excluded_boundaries
Broken boundaries.
virtual void computeOffDiagElemNeighJacobian(Moose::DGJacobianType type, const MooseVariableFEBase &jvar)=0
Computes the element-element off-diagonal Jacobian.
virtual void computeElemNeighResidual(Moose::DGResidualType type)=0
Computes the residual for this element or the neighbor.
virtual void computeResidual() override
Computes the residual for the current side.
const unsigned int & _current_side
Current side.
virtual void computeOffDiagJacobian(unsigned int jvar) override
Computes d-residual / d-jvar...
bool excludeBoundary() const
Check current element if it contains broken boundary.
static InputParameters validParams()
Factory constructor initializes all internal references needed for residual computation.
const Elem *const & _current_elem
Current element.
virtual void computeElemNeighJacobian(Moose::DGJacobianType type)=0
Computes the element/neighbor-element/neighbor Jacobian.
DGKernelBase(const InputParameters ¶meters)
const Elem *const & _neighbor_elem
The neighboring element.
void prepareShapes(unsigned int var_num) override final
Prepare shape functions.
const std::string & name() const
Get the name of the class.
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
const std::set< BoundaryID > & meshSidesetIds() const
Returns a read-only reference to the set of sidesets currently present in the Mesh.
std::vector< BoundaryID > getBoundaryIDs(const Elem *const elem, const unsigned short int side) const
Returns a vector of boundary IDs for the requested element on the requested side.
This is a base class for objects that can provide residual contributions for both local and neighbor ...
static InputParameters validParams()
THREAD_ID _tid
The thread ID for this kernel.
virtual void precalculateJacobian()
MooseMesh & _mesh
Reference to this Kernel's mesh object.
virtual const MooseVariableBase & variable() const =0
Returns the variable that this object operates on.
const MooseVariableFieldBase & getVariable(unsigned int jvar_num) const
Retrieve the variable object from our system associated with jvar_num.
SubProblem & _subproblem
Reference to this kernel's SubProblem.
virtual void precalculateOffDiagJacobian(unsigned int)
virtual void precalculateResidual()
virtual void prepareFaceShapes(unsigned int var, const THREAD_ID tid)=0
This interface is designed for DGKernel, InternalSideUserObject, InterfaceUserObject,...
static InputParameters validParams()
std::string stringify(const T &t)
conversion to string