Line data Source code
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 : #include "ControllableParameter.h" 11 : #include "MooseUtils.h" 12 : 13 : void 14 13651 : ControllableParameter::add(ControllableItem * item) 15 : { 16 13651 : _items.push_back(item); 17 13651 : } 18 : 19 : std::string 20 24 : ControllableParameter::dump() const 21 : { 22 24 : std::ostringstream oss; 23 132 : for (auto item_ptr : _items) 24 108 : oss << item_ptr->dump(); 25 48 : return oss.str(); 26 24 : } 27 : 28 : void 29 10204 : ControllableParameter::checkExecuteOnType(const ExecFlagType & current) const 30 : { 31 23717 : for (const ControllableItem * const item : _items) 32 : { 33 13517 : const std::set<ExecFlagType> & flags = item->getExecuteOnFlags(); 34 13517 : if (!flags.empty() && flags.find(current) == flags.end()) 35 4 : mooseError("The controllable parameter (", 36 4 : item->name(), 37 : ") is not allowed to execute on '", 38 : current, 39 : "', it is only allowed to execute on '", 40 4 : MooseUtils::join(flags, " "), 41 : "'."); 42 : } 43 10200 : } 44 : 45 : std::ostream & 46 0 : operator<<(std::ostream & stream, const ControllableParameter & obj) 47 : { 48 0 : return stream << obj.dump(); 49 : }