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 MFEM_ENABLED 11 : 12 : #include "SetMFEMMeshFESpaceAction.h" 13 : 14 : registerMooseAction("MooseApp", SetMFEMMeshFESpaceAction, "set_mesh_fe_space"); 15 : 16 : InputParameters 17 39042 : SetMFEMMeshFESpaceAction::validParams() 18 : { 19 39042 : InputParameters params = Action::validParams(); 20 39042 : params.addClassDescription("Set the mesh nodal finite element space to the same as the mesh " 21 : "displacement variable, if one is specified."); 22 39042 : return params; 23 0 : } 24 : 25 39042 : SetMFEMMeshFESpaceAction::SetMFEMMeshFESpaceAction(const InputParameters & parameters) 26 39042 : : Action(parameters) 27 : { 28 39042 : } 29 : 30 : void 31 35836 : SetMFEMMeshFESpaceAction::act() 32 : { 33 35836 : auto * mfem_problem = dynamic_cast<MFEMProblem *>(_problem.get()); 34 : 35 35836 : if (!mfem_problem) 36 : { 37 35828 : return; 38 : } 39 : 40 134 : mfem::ParMesh & mesh = mfem_problem->mesh().getMFEMParMesh(); 41 134 : auto const displacement = mfem_problem->getMeshDisplacementGridFunction(); 42 134 : if (!displacement) 43 : { 44 126 : return; 45 : } 46 : 47 8 : mesh.SetNodalFESpace(displacement.value().get().ParFESpace()); 48 : } 49 : 50 : #endif