https://mooseframework.inl.gov
InternalSideIntegralPostprocessor.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 
16 {
18  return params;
19 }
20 
22  const InputParameters & parameters)
23  : InternalSidePostprocessor(parameters), _qp(0), _integral_value(0), _qp_integration(true)
24 {
25 }
26 
27 void
29 {
30  _integral_value = 0;
31 }
32 
33 void
35 {
37 }
38 
39 Real
41 {
42  return _integral_value;
43 }
44 
45 void
47 {
48  const auto & pps = static_cast<const InternalSideIntegralPostprocessor &>(y);
49  _integral_value += pps._integral_value;
50 }
51 
52 Real
54 {
55  Real sum = 0;
56  if (_qp_integration)
57  for (_qp = 0; _qp < _qrule->n_points(); _qp++)
58  sum += _JxW[_qp] * _coord[_qp] * computeQpIntegral();
59  else
60  {
61  // Finite volume functors integration is over FaceInfo, not quadrature points
62  getFaceInfos();
63 
64  for (auto & fi : _face_infos)
65  sum += fi->faceArea() * fi->faceCoord() * computeFaceInfoIntegral(fi);
66  }
67  return sum;
68 }
69 
70 void
72 {
74 }
static InputParameters validParams()
void getFaceInfos()
Computes the local FaceInfo(s) to use in functor arguments and interpolations.
virtual Real computeFaceInfoIntegral(const FaceInfo *)
virtual void finalize() override
Finalize.
const MooseArray< Real > & _JxW
virtual void threadJoin(const UserObject &y) override
Must override.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual Real getValue() const override
This will get called to actually grab the final value the postprocessor has calculated.
InternalSideIntegralPostprocessor(const InputParameters &parameters)
This postprocessor computes a surface integral of the specified variable on internal sides of the mes...
void gatherSum(T &value)
Gather the parallel sum of the variable passed in.
Definition: UserObject.h:126
unsigned int _qp
The local quadrature point index when computing an integral over quadrature points.
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
Real _integral_value
Holds the postprocessor result, the integral.
const QBase *const & _qrule
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< const FaceInfo * > _face_infos
Holds the FaceInfos to loop on to consider all active neighbors of an element on a given side...
const MooseArray< Real > & _coord
virtual void execute() override
Execute method.
bool _qp_integration
Whether to integrate over quadrature points or FaceInfos.
Base class for user-specific data.
Definition: UserObject.h:40