10#ifdef MOOSE_MFEM_ENABLED
27 checkValidTransferProblemTypes<Moose::FEBackend::MFEM, Moose::FEBackend::MFEM>();
45 auto getGF = [&](
MFEMProblem & problem,
const std::string &
name) -> mfem::Vector &
51 mooseError(
"No real or complex variable named '",
name,
"' found.");
54 for (
const auto v : make_range(
numToVar()))
59 if (from_var.Size() != to_var.Size())
73 for (
const auto i : make_range(
getToMultiApp()->numGlobalApps()))
75 mooseError(
"Child application allocation on parallel processes must be the same to support "
76 "siblings variable field copy transfer");
79 mooseError(
"Number of source and target child apps must match for siblings transfer");
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
registerMooseObject("MooseApp", MultiAppMFEMCopyTransfer)
Virtual base class for MultiApp transfers to and/or from MFEMProblems.
const VariableName & getToVarName(int i) const
Getter for destination variable name.
unsigned int numToVar() const
Return for the number of destination variables.
static InputParameters validParams()
const VariableName & getFromVarName(int i) const
Getter for source variable name.
virtual FEProblemBase & getActiveToProblem()
Getter for current problem containing destination variables.
virtual FEProblemBase & getActiveFromProblem()
Getter for current problem containing source variables.
std::shared_ptr< mfem::ParComplexGridFunction > getComplexGridFunction(const std::string &name)
std::shared_ptr< mfem::ParGridFunction > getGridFunction(const std::string &name)
MFEMProblemData & getProblemData()
Method to get the current MFEMProblemData object storing the current data specifying the FE problem.
const std::string & name() const
Get the name of the class.
bool Has(const std::string &field_name) const
Predicate to check if a field is registered with name field_name.
Transfer to copy MFEMVariables between multiapps.
virtual MFEMProblem & getActiveToProblem() override
Set current MFEM problem to fetch destination variables from.
virtual void transferVariables(bool is_target_local) override
Transfer all variables from active source problem to active destination problem.
void checkSiblingsTransferSupported() const override
Check number of source and target child apps match for sibling transfer.
MultiAppMFEMCopyTransfer(InputParameters const ¶ms)
static InputParameters validParams()
virtual MFEMProblem & getActiveFromProblem() override
Set current MFEM problem to fetch source variables from.
const std::shared_ptr< MultiApp > getToMultiApp() const
Get the MultiApp to transfer data to.
const std::shared_ptr< MultiApp > getFromMultiApp() const
Get the MultiApp to transfer data from.
Moose::MFEM::ComplexGridFunctions cmplx_gridfunctions
Moose::MFEM::GridFunctions gridfunctions