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.");
52 _field_var(_subproblem.getStandardVariable(_tid,
name())),
54 _current_elem(_assembly.elem()),
55 _neighbor_elem(_assembly.neighbor()),
57 _current_side(_assembly.side()),
58 _current_side_elem(_assembly.sideElem()),
60 _coord_sys(_assembly.coordSystem()),
61 _q_point(_assembly.qPointsFace()),
62 _qrule(_assembly.qRuleFace()),
63 _JxW(_assembly.JxWFace()),
64 _coord(_assembly.coordTransformation()),
68 _var(mooseVariableField()),
69 _scale_by_flux_faces(parameters.
get<bool>(
"scale_by_flux_faces")),
72 _grad_u(_var.gradSln()),
74 _normals(_assembly.normals()),
76 _u_neighbor(_var.slnNeighbor()),
77 _grad_u_neighbor(_var.gradSlnNeighbor())
80 for (
const auto & var : coupled_vars)
95 Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
105 unsigned int n_flux_faces = 0;
110 paramError(
"scale_by_flux_faces",
"Unsupported at this time for finite volume variables");
114 for (
unsigned int side = 0; side <
_current_elem->n_sides(); side++)
125 Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
std::string name(const ElemQuality q)
static InputParameters validParams()
Factory constructor initializes all internal references needed for indicator computation.
bool _scale_by_flux_faces
static InputParameters validParams()
MooseVariable & _field_var
virtual Real computeQpIntegral()=0
The virtual function you will want to override to compute error contributions.
static const BoundaryID InternalBndId
T * get(const std::unique_ptr< T > &u)
The MooseUtils::get() specializations are used to support making forwards-compatible code changes fro...
virtual bool isFV() const
NumericVector< Number > & _solution
ADRealEigenVector< T, D, asd > sqrt(const ADRealEigenVector< T, D, asd > &)
Enhances MooseVariableInterface interface provide values from neighbor elements.
virtual void finalize() override
Can be overridden to do a final postprocessing of the indicator field.
InternalSideIndicator(const InputParameters ¶meters)
MooseVariableField< Real > & _var
boundary_id_type BoundaryID
VarKindType
Framework-wide stuff.
virtual void computeIndicator() override
Computes the indicator for the current side.
virtual const OutputTools< Real >::VariableValue & value()
The value of the variable this object is operating on.
const Elem *const & _neighbor_elem
The neighboring element.
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 ...
const std::vector< MooseVariableFieldBase * > & getCoupledMooseVars() const
Get the list of all coupled variables.
void addMooseVariableDependency(MooseVariableFieldBase *var)
Call this function to add the passed in MooseVariableFieldBase as a variable that this object depends...
const dof_id_type & nodalDofIndexNeighbor() const override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const dof_id_type & nodalDofIndex() const override
const MooseArray< Real > & _coord
const DoFValue & dofValues() const override
dof values getters
MooseVariableField< Real > & mooseVariableField()
Return the MooseVariableField<T> object that this interface acts on.
Interface for objects that needs scalar coupling capabilities.
virtual void set(const numeric_index_type i, const Number value)=0
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
virtual void add(const numeric_index_type i, const Number value)=0
const MooseArray< Real > & _JxW
Enhances Coupleable interface to also couple the values from neighbor elements.
const Elem *const & _current_elem
const QBase *const & _qrule