20#include "libmesh/dof_map.h"
21#include "libmesh/dense_vector.h"
22#include "libmesh/numeric_vector.h"
23#include "libmesh/dense_subvector.h"
24#include "libmesh/libmesh_common.h"
25#include "libmesh/quadrature.h"
34 "variable",
"The name of the variable that this side indicator applies to");
35 params.
addParam<
bool>(
"scale_by_flux_faces",
37 "Whether or not to scale the error values by "
38 "the number of flux faces. This attempts to "
39 "not penalize elements on boundaries for "
40 "having less neighbors.");
50 _field_var(_subproblem.getStandardVariable(_tid, name())),
51 _current_elem(_assembly.elem()),
52 _neighbor_elem(_assembly.neighbor()),
53 _current_side(_assembly.side()),
54 _current_side_elem(_assembly.sideElem()),
55 _coord_sys(_assembly.coordSystem()),
56 _qrule(_assembly.qRuleFace()),
57 _q_point(_assembly.qPointsFace()),
58 _JxW(_assembly.JxWFace()),
59 _coord(_assembly.coordTransformation()),
60 _boundary_id(parameters.get<
BoundaryID>(
"_boundary_id")),
61 _scale_by_flux_faces(parameters.get<bool>(
"scale_by_flux_faces")),
62 _normals(_assembly.normals())
65 for (
const auto & var : coupled_vars)
71 "Internal side indicators do not support using the displaced mesh at this time. "
72 "They can be used on the undisplaced mesh in a Problem with displaced mesh");
75 mooseError(
"Only constant monomial variables for the internal side indicator are supported");
99 unsigned int n_flux_faces = 0;
104 paramError(
"scale_by_flux_faces",
"Unsupported at this time for finite volume variables");
108 for (
unsigned int side = 0; side <
_current_elem->n_sides(); side++)
123 std::sqrt(value) /
static_cast<Real
>(n_flux_faces));
boundary_id_type BoundaryID
const std::vector< MooseVariableFieldBase * > & getCoupledMooseVars() const
Get the list of all coupled variables.
static InputParameters validParams()
const bool _use_displaced_mesh
Whether to use the displaced mesh.
NumericVector< Number > & _solution
const Elem *const & _current_elem
Current element under consideration.
bool _scale_by_flux_faces
Whether to scale the indicator value by the number of flux faces in an attempt to avoid penalizing in...
unsigned int _qp
The current quadrature point.
const MooseArray< Real > & _JxW
The quadrature weight multiplied by the element Jacobian.
virtual bool isVarFV() const =0
Whether or not the derived classes are acting on a finite volume variable or not.
const MooseArray< Real > & _coord
The coordinate transformation.
const Elem *const & _neighbor_elem
The neighbor element across from the current side.
static InputParameters validParams()
virtual Real computeQpIntegral()=0
The virtual function you will want to override to compute error contributions.
MooseVariableFE< Real > & _field_var
virtual void finalize() override
Can be overridden to do a final postprocessing of the indicator field.
static const BoundaryID InternalBndId
const QBase *const & _qrule
The quadrature rule being used.
virtual void computeIndicator() override
Computes the indicator for the current side.
InternalSideIndicatorBase(const InputParameters ¶meters)
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 ...
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
const libMesh::FEType & feType() const
Get the type of finite element object.
SystemBase & sys()
Get the system this variable is part of.
unsigned int number() const
Get variable number coming from libMesh.
void addMooseVariableDependency(MooseVariableFieldBase *var)
Call this function to add the passed in MooseVariableFieldBase as a variable that this object depends...
const DofValues & dofValues() const override
dof values getters
bool hasBlocks(const SubdomainID id) const override
Returns whether the functor is defined on this block.
Enhances Coupleable interface to also couple the values from neighbor elements.
Interface for objects that needs scalar coupling capabilities.
unsigned int number() const
Gets the number of this system.
virtual void set(const numeric_index_type i, const T value)=0
virtual void add(const numeric_index_type i, const T value)=0