LCOV - code coverage report
Current view: top level - src/mfem/submeshes - MFEMDomainSubMesh.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #31405 (292dce) with base fef103 Lines: 20 21 95.2 %
Date: 2025-09-04 07:52:05 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 "MFEMDomainSubMesh.h"
      13             : #include "MFEMProblem.h"
      14             : 
      15             : registerMooseObject("MooseApp", MFEMDomainSubMesh);
      16             : 
      17             : InputParameters
      18        8732 : MFEMDomainSubMesh::validParams()
      19             : {
      20        8732 :   InputParameters params = MFEMSubMesh::validParams();
      21        8732 :   params += MFEMBlockRestrictable::validParams();
      22       17464 :   params.addClassDescription("Class to construct an MFEMSubMesh formed from the subspace of the "
      23             :                              "parent mesh restricted to the set of user-specified subdomains.");
      24       26196 :   params.addParam<BoundaryName>("submesh_boundary", "Name to assign submesh boundary.");
      25        8732 :   return params;
      26           0 : }
      27             : 
      28          51 : MFEMDomainSubMesh::MFEMDomainSubMesh(const InputParameters & parameters)
      29             :   : MFEMSubMesh(parameters),
      30          51 :     MFEMBlockRestrictable(parameters, getMFEMProblem().mesh().getMFEMParMesh())
      31             : {
      32          51 : }
      33             : 
      34             : void
      35          51 : MFEMDomainSubMesh::buildSubMesh()
      36             : {
      37         102 :   _submesh = std::make_shared<mfem::ParSubMesh>(
      38         153 :       mfem::ParSubMesh::CreateFromDomain(getMesh(), getSubdomainAttributes()));
      39          51 :   _submesh->attribute_sets.attr_sets = getMesh().attribute_sets.attr_sets;
      40          51 :   _submesh->bdr_attribute_sets.attr_sets = getMesh().bdr_attribute_sets.attr_sets;
      41             : 
      42         153 :   if (isParamSetByUser("submesh_boundary"))
      43             :   {
      44          14 :     const BoundaryName & submesh_boundary = getParam<BoundaryName>("submesh_boundary");
      45           7 :     _submesh->bdr_attribute_sets.CreateAttributeSet(submesh_boundary);
      46           7 :     _submesh->bdr_attribute_sets.AddToAttributeSet(submesh_boundary,
      47           7 :                                                    getMesh().bdr_attributes.Max() + 1);
      48             :   }
      49          51 : }
      50             : 
      51             : #endif

Generated by: LCOV version 1.14