https://mooseframework.inl.gov
Loading...
Searching...
No Matches
SideIntegralPostprocessor.C
Go to the documentation of this file.
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
11
12#include "libmesh/quadrature.h"
13
20
22 : SidePostprocessor(parameters), _qp(0), _integral_value(0), _qp_integration(true)
23{
24}
25
26void
34
35void
40
41void
46
47Real
52
53void
55{
56 const auto & pps = static_cast<const SideIntegralPostprocessor &>(y);
58}
59
60Real
62{
63 Real sum = 0;
65 for (_qp = 0; _qp < _qrule->n_points(); _qp++)
66 sum += _JxW[_qp] * _coord[_qp] * computeQpIntegral();
67 else
68 {
69 // Finite volume functors integration is over FaceInfo, not quadrature points
71
72 for (auto & fi : _face_infos)
73 sum += fi->faceArea() * fi->faceCoord() * computeFaceInfoIntegral(fi);
74 }
75 return sum;
76}
77
78void
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
bool isFiniteVolumeInfoDirty() const
Definition MooseMesh.h:1461
virtual void initialSetup()
Gets called at the beginning of the simulation before this object is asked to do its job.
This postprocessor computes a surface integral of the specified variable on a sideset on the boundary...
bool _qp_integration
Whether to integrate over quadrature points or FaceInfos.
virtual void threadJoin(const UserObject &y) override
Must override.
static InputParameters validParams()
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
virtual void errorNoFaceInfo() const
Error method to call when face info is needed but not available.
Real _integral_value
Holds the postprocessor result, the integral.
virtual Real computeQpIntegral()=0
virtual Real computeFaceInfoIntegral(const FaceInfo *)
virtual void initialSetup() override
Gets called at the beginning of the simulation before this object is asked to do its job.
virtual void execute() override
Execute method.
SideIntegralPostprocessor(const InputParameters &parameters)
unsigned int _qp
The local quadrature point index when computing an integral over quadrature points.
virtual void finalize() override
This is called after execute() and after threadJoin()! This is probably where you want to do MPI comm...
virtual Real getValue() const override
This will get called to actually grab the final value the postprocessor has calculated.
Base class for postprocessors executed on one or more sidesets.
static InputParameters validParams()
MooseMesh & _mesh
const MooseArray< Real > & _coord
const QBase *const & _qrule
const MooseArray< Real > & _JxW
void getFaceInfos()
Computes the local FaceInfo(s) to use in functor arguments and interpolations.
std::vector< const FaceInfo * > _face_infos
Holds the FaceInfos to loop on to consider all active neighbors of an element on a given side.
void gatherSum(T &value)
Gather the parallel sum of the variable passed in.
Base class for user-specific data.
Definition UserObject.h:20