Line data Source code
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 : // MOOSE includes 11 : #include "StepUOInterface.h" 12 : #include "StepUserObject.h" 13 : 14 : void 15 484 : StepUOInterface::getStepUserObject(const FEProblemBase & fe_problem, 16 : const StepUserObject *& step_user_object, 17 : const std::string & name) 18 : { 19 : std::vector<const UserObject *> uos; 20 968 : fe_problem.theWarehouse().query().condition<AttribSystem>("UserObject").queryIntoUnsorted(uos); 21 : 22 : std::vector<const StepUserObject *> step_uos; 23 864 : for (const auto & uo : uos) 24 : { 25 380 : const StepUserObject * possible_step_uo = dynamic_cast<const StepUserObject *>(uo); 26 380 : if (possible_step_uo) 27 67 : step_uos.push_back(possible_step_uo); 28 : } 29 : 30 484 : if (step_uos.size() > 1) 31 0 : mooseError("Your input file has multiple StepUserObjects. MOOSE currently only support one in ", 32 : name, 33 : ". \n"); 34 484 : else if (step_uos.size() == 1) 35 : mooseInfo( 36 : "A StepUserObject, has been identified and will be used to drive stepping behavior in ", 37 : name, 38 : "."); 39 : 40 484 : step_user_object = step_uos.size() == 1 ? step_uos[0] : nullptr; 41 484 : }