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 
14 template <>
17 {
19  return params;
20 }
21 
23  : SideUserObject(parameters), _qp(0), _integral_value(0)
24 {
25 }
26 
27 void
29 {
30  _integral_value = 0;
31 }
32 
33 void
35 {
37 }
38 
39 Real
41 {
43  return _integral_value;
44 }
45 
46 void
48 {
49  const SideIntegralUserObject & pps = static_cast<const SideIntegralUserObject &>(y);
51 }
52 
53 Real
55 {
56  Real sum = 0;
57  for (_qp = 0; _qp < _qrule->n_points(); _qp++)
58  sum += _JxW[_qp] * _coord[_qp] * computeQpIntegral();
59  return sum;
60 }
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:103
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...
const QBase *const & _qrule
virtual Real computeQpIntegral()=0
virtual void threadJoin(const UserObject &y) override
Must override.
Base class for user-specific data.
Definition: UserObject.h:37
InputParameters validParams< SideIntegralUserObject >()