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 : // MOOSE includes 11 : #include "ElementL2ErrorFunctionAux.h" 12 : #include "Function.h" 13 : 14 : registerMooseObject("MooseApp", ElementL2ErrorFunctionAux); 15 : 16 : InputParameters 17 28580 : ElementL2ErrorFunctionAux::validParams() 18 : { 19 28580 : InputParameters params = ElementLpNormAux::validParams(); 20 28580 : params.addClassDescription("A class for computing the element-wise L^2 (Euclidean) error between " 21 : "a function and a coupled variable."); 22 28580 : params.addRequiredParam<FunctionName>("function", "Function representing the exact solution"); 23 28580 : return params; 24 0 : } 25 : 26 26 : ElementL2ErrorFunctionAux::ElementL2ErrorFunctionAux(const InputParameters & parameters) 27 26 : : ElementLpNormAux(parameters), _func(getFunction("function")) 28 : { 29 26 : } 30 : 31 : Real 32 179200 : ElementL2ErrorFunctionAux::computeValue() 33 : { 34 179200 : return _func.value(_t, _q_point[_qp]) - _coupled_var[_qp]; 35 : }