LCOV - code coverage report
Current view: top level - src/mfem/fespaces - MFEMFESpace.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #33380 (547b29) with base 8581c3 Lines: 24 24 100.0 %
Date: 2026-07-20 19:36:28 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 "MFEMFESpace.h"
      13             : #include "MFEMProblem.h"
      14             : 
      15             : InputParameters
      16       12166 : MFEMFESpace::validParams()
      17             : {
      18       12166 :   InputParameters params = MFEMObject::validParams();
      19       24332 :   params.registerBase("MFEMFESpace");
      20       24332 :   params.registerSystemAttributeName("MFEMFESpace");
      21       48664 :   MooseEnum ordering("NODES VDIM", "VDIM");
      22       48664 :   params.addParam<MooseEnum>("ordering", ordering, "Ordering style to use for vector DoFs.");
      23       48664 :   params.addParam<int>("vdim", 1, "The number of degrees of freedom per basis function.");
      24       36498 :   params.addParam<std::string>("submesh",
      25             :                                "Submesh to define the FESpace on. Leave blank to use base mesh.");
      26       24332 :   return params;
      27       12166 : }
      28             : 
      29        2876 : MFEMFESpace::MFEMFESpace(const InputParameters & parameters)
      30             :   : MFEMObject(parameters),
      31        2876 :     _ordering(parameters.get<MooseEnum>("ordering")),
      32        2876 :     _pmesh(
      33        2876 :         parameters.isParamValid("submesh")
      34        6059 :             ? getMFEMProblem().getProblemData().submeshes.GetRef(getParam<std::string>("submesh"))
      35        8321 :             : const_cast<mfem::ParMesh &>(getMFEMProblem().mesh().getMFEMParMesh()))
      36             : {
      37        2876 : }
      38             : 
      39             : void
      40        2876 : MFEMFESpace::buildFEC() const
      41             : {
      42        5720 :   _fec = std::shared_ptr<mfem::FiniteElementCollection>(
      43        8596 :       mfem::FiniteElementCollection::New(getFECName().c_str()));
      44        2860 : }
      45             : 
      46             : void
      47        2876 : MFEMFESpace::buildFESpace() const
      48             : {
      49             :   _fespace =
      50        2876 :       std::make_shared<mfem::ParFiniteElementSpace>(&_pmesh, getFEC().get(), getVDim(), _ordering);
      51        2860 : }
      52             : 
      53             : #endif

Generated by: LCOV version 1.14