LCOV - code coverage report
Current view: top level - src/postprocessors - NodalExtremeValue.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 1f9d31 Lines: 17 18 94.4 %
Date: 2025-09-02 20:01:20 Functions: 4 4 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       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             : 
      15             : registerMooseObject("MooseApp", NodalExtremeValue);
      16             : 
      17             : InputParameters
      18       14572 : NodalExtremeValue::validParams()
      19             : {
      20       14572 :   InputParameters params = ExtremeValueBase<NodalVariablePostprocessor>::validParams();
      21       58288 :   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       14572 :   params.addClassDescription(
      26             :       "Finds either the min or max elemental value of a variable over the domain.");
      27       14572 :   return params;
      28           0 : }
      29             : 
      30         161 : NodalExtremeValue::NodalExtremeValue(const InputParameters & parameters)
      31             :   : ExtremeValueBase<NodalVariablePostprocessor>(parameters),
      32         269 :     _proxy_variable(isParamValid("proxy_variable") ? coupledValue("proxy_variable") : _u),
      33         587 :     _proxy_var(isParamValid("proxy_variable") ? getVar("proxy_variable", 0) : nullptr)
      34             : {
      35         157 : }
      36             : 
      37             : void
      38      245808 : NodalExtremeValue::execute()
      39             : {
      40      245808 :   const bool have_dofs = _var->dofIndices().size();
      41      245808 :   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      245808 :   if (have_dofs)
      45      245808 :     computeExtremeValue();
      46      245808 : }
      47             : 
      48             : std::pair<Real, Real>
      49      245808 : NodalExtremeValue::getProxyValuePair()
      50             : {
      51      245808 :   return std::make_pair(_proxy_variable[_qp], _u[_qp]);
      52             : }

Generated by: LCOV version 1.14