Line data Source code
1 : // The libMesh Finite Element Library. 2 : // Copyright (C) 2002-2025 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 15326404 : std::unique_ptr<FETransformationBase<OutputShape>> FETransformationBase<OutputShape>::build( const FEType & fe_type ) 33 : { 34 15326404 : switch (fe_type.family) 35 : { 36 : // H1 Conforming Elements 37 13912368 : 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_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 13912368 : return std::make_unique<H1FETransformation<OutputShape>>(); 58 : 59 : // HCurl Conforming Elements 60 90070 : case NEDELEC_ONE: 61 90070 : return std::make_unique<HCurlFETransformation<OutputShape>>(); 62 : 63 : // HDiv Conforming Elements 64 438895 : case RAVIART_THOMAS: 65 : case L2_RAVIART_THOMAS: 66 438895 : return std::make_unique<HDivFETransformation<OutputShape>>(); 67 : 68 : // L2 Conforming Elements 69 : 70 : // Other... 71 16024 : case SCALAR: 72 : // Should never need this for SCALARs 73 16024 : return std::make_unique<H1FETransformation<OutputShape>>(); 74 : 75 0 : default: 76 0 : libmesh_error_msg("Unknown family = " << Utility::enum_to_string(fe_type.family)); 77 : } 78 : } 79 : 80 : template class LIBMESH_EXPORT FETransformationBase<Real>; 81 : template class LIBMESH_EXPORT FETransformationBase<RealGradient>; 82 : 83 : } // namespace libMesh