21#include "libmesh/fe_interface.h"
22#include "libmesh/fe_lagrange_gll_shape_1D.h"
24#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
25#include "libmesh/fe_interface_macros.h"
26#include "libmesh/inf_fe.h"
29#include "libmesh/elem.h"
30#include "libmesh/fe.h"
31#include "libmesh/fe_compute_data.h"
32#include "libmesh/dof_map.h"
33#include "libmesh/enum_fe_family.h"
34#include "libmesh/enum_order.h"
35#include "libmesh/enum_elem_type.h"
36#include "libmesh/enum_to_string.h"
45 libmesh_error_msg(
"ERROR: Do not define an object of this type.");
50#ifndef LIBMESH_ENABLE_INFINITE_ELEMENTS
83#define fe_family_case_func(family, dim, func_and_args, prefix, suffix) \
85 prefix FE<dim,family>::func_and_args suffix \
87#define fe_family_case(family) \
90#define fe_family_scalar_case_func(dim, func_and_args, prefix, suffix) \
91 fe_family_case_func(CLOUGH, dim, func_and_args, prefix, suffix) \
92 fe_family_case_func(HERMITE, dim, func_and_args, prefix, suffix) \
93 fe_family_case_func(HIERARCHIC, dim, func_and_args, prefix, suffix) \
94 fe_family_case_func(L2_HIERARCHIC, dim, func_and_args, prefix, suffix) \
95 fe_family_case_func(SIDE_HIERARCHIC, dim, func_and_args, prefix, suffix) \
96 fe_family_case_func(LAGRANGE, dim, func_and_args, prefix, suffix) \
97 fe_family_case_func(L2_LAGRANGE, dim, func_and_args, prefix, suffix) \
98 fe_family_case_func(L2_LAGRANGE_GLL, dim, func_and_args, prefix, suffix) \
99 fe_family_case_func(LAGRANGE_GLL, dim, func_and_args, prefix, suffix) \
100 fe_family_case_func(MONOMIAL, dim, func_and_args, prefix, suffix) \
101 fe_family_case_func(SCALAR, dim, func_and_args, prefix, suffix) \
102 fe_family_case_func(XYZ, dim, func_and_args, prefix, suffix) \
103 fe_family_case_func(SUBDIVISION, 2, func_and_args, \
104 libmesh_assert_equal_to (dim, 2); prefix, suffix)
106#define fe_family_scalar_case() \
107 fe_family_case(CLOUGH) \
108 fe_family_case(HERMITE) \
109 fe_family_case(HIERARCHIC) \
110 fe_family_case(L2_HIERARCHIC) \
111 fe_family_case(SIDE_HIERARCHIC) \
112 fe_family_case(LAGRANGE) \
113 fe_family_case(L2_LAGRANGE) \
114 fe_family_case(L2_LAGRANGE_GLL) \
115 fe_family_case(LAGRANGE_GLL) \
116 fe_family_case(MONOMIAL) \
117 fe_family_case(SCALAR) \
118 fe_family_case(XYZ) \
119 fe_family_case(SUBDIVISION) \
121#ifdef LIBMESH_ENABLE_HIGHER_ORDER_SHAPES
123#define fe_family_horder_case_func(dim, func_and_args, prefix, suffix) \
124 fe_family_case_func(BERNSTEIN, dim, func_and_args, prefix, suffix) \
125 fe_family_case_func(SZABAB, dim, func_and_args, prefix, suffix) \
126 fe_family_case_func(RATIONAL_BERNSTEIN, dim, func_and_args, prefix, suffix) \
128#define fe_family_horder_case() \
129 fe_family_case(BERNSTEIN) \
130 fe_family_case(SZABAB) \
131 fe_family_case(RATIONAL_BERNSTEIN) \
135#define fe_family_horder_case_func(dim, func_and_args, prefix, suffix)
136#define fe_family_horder_case()
140#define fe_family_vector_case_func(dim, func_and_args, prefix, suffix) \
141 fe_family_case_func(HIERARCHIC_VEC, dim, func_and_args, prefix, suffix) \
142 fe_family_case_func(L2_HIERARCHIC_VEC, dim, func_and_args, prefix, suffix) \
143 fe_family_case_func(LAGRANGE_VEC, dim, func_and_args, prefix, suffix) \
144 fe_family_case_func(L2_LAGRANGE_VEC, dim, func_and_args, prefix, suffix) \
145 fe_family_case_func(MONOMIAL_VEC, dim, func_and_args, prefix, suffix) \
146 fe_family_case_func(NEDELEC_ONE, dim, func_and_args, prefix, suffix) \
147 fe_family_case_func(RAVIART_THOMAS, dim, func_and_args, prefix, suffix) \
148 fe_family_case_func(L2_RAVIART_THOMAS, dim, func_and_args, prefix, suffix) \
150#define fe_family_vector_case() \
151 fe_family_case(HIERARCHIC_VEC) \
152 fe_family_case(L2_HIERARCHIC_VEC) \
153 fe_family_case(LAGRANGE_VEC) \
154 fe_family_case(L2_LAGRANGE_VEC) \
155 fe_family_case(MONOMIAL_VEC) \
156 fe_family_case(NEDELEC_ONE) \
157 fe_family_case(RAVIART_THOMAS) \
158 fe_family_case(L2_RAVIART_THOMAS) \
160#define fe_family_switch(dim, func_and_args, prefix, suffix) \
162 switch (fe_t.family) \
164 fe_family_scalar_case_func(dim, func_and_args, prefix, suffix) \
165 fe_family_horder_case_func(dim, func_and_args, prefix, suffix) \
167 libmesh_error_msg("Unsupported family = " << Utility::enum_to_string(fe_t.family)); \
171#define fe_family_with_vec_switch(dim, func_and_args, prefix, suffix) \
173 switch (fe_t.family) \
175 fe_family_scalar_case_func(dim, func_and_args, prefix, suffix) \
176 fe_family_horder_case_func(dim, func_and_args, prefix, suffix) \
177 fe_family_vector_case_func(dim, func_and_args, prefix, suffix) \
179 libmesh_error_msg("Unsupported family = " << Utility::enum_to_string(fe_t.family)); \
183#define fe_scalar_vec_error_switch(dim, func_and_args, prefix, suffix) \
185 switch (fe_t.family) \
187 fe_family_scalar_case_func(dim, func_and_args, prefix, suffix) \
188 fe_family_horder_case_func(dim, func_and_args, prefix, suffix) \
189 fe_family_vector_case() \
190 libmesh_error_msg("Error: Can only request scalar valued elements for Real FEInterface::func_and_args"); \
192 libmesh_error_msg("Unsupported family = " << Utility::enum_to_string(fe_t.family)); \
197#define fe_vector_scalar_error_switch(dim, func_and_args, prefix, suffix) \
199 switch (fe_t.family) \
201 fe_family_vector_case_func(dim, func_and_args, prefix, suffix) \
202 fe_family_scalar_case() \
203 fe_family_horder_case() \
204 libmesh_error_msg("Error: Can only request vector valued elements for RealGradient FEInterface::func_and_args"); \
206 libmesh_error_msg("Unsupported family = " << Utility::enum_to_string(fe_t.family)); \
211#define fe_switch(func_and_args) \
217 fe_family_switch (0, func_and_args, return, ;); \
220 fe_family_switch (1, func_and_args, return, ;); \
223 fe_family_switch (2, func_and_args, return, ;); \
226 fe_family_switch (3, func_and_args, return, ;); \
228 libmesh_error_msg("Invalid dim = " << dim); \
232#define fe_with_vec_switch(func_and_args) \
238 fe_family_with_vec_switch (0, func_and_args, return, ;); \
241 fe_family_with_vec_switch (1, func_and_args, return, ;); \
244 fe_family_with_vec_switch (2, func_and_args, return, ;); \
247 fe_family_with_vec_switch (3, func_and_args, return, ;); \
249 libmesh_error_msg("Invalid dim = " << dim); \
253#define void_fe_with_vec_switch(func_and_args) \
259 fe_family_with_vec_switch (0, func_and_args, , ; return;); \
262 fe_family_with_vec_switch (1, func_and_args, , ; return;); \
265 fe_family_with_vec_switch (2, func_and_args, , ; return;); \
268 fe_family_with_vec_switch (3, func_and_args, , ; return;); \
270 libmesh_error_msg("Invalid dim = " << dim); \
276#ifdef LIBMESH_ENABLE_DEPRECATED
281 libmesh_deprecated();
283#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
289 libmesh_not_implemented();
304 const bool add_p_level)
309#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
322 auto total_order = fe_t.
order + add_p_level*elem->
p_level();
324 fe_with_vec_switch(
n_dofs(elem, total_order));
331 const int extra_order,
337#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
350 auto total_order = fe_t.
order + extra_order;
352 fe_with_vec_switch(
n_dofs(elem, total_order));
357#ifdef LIBMESH_ENABLE_DEPRECATED
362 libmesh_deprecated();
364#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
370 libmesh_not_implemented();
376 fe_with_vec_switch(
n_dofs(t, o));
387 libmesh_deprecated();
398 const bool add_p_level)
403#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
425#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
434 auto total_order = fe_t.
order + extra_order;
436 fe_with_vec_switch(
n_dofs(elem, total_order));
441#ifdef LIBMESH_ENABLE_DEPRECATED
445 const unsigned int n)
447 libmesh_deprecated();
449#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
467 libmesh_deprecated();
490 const unsigned int n,
491 const bool add_p_level)
496#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
504 auto total_order = fe_t.
order + add_p_level*elem->
p_level();
513 const int extra_order,
515 const unsigned int n)
520#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
528 auto total_order = fe_t.
order + extra_order;
535#ifdef LIBMESH_ENABLE_DEPRECATED
540 libmesh_deprecated();
542#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
560 const bool add_p_level)
565#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
573 auto total_order = fe_t.
order + add_p_level*elem->
p_level();
582 const int extra_order,
588#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
596 auto total_order = fe_t.
order + extra_order;
604 const unsigned int dim,
607 std::vector<unsigned int> & di,
608 const bool add_p_level)
612 void_fe_with_vec_switch(
dofs_on_side(elem, o, s, di, add_p_level));
618 const unsigned int dim,
621 std::vector<unsigned int> & di,
622 const bool add_p_level)
626 void_fe_with_vec_switch(
dofs_on_edge(elem, o, e, di, add_p_level));
634 const std::vector<Number> & elem_soln,
635 std::vector<Number> & nodal_soln,
636 const bool add_p_level,
637 const unsigned int vdim)
639#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
658 const unsigned int side,
659 const std::vector<Number> & elem_soln,
660 std::vector<Number> & nodal_soln,
661 const bool add_p_level,
662 const unsigned int vdim)
664#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
668 libmesh_not_implemented();
675 const unsigned int dim = elem->
dim();
682#ifdef LIBMESH_ENABLE_DEPRECATED
688 libmesh_deprecated();
689#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
693 fe_with_vec_switch(
map(elem, p));
702 const Real tolerance,
705 libmesh_deprecated();
706#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
713 fe_with_vec_switch(
inverse_map(elem, p, tolerance, secure));
721 const std::vector<Point> & physical_points,
722 std::vector<Point> & reference_points,
723 const Real tolerance,
726 libmesh_deprecated();
728 const std::size_t n_pts = physical_points.size();
731 reference_points.resize(n_pts);
735 libMesh::err <<
"WARNING: empty vector physical_points!"
741#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
752 void_fe_with_vec_switch(
inverse_map(elem, physical_points, reference_points, tolerance, secure));
769 const unsigned int i,
772 libmesh_deprecated();
774#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
783 fe_switch(
shape(t,o,i,p));
789 const unsigned int i,
792 libmesh_deprecated();
794#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
803 fe_switch(
shape(elem,o,i,p));
812 const unsigned int i,
814 const bool add_p_level)
819#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
831 fe_switch(
shape(elem, fe_t.
order, i, p, add_p_level));
840 const unsigned int i,
846#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
860 auto total_order = fe_t.
order + extra_order;
862 fe_switch(
shape(elem, total_order, i, p,
false));
867#ifdef LIBMESH_ENABLE_DEPRECATED
869void FEInterface::shape<Real>(
const unsigned int dim,
872 const unsigned int i,
876 libmesh_deprecated();
878#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
893 fe_scalar_vec_error_switch(0,
shape(t,o,i,p), phi = , ;
break;);
896 fe_scalar_vec_error_switch(1,
shape(t,o,i,p), phi = , ;
break;);
899 fe_scalar_vec_error_switch(2,
shape(t,o,i,p), phi = , ;
break;);
902 fe_scalar_vec_error_switch(3,
shape(t,o,i,p), phi = , ;
break;);
905 libmesh_error_msg(
"Invalid dimension = " <<
dim);
914void FEInterface::shape<Real>(
const unsigned int dim,
917 const unsigned int i,
921 libmesh_deprecated();
923#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
937 fe_scalar_vec_error_switch(0,
shape(elem,o,i,p), phi = , ;
break;);
940 fe_scalar_vec_error_switch(1,
shape(elem,o,i,p), phi = , ;
break;);
943 fe_scalar_vec_error_switch(2,
shape(elem,o,i,p), phi = , ;
break;);
946 fe_scalar_vec_error_switch(3,
shape(elem,o,i,p), phi = , ;
break;);
949 libmesh_error_msg(
"Invalid dimension = " <<
dim);
959void FEInterface::shape<Real>(
const FEType & fe_t,
961 const unsigned int i,
968#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
983 fe_scalar_vec_error_switch(0,
shape(elem, fe_t.
order, i, p,
true), phi = , ;
break;);
986 fe_scalar_vec_error_switch(1,
shape(elem, fe_t.
order, i, p,
true), phi = , ;
break;);
989 fe_scalar_vec_error_switch(2,
shape(elem, fe_t.
order, i, p,
true), phi = , ;
break;);
992 fe_scalar_vec_error_switch(3,
shape(elem, fe_t.
order, i, p,
true), phi = , ;
break;);
995 libmesh_error_msg(
"Invalid dimension = " <<
dim);
1002void FEInterface::shape<Real>(
const FEType & fe_t,
1005 const unsigned int i,
1012#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1023 auto total_order = fe_t.
order + extra_order;
1034 fe_scalar_vec_error_switch(0,
shape(elem, total_order, i, p,
false), phi = , ;
break;);
1037 fe_scalar_vec_error_switch(1,
shape(elem, total_order, i, p,
false), phi = , ;
break;);
1040 fe_scalar_vec_error_switch(2,
shape(elem, total_order, i, p,
false), phi = , ;
break;);
1043 fe_scalar_vec_error_switch(3,
shape(elem, total_order, i, p,
false), phi = , ;
break;);
1046 libmesh_error_msg(
"Invalid dimension = " <<
dim);
1053void FEInterface::shapes<Real>(
const unsigned int dim,
1056 const unsigned int i,
1057 const std::vector<Point> & p,
1058 std::vector<Real> & phi,
1059 const bool add_p_level)
1061#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1068 phi[qpi] =
ifem_shape(elevated, elem, i, p[qpi]);
1078 fe_scalar_vec_error_switch(0,
shapes(elem,o,i,p,phi,add_p_level), , ;
return;);
1081 fe_scalar_vec_error_switch(1,
shapes(elem,o,i,p,phi,add_p_level), , ;
return;);
1084 fe_scalar_vec_error_switch(2,
shapes(elem,o,i,p,phi,add_p_level), , ;
return;);
1087 fe_scalar_vec_error_switch(3,
shapes(elem,o,i,p,phi,add_p_level), , ;
return;);
1090 libmesh_error_msg(
"Invalid dimension = " <<
dim);
1098void FEInterface::all_shapes<Real>(
const unsigned int dim,
1101 const std::vector<Point> & p,
1102 std::vector<std::vector<Real>> & phi,
1103 const bool add_p_level)
1105#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1110 FEInterface::shapes<Real>(
dim, fe_t, elem, i, p, phi[i], add_p_level);
1120 fe_scalar_vec_error_switch(0,
all_shapes(elem,o,p,phi,add_p_level), , ;
return;);
1123 fe_scalar_vec_error_switch(1,
all_shapes(elem,o,p,phi,add_p_level), , ;
return;);
1126 fe_scalar_vec_error_switch(2,
all_shapes(elem,o,p,phi,add_p_level), , ;
return;);
1129 fe_scalar_vec_error_switch(3,
all_shapes(elem,o,p,phi,add_p_level), , ;
return;);
1132 libmesh_error_msg(
"Invalid dimension = " <<
dim);
1140#ifdef LIBMESH_ENABLE_DEPRECATED
1142void FEInterface::shape<RealGradient>(
const unsigned int dim,
1145 const unsigned int i,
1149 libmesh_deprecated();
1152#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1155 libmesh_not_implemented();
1163 fe_vector_scalar_error_switch(0,
shape(t,o,i,p), phi = , ;
break;);
1166 fe_vector_scalar_error_switch(1,
shape(t,o,i,p), phi = , ;
break;);
1169 fe_vector_scalar_error_switch(2,
shape(t,o,i,p), phi = , ;
break;);
1172 fe_vector_scalar_error_switch(3,
shape(t,o,i,p), phi = , ;
break;);
1175 libmesh_error_msg(
"Invalid dimension = " <<
dim);
1183void FEInterface::shape<RealGradient>(
const FEType & fe_t,
1185 const unsigned int i,
1190#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1193 libmesh_not_implemented();
1209 fe_vector_scalar_error_switch(0,
shape(elem, fe_t.
order, i, p,
true), phi = , ;
break;);
1212 fe_vector_scalar_error_switch(1,
shape(elem, fe_t.
order, i, p,
true), phi = , ;
break;);
1215 fe_vector_scalar_error_switch(2,
shape(elem, fe_t.
order, i, p,
true), phi = , ;
break;);
1218 fe_vector_scalar_error_switch(3,
shape(elem, fe_t.
order, i, p,
true), phi = , ;
break;);
1221 libmesh_error_msg(
"Invalid dimension = " <<
dim);
1228void FEInterface::shape<RealGradient>(
const FEType & fe_t,
1231 const unsigned int i,
1236#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1239 libmesh_not_implemented();
1252 auto total_order = fe_t.
order + extra_order;
1257 fe_vector_scalar_error_switch(0,
shape(elem, total_order, i, p,
false), phi = , ;
break;);
1260 fe_vector_scalar_error_switch(1,
shape(elem, total_order, i, p,
false), phi = , ;
break;);
1263 fe_vector_scalar_error_switch(2,
shape(elem, total_order, i, p,
false), phi = , ;
break;);
1266 fe_vector_scalar_error_switch(3,
shape(elem, total_order, i, p,
false), phi = , ;
break;);
1269 libmesh_error_msg(
"Invalid dimension = " <<
dim);
1276void FEInterface::shapes<RealGradient>(
const unsigned int dim,
1279 const unsigned int i,
1280 const std::vector<Point> & p,
1281 std::vector<RealGradient> & phi,
1282 const bool add_p_level)
1286 libmesh_not_implemented();
1293 fe_vector_scalar_error_switch(0,
shapes(elem,o,i,p,phi,add_p_level), , ;
return;);
1296 fe_vector_scalar_error_switch(1,
shapes(elem,o,i,p,phi,add_p_level), , ;
return;);
1299 fe_vector_scalar_error_switch(2,
shapes(elem,o,i,p,phi,add_p_level), , ;
return;);
1302 fe_vector_scalar_error_switch(3,
shapes(elem,o,i,p,phi,add_p_level), , ;
return;);
1305 libmesh_error_msg(
"Invalid dimension = " <<
dim);
1314void FEInterface::all_shapes<RealGradient>(
const unsigned int dim,
1317 const std::vector<Point> & p,
1318 std::vector<std::vector<RealGradient>> & phi,
1319 const bool add_p_level)
1323 libmesh_not_implemented();
1330 fe_vector_scalar_error_switch(0,
all_shapes(elem,o,p,phi,add_p_level), , ;
return;);
1333 fe_vector_scalar_error_switch(1,
all_shapes(elem,o,p,phi,add_p_level), , ;
return;);
1336 fe_vector_scalar_error_switch(2,
all_shapes(elem,o,p,phi,add_p_level), , ;
return;);
1339 fe_vector_scalar_error_switch(3,
all_shapes(elem,o,p,phi,add_p_level), , ;
return;);
1342 libmesh_error_msg(
"Invalid dimension = " <<
dim);
1349#ifdef LIBMESH_ENABLE_DEPRECATED
1355 libmesh_deprecated();
1357#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1360 inf_fe_switch(
shape);
1376#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1378 inf_fe_switch(
shape);
1385#ifdef LIBMESH_ENABLE_DEPRECATED
1389 const unsigned int i,
1390 const unsigned int j,
1393 libmesh_deprecated();
1395 libmesh_assert_greater (
dim,j);
1396#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1413 const unsigned int i,
1414 const unsigned int j,
1417 libmesh_deprecated();
1419 libmesh_assert_greater (
dim,j);
1420#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1433 fe_family_switch (0,
shape_deriv(elem, o, i, j, p),
return , ;);
1435 fe_family_switch (1,
shape_deriv(elem, o, i, j, p),
return , ;);
1437 fe_family_switch (2,
shape_deriv(elem, o, i, j, p),
return , ;);
1439 fe_family_switch (3,
shape_deriv(elem, o, i, j, p),
return , ;);
1441 libmesh_error_msg(
"Invalid dimension = " <<
dim);
1451 const unsigned int i,
1452 const unsigned int j,
1457 libmesh_assert_greater (
dim, j);
1458#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1480 const unsigned int i,
1481 const unsigned int j,
1486 libmesh_assert_greater (
dim, j);
1487#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1497 auto total_order = fe_t.
order + extra_order;
1504 fe_family_switch (0,
shape_deriv(elem, total_order, i, j, p,
false),
return , ;);
1506 fe_family_switch (1,
shape_deriv(elem, total_order, i, j, p,
false),
return , ;);
1508 fe_family_switch (2,
shape_deriv(elem, total_order, i, j, p,
false),
return , ;);
1510 fe_family_switch (3,
shape_deriv(elem, total_order, i, j, p,
false),
return , ;);
1512 libmesh_error_msg(
"Invalid dimension = " <<
dim);
1522void FEInterface::shape_derivs<Real>(
const FEType & fe_t,
1524 const unsigned int i,
1525 const unsigned int j,
1526 const std::vector<Point> & p,
1527 std::vector<Real> & dphi,
1528 const bool add_p_level)
1535 fe_scalar_vec_error_switch(0,
shape_derivs(elem,o,i,j,p,dphi,add_p_level), , ;
break;);
1538 fe_scalar_vec_error_switch(1,
shape_derivs(elem,o,i,j,p,dphi,add_p_level), , ;
break;);
1541 fe_scalar_vec_error_switch(2,
shape_derivs(elem,o,i,j,p,dphi,add_p_level), , ;
break;);
1544 fe_scalar_vec_error_switch(3,
shape_derivs(elem,o,i,j,p,dphi,add_p_level), , ;
break;);
1547 libmesh_error_msg(
"Invalid dimension = " << elem->
dim());
1558void FEInterface::all_shape_derivs<Real>(
const unsigned int dim,
1561 const std::vector<Point> & p,
1562 std::vector<std::vector<Real>> * comps[3],
1563 const bool add_p_level)
1565#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1571 FEInterface::shape_derivs<Real>(fe_t, elem, i, j, p, (*comps[j])[i], add_p_level);
1581 fe_scalar_vec_error_switch(0,
all_shape_derivs(elem,o,p,comps,add_p_level), , ;
return;);
1584 fe_scalar_vec_error_switch(1,
all_shape_derivs(elem,o,p,comps,add_p_level), , ;
return;);
1587 fe_scalar_vec_error_switch(2,
all_shape_derivs(elem,o,p,comps,add_p_level), , ;
return;);
1590 fe_scalar_vec_error_switch(3,
all_shape_derivs(elem,o,p,comps,add_p_level), , ;
return;);
1593 libmesh_error_msg(
"Invalid dimension = " <<
dim);
1602void FEInterface::shape_derivs<RealGradient>(
const FEType & fe_t,
1604 const unsigned int i,
1605 const unsigned int j,
1606 const std::vector<Point> & p,
1607 std::vector<RealGradient> & dphi,
1608 const bool add_p_level)
1615 fe_vector_scalar_error_switch(0,
shape_derivs(elem,o,i,j,p,dphi,add_p_level), , ;
break;);
1618 fe_vector_scalar_error_switch(1,
shape_derivs(elem,o,i,j,p,dphi,add_p_level), , ;
break;);
1621 fe_vector_scalar_error_switch(2,
shape_derivs(elem,o,i,j,p,dphi,add_p_level), , ;
break;);
1624 fe_vector_scalar_error_switch(3,
shape_derivs(elem,o,i,j,p,dphi,add_p_level), , ;
break;);
1627 libmesh_error_msg(
"Invalid dimension = " << elem->
dim());
1635#ifdef LIBMESH_ENABLE_DEPRECATED
1641 libmesh_deprecated();
1643#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1662#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1672#ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
1673#ifdef LIBMESH_ENABLE_DEPRECATED
1677 const unsigned int i,
1678 const unsigned int j,
1681 libmesh_deprecated();
1683 libmesh_assert_greater_equal (
dim*(
dim-1),j);
1684#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1686 libmesh_not_implemented();
1702 libmesh_error_msg(
"Invalid dimension = " <<
dim);
1711 const unsigned int i,
1712 const unsigned int j,
1715 libmesh_deprecated();
1717 libmesh_assert_greater_equal (
dim*(
dim-1),j);
1720 libmesh_not_implemented();
1735 libmesh_error_msg(
"Invalid dimension = " <<
dim);
1745 const unsigned int i,
1746 const unsigned int j,
1751 libmesh_assert_greater_equal (
dim*(
dim-1),j);
1752#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1754 libmesh_not_implemented();
1771 libmesh_error_msg(
"Invalid dimension = " <<
dim);
1783 const unsigned int i,
1784 const unsigned int j,
1789 libmesh_assert_greater_equal (
dim*(
dim-1),j);
1792 libmesh_not_implemented();
1796 auto total_order = fe_t.
order + extra_order;
1804 fe_family_switch (0,
shape_second_deriv(elem, total_order, i, j, p,
false),
return , ;);
1806 fe_family_switch (1,
shape_second_deriv(elem, total_order, i, j, p,
false),
return , ;);
1808 fe_family_switch (2,
shape_second_deriv(elem, total_order, i, j, p,
false),
return , ;);
1810 fe_family_switch (3,
shape_second_deriv(elem, total_order, i, j, p,
false),
return , ;);
1812 libmesh_error_msg(
"Invalid dimension = " <<
dim);
1821#ifdef LIBMESH_ENABLE_DEPRECATED
1827 libmesh_deprecated();
1829#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1831 libmesh_not_implemented();
1845#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1847 libmesh_not_implemented();
1855#ifdef LIBMESH_ENABLE_DEPRECATED
1857void FEInterface::shape<RealGradient>(
const unsigned int dim,
1860 const unsigned int i,
1864 libmesh_deprecated();
1868 libmesh_not_implemented();
1875 fe_vector_scalar_error_switch(0,
shape(elem,o,i,p), phi = , ;
break;);
1878 fe_vector_scalar_error_switch(1,
shape(elem,o,i,p), phi = , ;
break;);
1881 fe_vector_scalar_error_switch(2,
shape(elem,o,i,p), phi = , ;
break;);
1884 fe_vector_scalar_error_switch(3,
shape(elem,o,i,p), phi = , ;
break;);
1887 libmesh_error_msg(
"Invalid dimension = " <<
dim);
1900#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1911 const unsigned int n_dof =
n_dofs (fe_t, elem);
1912 const Point & p = data.
p;
1913 data.
shape.resize(n_dof);
1917 data.
dshape.resize(n_dof);
1920 for (
unsigned int d=0; d<
dim; d++)
1924 std::vector<Point> pt = {p};
1926 fe->reinit(elem, &pt);
1949 for (
unsigned int n=0; n<n_dof; n++)
1959 for (
unsigned int j=0; j<
dim; j++)
1967#ifdef LIBMESH_ENABLE_AMR
1971 const unsigned int variable_number,
1978 switch (elem->
dim())
2095 libmesh_error_msg(
"Invalid dimension = " << elem->
dim());
2103#ifdef LIBMESH_ENABLE_PERIODIC
2110 const unsigned int variable_number,
2121 constraints, dof_map, boundaries,
mesh, point_locator, variable_number, elem);
2125 constraints, dof_map, boundaries,
mesh, point_locator, variable_number, elem);
2129 "compute_periodic_constraints only set up for vector or scalar FEFieldTypes");
2144 const unsigned int unlimited = 11;
2148 const unsigned int unknown = unlimited;
2274#ifdef LIBMESH_ENABLE_HIGHER_ORDER_SHAPES
2671 fe_family_horder_case()
2686 fe_family_vector_case()
The constraint matrix storage format.
This class handles the numbering of degrees of freedom on a mesh.
const FEType & variable_type(const unsigned int i) const
This is the base class from which all geometric element types are derived.
virtual unsigned short dim() const =0
virtual ElemType type() const =0
unsigned int p_level() const
virtual bool infinite() const =0
static bool on_reference_element(const Point &p, const ElemType t, const Real eps=TOLERANCE)
class FEComputeData hides arbitrary data to be passed to and from children of FEBase through the FEIn...
const Point & p
Holds the point where the data are to be computed.
std::vector< Gradient > dshape
Storage for the computed shape derivative values.
bool need_derivative()
Check whether derivatives should be computed or not.
std::vector< std::vector< Real > > local_transform
Storage for local to global mapping at p.
std::vector< Number > shape
Storage for the computed shape function values.
void init()
Inits the output data to default values, provided the fields are correctly resized.
static std::unique_ptr< FEGenericBase > build(const unsigned int dim, const FEType &type)
Builds a specific finite element type.
static void compute_periodic_constraints(DofConstraints &constraints, DofMap &dof_map, const PeriodicBoundaries &boundaries, const MeshBase &mesh, const PointLocatorBase *point_locator, const unsigned int variable_number, const Elem *elem)
Computes the constraint matrix contributions (for meshes with periodic boundary conditions) correspon...
static Real ifem_shape(const unsigned int dim, const FEType &fe_t, const ElemType t, const unsigned int i, const Point &p)
static void dofs_on_side(const Elem *const elem, const unsigned int dim, const FEType &fe_t, unsigned int s, std::vector< unsigned int > &di, const bool add_p_level=true)
Fills the vector di with the local degree of freedom indices associated with side s of element elem A...
static void ifem_nodal_soln(const unsigned int dim, const FEType &fe_t, const Elem *elem, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
static Real shape(const unsigned int dim, const FEType &fe_t, const ElemType t, const unsigned int i, const Point &p)
static bool is_InfFE_elem(const ElemType et)
static Real shape_second_deriv(const unsigned int dim, const FEType &fe_t, const ElemType t, const unsigned int i, const unsigned int j, const Point &p)
static void all_shape_derivs(const unsigned int dim, const FEType &fe_t, const Elem *elem, const std::vector< Point > &p, std::vector< std::vector< OutputType > > *comps[3], const bool add_p_level=true)
Real(* shape_second_deriv_ptr)(const FEType fet, const Elem *elem, const unsigned int i, const unsigned int j, const Point &p, const bool add_p_level)
Typedef for pointer to a function that returns FE shape function second derivative values.
static bool is_hierarchic(const FEType &fe_type)
Returns whether or not the input FEType's higher-order shape functions are always hierarchic.
FEInterface()
Empty constructor.
static shape_deriv_ptr shape_deriv_function(const unsigned int dim, const FEType &fe_t, const ElemType t)
Real(* shape_deriv_ptr)(const FEType fet, const Elem *elem, const unsigned int i, const unsigned int j, const Point &p, const bool add_p_level)
Typedef for pointer to a function that returns FE shape function derivative values.
static Real shape_deriv(const unsigned int dim, const FEType &fe_t, const ElemType t, const unsigned int i, const unsigned int j, const Point &p)
static n_dofs_at_node_ptr n_dofs_at_node_function(const unsigned int dim, const FEType &fe_t)
static unsigned int n_vec_dim(const MeshBase &mesh, const FEType &fe_type)
static FEContinuity get_continuity(const FEType &fe_type)
Returns the input FEType's FEContinuity based on the underlying FEFamily and potentially the Order,...
static void ifem_compute_data(const unsigned int dim, const FEType &fe_t, const Elem *elem, FEComputeData &data)
static bool on_reference_element(const Point &p, const ElemType t, const Real eps=TOLERANCE)
static FEFieldType field_type(const FEType &fe_type)
static Real ifem_shape_deriv(const unsigned int dim, const FEType &fe_t, const ElemType t, const unsigned int i, const unsigned int j, const Point &p)
static Point ifem_inverse_map(const unsigned int dim, const FEType &fe_t, const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true)
static void shape_derivs(const FEType &fe_t, const Elem *elem, const unsigned int i, const unsigned int j, const std::vector< Point > &p, std::vector< OutputType > &dphi, const bool add_p_level=true)
Fills dphi with the derivatives of the shape function at point p in direction j.
static void compute_data(const unsigned int dim, const FEType &fe_t, const Elem *elem, FEComputeData &data)
Lets the appropriate child of FEBase compute the requested data for the input specified in data,...
unsigned int(* n_dofs_at_node_ptr)(const ElemType, const Order, const unsigned int)
static shape_second_deriv_ptr shape_second_deriv_function(const unsigned int dim, const FEType &fe_t, const ElemType t)
static unsigned int ifem_n_dofs_at_node(const unsigned int dim, const FEType &fe_t, const ElemType t, const unsigned int n)
static unsigned int n_dofs(const unsigned int dim, const FEType &fe_t, const ElemType t)
static void compute_periodic_constraints(DofConstraints &constraints, DofMap &dof_map, const PeriodicBoundaries &boundaries, const MeshBase &mesh, const PointLocatorBase *point_locator, const unsigned int variable_number, const Elem *elem)
Computes the constraint matrix contributions (for periodic boundary conditions) corresponding to vari...
static void all_shapes(const unsigned int dim, const FEType &fe_t, const Elem *elem, const std::vector< Point > &p, std::vector< std::vector< OutputType > > &phi, const bool add_p_level=true)
static unsigned int ifem_n_dofs_per_elem(const unsigned int dim, const FEType &fe_t, const ElemType t)
static unsigned int ifem_n_shape_functions(const FEType &fe_t, const Elem *elem)
Real(* shape_ptr)(const FEType fe_t, const Elem *elem, const unsigned int i, const Point &p, const bool add_p_level)
Typedef for pointer to a function that returns FE shape function values.
static Point ifem_map(const unsigned int dim, const FEType &fe_t, const Elem *elem, const Point &p)
static unsigned int n_dofs_at_node(const unsigned int dim, const FEType &fe_t, const ElemType t, const unsigned int n)
static void shapes(const unsigned int dim, const FEType &fe_t, const Elem *elem, const unsigned int i, const std::vector< Point > &p, std::vector< OutputType > &phi, const bool add_p_level=true)
Fills phi with the values of the shape function at point p.
static Point inverse_map(const unsigned int dim, const FEType &fe_t, const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true)
This is now deprecated; use FEMap::inverse_map instead.
static void nodal_soln(const unsigned int dim, const FEType &fe_t, const Elem *elem, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln, const bool add_p_level=true, const unsigned int vdim=1)
Build the nodal soln from the element soln.
static unsigned int max_order(const FEType &fe_t, const ElemType &el_t)
static unsigned int ifem_n_dofs(const FEType &fe_t, const Elem *elem)
static unsigned int n_dofs_per_elem(const unsigned int dim, const FEType &fe_t, const ElemType t)
static shape_ptr shape_function(const unsigned int dim, const FEType &fe_t, const ElemType t)
static bool orientation_dependent(const FEFamily &fe_family)
static bool extra_hanging_dofs(const FEType &fe_t)
static void side_nodal_soln(const FEType &fe_t, const Elem *elem, const unsigned int side, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln, const bool add_p_level=true, const unsigned int vdim=1)
Build the nodal soln on one side from the (full) element soln.
static void dofs_on_edge(const Elem *const elem, const unsigned int dim, const FEType &fe_t, unsigned int e, std::vector< unsigned int > &di, const bool add_p_level=true)
Fills the vector di with the local degree of freedom indices associated with edge e of element elem A...
static void compute_constraints(DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
Computes the constraint matrix contributions (for non-conforming adapted meshes) corresponding to var...
static unsigned int n_shape_functions(const unsigned int dim, const FEType &fe_t, const ElemType t)
static Point map(unsigned int dim, const FEType &fe_t, const Elem *elem, const Point &p)
This is now deprecated; use FEMap::map instead.
class FEType hides (possibly multiple) FEFamily and approximation orders, thereby enabling specialize...
OrderWrapper order
The approximation order of the element (at 0 p-refinement level).
FEFamily family
The type of finite element.
static void compute_constraints(DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
Computes the constraint matrix contributions (for non-conforming adapted meshes) corresponding to var...
This is the MeshBase class.
We're using a class instead of a typedef to allow forward declarations and future flexibility.
This is the base class for point locators.
A Point defines a location in LIBMESH_DIM dimensional Real space.
std::string enum_to_string(const T e)
The libMesh namespace provides an interface to certain functionality in the library.
auto index_range(const T &sizable)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...
ElemType
Defines an enum for geometric element types.
constexpr unsigned int fe_lagrange_gll_max_points_1D
The number of points in the largest Gauss-Lobatto rule that QGaussLobatto tabulates,...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...