Skip to content

Commit

Permalink
Adapt to new API for retrieving multiapp (idaholab#19451)
Browse files Browse the repository at this point in the history
  • Loading branch information
GiudGiud authored and MengnanLi91 committed Jan 4, 2023
1 parent b756e17 commit 7d2f578
Showing 1 changed file with 5 additions and 5 deletions.
Expand Up @@ -57,8 +57,8 @@ OptimizationParameterTransfer::execute()
for (const auto & v : _values)
values_full.insert(values_full.end(), v->begin(), v->end());

for (unsigned int i = 0; i < _to_multi_app->numGlobalApps(); ++i)
if (_to_multi_app->hasLocalApp(i))
for (unsigned int i = 0; i < getToMultiApp()->numGlobalApps(); ++i)
if (getToMultiApp()->hasLocalApp(i))
{
ControlsReceiver * ptr = getReceiver(i);
ptr->transfer(_parameters, values_full);
Expand All @@ -69,11 +69,11 @@ ControlsReceiver *
OptimizationParameterTransfer::getReceiver(unsigned int app_index)
{
// Test that the sub-application has the given Control object
FEProblemBase & to_problem = _to_multi_app->appProblemBase(app_index);
FEProblemBase & to_problem = getToMultiApp()->appProblemBase(app_index);
ExecuteMooseObjectWarehouse<Control> & control_wh = to_problem.getControlWarehouse();
if (!control_wh.hasActiveObject(_receiver_name))
mooseError("The sub-application (",
_to_multi_app->name(),
getToMultiApp()->name(),
") does not contain a Control object with the name '",
_receiver_name,
"'.");
Expand All @@ -84,7 +84,7 @@ OptimizationParameterTransfer::getReceiver(unsigned int app_index)
if (!ptr)
mooseError(
"The sub-application (",
_to_multi_app->name(),
getToMultiApp()->name(),
") Control object for the 'to_control' parameter must be of type 'ControlsReceiver'.");

return ptr;
Expand Down

0 comments on commit 7d2f578

Please sign in to comment.