https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ElementIntegralPostprocessor.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
20
22 : ElementPostprocessor(parameters), _qp(0), _integral_value(0)
23{
24}
25
26void
31
32void
37
38Real
43
44void
46{
47 const auto & pps = static_cast<const ElementIntegralPostprocessor &>(y);
49}
50
51Real
53{
54 Real sum = 0;
55
56 for (_qp = 0; _qp < _qrule->n_points(); _qp++)
57 sum += _JxW[_qp] * _coord[_qp] * computeQpIntegral();
58 return sum;
59}
60
61void
This postprocessor computes a volume integral of the specified variable.
virtual Real computeQpIntegral()=0
ElementIntegralPostprocessor(const InputParameters &parameters)
virtual void execute() override
Execute method.
virtual Real getValue() const override
This will get called to actually grab the final value the postprocessor has calculated.
virtual void finalize() override
This is called after execute() and after threadJoin()! This is probably where you want to do MPI comm...
virtual void threadJoin(const UserObject &y) override
Must override.
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
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 gatherSum(T &value)
Gather the parallel sum of the variable passed in.
Base class for user-specific data.
Definition UserObject.h:20