Skip to content

Commit

Permalink
Document and add check on reporter transfer doing N-N siblings transf…
Browse files Browse the repository at this point in the history
…er, refs idaholab#19451
  • Loading branch information
GiudGiud committed Jan 31, 2024
1 parent 91b937a commit a5cdf3d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
Expand Up @@ -10,6 +10,13 @@ This MultiAppReporterTransfer provides a method to transfer a reporter value (se

When transferring data from the main application the data from the main is copied to each sub-application. If the [!param](/Transfers/MultiAppReporterTransfer/subapp_index) is used then data is only transferred to the specified sub-application. When transferring data to the main application the [!param](/Transfers/MultiAppReporterTransfer/subapp_index) must be supplied if there is more than one sub-application.

## Siblings transfer behavior

This transfer supports sending data from a MultiApp to a MultiApp if and only if the number of subapps
in the source MultiApp matches the number of subapps in the target MultiApp, and they are distributed
the same way on the parallel processes. Each source app is then matched to the target app with the same
subapp index.

## Example Input File Syntax

!alert! tip
Expand Down
3 changes: 3 additions & 0 deletions framework/include/transfers/MultiAppReporterTransfer.h
Expand Up @@ -35,4 +35,7 @@ class MultiAppReporterTransfer : public MultiAppTransfer, public ReporterTransfe

/// If set, indicates a particular subapp to transfer the reporter to/from
const unsigned int & _subapp_index;

private:
virtual void checkSiblingsTransferSupported() const override;
};
16 changes: 16 additions & 0 deletions framework/src/transfers/MultiAppReporterTransfer.C
Expand Up @@ -154,3 +154,19 @@ MultiAppReporterTransfer::execute()
else
executeToMultiapp();
}

void
MultiAppReporterTransfer::checkSiblingsTransferSupported() const
{
// Check that we are in the supported configuration: same number of source and target apps
// The allocation of the child apps on the processors must be the same
if (getFromMultiApp()->numGlobalApps() == getToMultiApp()->numGlobalApps())
{
for (const auto i : make_range(getToMultiApp()->numGlobalApps()))
if (getFromMultiApp()->hasLocalApp(i) + getToMultiApp()->hasLocalApp(i) == 1)
mooseError("Child application allocation on parallel processes must be the same to support "
"siblings reporter transfer");
}
else
mooseError("Number of source and target child apps must match for siblings transfer");
}

0 comments on commit a5cdf3d

Please sign in to comment.