10 #ifdef MOOSE_MFEM_ENABLED 15 #include "libmesh/int_range.h" 22 "Variable(s) to store transferred values in.");
24 "Variable(s) to transfer from.");
30 _from_var_names(getParam<
std::vector<VariableName>>(
"source_variables")),
31 _to_var_names(getParam<
std::vector<VariableName>>(
"variables"))
34 paramError(
"source_variables",
"Number of variables transferred must be same in both systems.");
40 TIME_SECTION(
"MFEMMultiAppTransfer::execute", 5,
"Perform transfer to and/or from subapps.");
62 bool transfers_done =
false;
67 bool is_target_local =
getToMultiApp()->hasLocalApp(to_app_id);
72 transfers_done |= is_target_local;
75 mooseError(
"BETWEEN_MULTIAPP transfer not supported if there is not at least one subapp " 76 "per multiapp involved on each rank");
87 mooseError(
"No displaced problem to provide a displaced equation system");
unsigned int numFromVar() const
Return the number of source variables.
libMesh::EquationSystems & getlibMeshEquationSystem(FEProblemBase &problem, bool use_displaced) const
Get libMesh EquationSystem, which may or may not be displaced.
const std::shared_ptr< MultiApp > getFromMultiApp() const
Get the MultiApp to transfer data from.
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
MooseEnum _current_direction
const std::shared_ptr< MultiApp > getToMultiApp() const
Get the MultiApp to transfer data to.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
unsigned int numToVar() const
Return for the number of destination variables.
virtual libMesh::EquationSystems & es() override
void setActiveToProblem(FEProblemBase &to_problem, const unsigned int global_app_index)
Set current problem to fetch destination variables from.
MFEMMultiAppTransfer(InputParameters const ¶ms)
static InputParameters validParams()
void setActiveFromProblem(FEProblemBase &from_problem, const unsigned int global_app_index)
Set current problem to fetch source variables from.
static InputParameters validParams()
virtual std::shared_ptr< const DisplacedProblem > getDisplacedProblem() const
Base class for all MultiAppTransfer objects.
IntRange< T > make_range(T beg, T end)
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
virtual void transferVariables(bool is_target_local)=0
Transfer all variables from active source problem to active destination problem.
void execute() override
Set active source and destination problems, and execute variable transfer.