fe_macro.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2018 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 FE<2,SUBDIVISION>::FE(const FEType & fet); \
46  template unsigned int FE<2,SUBDIVISION>::n_shape_functions () const; \
47  template void FE<2,SUBDIVISION>::attach_quadrature_rule (QBase *); \
48  template unsigned int FE<2,SUBDIVISION>::n_quadrature_points () const; \
49  template void FE<2,SUBDIVISION>::reinit(const Elem *,const std::vector<Point> * const,const std::vector<Real> * const); \
50  template void FE<2,SUBDIVISION>::init_base_shape_functions(const std::vector<Point> &, const Elem *); \
51  template void FE<2,SUBDIVISION>::init_shape_functions(const std::vector<Point> &, const Elem *)
52 
53 #else // LIBMESH_ENABLE_INFINITE_ELEMENTS
54 
55 #define INSTANTIATE_SUBDIVISION_FE \
56  template FE<2,SUBDIVISION>::FE(const FEType & fet); \
57  template unsigned int FE<2,SUBDIVISION>::n_shape_functions () const; \
58  template void FE<2,SUBDIVISION>::attach_quadrature_rule (QBase *); \
59  template unsigned int FE<2,SUBDIVISION>::n_quadrature_points () const; \
60  template void FE<2,SUBDIVISION>::reinit(const Elem *,const std::vector<Point> * const,const std::vector<Real> * const); \
61  template void FE<2,SUBDIVISION>::init_shape_functions(const std::vector<Point> &, const Elem *)
62 
63 #endif // LIBMESH_ENABLE_INFINITE_ELEMENTS
64 
65 
66 #ifndef LIBMESH_ENABLE_HIGHER_ORDER_SHAPES
67 
68 #define INSTANTIATE_FE(_dim) template class FE< (_dim), CLOUGH>; \
69  template class FE< (_dim), HERMITE>; \
70  template class FE< (_dim), HIERARCHIC>; \
71  template class FE< (_dim), L2_HIERARCHIC>; \
72  template class FE< (_dim), LAGRANGE>; \
73  template class FE< (_dim), LAGRANGE_VEC>; \
74  template class FE< (_dim), L2_LAGRANGE>; \
75  template class FE< (_dim), MONOMIAL>; \
76  template class FE< (_dim), SCALAR>; \
77  template class FE< (_dim), XYZ>; \
78  template class FE< (_dim), NEDELEC_ONE>
79 
80 #define INSTANTIATE_ALL_MAPS(_dim) \
81  INSTANTIATE_MAPS(_dim,CLOUGH); \
82  INSTANTIATE_MAPS(_dim,HERMITE); \
83  INSTANTIATE_MAPS(_dim,HIERARCHIC); \
84  INSTANTIATE_MAPS(_dim,L2_HIERARCHIC); \
85  INSTANTIATE_MAPS(_dim,LAGRANGE); \
86  INSTANTIATE_MAPS(_dim,LAGRANGE_VEC); \
87  INSTANTIATE_MAPS(_dim,L2_LAGRANGE); \
88  INSTANTIATE_MAPS(_dim,MONOMIAL); \
89  INSTANTIATE_MAPS(_dim,SCALAR); \
90  INSTANTIATE_MAPS(_dim,XYZ); \
91  INSTANTIATE_MAPS(_dim,NEDELEC_ONE)
92 
93 #else //LIBMESH_ENABLE_HIGHER_ORDER_SHAPES
94 
95 #define INSTANTIATE_FE(_dim) template class FE< (_dim), CLOUGH>; \
96  template class FE< (_dim), HERMITE>; \
97  template class FE< (_dim), HIERARCHIC>; \
98  template class FE< (_dim), L2_HIERARCHIC>; \
99  template class FE< (_dim), LAGRANGE>; \
100  template class FE< (_dim), LAGRANGE_VEC>; \
101  template class FE< (_dim), L2_LAGRANGE>; \
102  template class FE< (_dim), MONOMIAL>; \
103  template class FE< (_dim), SCALAR>; \
104  template class FE< (_dim), BERNSTEIN>; \
105  template class FE< (_dim), SZABAB>; \
106  template class FE< (_dim), XYZ>; \
107  template class FE< (_dim), NEDELEC_ONE>
108 
109 #define INSTANTIATE_ALL_MAPS(_dim) \
110  INSTANTIATE_MAPS(_dim,CLOUGH); \
111  INSTANTIATE_MAPS(_dim,HERMITE); \
112  INSTANTIATE_MAPS(_dim,HIERARCHIC); \
113  INSTANTIATE_MAPS(_dim,L2_HIERARCHIC); \
114  INSTANTIATE_MAPS(_dim,LAGRANGE); \
115  INSTANTIATE_MAPS(_dim,LAGRANGE_VEC); \
116  INSTANTIATE_MAPS(_dim,L2_LAGRANGE); \
117  INSTANTIATE_MAPS(_dim,MONOMIAL); \
118  INSTANTIATE_MAPS(_dim,SCALAR); \
119  INSTANTIATE_MAPS(_dim,BERNSTEIN); \
120  INSTANTIATE_MAPS(_dim,SZABAB); \
121  INSTANTIATE_MAPS(_dim,XYZ); \
122  INSTANTIATE_MAPS(_dim,NEDELEC_ONE)
123 
124 #endif //LIBMESH_ENABLE_HIGHER_ORDER_SHAPES
125 
126 #endif // LIBMESH_FE_MACRO_H