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 : #pragma once 11 : 12 : #include "SidePostprocessor.h" 13 : 14 : /** 15 : * This postprocessor computes a surface integral of the specified variable on 16 : * a sideset on the boundary of the mesh. 17 : * Note that specializations of this integral are possible by deriving from this 18 : * class and overriding computeQpIntegral(). 19 : */ 20 : class SideIntegralPostprocessor : public SidePostprocessor 21 : { 22 : public: 23 : static InputParameters validParams(); 24 : 25 : SideIntegralPostprocessor(const InputParameters & parameters); 26 : 27 : virtual void initialSetup() override; 28 : virtual void initialize() override; 29 : virtual void execute() override; 30 : virtual void finalize() override; 31 : virtual Real getValue() const override; 32 : virtual void threadJoin(const UserObject & y) override; 33 : 34 : protected: 35 : virtual Real computeQpIntegral() = 0; 36 0 : virtual Real computeFaceInfoIntegral(const FaceInfo * /* fi */) 37 : { 38 0 : mooseError("Integral over faces have not been implemented for this postprocessor"); 39 : }; 40 : virtual Real computeIntegral(); 41 : 42 : /** 43 : * Error method to call when face info is needed but not available 44 : */ 45 0 : virtual void errorNoFaceInfo() const 46 : { 47 0 : mooseError("Face info integration was specified, but the mesh contains no face info objects."); 48 : } 49 : 50 : /// The local quadrature point index when computing an integral over quadrature points 51 : unsigned int _qp; 52 : 53 : /// Holds the postprocessor result, the integral 54 : Real _integral_value; 55 : 56 : /// Whether to integrate over quadrature points or FaceInfos 57 : bool _qp_integration; 58 : };