inf_fe_base_radial.C
Go to the documentation of this file.00001 // The libMesh Finite Element Library. 00002 // Copyright (C) 2002-2012 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner 00003 00004 // This library is free software; you can redistribute it and/or 00005 // modify it under the terms of the GNU Lesser General Public 00006 // License as published by the Free Software Foundation; either 00007 // version 2.1 of the License, or (at your option) any later version. 00008 00009 // This library is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 // Lesser General Public License for more details. 00013 00014 // You should have received a copy of the GNU Lesser General Public 00015 // License along with this library; if not, write to the Free Software 00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 00018 00019 00020 // Local includes 00021 #include "libmesh/libmesh_config.h" 00022 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 00023 #include "libmesh/inf_fe.h" 00024 #include "libmesh/inf_fe_macro.h" 00025 #include "libmesh/fe.h" 00026 #include "libmesh/elem.h" 00027 00028 namespace libMesh 00029 { 00030 00031 00032 00033 // ------------------------------------------------------------ 00034 // InfFE::Base class members 00035 template <unsigned int Dim, FEFamily T_radial, InfMapType T_base> 00036 Elem* InfFE<Dim,T_radial,T_base>::Base::build_elem (const Elem* inf_elem) 00037 { 00038 AutoPtr<Elem> ape(inf_elem->build_side(0)); 00039 return ape.release(); 00040 } 00041 00042 00043 00044 00045 template <unsigned int Dim, FEFamily T_radial, InfMapType T_base> 00046 ElemType InfFE<Dim,T_radial,T_base>::Base::get_elem_type (const ElemType type) 00047 { 00048 switch (type) 00049 { 00050 // 3D infinite elements: 00051 // with Dim=3 -> infinite elements on their own 00052 case INFHEX8: 00053 return QUAD4; 00054 00055 case INFHEX16: 00056 return QUAD8; 00057 00058 case INFHEX18: 00059 return QUAD9; 00060 00061 case INFPRISM6: 00062 return TRI3; 00063 00064 case INFPRISM12: 00065 return TRI6; 00066 00067 // 2D infinite elements: 00068 // with Dim=3 -> used as boundary condition, 00069 // with Dim=2 -> infinite elements on their own 00070 case INFQUAD4: 00071 return EDGE2; 00072 00073 case INFQUAD6: 00074 return EDGE3; 00075 00076 // 1D infinite elements: 00077 // with Dim=2 -> used as boundary condition, 00078 // with Dim=1 -> infinite elements on their own, 00079 // but no base element! 00080 case INFEDGE2: 00081 return INVALID_ELEM; 00082 00083 default: 00084 { 00085 libMesh::err << "ERROR: Unsupported element type!: " << type 00086 << std::endl; 00087 libmesh_error(); 00088 } 00089 } 00090 00091 00092 libmesh_error(); 00093 return INVALID_ELEM; 00094 } 00095 00096 00097 00098 00099 00100 template <unsigned int Dim, FEFamily T_radial, InfMapType T_base> 00101 unsigned int InfFE<Dim,T_radial,T_base>::Base::n_base_mapping_sf (const ElemType base_elem_type, 00102 const Order base_mapping_order) 00103 { 00104 if (Dim == 1) 00105 return 1; 00106 00107 else if (Dim == 2) 00108 return FE<1,LAGRANGE>::n_shape_functions (base_elem_type, 00109 base_mapping_order); 00110 else if (Dim == 3) 00111 return FE<2,LAGRANGE>::n_shape_functions (base_elem_type, 00112 base_mapping_order); 00113 else 00114 { 00115 // whoa, cool infinite element! 00116 libmesh_error(); 00117 return 0; 00118 } 00119 } 00120 00121 00122 00123 00124 00125 // ------------------------------------------------------------ 00126 // InfFE::Radial class members 00127 template <unsigned int Dim, FEFamily T_radial, InfMapType T_map> 00128 unsigned int InfFE<Dim,T_radial,T_map>::Radial::n_dofs_at_node (const Order o_radial, 00129 const unsigned int n_onion) 00130 { 00131 libmesh_assert_less (n_onion, 2); 00132 00133 if (n_onion == 0) 00134 /* 00135 * in the base, no matter what, we have 1 node associated 00136 * with radial direction 00137 */ 00138 return 1; 00139 else 00140 /* 00141 * this works, since for Order o_radial=CONST=0, we still 00142 * have the (1-v)/2 mode, associated to the base 00143 */ 00144 return static_cast<unsigned int>(o_radial); 00145 } 00146 00147 00148 00149 00150 00151 00152 //-------------------------------------------------------------- 00153 // Explicit instantiations 00154 INSTANTIATE_INF_FE_MBRF(1,CARTESIAN,Elem*,Base::build_elem(const Elem*)); 00155 INSTANTIATE_INF_FE_MBRF(2,CARTESIAN,Elem*,Base::build_elem(const Elem*)); 00156 INSTANTIATE_INF_FE_MBRF(3,CARTESIAN,Elem*,Base::build_elem(const Elem*)); 00157 INSTANTIATE_INF_FE_MBRF(1,CARTESIAN,ElemType,Base::get_elem_type(const ElemType type)); 00158 INSTANTIATE_INF_FE_MBRF(2,CARTESIAN,ElemType,Base::get_elem_type(const ElemType type)); 00159 INSTANTIATE_INF_FE_MBRF(3,CARTESIAN,ElemType,Base::get_elem_type(const ElemType type)); 00160 INSTANTIATE_INF_FE_MBRF(1,CARTESIAN,unsigned int,Base::n_base_mapping_sf(const ElemType,const Order)); 00161 INSTANTIATE_INF_FE_MBRF(2,CARTESIAN,unsigned int,Base::n_base_mapping_sf(const ElemType,const Order)); 00162 INSTANTIATE_INF_FE_MBRF(3,CARTESIAN,unsigned int,Base::n_base_mapping_sf(const ElemType,const Order)); 00163 INSTANTIATE_INF_FE_MBRF(1,CARTESIAN,unsigned int,Radial::n_dofs_at_node (const Order,const unsigned int)); 00164 INSTANTIATE_INF_FE_MBRF(2,CARTESIAN,unsigned int,Radial::n_dofs_at_node (const Order,const unsigned int)); 00165 INSTANTIATE_INF_FE_MBRF(3,CARTESIAN,unsigned int,Radial::n_dofs_at_node (const Order,const unsigned int)); 00166 00167 } // namespace libMesh 00168 00169 #endif //ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 00170
Site Created By: libMesh Developers
Last modified: February 05 2013 19:54:47 UTC
Hosted By: