www.mooseframework.org
NodalProxyMaxValue.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 #include "NodalProxyMaxValue.h"
16 #include "MooseMesh.h"
17 #include "SubProblem.h"
18 // libMesh
19 #include "libmesh/boundary_info.h"
20 
21 template <>
24 {
26  return params;
27 }
28 
30  : NodalVariablePostprocessor(parameters), _value(-std::numeric_limits<Real>::max())
31 {
32 }
33 
34 void
36 {
37  _value = -std::numeric_limits<Real>::max();
38 }
39 
40 Real
42 {
43  return _u[_qp];
44 }
45 
46 void
48 {
49  Real val = computeValue();
50 
51  if (val > _value)
52  {
53  _value = val;
54  _node_id = _current_node->id();
55  }
56 }
57 
58 Real
60 {
62  return _node_id;
63 }
64 
65 void
67 {
68  const NodalProxyMaxValue & pps = static_cast<const NodalProxyMaxValue &>(y);
69  if (pps._value > _value)
70  {
71  _value = pps._value;
72  _node_id = pps._node_id;
73  }
74 }
void gatherProxyValueMax(T1 &value, T2 &proxy)
Definition: UserObject.h:137
NodalProxyMaxValue(const InputParameters &parameters)
const Node *& _current_node
Reference to current node pointer.
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 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:42