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 : #pragma once 11 : 12 : #include "GeneralPostprocessor.h" 13 : 14 : // Input parameters 15 : /// A postprocessor for reporting the max/min value of another postprocessor over time 16 : class TimeExtremeValue : public GeneralPostprocessor 17 : { 18 : public: 19 : static InputParameters validParams(); 20 : 21 : /// What type of extreme value we are going to compute 22 : enum class ExtremeType 23 : { 24 : MAX, 25 : MIN, 26 : ABS_MAX, 27 : ABS_MIN 28 : }; 29 : 30 : /// What output to return, the extreme value, or the time it occurred 31 : enum class OutputType 32 : { 33 : EXTREME_VALUE, 34 : TIME 35 : }; 36 : 37 : /** 38 : * Class constructor 39 : * @param parameters The input parameters 40 : */ 41 : TimeExtremeValue(const InputParameters & parameters); 42 818 : virtual void initialize() override {} 43 : virtual void execute() override; 44 : virtual Real getValue() const override; 45 : 46 : protected: 47 : const PostprocessorValue & _postprocessor; 48 : 49 : /// The extreme value type ("max", "min", etc.) 50 : ExtremeType _type; 51 : 52 : // The output type ("extreme_value", "time") 53 : OutputType _output_type; 54 : 55 : /// The extreme value 56 : Real & _value; 57 : 58 : /// The time the extreme value occurred 59 : Real & _time; 60 : };