22 "Maps the time steps and the load step simulation times. It can be " 23 "used in either direction depending on the simulation setup. It " 24 "generates steps to be used in StepPeriod to control the enabled/disabled state of objects " 25 "with user-provided simulation steps.");
28 "The beginning of step times. The number of steps is inferred from the number of times. One " 29 "step is defined by its start time; and its end time is taken from the start time of the " 30 "next step (if it exists). This list needs to be in ascending value order.");
33 "The end of step times. The number of steps is inferred from the number of times. One " 34 "step is defined by the interval between previous start time and the next. The first step " 35 "is assumed to start at time zero. This list needs to be in ascending value order.");
37 "The total time interval in which the steps take place. This option needs " 38 "to be used together with the 'number_steps'.");
41 "Total number of steps in the total time inteval (provided as total_time_interval).");
45 "The durations of the steps. 'n' of step time intervals define 'n+1' steps " 46 "starting at time equals zero.");
49 "set_sync_times",
false,
"Whether to make the output times include the step times.");
58 _total_time_interval(0),
63 const bool is_interval_and_steps =
68 if (
int(is_step_start_times) +
int(is_step_end_times) +
int(is_interval_and_steps) +
69 int(is_step_durations) >
71 mooseError(
"In AnalysisStepUserObject, only one of 'step_start_times', 'step_end_times', " 72 "'total_time_interval', and 'step_durations' can be set");
75 mooseError(
"In AnalysisStepUserObject, both 'total_time_interval' and 'number_steps' need both " 79 if (is_step_start_times)
81 _times = getParam<std::vector<Real>>(
"step_start_times");
84 "start times for AnalysisStepUserObject are not provided in ascending order. " 88 mooseInfo(
"Step start times are used to define simulation steps in ",
name(),
".");
90 else if (is_step_end_times)
92 _times = getParam<std::vector<Real>>(
"step_end_times");
96 "end times for AnalysisStepUserObject are not provided in ascending order. Please revise " 100 mooseInfo(
"Step start times are used to define simulation steps in ",
name(),
".");
102 else if (is_interval_and_steps)
116 mooseInfo(
"The total time interval and the provided number of steps are used to define " 117 "simulation steps in ",
121 else if (is_step_durations)
132 mooseInfo(
"Step durations are used to define simulation steps in ",
name(),
".");
136 "Plese provide 'step_start_times' or 'step_durations' or 'total_time_interval' and " 137 "'number_steps' to define simulation loading steps.");
140 if (getParam<bool>(
"set_sync_times"))
143 for (
const auto t :
_times)
144 sync_times.insert(t);
151 if (
_times.size() <= step)
152 mooseError(
"AnalysisStepUserObject was called with a wrong step number");
162 if (
_times.size() > step + 1)
163 end_time =
_times[step + 1];
164 else if (
_times.size() == step + 1)
165 end_time = std::numeric_limits<double>::max();
167 mooseError(
"AnalysisStepUserObject was called with a wrong step number");
179 if (i + 1 ==
_times.size())
Real _total_time_interval
static InputParameters validParams()
Real getEndTime(const unsigned int &step) const
void mooseInfo(Args &&... args) const
std::vector< Real > _times
void initialize() override
virtual const std::string & name() const
AnalysisStepUserObject(const InputParameters ¶meters)
Real getStartTime(const unsigned int &step) const
bool absoluteFuzzyLessThan(const T &var1, const T2 &var2, const T3 &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
void paramError(const std::string ¶m, Args... args) const
static InputParameters validParams()
std::vector< Real > _step_durations
bool isParamSetByUser(const std::string &nm) const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
bool absoluteFuzzyGreaterEqual(const T &var1, const T2 &var2, const T3 &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
void mooseError(Args &&... args) const
unsigned int getStep(const Real &time) const
User object that provides analysis steps given user input.
unsigned int _number_steps
registerMooseObject("SolidMechanicsApp", AnalysisStepUserObject)
std::set< Real > & getSyncTimes()
auto index_range(const T &sizable)
OutputWarehouse & getOutputWarehouse()