libMesh
fe_macro.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2017 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 #ifndef LIBMESH_FE_MACRO_H
20 #define LIBMESH_FE_MACRO_H
21 
22 
23 
24 
25 // These macros help in instantiating specific versions
26 // of the \p FE class. Simply include this file, and
27 // instantiate at the end for the desired dimension(s).
28 #define INSTANTIATE_MAPS(_dim,_type) \
29  template Point FE<_dim, _type>::map(const Elem *, const Point &); \
30  template Point FE<_dim, _type>::map_xi(const Elem *, const Point &); \
31  template Point FE<_dim, _type>::map_eta(const Elem *, const Point &); \
32  template Point FE<_dim, _type>::map_zeta(const Elem *, const Point &); \
33  template void FE<_dim, _type>::inverse_map(const Elem *, const std::vector<Point> &, std::vector<Point> &, Real, bool); \
34  template Point FE<_dim, _type>::inverse_map(const Elem *, const Point &, Real, bool)
35 
36 #define INSTANTIATE_SUBDIVISION_MAPS \
37  template Point FE<2, SUBDIVISION>::map(const Elem *, const Point &); \
38  template Point FE<2, SUBDIVISION>::map_xi(const Elem *, const Point &); \
39  template Point FE<2, SUBDIVISION>::map_eta(const Elem *, const Point &); \
40  template Point FE<2, SUBDIVISION>::map_zeta(const Elem *, const Point &)
41 
42 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
43 
44 #define INSTANTIATE_SUBDIVISION_FE \
45  template unsigned int FE<2,SUBDIVISION>::n_shape_functions () const; \
46  template void FE<2,SUBDIVISION>::attach_quadrature_rule (QBase *); \
47  template unsigned int FE<2,SUBDIVISION>::n_quadrature_points () const; \
48  template void FE<2,SUBDIVISION>::reinit(const Elem *,const std::vector<Point> * const,const std::vector<Real> * const); \
49  template void FE<2,SUBDIVISION>::init_base_shape_functions(const std::vector<Point> &, const Elem *); \
50  template void FE<2,SUBDIVISION>::init_shape_functions(const std::vector<Point> &, const Elem *)
51 
52 #else // LIBMESH_ENABLE_INFINITE_ELEMENTS
53 
54 #define INSTANTIATE_SUBDIVISION_FE \
55  template unsigned int FE<2,SUBDIVISION>::n_shape_functions () const; \
56  template void FE<2,SUBDIVISION>::attach_quadrature_rule (QBase *); \
57  template unsigned int FE<2,SUBDIVISION>::n_quadrature_points () const; \
58  template void FE<2,SUBDIVISION>::reinit(const Elem *,const std::vector<Point> * const,const std::vector<Real> * const); \
59  template void FE<2,SUBDIVISION>::init_shape_functions(const std::vector<Point> &, const Elem *)
60 
61 #endif // LIBMESH_ENABLE_INFINITE_ELEMENTS
62 
63 
64 #ifndef LIBMESH_ENABLE_HIGHER_ORDER_SHAPES
65 
66 #define INSTANTIATE_FE(_dim) template class FE< (_dim), CLOUGH>; \
67  template class FE< (_dim), HERMITE>; \
68  template class FE< (_dim), HIERARCHIC>; \
69  template class FE< (_dim), L2_HIERARCHIC>; \
70  template class FE< (_dim), LAGRANGE>; \
71  template class FE< (_dim), LAGRANGE_VEC>; \
72  template class FE< (_dim), L2_LAGRANGE>; \
73  template class FE< (_dim), MONOMIAL>; \
74  template class FE< (_dim), SCALAR>; \
75  template class FE< (_dim), XYZ>; \
76  template class FE< (_dim), NEDELEC_ONE>
77 
78 #define INSTANTIATE_ALL_MAPS(_dim) \
79  INSTANTIATE_MAPS(_dim,CLOUGH); \
80  INSTANTIATE_MAPS(_dim,HERMITE); \
81  INSTANTIATE_MAPS(_dim,HIERARCHIC); \
82  INSTANTIATE_MAPS(_dim,L2_HIERARCHIC); \
83  INSTANTIATE_MAPS(_dim,LAGRANGE); \
84  INSTANTIATE_MAPS(_dim,LAGRANGE_VEC); \
85  INSTANTIATE_MAPS(_dim,L2_LAGRANGE); \
86  INSTANTIATE_MAPS(_dim,MONOMIAL); \
87  INSTANTIATE_MAPS(_dim,SCALAR); \
88  INSTANTIATE_MAPS(_dim,XYZ); \
89  INSTANTIATE_MAPS(_dim,NEDELEC_ONE)
90 
91 #else //LIBMESH_ENABLE_HIGHER_ORDER_SHAPES
92 
93 #define INSTANTIATE_FE(_dim) template class FE< (_dim), CLOUGH>; \
94  template class FE< (_dim), HERMITE>; \
95  template class FE< (_dim), HIERARCHIC>; \
96  template class FE< (_dim), L2_HIERARCHIC>; \
97  template class FE< (_dim), LAGRANGE>; \
98  template class FE< (_dim), LAGRANGE_VEC>; \
99  template class FE< (_dim), L2_LAGRANGE>; \
100  template class FE< (_dim), MONOMIAL>; \
101  template class FE< (_dim), SCALAR>; \
102  template class FE< (_dim), BERNSTEIN>; \
103  template class FE< (_dim), SZABAB>; \
104  template class FE< (_dim), XYZ>; \
105  template class FE< (_dim), NEDELEC_ONE>
106 
107 #define INSTANTIATE_ALL_MAPS(_dim) \
108  INSTANTIATE_MAPS(_dim,CLOUGH); \
109  INSTANTIATE_MAPS(_dim,HERMITE); \
110  INSTANTIATE_MAPS(_dim,HIERARCHIC); \
111  INSTANTIATE_MAPS(_dim,L2_HIERARCHIC); \
112  INSTANTIATE_MAPS(_dim,LAGRANGE); \
113  INSTANTIATE_MAPS(_dim,LAGRANGE_VEC); \
114  INSTANTIATE_MAPS(_dim,L2_LAGRANGE); \
115  INSTANTIATE_MAPS(_dim,MONOMIAL); \
116  INSTANTIATE_MAPS(_dim,SCALAR); \
117  INSTANTIATE_MAPS(_dim,BERNSTEIN); \
118  INSTANTIATE_MAPS(_dim,SZABAB); \
119  INSTANTIATE_MAPS(_dim,XYZ); \
120  INSTANTIATE_MAPS(_dim,NEDELEC_ONE)
121 
122 #endif //LIBMESH_ENABLE_HIGHER_ORDER_SHAPES
123 
124 #endif // LIBMESH_FE_MACRO_H