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 "FunctionElementIntegralUserObject.h" 11 : #include "Function.h" 12 : 13 : registerMooseObject("MooseApp", FunctionElementIntegralUserObject); 14 : 15 : InputParameters 16 28555 : FunctionElementIntegralUserObject::validParams() 17 : { 18 28555 : InputParameters params = ElementIntegralUserObject::validParams(); 19 28555 : params.addClassDescription("Computes a volume integral of a function."); 20 28555 : params.addRequiredParam<FunctionName>("function", "The function that this object operates on"); 21 28555 : return params; 22 0 : } 23 : 24 13 : FunctionElementIntegralUserObject::FunctionElementIntegralUserObject( 25 13 : const InputParameters & parameters) 26 13 : : ElementIntegralUserObject(parameters), _function(getFunction("function")) 27 : { 28 13 : } 29 : 30 : Real 31 320 : FunctionElementIntegralUserObject::computeQpIntegral() 32 : { 33 320 : return _function.value(_t, _q_point[_qp]); 34 : }