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 10182 : MFEMScalarFESpace::validParams() 18 : { 19 10182 : InputParameters params = MFEMSimplifiedFESpace::validParams(); 20 20364 : params.addClassDescription("Convenience class to construct scalar finite element spaces."); 21 40728 : MooseEnum fec_types("H1 L2", "H1"); 22 40728 : 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 40728 : "GaussLobatto"); 26 40728 : 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 40728 : MooseEnum fec_maps("VALUE INTEGRAL", "VALUE", true); 32 30546 : params.addParam<MooseEnum>( 33 : "fec_map", 34 : fec_maps, 35 : "Specify the FE map type used VALUE or INTEGRAL (meaningful for L2 only)"); 36 : 37 20364 : return params; 38 10182 : } 39 : 40 415 : MFEMScalarFESpace::MFEMScalarFESpace(const InputParameters & parameters) 41 : : MFEMSimplifiedFESpace(parameters), 42 415 : _fec_type(getParam<MooseEnum>("fec_type")), 43 1245 : _fec_map(getParam<MooseEnum>("fec_map")) 44 : { 45 415 : } 46 : 47 : std::string 48 415 : MFEMScalarFESpace::getFECName() const 49 : { 50 : std::string basis = 51 415 : _fec_type == "L2" 52 555 : ? "_T" + std::to_string(getParam<MooseEnum>("basis")) 53 1865 : : "@" + std::string({mfem::BasisType::GetChar(getParam<MooseEnum>("basis"))}); 54 : 55 : // This is to get around an MFEM bug (to be removed in #31525) 56 1223 : basis = (basis == "@G" || basis == "_T0") ? "" : basis; 57 : 58 415 : if (_fec_map == "INTEGRAL") 59 0 : return "L2Int" + basis + "_" + std::to_string(getProblemDim()) + "D_P" + 60 0 : std::to_string(_fec_order); 61 : 62 830 : return _fec_type + basis + "_" + std::to_string(getProblemDim()) + "D_P" + 63 1245 : std::to_string(_fec_order); 64 415 : } 65 : 66 : int 67 415 : MFEMScalarFESpace::getVDim() const 68 : { 69 415 : return 1; 70 : } 71 : 72 : #endif