www.mooseframework.org
SideIntegralUserObject.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 "SideIntegralUserObject.h"
11 
12 #include "libmesh/quadrature.h"
13 
16 {
18  return params;
19 }
20 
22  : SideUserObject(parameters), _qp(0), _integral_value(0)
23 {
24 }
25 
26 void
28 {
29  _integral_value = 0;
30 }
31 
32 void
34 {
36 }
37 
38 void
40 {
42 }
43 
44 Real
46 {
47  return _integral_value;
48 }
49 
50 void
52 {
53  const auto & pps = static_cast<const SideIntegralUserObject &>(y);
54  _integral_value += pps._integral_value;
55 }
56 
57 Real
59 {
60  Real sum = 0;
61  for (_qp = 0; _qp < _qrule->n_points(); _qp++)
62  sum += _JxW[_qp] * _coord[_qp] * computeQpIntegral();
63  return sum;
64 }
static InputParameters validParams()
SideIntegralUserObject(const InputParameters &parameters)
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
Base class for user objects executed one or more sidesets, which may be on the outer boundary of the ...
virtual Real getValue() const
Returns the integral value.
const MooseArray< Real > & _JxW
void gatherSum(T &value)
Gather the parallel sum of the variable passed in.
Definition: UserObject.h:125
const MooseArray< Real > & _coord
virtual void execute() override
Execute method.
This postprocessor computes a side integral of the specified variable over a given boundary...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static InputParameters validParams()
const QBase *const & _qrule
virtual void finalize() override
Finalize.
virtual Real computeQpIntegral()=0
virtual void threadJoin(const UserObject &y) override
Must override.
Base class for user-specific data.
Definition: UserObject.h:39