14#include "libmesh/quadrature.h"
23 "Computes the H1 or W^{1,p} error between an exact function and a coupled variable.");
39 mooseError(
"ElementH1ErrorFunctionAux only makes sense as an Elemental AuxVariable.");
41 Real summed_value = 0;
registerMooseObject("MooseApp", ElementH1ErrorFunctionAux)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
virtual void precalculateValue()
This callback is used for AuxKernelTempls that need to perform a per-element calculation.
bool isNodal() const
Nodal or elemental kernel?
const MooseArray< Point > & _q_point
Active quadrature points.
const MooseArray< Real > & _coord
const MooseArray< Real > & _JxW
Transformed Jacobian weights.
unsigned int _qp
Quadrature point index.
MooseVariableField< Real > & _var
This is a regular kernel so we cast to a regular MooseVariable, hides base _var.
const QBase *const & _qrule
Quadrature rule being used.
A class for computing the element-wise H1 error (actually W^{1,p} error, if you set the value of p to...
const VariableGradient & _grad_coupled_var
The gradient of the computed solution.
virtual Real computeValue() override
Computes the error at the current qp.
static InputParameters validParams()
ElementH1ErrorFunctionAux(const InputParameters ¶meters)
Class constructor.
virtual void compute() override
Overrides ElementLpNormAux since we want to raise to a power in computeValue() instead.
A class for computing the element-wise L^2 error (actually L^p error, if you set the value of p to so...
const Function & _func
Function representing the exact solution.
static InputParameters validParams()
const VariableValue & _coupled_var
A reference to the variable to compute the norm of.
virtual RealGradient gradient(Real t, const Point &p) const
Function objects can optionally provide a gradient at a point.
virtual Real value(Real t, const Point &p) const
Override this to evaluate the scalar function at point (t,x,y,z), by default this returns zero,...
virtual void setNodalValue(const OutputType &value, unsigned int idx=0)=0
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
MooseUnits pow(const MooseUnits &, int)