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