Line data Source code
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 : 13 : registerMooseObject("MooseApp", ElementHCurlSemiError); 14 : 15 : InputParameters 16 28638 : ElementHCurlSemiError::validParams() 17 : { 18 28638 : InputParameters params = ElementVectorL2Error::validParams(); 19 28638 : params.addClassDescription("Returns the H(curl)-seminorm of the difference between a pair of " 20 : "computed and analytical vector-valued solutions."); 21 28638 : params.addRequiredParam<FunctionName>("function", 22 : "The vector analytical solution to compare against"); 23 28638 : params.addRequiredCoupledVar("variable", "The vector FE solution"); 24 28638 : params.suppressParameter<FunctionName>("function_x"); 25 28638 : params.suppressParameter<FunctionName>("function_y"); 26 28638 : params.suppressParameter<FunctionName>("function_z"); 27 28638 : params.suppressParameter<std::vector<VariableName>>("var_x"); 28 28638 : params.suppressParameter<std::vector<VariableName>>("var_y"); 29 28638 : params.suppressParameter<std::vector<VariableName>>("var_z"); 30 28638 : return params; 31 0 : } 32 : 33 56 : ElementHCurlSemiError::ElementHCurlSemiError(const InputParameters & parameters) 34 : : ElementVectorL2Error(parameters), 35 56 : _u_var(*getVectorVar("variable", 0)), 36 112 : _curl_u(_u_var.curlSln()) 37 : { 38 56 : } 39 : 40 : Real 41 46800 : ElementHCurlSemiError::computeQpIntegral() 42 : { 43 46800 : return (_curl_u[_qp] - _func.curl(_t, _q_point[_qp])).norm_sq(); 44 : }