www.mooseframework.org
NodalProxyMaxValue.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 "NodalProxyMaxValue.h"
11 #include "MooseMesh.h"
12 #include "SubProblem.h"
13 // libMesh
14 #include "libmesh/boundary_info.h"
15 
17 
18 template <>
21 {
23  return params;
24 }
25 
27  : NodalVariablePostprocessor(parameters), _value(-std::numeric_limits<Real>::max())
28 {
29 }
30 
31 void
33 {
34  _value = -std::numeric_limits<Real>::max();
35 }
36 
37 Real
39 {
40  return _u[_qp];
41 }
42 
43 void
45 {
46  Real val = computeValue();
47 
48  if (val > _value)
49  {
50  _value = val;
51  _node_id = _current_node->id();
52  }
53 }
54 
55 Real
57 {
59  return _node_id;
60 }
61 
62 void
64 {
65  const NodalProxyMaxValue & pps = static_cast<const NodalProxyMaxValue &>(y);
66  if (pps._value > _value)
67  {
68  _value = pps._value;
69  _node_id = pps._node_id;
70  }
71 }
void gatherProxyValueMax(T1 &value, T2 &proxy)
Definition: UserObject.h:121
registerMooseObject("MooseApp", NodalProxyMaxValue)
NodalProxyMaxValue(const InputParameters &parameters)
This is a base class for other classes which compute post-processed values based on nodal solution va...
virtual void execute() override
Execute method.
Computes the max value at a node and broadcasts it to all processors.
const Node *const & _current_node
Reference to current node pointer.
const VariableValue & _u
Holds the solution at current quadrature points.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
InputParameters validParams< NodalProxyMaxValue >()
virtual Real computeValue()
The method called to compute the value that will be returned by the proxy value.
virtual Real getValue() override
This will get called to actually grab the final value the postprocessor has calculated.
void threadJoin(const UserObject &y) override
Must override.
const unsigned int _qp
Quadrature point index.
InputParameters validParams< NodalVariablePostprocessor >()
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
Base class for user-specific data.
Definition: UserObject.h:37