https://mooseframework.inl.gov
Loading...
Searching...
No Matches
AnalysisStepNumber.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://www.mooseframework.org
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 "AnalysisStepNumber.h"
11#include "UserObjectInterface.h"
12
14
17{
19 params.addRequiredParam<UserObjectName>("analysis_step_user_object",
20 "The AnalysisStepUserObject that stores step times.");
21 params.addParam<bool>("use_one_based_indexing", false, "Make step number start at one.");
22 params.addClassDescription("Outputs the current analysis step number.");
23 params.set<ExecFlagEnum>("execute_on") = {
24 EXEC_INITIAL, EXEC_TIMESTEP_BEGIN}; // only need to execute once per time step
25 return params;
26}
27
29 : GeneralPostprocessor(parameters),
30 _step_uo(getUserObject<AnalysisStepUserObject>("analysis_step_user_object")),
31 _use_one_based_indexing(getParam<bool>("use_one_based_indexing"))
32{
33}
34
35Real
registerMooseObject("SolidMechanicsApp", AnalysisStepNumber)
const ExecFlagType EXEC_TIMESTEP_BEGIN
const ExecFlagType EXEC_INITIAL
void ErrorVector unsigned int
Given the current time, outputs the current analysis step number.
virtual PostprocessorValue getValue() const override
const bool _use_one_based_indexing
Flag for reporting step times beginning at 1 instead of 0.
AnalysisStepNumber(const InputParameters &parameters)
const AnalysisStepUserObject & _step_uo
The AnalysisStepUserObject that contains step time information.
static InputParameters validParams()
User object that provides analysis steps given user input.
unsigned int getStep(const Real &time) const
static InputParameters validParams()
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
T & set(const std::string &name, bool quiet_mode=false)
const Real & _t_old