https://mooseframework.inl.gov
Loading...
Searching...
No Matches
NodalMaxValueId.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 "NodalMaxValueId.h"
11#include "MooseMesh.h"
12#include "SubProblem.h"
13// libMesh
14#include "libmesh/boundary_info.h"
15
18
21{
24 "Finds the node id with the maximum nodal value across all postprocessors.");
25 return params;
26}
27
29 : NodalVariablePostprocessor(parameters), _value(-std::numeric_limits<Real>::max())
30{
31}
32
33void
35{
36 _value = -std::numeric_limits<Real>::max();
37}
38
39Real
41{
42 return _u[_qp];
43}
44
45void
47{
48 Real val = computeValue();
49
50 if (val > _value)
51 {
52 _value = val;
53 _node_id = _current_node->id();
54 }
55}
56
57Real
59{
60 return _node_id;
61}
62
63void
68
69void
71{
72 const auto & pps = static_cast<const NodalMaxValueId &>(y);
73 if (pps._value > _value)
74 {
75 _value = pps._value;
76 _node_id = pps._node_id;
77 }
78}
registerMooseObjectRenamed("MooseApp", NodalProxyMaxValue, "04/01/2022 00:00", NodalMaxValueId)
registerMooseObject("MooseApp", NodalMaxValueId)
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.
Computes the id of the node with the maximum value across all processes.
static InputParameters validParams()
NodalMaxValueId(const InputParameters &parameters)
void threadJoin(const UserObject &y) override
Must override.
virtual Real getValue() const override
This will get called to actually grab the final value the postprocessor has calculated.
virtual Real computeValue()
The method called to compute the value that will be returned by the proxy value.
virtual void finalize() override
This is called after execute() and after threadJoin()! This is probably where you want to do MPI comm...
dof_id_type _node_id
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
virtual void execute() override
Execute method.
const Node *const & _current_node
Reference to current node pointer.
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 gatherProxyValueMax(T1 &proxy, T2 &value)
Deteremine the value of a variable according to the parallel maximum of the provided proxy.
Base class for user-specific data.
Definition UserObject.h:20