Loading [MathJax]/extensions/tex2jax.js
https://mooseframework.inl.gov
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
ElementHCurlSemiError.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 "ElementHCurlSemiError.h"
11 #include "Function.h"
12 
14 
17 {
19  params.addClassDescription("Returns the H(curl)-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),
35  _u_var(*getVectorVar("variable", 0)),
36  _curl_u(_u_var.curlSln())
37 {
38 }
39 
40 Real
42 {
43  return (_curl_u[_qp] - _func.curl(_t, _q_point[_qp])).norm_sq();
44 }
ElementHCurlSemiError(const InputParameters &parameters)
const MooseArray< Point > & _q_point
virtual RealVectorValue curl(Real t, const Point &p) const
Override this to evaluate the curl of the vector function at a point (t,x,y,z), by default this retur...
Definition: Function.C:103
const VectorVariableCurl & _curl_u
curl of the vector variable
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...
registerMooseObject("MooseApp", ElementHCurlSemiError)
static InputParameters validParams()
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
This method adds a coupled variable name pair.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual Real computeQpIntegral() override
auto norm_sq(const T &a) -> decltype(std::norm(a))
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...
static InputParameters validParams()
This postprocessor will print out the H(curl)-seminorm of the difference between the computed solutio...
const Function & _func
vector or component-wise analytical solution to compare against