Line data Source code
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 MOOSE_MFEM_ENABLED 11 : 12 : #include "MFEMSubMeshTransfer.h" 13 : #include "MFEMProblem.h" 14 : 15 : registerMooseObject("MooseApp", MFEMSubMeshTransfer); 16 : 17 : InputParameters 18 2514 : MFEMSubMeshTransfer::validParams() 19 : { 20 2514 : InputParameters params = MFEMExecutedObject::validParams(); 21 5028 : params.registerBase("MFEMSubMeshTransfer"); 22 5028 : params.addClassDescription("Class to transfer MFEM variable data to or from a restricted copy of " 23 : "the variable defined on " 24 : " a subspace of an MFEMMesh, represented as an MFEMSubMesh."); 25 10056 : MFEMExecutedObject::addRequiredDependencyParam<VariableName>( 26 : params, 27 : "from_variable", 28 : "MFEM variable to transfer data from. Can be defined on either the parent mesh or a " 29 : "submesh of it."); 30 7542 : params.addRequiredParam<VariableName>("to_variable", 31 : "MFEM variable to transfer data into. Can be defined on " 32 : "either the parent mesh or a submesh of it."); 33 : 34 2514 : return params; 35 0 : } 36 : 37 208 : MFEMSubMeshTransfer::MFEMSubMeshTransfer(const InputParameters & parameters) 38 : : MFEMExecutedObject(parameters), 39 208 : _source_var_name(getParam<VariableName>("from_variable")), 40 208 : _source_var(*getMFEMProblem().getGridFunction(_source_var_name)), 41 416 : _result_var_name(getParam<VariableName>("to_variable")), 42 416 : _result_var(*getMFEMProblem().getGridFunction(_result_var_name)) 43 : { 44 208 : } 45 : 46 : std::optional<std::string> 47 208 : MFEMSubMeshTransfer::suppliedVariableName() const 48 : { 49 208 : return _result_var_name; 50 : } 51 : 52 : void 53 280 : MFEMSubMeshTransfer::execute() 54 : { 55 280 : mfem::ParSubMesh::Transfer(_source_var, _result_var); 56 280 : } 57 : 58 : #endif