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