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 "SideAverageFunctorPostprocessor.h" 11 : 12 : registerMooseObject("MooseApp", SideAverageFunctorPostprocessor); 13 : 14 : InputParameters 15 14640 : SideAverageFunctorPostprocessor::validParams() 16 : { 17 14640 : InputParameters params = SideIntegralFunctorPostprocessorTempl<false>::validParams(); 18 14640 : params.addClassDescription("Computes the average of a functor over a side set."); 19 14640 : return params; 20 0 : } 21 : 22 195 : SideAverageFunctorPostprocessor::SideAverageFunctorPostprocessor(const InputParameters & parameters) 23 195 : : SideIntegralFunctorPostprocessorTempl<false>(parameters), _area(0.0) 24 : { 25 195 : } 26 : 27 : void 28 180 : SideAverageFunctorPostprocessor::initialize() 29 : { 30 180 : SideIntegralFunctorPostprocessorTempl<false>::initialize(); 31 180 : _area = 0.0; 32 180 : } 33 : 34 : void 35 3848 : SideAverageFunctorPostprocessor::execute() 36 : { 37 3848 : SideIntegralFunctorPostprocessorTempl<false>::execute(); 38 : 39 3848 : _area += this->_current_side_volume; 40 3848 : } 41 : 42 : Real 43 165 : SideAverageFunctorPostprocessor::getValue() const 44 : { 45 165 : return _integral_value / _area; 46 : } 47 : 48 : void 49 165 : SideAverageFunctorPostprocessor::finalize() 50 : { 51 165 : SideIntegralFunctorPostprocessorTempl<false>::gatherSum(_area); 52 165 : SideIntegralFunctorPostprocessorTempl<false>::gatherSum(_integral_value); 53 165 : } 54 : 55 : void 56 15 : SideAverageFunctorPostprocessor::threadJoin(const UserObject & y) 57 : { 58 15 : SideIntegralFunctorPostprocessorTempl<false>::threadJoin(y); 59 : 60 15 : const auto & pps = static_cast<const SideAverageFunctorPostprocessor &>(y); 61 15 : _area += pps._area; 62 15 : }