https://mooseframework.inl.gov
NodalExtremeValue.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 "NodalExtremeValue.h"
11 
12 #include <algorithm>
13 #include <limits>
14 
16 
19 {
21  params.addCoupledVar("proxy_variable",
22  "The name of the variable to use to identify the location at which "
23  "the variable value should be taken; if not provided, this defaults "
24  "to the 'variable'.");
25  params.addClassDescription(
26  "Finds either the min or max elemental value of a variable over the domain.");
27  return params;
28 }
29 
32  _proxy_variable(isParamValid("proxy_variable") ? coupledValue("proxy_variable") : _u),
33  _proxy_var(isParamValid("proxy_variable") ? getVar("proxy_variable", 0) : nullptr)
34 {
35 }
36 
37 void
39 {
40  const bool have_dofs = _var->dofIndices().size();
41  if (_proxy_var)
42  mooseAssert(static_cast<bool>(_proxy_var->dofIndices().size()) == have_dofs,
43  "Should not use variables that don't have coincident dof maps");
44  if (have_dofs)
46 }
47 
48 std::pair<Real, Real>
50 {
51  return std::make_pair(_proxy_variable[_qp], _u[_qp]);
52 }
This is a base class for other classes which compute post-processed values based on nodal solution va...
MooseVariableBase * _var
The variable this object is acting on.
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...
const std::vector< dof_id_type > & dofIndices() const final
Get local DoF indices.
static InputParameters validParams()
const MooseVariable *const _proxy_var
A postprocessor for collecting the nodal min or max value.
const VariableValue & _proxy_variable
A proxy variable used to find the quadrature point at which to evaluate the variable.
virtual const std::vector< dof_id_type > & dofIndices() const
Get local DoF indices.
virtual std::pair< Real, Real > getProxyValuePair() override
const unsigned int _qp
Quadrature point index.
void addCoupledVar(const std::string &name, const std::string &doc_string)
This method adds a coupled variable name pair.
static InputParameters validParams()
virtual void execute() override
Execute method.
virtual void computeExtremeValue()
Get the extreme value with a functor element argument.
NodalExtremeValue(const InputParameters &parameters)
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...
registerMooseObject("MooseApp", NodalExtremeValue)