https://mooseframework.inl.gov
Loading...
Searching...
No Matches
TimeWindowedStatisticsPostProcessor.h
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#pragma once
11
13
14#include <vector>
15
32{
33public:
35
37
38 virtual void initialize() override {}
39 virtual void execute() override;
40 virtual void finalize() override {}
41 virtual Real getValue() const override { return _value; }
42
43protected:
45 CreateMooseEnumClass(Statistic, MEAN, STD, TIME_INTEGRATED_MEAN, STATISTICS_TIME);
46
53 Real windowMean(std::size_t begin, std::size_t end) const;
54
58 const unsigned int _window;
60 const Statistic _statistic;
62 const Real _start_time;
64 const Real _reference;
65
66 // Restartable state
67
69 std::vector<Real> & _history;
73 bool & _averaging;
75 Real & _sum;
77 Real & _avg_time;
78
80 Real _value;
81};
Real PostprocessorValue
various MOOSE typedefs
Definition MooseTypes.h:230
This class is here to combine the Postprocessor interface and the base class Postprocessor object alo...
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
Time statistics of another postprocessor, using only samples with t >= start_time.
Real _value
Value of the selected statistic computed in the latest execute()
virtual Real getValue() const override
This will get called to actually grab the final value the postprocessor has calculated.
Real & _sum
Time integral of the monitored value since start_time, with the rectangle rule.
Real windowMean(std::size_t begin, std::size_t end) const
Arithmetic mean of the stored samples in the half-open index range [begin, end)
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
Real & _avg_time
Length of the time integration interval, the sum of the time steps clipped to start_time.
CreateMooseEnumClass(Statistic, MEAN, STD, TIME_INTEGRATED_MEAN, STATISTICS_TIME)
Statistics that can be reported, see the class description.
const PostprocessorValue & _pp
Value of the monitored postprocessor.
bool & _averaging
Whether averaging has started, i.e. a time step with t >= start_time has been reached.
const Real _reference
Normalization scale for a relative statistic; 0 means use the window mean magnitude.
const Statistic _statistic
Statistic reported by getValue()
const Real _start_time
Simulation time from which samples are recorded.
int & _last_step
Time step index of the last recorded sample, used to record at most one sample per step.
std::vector< Real > & _history
Recorded samples, one per time step, most recent last; capped at 2 * _window entries.
virtual void execute() override
Execute method.
const unsigned int _window
Number of most recent time steps used by the windowed statistics (mean, std)
virtual void finalize() override
This is called after execute() and after threadJoin()! This is probably where you want to do MPI comm...