LCOV - code coverage report
Current view: top level - src/postprocessors - NodalMaxValue.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 2bf808 Lines: 4 23 17.4 %
Date: 2025-07-17 01:28:37 Functions: 1 7 14.3 %
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 "NodalMaxValue.h"
      11             : 
      12             : #include <algorithm>
      13             : #include <limits>
      14             : 
      15             : registerMooseObjectReplaced("MooseApp", NodalMaxValue, "09/27/2021 00:00", NodalExtremeValue);
      16             : 
      17             : InputParameters
      18       14265 : NodalMaxValue::validParams()
      19             : {
      20       14265 :   InputParameters params = NodalVariablePostprocessor::validParams();
      21       14265 :   params.addClassDescription("Computes the maximum (over all the nodal values) of a variable.");
      22       14265 :   return params;
      23           0 : }
      24             : 
      25           0 : NodalMaxValue::NodalMaxValue(const InputParameters & parameters)
      26           0 :   : NodalVariablePostprocessor(parameters), _value(-std::numeric_limits<Real>::max())
      27             : {
      28           0 : }
      29             : 
      30             : void
      31           0 : NodalMaxValue::initialize()
      32             : {
      33           0 :   _value = -std::numeric_limits<Real>::max();
      34           0 : }
      35             : 
      36             : void
      37           0 : NodalMaxValue::execute()
      38             : {
      39           0 :   _value = std::max(_value, _u[_qp]);
      40           0 : }
      41             : 
      42             : Real
      43           0 : NodalMaxValue::getValue() const
      44             : {
      45           0 :   return _value;
      46             : }
      47             : 
      48             : void
      49           0 : NodalMaxValue::finalize()
      50             : {
      51           0 :   gatherMax(_value);
      52           0 : }
      53             : 
      54             : void
      55           0 : NodalMaxValue::threadJoin(const UserObject & y)
      56             : {
      57           0 :   const auto & pps = static_cast<const NodalMaxValue &>(y);
      58           0 :   _value = std::max(_value, pps._value);
      59           0 : }

Generated by: LCOV version 1.14