https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
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
38Real
40{
41 Real diff = _div_u[_qp] - _func.div(_t, _q_point[_qp]);
42 return diff * diff;
43}
registerMooseObject("MooseApp", ElementHDivSemiError)
This postprocessor will print out the H(div)-seminorm of the difference between the computed solution...
const VectorVariableDivergence & _div_u
div of the vector variable
ElementHDivSemiError(const InputParameters &parameters)
virtual Real computeQpIntegral() override
static InputParameters validParams()
const MooseArray< Point > & _q_point
This postprocessor will print out the L2-seminorm of the difference between the computed solution and...
const Function & _func
vector or component-wise analytical solution to compare against
static InputParameters validParams()
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,...
Definition Function.C:96
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void suppressParameter(const std::string &name)
This method suppresses an inherited parameter so that it isn't required or valid in the derived class...
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
This method adds a coupled variable name pair.
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 addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump.