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()),
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++)
std::string name(const ElemQuality q)
const libMesh::FEType & feType() const
Get the type of finite element object.
static InputParameters validParams()
unsigned int number() const
Get variable number coming from libMesh.
const MooseArray< Real > & _coord
The coordinate transformation.
T * get(const std::unique_ptr< T > &u)
The MooseUtils::get() specializations are used to support making forwards-compatible code changes fro...
const QBase *const & _qrule
The quadrature rule being used.
NumericVector< Number > & _solution
bool _scale_by_flux_faces
Whether to scale the indicator value by the number of flux faces in an attempt to avoid penalizing in...
virtual void computeIndicator() override
Computes the indicator for the current side.
const bool _use_displaced_mesh
Whether to use the displaced mesh.
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
InternalSideIndicatorBase(const InputParameters ¶meters)
boundary_id_type BoundaryID
static InputParameters validParams()
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 ...
unsigned int number() const
Gets the number of this system.
unsigned int _qp
The current quadrature point.
static const BoundaryID InternalBndId
const Elem *const & _neighbor_elem
The neighbor element across from the current side.
const std::vector< MooseVariableFieldBase * > & getCoupledMooseVars() const
Get the list of all coupled variables.
virtual void finalize() override
Can be overridden to do a final postprocessing of the indicator field.
const Elem *const & _current_elem
Current element under consideration.
void addMooseVariableDependency(MooseVariableFieldBase *var)
Call this function to add the passed in MooseVariableFieldBase as a variable that this object depends...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
MooseVariableFE< Real > & _field_var
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template * sqrt(_arg)) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(tanh
virtual Real computeQpIntegral()=0
The virtual function you will want to override to compute error contributions.
bool hasBlocks(const SubdomainID id) const override
Returns whether the functor is defined on this block.
const DoFValue & dofValues() const override
dof values getters
virtual bool isVarFV() const =0
Whether or not the derived classes are acting on a finite volume variable or not. ...
Interface for objects that needs scalar coupling capabilities.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
const MooseArray< Real > & _JxW
The quadrature weight multiplied by the element Jacobian.
virtual void set(const numeric_index_type i, const Number value)=0
virtual void add(const numeric_index_type i, const Number value)=0
SystemBase & sys()
Get the system this variable is part of.
Enhances Coupleable interface to also couple the values from neighbor elements.