inf_fe_base_radial.C
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2014 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 
19 
20 // Local includes
21 #include "libmesh/libmesh_config.h"
22 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
23 #include "libmesh/inf_fe.h"
24 #include "libmesh/inf_fe_macro.h"
25 #include "libmesh/fe.h"
26 #include "libmesh/elem.h"
27 
28 namespace libMesh
29 {
30 
31 
32 
33 // ------------------------------------------------------------
34 // InfFE::Base class members
35 template <unsigned int Dim, FEFamily T_radial, InfMapType T_base>
37 {
38  AutoPtr<Elem> ape(inf_elem->build_side(0));
39  return ape.release();
40 }
41 
42 
43 
44 
45 template <unsigned int Dim, FEFamily T_radial, InfMapType T_base>
47 {
48  switch (type)
49  {
50  // 3D infinite elements:
51  // with Dim=3 -> infinite elements on their own
52  case INFHEX8:
53  return QUAD4;
54 
55  case INFHEX16:
56  return QUAD8;
57 
58  case INFHEX18:
59  return QUAD9;
60 
61  case INFPRISM6:
62  return TRI3;
63 
64  case INFPRISM12:
65  return TRI6;
66 
67  // 2D infinite elements:
68  // with Dim=3 -> used as boundary condition,
69  // with Dim=2 -> infinite elements on their own
70  case INFQUAD4:
71  return EDGE2;
72 
73  case INFQUAD6:
74  return EDGE3;
75 
76  // 1D infinite elements:
77  // with Dim=2 -> used as boundary condition,
78  // with Dim=1 -> infinite elements on their own,
79  // but no base element!
80  case INFEDGE2:
81  return INVALID_ELEM;
82 
83  default:
84  {
85  libMesh::err << "ERROR: Unsupported element type!: " << type
86  << std::endl;
87  libmesh_error();
88  }
89  }
90 
91 
92  libmesh_error();
93  return INVALID_ELEM;
94 }
95 
96 
97 
98 
99 
100 template <unsigned int Dim, FEFamily T_radial, InfMapType T_base>
102  const Order base_mapping_order)
103 {
104  if (Dim == 1)
105  return 1;
106 
107  else if (Dim == 2)
108  return FE<1,LAGRANGE>::n_shape_functions (base_elem_type,
109  base_mapping_order);
110  else if (Dim == 3)
111  return FE<2,LAGRANGE>::n_shape_functions (base_elem_type,
112  base_mapping_order);
113  else
114  {
115  // whoa, cool infinite element!
116  libmesh_error();
117  return 0;
118  }
119 }
120 
121 
122 
123 
124 
125 // ------------------------------------------------------------
126 // InfFE::Radial class members
127 template <unsigned int Dim, FEFamily T_radial, InfMapType T_map>
129  const unsigned int n_onion)
130 {
131  libmesh_assert_less (n_onion, 2);
132 
133  if (n_onion == 0)
134  /*
135  * in the base, no matter what, we have 1 node associated
136  * with radial direction
137  */
138  return 1;
139  else
140  /*
141  * this works, since for Order o_radial=CONST=0, we still
142  * have the (1-v)/2 mode, associated to the base
143  */
144  return static_cast<unsigned int>(o_radial);
145 }
146 
147 
148 
149 
150 
151 
152 //--------------------------------------------------------------
153 // Explicit instantiations
163 INSTANTIATE_INF_FE_MBRF(1,CARTESIAN,unsigned int,Radial::n_dofs_at_node (const Order,const unsigned int));
164 INSTANTIATE_INF_FE_MBRF(2,CARTESIAN,unsigned int,Radial::n_dofs_at_node (const Order,const unsigned int));
165 INSTANTIATE_INF_FE_MBRF(3,CARTESIAN,unsigned int,Radial::n_dofs_at_node (const Order,const unsigned int));
166 
167 } // namespace libMesh
168 
169 #endif //ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS

Site Created By: libMesh Developers
Last modified: February 07 2014 16:57:05 UTC

Hosted By:
SourceForge.net Logo