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