LCOV - code coverage report
Current view: top level - src/mfem/actions - SetMFEMMeshFESpaceAction.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #33187 (5aa0b2) with base d7c4bd Lines: 13 14 92.9 %
Date: 2026-06-30 12:18:20 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.14