10 #ifdef MOOSE_MFEM_ENABLED 27 "variable",
"AuxVariable to store transferred value in.");
29 "Variable to transfer from");
36 _from_var_names(getParam<
std::vector<VariableName>>(
"source_variable")),
37 _to_var_names(getParam<
std::vector<AuxVariableName>>(
"variable"))
39 auto bad_problem = [
this]()
42 " only works with MFEMProblem based applications. Check that all your inputs " 43 "involved in this transfer are MFEMProblem based");
47 if (!dynamic_cast<MFEMProblem *>(&
getToMultiApp()->problemBase()))
51 !dynamic_cast<MFEMProblem *>(&
getToMultiApp()->appProblemBase(i)))
71 mooseError(
"No transferred variables were specified, neither programmatically or through the " 72 "'source_variable' parameter");
74 mooseError(
"Number of variables transferred must be same in both systems.");
75 for (
unsigned v = 0; v <
numToVar(); ++v)
88 TIME_SECTION(
"MultiAppMFEMCopyTransfer::execute", 5,
"Copies variables");
91 for (
unsigned int i = 0; i <
getToMultiApp()->numGlobalApps(); i++)
113 int transfers_done = 0;
127 mooseError(
"BETWEEN_MULTIAPP transfer not supported if there is not at least one subapp " 128 "per multiapp involved on each rank");
141 mooseError(
"Child application allocation on parallel processes must be the same to support " 142 "siblings variable field copy transfer");
145 mooseError(
"Number of source and target child apps must match for siblings transfer");
MFEMProblemData & getProblemData()
Method to get the current MFEMProblemData object storing the current data specifying the FE problem...
const std::shared_ptr< MultiApp > getFromMultiApp() const
Get the MultiApp to transfer data from.
MooseEnum _current_direction
void execute() override
Execute the transfer.
const std::shared_ptr< MultiApp > getToMultiApp() const
Get the MultiApp to transfer data to.
bool hasFromMultiApp() const
Whether the transfer owns a non-null from_multi_app.
void transfer(MFEMProblem &to_problem, MFEMProblem &from_problem)
auto const & getToVarName(int i)
const std::string & type() const
Get the type of this class.
MultiAppMFEMCopyTransfer(InputParameters const ¶ms)
void checkSiblingsTransferSupported() const override
Whether the transfer supports siblings transfer.
static InputParameters validParams()
auto const & getFromVarName(int i)
Base class for all MultiAppTransfer objects.
IntRange< T > make_range(T beg, T end)
bool hasToMultiApp() const
Whether the transfer owns a non-null to_multi_app.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
T & GetRef(const std::string &field_name) const
Returns a reference to a field.
registerMooseObject("MooseApp", MultiAppMFEMCopyTransfer)
Moose::MFEM::GridFunctions gridfunctions
static InputParameters validParams()