www.mooseframework.org
SideIntegralUserObject.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 #include "SideIntegralUserObject.h"
16 
17 #include "libmesh/quadrature.h"
18 
19 template <>
22 {
24  return params;
25 }
26 
28  : SideUserObject(parameters), _qp(0), _integral_value(0)
29 {
30 }
31 
32 void
34 {
35  _integral_value = 0;
36 }
37 
38 void
40 {
42 }
43 
44 Real
46 {
48  return _integral_value;
49 }
50 
51 void
53 {
54  const SideIntegralUserObject & pps = static_cast<const SideIntegralUserObject &>(y);
56 }
57 
58 Real
60 {
61  Real sum = 0;
62  for (_qp = 0; _qp < _qrule->n_points(); _qp++)
63  sum += _JxW[_qp] * _coord[_qp] * computeQpIntegral();
64  return sum;
65 }
InputParameters validParams< SideUserObject >()
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.
const MooseArray< Real > & _JxW
void gatherSum(T &value)
Gather the parallel sum of the variable passed in.
Definition: UserObject.h:119
const MooseArray< Real > & _coord
virtual void execute() override
Execute method.
virtual Real getValue()
Returns the integral value.
This postprocessor computes a side integral of the specified variable over a given boundary...
virtual Real computeQpIntegral()=0
virtual void threadJoin(const UserObject &y) override
Must override.
Base class for user-specific data.
Definition: UserObject.h:42
InputParameters validParams< SideIntegralUserObject >()