https://mooseframework.inl.gov
Loading...
Searching...
No Matches
PerfGraphData.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 "PerfGraphData.h"
11
13
16{
19 "Retrieves performance information about a section from the PerfGraph.");
20
21 params.addRequiredParam<std::string>("section_name", "The name of the section to get data for");
23 "data_type", PerfGraph::dataTypeEnum(), "The type of data to retrieve for the section_name");
24 params.addParam<bool>("must_exist",
25 true,
26 "Whether or not the section must exist; if false and the section does not "
27 "exist, the value is set to zero");
28
29 return params;
30}
31
33 : GeneralPostprocessor(parameters),
34 _data_type(getParam<MooseEnum>("data_type")),
35 _section_name(getParam<std::string>("section_name")),
36 _must_exist(getParam<bool>("must_exist"))
37{
38}
39
40void
47
48Real
50{
51 return _current_data;
52}
registerMooseObject("MooseApp", PerfGraphData)
bool checkingUOAuxState() const
Return a flag to indicate whether we are executing user objects and auxliary kernels for state check ...
This class is here to combine the Postprocessor interface and the base class Postprocessor object alo...
static InputParameters validParams()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object.
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
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.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition MooseEnum.h:55
Real _current_data
The current data.
PerfGraphData(const InputParameters &parameters)
virtual Real getValue() const override
This will get called to actually grab the final value the postprocessor has calculated.
const std::string & _section_name
The section name in the PerfGraph to query.
const int _data_type
The data type to request in regards to the PerfGraph section.
const bool _must_exist
Whether or not the section must exist (if it does not, 0 is returned)
static InputParameters validParams()
virtual void finalize() override
This is called after execute() and after threadJoin()! This is probably where you want to do MPI comm...
PerfGraph & perfGraph()
Get the PerfGraph.
DataType
For retrieving values.
Definition PerfGraph.h:52
Real sectionData(const DataType type, const std::string &section_name, const bool must_exist=true)
Gets a PerfGraph result pertaining to a section.
Definition PerfGraph.C:94
static MooseEnum dataTypeEnum()
DataType in a MooseEnum for use in InputParameters in objects that query the PerfGraph with sectionDa...
Definition PerfGraph.h:72
FEProblemBase & _fe_problem
Reference to the FEProblemBase for this user object.