https://mooseframework.inl.gov
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 
13 registerMooseObject("SolidMechanicsApp", AnalysisStepNumber);
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 
35 Real
37 {
39 }
virtual PostprocessorValue getValue() const override
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
T & set(const std::string &name, bool quiet_mode=false)
registerMooseObject("SolidMechanicsApp", AnalysisStepNumber)
static InputParameters validParams()
void addRequiredParam(const std::string &name, const std::string &doc_string)
static InputParameters validParams()
const Real & _t_old
const ExecFlagType EXEC_TIMESTEP_BEGIN
Given the current time, outputs the current analysis step number.
const AnalysisStepUserObject & _step_uo
The AnalysisStepUserObject that contains step time information.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
unsigned int getStep(const Real &time) const
User object that provides analysis steps given user input.
const bool _use_one_based_indexing
Flag for reporting step times beginning at 1 instead of 0.
void ErrorVector unsigned int
AnalysisStepNumber(const InputParameters &parameters)
const ExecFlagType EXEC_INITIAL