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 12861431 : std::unique_ptr<FETransformationBase<OutputShape>> FETransformationBase<OutputShape>::build( const FEType & fe_type ) 33 : { 34 12861431 : switch (fe_type.family) 35 : { 36 : // H1 Conforming Elements 37 11636709 : 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 L2_LAGRANGE_VEC: // PB: Shouldn't this be L2 conforming? 56 : case JACOBI_20_00: // PB: For infinite elements... 57 : case JACOBI_30_00: // PB: For infinite elements... 58 11636709 : return std::make_unique<H1FETransformation<OutputShape>>(); 59 : 60 : // HCurl Conforming Elements 61 92379 : case NEDELEC_ONE: 62 92379 : return std::make_unique<HCurlFETransformation<OutputShape>>(); 63 : 64 : // HDiv Conforming Elements 65 405956 : case RAVIART_THOMAS: 66 : case L2_RAVIART_THOMAS: 67 405956 : return std::make_unique<HDivFETransformation<OutputShape>>(); 68 : 69 : // L2 Conforming Elements 70 : 71 : // Other... 72 7980 : case SCALAR: 73 : // Should never need this for SCALARs 74 7980 : return std::make_unique<H1FETransformation<OutputShape>>(); 75 : 76 0 : default: 77 0 : libmesh_error_msg("Unknown family = " << Utility::enum_to_string(fe_type.family)); 78 : } 79 : } 80 : 81 : template class LIBMESH_EXPORT FETransformationBase<Real>; 82 : template class LIBMESH_EXPORT FETransformationBase<RealGradient>; 83 : 84 : } // namespace libMesh