https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ElementIntegralUserObject.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
10// MOOSE includes
12
13#include "libmesh/quadrature.h"
14
17{
19 params.addClassDescription("Performs a spatial integration");
20 return params;
21}
22
24 : ElementUserObject(parameters), _qp(0), _integral_value(0)
25{
26}
27
28void
33
34void
39
40void
45
46Real
51
52void
54{
55 const auto & pps = static_cast<const ElementIntegralUserObject &>(y);
57}
58
59Real
61{
62 Real sum = 0;
63
64 for (_qp = 0; _qp < _qrule->n_points(); _qp++)
65 sum += _JxW[_qp] * _coord[_qp] * computeQpIntegral();
66 return sum;
67}
This postprocessor computes a volume integral of the specified variable.
virtual void execute() override
Execute method.
virtual Real computeQpIntegral()=0
static InputParameters validParams()
virtual Real getValue() const
Returns the integral value.
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
ElementIntegralUserObject(const InputParameters &parameters)
virtual void threadJoin(const UserObject &y) override
Must override.
virtual void finalize() override
Finalize.
static InputParameters validParams()
const QBase *const & _qrule
const MooseArray< Real > & _coord
const MooseArray< Real > & _JxW
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump.
void gatherSum(T &value)
Gather the parallel sum of the variable passed in.
Base class for user-specific data.
Definition UserObject.h:20