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 "MFEMBoundarySubMesh.h" 13 : #include "MFEMProblem.h" 14 : 15 : registerMooseObject("MooseApp", MFEMBoundarySubMesh); 16 : 17 : InputParameters 18 9368 : MFEMBoundarySubMesh::validParams() 19 : { 20 9368 : InputParameters params = MFEMSubMesh::validParams(); 21 9368 : params += MFEMBoundaryRestrictable::validParams(); 22 : 23 18736 : params.addClassDescription("Class to construct an MFEMSubMesh formed from the subspace of the " 24 : "parent mesh restricted to the set of user-specified boundaries."); 25 28104 : params.addParam<BoundaryName>("submesh_boundary", "Name to assign submesh boundary."); 26 9368 : return params; 27 0 : } 28 : 29 8 : MFEMBoundarySubMesh::MFEMBoundarySubMesh(const InputParameters & parameters) 30 : : MFEMSubMesh(parameters), 31 8 : MFEMBoundaryRestrictable(parameters, getMFEMProblem().mesh().getMFEMParMesh()) 32 : { 33 8 : } 34 : 35 : void 36 8 : MFEMBoundarySubMesh::buildSubMesh() 37 : { 38 16 : _submesh = std::make_shared<mfem::ParSubMesh>( 39 24 : mfem::ParSubMesh::CreateFromBoundary(getMesh(), getBoundaryAttributes())); 40 8 : _submesh->attribute_sets.attr_sets = getMesh().bdr_attribute_sets.attr_sets; 41 : 42 24 : if (isParamSetByUser("submesh_boundary")) 43 0 : _submesh->bdr_attribute_sets.SetAttributeSet( 44 0 : getParam<BoundaryName>("submesh_boundary"), 45 0 : mfem::Array<int>({getMesh().bdr_attributes.Max() + 1})); 46 8 : } 47 : 48 : #endif