Skip to content

Commit

Permalink
Document and add check on copy transfer doing N-N siblings transfer, …
Browse files Browse the repository at this point in the history
  • Loading branch information
GiudGiud authored and subhendu-LANL committed Mar 12, 2024
1 parent d473482 commit b438c46
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
Expand Up @@ -5,6 +5,13 @@ and [auxiliary](/AuxVariables/index.md)) between [MultiApps](/MultiApps/index.md
of variables, including higher order, elemental, and nodal are supported. The only limitation is that
the meshes in the parent and sub application must be identical.

## 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 Syntax

!listing test/tests/transfers/multiapp_copy_transfer/linear_lagrange_to_sub/parent.i block=Transfers
Expand Down
3 changes: 3 additions & 0 deletions framework/include/transfers/MultiAppCopyTransfer.h
Expand Up @@ -47,4 +47,7 @@ class MultiAppCopyTransfer : public MultiAppDofCopyTransfer
VariableName _from_var_name;
/// Name of variables transferring to
AuxVariableName _to_var_name;

private:
virtual void checkSiblingsTransferSupported() const override;
};
16 changes: 16 additions & 0 deletions framework/src/transfers/MultiAppCopyTransfer.C
Expand Up @@ -82,3 +82,19 @@ MultiAppCopyTransfer::execute()
"per multiapp involved on each rank");
}
}

void
MultiAppCopyTransfer::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 variable field copy transfer");
}
else
mooseError("Number of source and target child apps must match for siblings transfer");
}

0 comments on commit b438c46

Please sign in to comment.