https://mooseframework.inl.gov
Loading...
Searching...
No Matches
AnalysisStepUOInterface.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// MOOSE includes
13
14void
16 const AnalysisStepUserObject *& step_user_object,
17 const std::string & name)
18{
19 std::vector<const UserObject *> uos;
20 fe_problem.theWarehouse().query().condition<AttribSystem>("UserObject").queryIntoUnsorted(uos);
21
22 std::vector<const AnalysisStepUserObject *> step_uos;
23 for (const auto & uo : uos)
24 {
25 const AnalysisStepUserObject * possible_step_uo =
26 dynamic_cast<const AnalysisStepUserObject *>(uo);
27 if (possible_step_uo)
28 step_uos.push_back(possible_step_uo);
29 }
30
31 if (step_uos.size() > 1)
32 mooseError("Your input file has multiple AnalysisStepUserObjects. MOOSE currently only support "
33 "one in ",
34 name,
35 ". \n");
36 else if (step_uos.size() == 1)
37 mooseInfo("A AnalysisStepUserObject, has been identified and will be used to drive stepping "
38 "behavior in ",
39 name,
40 ".");
41
42 step_user_object = step_uos.size() == 1 ? step_uos[0] : nullptr;
43}
void mooseInfo(Args &&... args)
void mooseError(Args &&... args)
const std::string name
Definition Setup.h:21
virtual void getAnalysisStepUserObject(const FEProblemBase &fe_problem, const AnalysisStepUserObject *&step_user_object, const std::string &name)
User object that provides analysis steps given user input.
TheWarehouse & theWarehouse() const
Query query()