https://mooseframework.inl.gov
MFEMSubMeshTransfer.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #ifdef MFEM_ENABLED
11 
12 #include "MFEMSubMeshTransfer.h"
13 #include "MFEMProblem.h"
14 
16 
19 {
21  params.registerBase("MFEMSubMeshTransfer");
22  params.addClassDescription("Class to transfer MFEM variable data to or from a restricted copy of "
23  "the variable defined on an "
24  " a subspace of an MFEMMesh, represented as an MFEMSubMesh.");
25  params.addRequiredParam<VariableName>("from_variable",
26  "MFEM variable to transfer data from. Can be defined on "
27  "either the parent mesh or a submesh of it.");
28  params.addRequiredParam<VariableName>("to_variable",
29  "MFEM variable to transfer data into. Can be defined on "
30  "either the parent mesh or a submesh of it.");
31  return params;
32 }
33 
35  : MFEMGeneralUserObject(parameters),
36  _source_var_name(getParam<VariableName>("from_variable")),
37  _source_var(*getMFEMProblem().getProblemData().gridfunctions.Get(_source_var_name)),
38  _result_var_name(getParam<VariableName>("to_variable")),
39  _result_var(*getMFEMProblem().getProblemData().gridfunctions.Get(_result_var_name))
40 {
41 }
42 
43 void
45 {
46  mfem::ParSubMesh::Transfer(_source_var, _result_var);
47 }
48 
49 #endif
MFEMSubMeshTransfer(const InputParameters &parameters)
static InputParameters validParams()
static InputParameters validParams()
const mfem::ParGridFunction & _source_var
Reference to source gridfunction.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
Class to transfer MFEM variable data to or from a restricted copy of the variable defined on an a sub...
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
void registerBase(const std::string &value)
This method must be called from every base "Moose System" to create linkage with the Action System...
mfem::ParGridFunction & _result_var
Reference to result gridfunction.
virtual void execute() override
Execute method.
registerMooseObject("MooseApp", MFEMSubMeshTransfer)
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump...