Skip to content

Commit

Permalink
Merge pull request #25971 from GiudGiud/PR_misc_4
Browse files Browse the repository at this point in the history
Small changes in Actions
  • Loading branch information
GiudGiud authored Nov 7, 2023
2 parents 1c87d63 + 3decfc5 commit 445341c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
8 changes: 8 additions & 0 deletions framework/include/actions/Action.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ class Action : public ConsoleStreamInterface,

inline bool isParamValid(const std::string & name) const { return _pars.isParamValid(name); }

inline bool isParamSetByUser(const std::string & name) const;

void appendTask(const std::string & task) { _all_tasks.insert(task); }

/**
Expand Down Expand Up @@ -286,3 +288,9 @@ Action::getParam(const std::string & name) const
{
return InputParameters::getParamHelper(name, _pars, static_cast<T *>(0));
}

bool
Action::isParamSetByUser(const std::string & name) const
{
return _pars.isParamSetByUser(name);
}
13 changes: 12 additions & 1 deletion framework/include/actions/ActionWarehouse.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,18 @@ class ActionWarehouse : public ConsoleStreamInterface
}
}
if (!p)
mooseError("Action with name being ", name, " does not exist");
{
std::vector<std::string> all_names;
for (auto act_ptr : _all_ptrs)
if (!act_ptr->name().empty())
all_names.push_back(act_ptr->name());
else
all_names.push_back("unnamed");
mooseError("Action with name '",
name,
"' does not exist.\n These are the Actions that do exist:",
Moose::stringify(all_names));
}
return *p;
}

Expand Down

0 comments on commit 445341c

Please sign in to comment.