libMesh
Loading...
Searching...
No Matches
fe_transformation_base.C
Go to the documentation of this file.
1// The libMesh Finite Element Library.
2// Copyright (C) 2002-2026 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3
4// This library is free software; you can redistribute it and/or
5// modify it under the terms of the GNU Lesser General Public
6// License as published by the Free Software Foundation; either
7// version 2.1 of the License, or (at your option) any later version.
8
9// This library is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12// Lesser General Public License for more details.
13
14// You should have received a copy of the GNU Lesser General Public
15// License along with this library; if not, write to the Free Software
16// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
18#include "libmesh/fe_transformation_base.h"
19#include "libmesh/h1_fe_transformation.h"
20#include "libmesh/hcurl_fe_transformation.h"
21#include "libmesh/hdiv_fe_transformation.h"
22#include "libmesh/fe_type.h"
23#include "libmesh/enum_to_string.h"
24
25// C++ Includes
26#include <memory>
27
28namespace libMesh
29{
30
31template<typename OutputShape>
32std::unique_ptr<FETransformationBase<OutputShape>> FETransformationBase<OutputShape>::build( const FEType & fe_type )
33{
34 switch (fe_type.family)
35 {
36 // H1 Conforming Elements
37 case LAGRANGE:
38 case HIERARCHIC:
39 case BERNSTEIN:
40 case SZABAB:
41 case CLOUGH: // PB: Really H2
42 case HERMITE: // PB: Really H2
43 case SUBDIVISION:
44 case LAGRANGE_VEC:
45 case HIERARCHIC_VEC:
46 case MONOMIAL: // PB: Shouldn't this be L2 conforming?
47 case MONOMIAL_VEC: // PB: Shouldn't this be L2 conforming?
48 case XYZ: // PB: Shouldn't this be L2 conforming?
50 case L2_HIERARCHIC:
52 case SIDE_HIERARCHIC:
53 case L2_LAGRANGE: // PB: Shouldn't this be L2 conforming?
54 case L2_LAGRANGE_VEC: // PB: Shouldn't this be L2 conforming?
55 case JACOBI_20_00: // PB: For infinite elements...
56 case JACOBI_30_00: // PB: For infinite elements...
57 return std::make_unique<H1FETransformation<OutputShape>>();
58
59 // HCurl Conforming Elements
60 case NEDELEC_ONE:
61 return std::make_unique<HCurlFETransformation<OutputShape>>();
62
63 // HDiv Conforming Elements
64 case RAVIART_THOMAS:
66 return std::make_unique<HDivFETransformation<OutputShape>>();
67
68 // L2 Conforming Elements
69
70 // Other...
71 case SCALAR:
72 // Should never need this for SCALARs
73 return std::make_unique<H1FETransformation<OutputShape>>();
74
75 default:
76 libmesh_error_msg("Unknown family = " << Utility::enum_to_string(fe_type.family));
77 }
78}
79
80template class LIBMESH_EXPORT FETransformationBase<Real>;
81template class LIBMESH_EXPORT FETransformationBase<RealGradient>;
82
83} // namespace libMesh
This class handles the computation of the shape functions in the physical domain.
static std::unique_ptr< FETransformationBase< OutputShape > > build(const FEType &type)
Builds an FETransformation object based on the finite element type.
class FEType hides (possibly multiple) FEFamily and approximation orders, thereby enabling specialize...
Definition fe_type.h:197
FEFamily family
The type of finite element.
Definition fe_type.h:228
std::string enum_to_string(const T e)
The libMesh namespace provides an interface to certain functionality in the library.
@ L2_RAVIART_THOMAS
@ L2_HIERARCHIC_VEC
@ RATIONAL_BERNSTEIN