https://mooseframework.inl.gov
Loading...
Searching...
No Matches
src
postprocessors
NodalMaxValue.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 "
NodalMaxValue.h
"
11
12
#include <algorithm>
13
#include <limits>
14
15
registerMooseObjectReplaced
(
"MooseApp"
,
NodalMaxValue
,
"09/27/2021 00:00"
,
NodalExtremeValue
);
16
17
InputParameters
18
NodalMaxValue::validParams
()
19
{
20
InputParameters
params =
NodalVariablePostprocessor::validParams
();
21
params.
addClassDescription
(
"Computes the maximum (over all the nodal values) of a variable."
);
22
return
params;
23
}
24
25
NodalMaxValue::NodalMaxValue
(
const
InputParameters
& parameters)
26
:
NodalVariablePostprocessor
(parameters), _value(-
std
::numeric_limits<Real>::max())
27
{
28
}
29
30
void
31
NodalMaxValue::initialize
()
32
{
33
_value
= -std::numeric_limits<Real>::max();
34
}
35
36
void
37
NodalMaxValue::execute
()
38
{
39
_value
= std::max(
_value
,
_u
[
_qp
]);
40
}
41
42
Real
43
NodalMaxValue::getValue
()
const
44
{
45
return
_value
;
46
}
47
48
void
49
NodalMaxValue::finalize
()
50
{
51
gatherMax
(
_value
);
52
}
53
54
void
55
NodalMaxValue::threadJoin
(
const
UserObject
& y)
56
{
57
const
auto
& pps =
static_cast<
const
NodalMaxValue
&
>
(y);
58
_value
= std::max(
_value
, pps._value);
59
}
registerMooseObjectReplaced
registerMooseObjectReplaced("MooseApp", NodalMaxValue, "09/27/2021 00:00", NodalExtremeValue)
NodalMaxValue.h
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
NodalExtremeValue
A postprocessor for collecting the nodal min or max value.
Definition
NodalExtremeValue.h:17
NodalMaxValue
This class computes a maximum (over all the nodal values) of the coupled variable.
Definition
NodalMaxValue.h:19
NodalMaxValue::getValue
virtual Real getValue() const override
This will get called to actually grab the final value the postprocessor has calculated.
Definition
NodalMaxValue.C:43
NodalMaxValue::execute
virtual void execute() override
Execute method.
Definition
NodalMaxValue.C:37
NodalMaxValue::NodalMaxValue
NodalMaxValue(const InputParameters ¶meters)
Definition
NodalMaxValue.C:25
NodalMaxValue::threadJoin
virtual void threadJoin(const UserObject &y) override
Must override.
Definition
NodalMaxValue.C:55
NodalMaxValue::_value
Real _value
Definition
NodalMaxValue.h:32
NodalMaxValue::validParams
static InputParameters validParams()
Definition
NodalMaxValue.C:18
NodalMaxValue::initialize
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
Definition
NodalMaxValue.C:31
NodalMaxValue::finalize
virtual void finalize() override
This is called after execute() and after threadJoin()! This is probably where you want to do MPI comm...
Definition
NodalMaxValue.C:49
NodalUserObject::_qp
const unsigned int _qp
Quadrature point index.
Definition
NodalUserObject.h:45
NodalVariablePostprocessor
This is a base class for other classes which compute post-processed values based on nodal solution va...
Definition
NodalVariablePostprocessor.h:21
NodalVariablePostprocessor::_u
const VariableValue & _u
Holds the solution at current quadrature points.
Definition
NodalVariablePostprocessor.h:29
NodalVariablePostprocessor::validParams
static InputParameters validParams()
Definition
NodalVariablePostprocessor.C:16
UserObjectBase::gatherMax
void gatherMax(T &value)
Gather the parallel max of the variable passed in.
Definition
UserObjectBase.h:108
UserObject
Base class for user-specific data.
Definition
UserObject.h:20
std
Generated on Fri Aug 21 2026 13:33:59 for https://mooseframework.inl.gov by
1.9.8