fe_type.h
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 #ifndef LIBMESH_FE_TYPE_H
21 #define LIBMESH_FE_TYPE_H
22 
23 // Local includes
24 #include "libmesh/auto_ptr.h"
25 #include "libmesh/libmesh_config.h"
26 #include "libmesh/enum_order.h"
27 #include "libmesh/enum_fe_family.h"
29 
30 // C++ includes
31 
32 namespace libMesh
33 {
34 
35 // Forward declarations
36 class QBase;
37 
38 
43 class FEType
44 {
45 public:
46 
47 #ifndef LIBMESH_ENABLE_INFINITE_ELEMENTS
48 
53  FEType(const Order o = FIRST,
54  const FEFamily f = LAGRANGE) :
55  order(o),
56  family(f)
57  {}
58 
59 
60  //TODO:[BSK] Could these data types all be const?
61  // [RHS] Order can't in the case of p refinement!
66 
72 
73 #else
74 
83  FEType(const Order o = FIRST,
84  const FEFamily f = LAGRANGE,
85  const Order ro = THIRD,
86  const FEFamily rf = JACOBI_20_00,
87  const InfMapType im = CARTESIAN) :
88  order(o),
89  radial_order(ro),
90  family(f),
91  radial_family(rf),
92  inf_map(im)
93  {}
94 
95 
99  Order order;
100 
105 
111 
118 
126 
127 #endif // ifndef LIBMESH_ENABLE_INFINITE_ELEMENTS
128 
132  bool operator== (const FEType &f2) const
133  {
134  return (order == f2.order
135  && family == f2.family
136 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
137  && radial_order == f2.radial_order
139  && inf_map == f2.inf_map
140 #endif // ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
141  );
142  }
143 
147  bool operator!= (const FEType &f2) const
148  {
149  return !(*this == f2);
150  }
151 
155  bool operator< (const FEType &f2) const
156  {
157  if (order != f2.order)
158  return (order < f2.order);
159  if (family != f2.family)
160  return (family < f2.family);
161 
162 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
163  if (radial_order != f2.radial_order)
164  return (radial_order < f2.radial_order);
165  if (radial_family != f2.radial_family)
166  return (radial_family < f2.radial_family);
167  if (inf_map != f2.inf_map)
168  return (inf_map < f2.inf_map);
169 #endif // ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
170  return false;
171  }
172 
180 
187  AutoPtr<QBase> default_quadrature_rule (const unsigned int dim,
188  const int extraorder=0) const;
189 
190 
191 private:
192 
193 };
194 
195 
196 
197 //-------------------------------------------------------------------
198 // FEType inline methods
199 inline
201 {
202  return static_cast<Order>(2*static_cast<unsigned int>(order) + 1);
203 }
204 
205 } // namespace libMesh
206 
207 
208 #endif // LIBMESH_FE_TYPE_H

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

Hosted By:
SourceForge.net Logo