Line data Source code
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 : 28 : namespace libMesh 29 : { 30 : 31 : template<typename OutputShape> 32 2688307 : std::unique_ptr<FETransformationBase<OutputShape>> FETransformationBase<OutputShape>::build( const FEType & fe_type ) 33 : { 34 2688307 : switch (fe_type.family) 35 : { 36 : // H1 Conforming Elements 37 1839873 : 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? 49 : case RATIONAL_BERNSTEIN: 50 : case L2_HIERARCHIC: 51 : case L2_HIERARCHIC_VEC: 52 : case SIDE_HIERARCHIC: 53 : case L2_LAGRANGE: // PB: Shouldn't this be L2 conforming? 54 : case L2_LAGRANGE_GLL: 55 : case LAGRANGE_GLL: 56 : case L2_LAGRANGE_VEC: // PB: Shouldn't this be L2 conforming? 57 : case JACOBI_20_00: // PB: For infinite elements... 58 : case JACOBI_30_00: // PB: For infinite elements... 59 1839873 : return std::make_unique<H1FETransformation<OutputShape>>(); 60 : 61 : // HCurl Conforming Elements 62 17659 : case NEDELEC_ONE: 63 17659 : return std::make_unique<HCurlFETransformation<OutputShape>>(); 64 : 65 : // HDiv Conforming Elements 66 91940 : case RAVIART_THOMAS: 67 : case L2_RAVIART_THOMAS: 68 91940 : return std::make_unique<HDivFETransformation<OutputShape>>(); 69 : 70 : // L2 Conforming Elements 71 : 72 : // Other... 73 596 : case SCALAR: 74 : // Should never need this for SCALARs 75 596 : return std::make_unique<H1FETransformation<OutputShape>>(); 76 : 77 0 : default: 78 0 : libmesh_error_msg("Unknown family = " << Utility::enum_to_string(fe_type.family)); 79 : } 80 : } 81 : 82 : template class LIBMESH_EXPORT FETransformationBase<Real>; 83 : template class LIBMESH_EXPORT FETransformationBase<RealGradient>; 84 : 85 : } // namespace libMesh