https://mooseframework.inl.gov
ElementHDivSemiError.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #include "ElementHDivSemiError.h"
11 #include "Function.h"
12 
14 
17 {
19  params.addClassDescription("Returns the H(div)-seminorm of the difference between a pair of "
20  "computed and analytical vector-valued solutions.");
21  params.addRequiredParam<FunctionName>("function",
22  "The vector analytical solution to compare against");
23  params.addRequiredCoupledVar("variable", "The vector FE solution");
24  params.suppressParameter<FunctionName>("function_x");
25  params.suppressParameter<FunctionName>("function_y");
26  params.suppressParameter<FunctionName>("function_z");
27  params.suppressParameter<std::vector<VariableName>>("var_x");
28  params.suppressParameter<std::vector<VariableName>>("var_y");
29  params.suppressParameter<std::vector<VariableName>>("var_z");
30  return params;
31 }
32 
34  : ElementVectorL2Error(parameters), _u_var(*getVectorVar("variable", 0)), _div_u(_u_var.divSln())
35 {
36 }
37 
38 Real
40 {
41  Real diff = _div_u[_qp] - _func.div(_t, _q_point[_qp]);
42  return diff * diff;
43 }
const MooseArray< Point > & _q_point
virtual Real div(Real t, const Point &p) const
Override this to evaluate the divergence of the vector function at a point (t,x,y,z), by default this returns zero, you must override it.
Definition: Function.C:110
This postprocessor will print out the L2-seminorm of the difference between the computed solution and...
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
void suppressParameter(const std::string &name)
This method suppresses an inherited parameter so that it isn&#39;t required or valid in the derived class...
static InputParameters validParams()
const VectorVariableDivergence & _div_u
div of the vector variable
registerMooseObject("MooseApp", ElementHDivSemiError)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
This method adds a coupled variable name pair.
This postprocessor will print out the H(div)-seminorm of the difference between the computed solution...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static InputParameters validParams()
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump...
ElementHDivSemiError(const InputParameters &parameters)
const Function & _func
vector or component-wise analytical solution to compare against
virtual Real computeQpIntegral() override