https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MFEMScalarFESpace.C
Go to the documentation of this file.
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
15
18{
20 params.addClassDescription("Convenience class to construct scalar finite element spaces.");
21 MooseEnum fec_types("H1 L2 L2Int", "H1");
22 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 "GaussLobatto");
26 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 return params;
33}
34
36 : MFEMSimplifiedFESpace(parameters), _fec_type(getParam<MooseEnum>("fec_type"))
37{
38}
39
40std::string
42{
43 std::string basis =
44 _fec_type == "L2" || _fec_type == "L2Int"
45 ? "_T" + std::to_string(getParam<MooseEnum>("basis"))
46 : "@" + std::string({mfem::BasisType::GetChar(getParam<MooseEnum>("basis"))});
47
48 return _fec_type + basis + "_" + std::to_string(getProblemDim()) + "D_P" +
49 std::to_string(_fec_order);
50}
51
52int
54{
55 return 1;
56}
57
58#endif
registerMooseObject("MooseApp", MFEMScalarFESpace)
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object.
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump.
virtual std::string getFECName() const override
Get the name of the desired FECollection.
static InputParameters validParams()
virtual int getVDim() const override
Get the number of degrees of freedom per basis function needed in this finite element space.
const std::string _fec_type
Name of the family of finite element collections to use.
MFEMScalarFESpace(const InputParameters &parameters)
Class with common parameters for MFEMVectorFESpace and MFEMScalarFESpace.
static InputParameters validParams()
int getProblemDim() const
Returns the dimension of the problem (i.e., the highest dimension of the reference elements in the me...
const int _fec_order
Order of the basis functions in the finite element collection.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition MooseEnum.h:55