https://mooseframework.inl.gov
src
postprocessors
SideAverageMaterialProperty.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 "
SideAverageMaterialProperty.h
"
11
12
registerMooseObject
(
"MooseApp"
,
SideAverageMaterialProperty
);
13
registerMooseObject
(
"MooseApp"
,
ADSideAverageMaterialProperty
);
14
15
template
<
bool
is_ad>
16
InputParameters
17
SideAverageMaterialPropertyTempl<is_ad>::validParams
()
18
{
19
InputParameters
params =
SideIntegralMaterialPropertyTempl<is_ad>::validParams
();
20
params.
addClassDescription
(
"Computes the average of a material property over a side set."
);
21
return
params;
22
}
23
24
template
<
bool
is_ad>
25
SideAverageMaterialPropertyTempl<is_ad>::SideAverageMaterialPropertyTempl
(
26
const
InputParameters
& parameters)
27
:
SideIntegralMaterialPropertyTempl
<is_ad>(parameters), _area(0.0)
28
{
29
}
30
31
template
<
bool
is_ad>
32
void
33
SideAverageMaterialPropertyTempl<is_ad>::initialize
()
34
{
35
SideIntegralMaterialPropertyTempl<is_ad>::initialize
();
36
_area = 0.0;
37
}
38
39
template
<
bool
is_ad>
40
void
41
SideAverageMaterialPropertyTempl<is_ad>::execute
()
42
{
43
SideIntegralMaterialPropertyTempl<is_ad>::execute
();
44
45
_area += this->_current_side_volume;
46
}
47
48
template
<
bool
is_ad>
49
Real
50
SideAverageMaterialPropertyTempl<is_ad>::getValue
()
const
51
{
52
return
_integral_value / _area;
53
}
54
55
template
<
bool
is_ad>
56
void
57
SideAverageMaterialPropertyTempl<is_ad>::finalize
()
58
{
59
SideIntegralMaterialPropertyTempl<is_ad>::gatherSum
(_area);
60
SideIntegralMaterialPropertyTempl<is_ad>::gatherSum
(_integral_value);
61
}
62
63
template
<
bool
is_ad>
64
void
65
SideAverageMaterialPropertyTempl<is_ad>::threadJoin
(
const
UserObject
& y)
66
{
67
SideIntegralMaterialPropertyTempl<is_ad>::threadJoin
(y);
68
69
const
auto
& pps =
static_cast<
const
SideAverageMaterialPropertyTempl<is_ad>
&
>
(y);
70
_area += pps.
_area
;
71
}
72
73
template
class
SideAverageMaterialPropertyTempl<false>
;
74
template
class
SideAverageMaterialPropertyTempl<true>
;
SideAverageMaterialPropertyTempl::_area
Real _area
Side set area.
Definition:
SideAverageMaterialProperty.h:34
SideIntegralMaterialPropertyTempl
Computes the integral of a material property over a side set.
Definition:
SideIntegralMaterialProperty.h:21
InputParameters
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
Definition:
InputParameters.h:65
SideAverageMaterialPropertyTempl::validParams
static InputParameters validParams()
Definition:
SideAverageMaterialProperty.C:17
SideAverageMaterialProperty.h
UserObject::gatherSum
void gatherSum(T &value)
Gather the parallel sum of the variable passed in.
Definition:
UserObject.h:126
SideIntegralMaterialPropertyTempl::validParams
static InputParameters validParams()
Definition:
SideIntegralMaterialProperty.C:19
registerMooseObject
registerMooseObject("MooseApp", SideAverageMaterialProperty)
SideAverageMaterialPropertyTempl::finalize
virtual void finalize() override
This is called after execute() and after threadJoin()! This is probably where you want to do MPI comm...
Definition:
SideAverageMaterialProperty.C:57
SideIntegralPostprocessor::threadJoin
virtual void threadJoin(const UserObject &y) override
Must override.
Definition:
SideIntegralPostprocessor.C:54
SideAverageMaterialPropertyTempl::threadJoin
virtual void threadJoin(const UserObject &y) override
Must override.
Definition:
SideAverageMaterialProperty.C:65
SideIntegralPostprocessor::initialize
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
Definition:
SideIntegralPostprocessor.C:36
Real
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
SideAverageMaterialPropertyTempl::SideAverageMaterialPropertyTempl
SideAverageMaterialPropertyTempl(const InputParameters ¶meters)
Definition:
SideAverageMaterialProperty.C:25
SideAverageMaterialPropertyTempl::execute
virtual void execute() override
Execute method.
Definition:
SideAverageMaterialProperty.C:41
SideAverageMaterialPropertyTempl::initialize
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
Definition:
SideAverageMaterialProperty.C:33
SideAverageMaterialPropertyTempl
Computes the average of a material property over a side set.
Definition:
SideAverageMaterialProperty.h:18
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::execute
virtual void execute() override
Execute method.
Definition:
SideIntegralPostprocessor.C:42
SideAverageMaterialPropertyTempl::getValue
virtual Real getValue() const override
This will get called to actually grab the final value the postprocessor has calculated.
Definition:
SideAverageMaterialProperty.C:50
UserObject
Base class for user-specific data.
Definition:
UserObject.h:40
Generated on Sun Aug 24 2025 13:53:48 for https://mooseframework.inl.gov by
1.8.14