LCOV - code coverage report
Current view: top level - src/mfem/fespaces - MFEMScalarFESpace.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #31730 (e8b711) with base e0c998 Lines: 22 22 100.0 %
Date: 2025-10-29 16:49:47 Functions: 4 4 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 "MFEMScalarFESpace.h"
      13             : 
      14             : registerMooseObject("MooseApp", MFEMScalarFESpace);
      15             : 
      16             : InputParameters
      17       10024 : MFEMScalarFESpace::validParams()
      18             : {
      19       10024 :   InputParameters params = MFEMSimplifiedFESpace::validParams();
      20       20048 :   params.addClassDescription("Convenience class to construct scalar finite element spaces.");
      21       40096 :   MooseEnum fec_types("H1 L2", "H1");
      22       40096 :   params.addParam<MooseEnum>("fec_type", fec_types, "Specifies the family of FE shape functions.");
      23             :   MooseEnum basis_types("GaussLegendre GaussLobatto Positive OpenUniform ClosedUniform "
      24             :                         "OpenHalfUniform Serendipity ClosedGL IntegratedGLL",
      25       40096 :                         "GaussLobatto");
      26       30072 :   params.addParam<MooseEnum>(
      27             :       "basis",
      28             :       basis_types,
      29             :       "Specifies the basis used for scalar elements. H1 spaces require a closed basis "
      30             :       "(GaussLobatto Positive ClosedUniform Serendipity ClosedGL)");
      31             : 
      32       20048 :   return params;
      33       10024 : }
      34             : 
      35         396 : MFEMScalarFESpace::MFEMScalarFESpace(const InputParameters & parameters)
      36         792 :   : MFEMSimplifiedFESpace(parameters), _fec_type(getParam<MooseEnum>("fec_type"))
      37             : {
      38         396 : }
      39             : 
      40             : std::string
      41         396 : MFEMScalarFESpace::getFECName() const
      42             : {
      43             :   std::string basis =
      44         396 :       _fec_type == "L2"
      45         514 :           ? "_T" + std::to_string(getParam<MooseEnum>("basis"))
      46        1803 :           : "@" + std::string({mfem::BasisType::GetChar(getParam<MooseEnum>("basis"))});
      47             : 
      48             :   // This is to get around an MFEM bug (to be removed in #31525)
      49        1188 :   basis = (basis == "@G" || basis == "_T0") ? "" : basis;
      50             : 
      51         792 :   return _fec_type + basis + "_" + std::to_string(getProblemDim()) + "D_P" +
      52        1584 :          std::to_string(_fec_order);
      53         396 : }
      54             : 
      55             : int
      56         396 : MFEMScalarFESpace::getVDim() const
      57             : {
      58         396 :   return 1;
      59             : }
      60             : 
      61             : #endif

Generated by: LCOV version 1.14