https://mooseframework.inl.gov
Loading...
Searching...
No Matches
src
postprocessors
FunctionSideAverage.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
#include "
FunctionSideAverage.h
"
11
12
registerMooseObject
(
"MooseApp"
,
FunctionSideAverage
);
13
14
InputParameters
15
FunctionSideAverage::validParams
()
16
{
17
InputParameters
params =
FunctionSideIntegral::validParams
();
18
params.
addClassDescription
(
"Computes the average of a function over a boundary."
);
19
return
params;
20
}
21
22
FunctionSideAverage::FunctionSideAverage
(
const
InputParameters
& parameters)
23
:
FunctionSideIntegral
(parameters)
24
{
25
}
26
27
void
28
FunctionSideAverage::initialize
()
29
{
30
FunctionSideIntegral::initialize
();
31
_volume
= 0;
32
}
33
34
void
35
FunctionSideAverage::execute
()
36
{
37
FunctionSideIntegral::execute
();
38
_volume
+=
_current_side_volume
;
39
}
40
41
Real
42
FunctionSideAverage::getValue
()
const
43
{
44
return
_integral_value
/
_volume
;
45
}
46
47
void
48
FunctionSideAverage::threadJoin
(
const
UserObject
& y)
49
{
50
FunctionSideIntegral::threadJoin
(y);
51
const
auto
& pps =
static_cast<
const
FunctionSideAverage
&
>
(y);
52
_volume
+= pps.
_volume
;
53
}
54
55
void
56
FunctionSideAverage::finalize
()
57
{
58
gatherSum
(
_volume
);
59
gatherSum
(
_integral_value
);
60
}
registerMooseObject
registerMooseObject("MooseApp", FunctionSideAverage)
FunctionSideAverage.h
FunctionSideAverage
Computes the average of a function over a boundary.
Definition
FunctionSideAverage.h:18
FunctionSideAverage::initialize
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
Definition
FunctionSideAverage.C:28
FunctionSideAverage::execute
virtual void execute() override
Execute method.
Definition
FunctionSideAverage.C:35
FunctionSideAverage::finalize
virtual void finalize() override
This is called after execute() and after threadJoin()! This is probably where you want to do MPI comm...
Definition
FunctionSideAverage.C:56
FunctionSideAverage::FunctionSideAverage
FunctionSideAverage(const InputParameters ¶meters)
Definition
FunctionSideAverage.C:22
FunctionSideAverage::validParams
static InputParameters validParams()
Definition
FunctionSideAverage.C:15
FunctionSideAverage::threadJoin
virtual void threadJoin(const UserObject &y) override
Must override.
Definition
FunctionSideAverage.C:48
FunctionSideAverage::_volume
Real _volume
Definition
FunctionSideAverage.h:31
FunctionSideAverage::getValue
virtual Real getValue() const override
This will get called to actually grab the final value the postprocessor has calculated.
Definition
FunctionSideAverage.C:42
FunctionSideIntegral
This postprocessor computes the integral of a function over a specified boundary.
Definition
FunctionSideIntegral.h:20
FunctionSideIntegral::threadJoin
virtual void threadJoin(const UserObject &y) override
Must override.
Definition
FunctionSideIntegral.C:33
FunctionSideIntegral::validParams
static InputParameters validParams()
Definition
FunctionSideIntegral.C:16
InputParameters
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
Definition
InputParameters.h:68
InputParameters::addClassDescription
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.
Definition
InputParameters.C:81
SideIntegralPostprocessor::initialize
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
Definition
SideIntegralPostprocessor.C:36
SideIntegralPostprocessor::_integral_value
Real _integral_value
Holds the postprocessor result, the integral.
Definition
SideIntegralPostprocessor.h:54
SideIntegralPostprocessor::execute
virtual void execute() override
Execute method.
Definition
SideIntegralPostprocessor.C:42
SideUserObject::_current_side_volume
const Real & _current_side_volume
Definition
SideUserObject.h:53
UserObjectBase::gatherSum
void gatherSum(T &value)
Gather the parallel sum of the variable passed in.
Definition
UserObjectBase.h:96
UserObject
Base class for user-specific data.
Definition
UserObject.h:20
Generated on Fri Aug 21 2026 13:33:59 for https://mooseframework.inl.gov by
1.9.8