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 5046 : MFEMScalarFESpace::validParams() 18 : { 19 5046 : InputParameters params = MFEMSimplifiedFESpace::validParams(); 20 10092 : params.addClassDescription("Convenience class to construct scalar finite element spaces."); 21 20184 : MooseEnum fec_types("H1 L2 L2Int", "H1"); 22 20184 : 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 20184 : "GaussLobatto"); 26 15138 : 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 10092 : return params; 33 5046 : } 34 : 35 1474 : MFEMScalarFESpace::MFEMScalarFESpace(const InputParameters & parameters) 36 2948 : : MFEMSimplifiedFESpace(parameters), _fec_type(getParam<MooseEnum>("fec_type")) 37 : { 38 1474 : } 39 : 40 : std::string 41 1474 : MFEMScalarFESpace::getFECName() const 42 : { 43 : std::string basis = 44 1129 : _fec_type == "L2" || _fec_type == "L2Int" 45 3317 : ? "_T" + std::to_string(getParam<MooseEnum>("basis")) 46 6656 : : "@" + std::string({mfem::BasisType::GetChar(getParam<MooseEnum>("basis"))}); 47 : 48 2948 : return _fec_type + basis + "_" + std::to_string(getProblemDim()) + "D_P" + 49 5896 : std::to_string(_fec_order); 50 1474 : } 51 : 52 : int 53 1474 : MFEMScalarFESpace::getVDim() const 54 : { 55 1474 : return 1; 56 : } 57 : 58 : #endif