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 "SetMFEMMeshFESpaceAction.h" 13 : 14 : registerMooseAction("MooseApp", SetMFEMMeshFESpaceAction, "set_mesh_fe_space"); 15 : 16 : InputParameters 17 49731 : SetMFEMMeshFESpaceAction::validParams() 18 : { 19 49731 : InputParameters params = Action::validParams(); 20 49731 : params.addClassDescription("Set the mesh nodal finite element space to the same as the mesh " 21 : "displacement variable, if one is specified."); 22 49731 : return params; 23 0 : } 24 : 25 49731 : SetMFEMMeshFESpaceAction::SetMFEMMeshFESpaceAction(const InputParameters & parameters) 26 49731 : : Action(parameters) 27 : { 28 49731 : } 29 : 30 : void 31 45550 : SetMFEMMeshFESpaceAction::act() 32 : { 33 45550 : if (_problem->feBackend() == Moose::FEBackend::MFEM) 34 : { 35 1495 : auto & mfem_problem = static_cast<MFEMProblem &>(*_problem); 36 1495 : if (const auto displacement = mfem_problem.getMeshDisplacementGridFunction()) 37 11 : mfem_problem.mesh().getMFEMParMesh().SetNodalFESpace(displacement.value().get().ParFESpace()); 38 : } 39 45550 : } 40 : 41 : #endif