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.");
79 _current_elem(_assembly.elem()),
80 _current_elem_volume(_assembly.elemVolume()),
82 _neighbor_elem(_assembly.neighbor()),
83 _neighbor_elem_volume(_assembly.neighborVolume()),
85 _current_side(_assembly.side()),
86 _current_side_elem(_assembly.sideElem()),
87 _current_side_volume(_assembly.sideElemVolume()),
89 _coord_sys(_assembly.coordSystem()),
90 _q_point(_assembly.qPointsFace()),
91 _qrule(_assembly.qRuleFace()),
92 _JxW(_assembly.JxWFace()),
93 _coord(_assembly.coordTransformation()),
94 _normals(_assembly.normals()),
96 _save_in_strings(parameters.
get<
std::vector<AuxVariableName>>(
"save_in")),
97 _diag_save_in_strings(parameters.
get<
std::vector<AuxVariableName>>(
"diag_save_in"))
100 std::vector<BoundaryName> bnd =
isParamValid(
"exclude_boundary")
101 ? getParam<std::vector<BoundaryName>>(
"exclude_boundary")
102 : std::vector<BoundaryName>(0);
107 std::vector<BoundaryName> diff;
108 for (
unsigned int i = 0; i < bnd_ids.size(); ++i)
109 if (valid_ids.find(bnd_ids[i]) == valid_ids.end())
110 diff.push_back(bnd[i]);
113 auto msg =
"DGKernel '" +
name() +
114 "' contains the following boundary names that do not exist on the mesh: " +
165 if (jvar_num ==
variable().number())
193 for (
auto bid : boundary_ids)
200 for (
auto bid : boundary_ids)
MooseMesh & _mesh
Reference to this Kernel's mesh object.
virtual void computeOffDiagJacobian(unsigned int jvar) override
Computes d-residual / d-jvar...
std::set< BoundaryID > _excluded_boundaries
Broken boundaries.
static InputParameters validParams()
Factory constructor initializes all internal references needed for residual computation.
static InputParameters validParams()
const std::set< BoundaryID > & meshSidesetIds() const
Returns a read-only reference to the set of sidesets currently present in the Mesh.
virtual void precalculateOffDiagJacobian(unsigned int)
T * get(const std::unique_ptr< T > &u)
The MooseUtils::get() specializations are used to support making forwards-compatible code changes fro...
virtual void precalculateResidual()
DGKernelBase(const InputParameters ¶meters)
/class BoundaryRestrictable /brief Provides functionality for limiting the object to certain boundary...
virtual void computeJacobian() override
Computes the jacobian for the current side.
THREAD_ID _tid
The thread ID for this kernel.
virtual void computeElemNeighResidual(Moose::DGResidualType type)=0
Computes the residual for this element or the neighbor.
virtual const std::string & name() const
Get the name of the class.
const MooseVariableFieldBase & getVariable(unsigned int jvar_num) const
Retrieve the variable object from our system associated with jvar_num.
static InputParameters validParams()
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
virtual void precalculateJacobian()
void prepareShapes(unsigned int var_num) override final
Prepare shape functions.
SubProblem & _subproblem
Reference to this kernel's SubProblem.
bool excludeBoundary() const
Check current element if it contains broken boundary.
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 ...
std::string stringify(const T &t)
conversion to string
static Threads::spin_mutex _resid_vars_mutex
static InputParameters validParams()
This is a base class for objects that can provide residual contributions for both local and neighbor ...
virtual void computeResidual() override
Computes the residual for the current side.
static InputParameters validParams()
const Elem *const & _current_elem
Current element.
An interface that restricts an object to subdomains via the 'blocks' input parameter.
const unsigned int & _current_side
Current side.
This interface is designed for DGKernel, InternalSideUserObject, InterfaceUserObject, where material properties on a side of both its primary side (face) and its secondary side (neighbor) all required.
const Elem *const & _neighbor_elem
The neighboring element.
virtual const MooseVariableBase & variable() const =0
Returns the variable that this object operates on.
virtual void computeElemNeighJacobian(Moose::DGJacobianType type)=0
Computes the element/neighbor-element/neighbor Jacobian.
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. ...
virtual void prepareFaceShapes(unsigned int var, const THREAD_ID tid)=0
static Threads::spin_mutex _jacoby_vars_mutex
virtual void computeOffDiagElemNeighJacobian(Moose::DGJacobianType type, const MooseVariableFEBase &jvar)=0
Computes the element-element off-diagonal Jacobian.