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 "FunctionSideIntegral.h" 11 : #include "Function.h" 12 : 13 : registerMooseObject("MooseApp", FunctionSideIntegral); 14 : 15 : InputParameters 16 28680 : FunctionSideIntegral::validParams() 17 : { 18 28680 : InputParameters params = SideIntegralPostprocessor::validParams(); 19 28680 : params.addClassDescription("Computes the integral of a function over a boundary."); 20 86040 : params.addParam<FunctionName>( 21 : "function", 22 57360 : 1.0, 23 : "This postprocessor will return the integral of this function over the boundary"); 24 28680 : return params; 25 0 : } 26 : 27 78 : FunctionSideIntegral::FunctionSideIntegral(const InputParameters & parameters) 28 78 : : SideIntegralPostprocessor(parameters), _func(getFunction("function")) 29 : { 30 78 : } 31 : 32 : void 33 6 : FunctionSideIntegral::threadJoin(const UserObject & y) 34 : { 35 6 : const auto & pps = static_cast<const FunctionSideIntegral &>(y); 36 6 : _integral_value += pps._integral_value; 37 6 : } 38 : 39 : Real 40 4816 : FunctionSideIntegral::computeQpIntegral() 41 : { 42 4816 : return _func.value(_t, _q_point[_qp]); 43 : }