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(MONOMIAL, dim, func_and_args, prefix, suffix) \
100 fe_family_case_func(SCALAR, dim, func_and_args, prefix, suffix) \
101 fe_family_case_func(XYZ, dim, func_and_args, prefix, suffix) \
102 fe_family_case_func(SUBDIVISION, 2, func_and_args, \
103 libmesh_assert_equal_to (dim, 2); prefix, suffix)
105#define fe_family_scalar_case() \
106 fe_family_case(CLOUGH) \
107 fe_family_case(HERMITE) \
108 fe_family_case(HIERARCHIC) \
109 fe_family_case(L2_HIERARCHIC) \
110 fe_family_case(SIDE_HIERARCHIC) \
111 fe_family_case(LAGRANGE) \
112 fe_family_case(L2_LAGRANGE) \
113 fe_family_case(L2_LAGRANGE_GLL) \
114 fe_family_case(MONOMIAL) \
115 fe_family_case(SCALAR) \
116 fe_family_case(XYZ) \
117 fe_family_case(SUBDIVISION) \
119#ifdef LIBMESH_ENABLE_HIGHER_ORDER_SHAPES
121#define fe_family_horder_case_func(dim, func_and_args, prefix, suffix) \
122 fe_family_case_func(BERNSTEIN, dim, func_and_args, prefix, suffix) \
123 fe_family_case_func(SZABAB, dim, func_and_args, prefix, suffix) \
124 fe_family_case_func(RATIONAL_BERNSTEIN, dim, func_and_args, prefix, suffix) \
126#define fe_family_horder_case() \
127 fe_family_case(BERNSTEIN) \
128 fe_family_case(SZABAB) \
129 fe_family_case(RATIONAL_BERNSTEIN) \
133#define fe_family_horder_case_func(dim, func_and_args, prefix, suffix)
134#define fe_family_horder_case()
138#define fe_family_vector_case_func(dim, func_and_args, prefix, suffix) \
139 fe_family_case_func(HIERARCHIC_VEC, dim, func_and_args, prefix, suffix) \
140 fe_family_case_func(L2_HIERARCHIC_VEC, dim, func_and_args, prefix, suffix) \
141 fe_family_case_func(LAGRANGE_VEC, dim, func_and_args, prefix, suffix) \
142 fe_family_case_func(L2_LAGRANGE_VEC, dim, func_and_args, prefix, suffix) \
143 fe_family_case_func(MONOMIAL_VEC, dim, func_and_args, prefix, suffix) \
144 fe_family_case_func(NEDELEC_ONE, dim, func_and_args, prefix, suffix) \
145 fe_family_case_func(RAVIART_THOMAS, dim, func_and_args, prefix, suffix) \
146 fe_family_case_func(L2_RAVIART_THOMAS, dim, func_and_args, prefix, suffix) \
148#define fe_family_vector_case() \
149 fe_family_case(HIERARCHIC_VEC) \
150 fe_family_case(L2_HIERARCHIC_VEC) \
151 fe_family_case(LAGRANGE_VEC) \
152 fe_family_case(L2_LAGRANGE_VEC) \
153 fe_family_case(MONOMIAL_VEC) \
154 fe_family_case(NEDELEC_ONE) \
155 fe_family_case(RAVIART_THOMAS) \
156 fe_family_case(L2_RAVIART_THOMAS) \
158#define fe_family_switch(dim, func_and_args, prefix, suffix) \
160 switch (fe_t.family) \
162 fe_family_scalar_case_func(dim, func_and_args, prefix, suffix) \
163 fe_family_horder_case_func(dim, func_and_args, prefix, suffix) \
165 libmesh_error_msg("Unsupported family = " << Utility::enum_to_string(fe_t.family)); \
169#define fe_family_with_vec_switch(dim, func_and_args, prefix, suffix) \
171 switch (fe_t.family) \
173 fe_family_scalar_case_func(dim, func_and_args, prefix, suffix) \
174 fe_family_horder_case_func(dim, func_and_args, prefix, suffix) \
175 fe_family_vector_case_func(dim, func_and_args, prefix, suffix) \
177 libmesh_error_msg("Unsupported family = " << Utility::enum_to_string(fe_t.family)); \
181#define fe_scalar_vec_error_switch(dim, func_and_args, prefix, suffix) \
183 switch (fe_t.family) \
185 fe_family_scalar_case_func(dim, func_and_args, prefix, suffix) \
186 fe_family_horder_case_func(dim, func_and_args, prefix, suffix) \
187 fe_family_vector_case() \
188 libmesh_error_msg("Error: Can only request scalar valued elements for Real FEInterface::func_and_args"); \
190 libmesh_error_msg("Unsupported family = " << Utility::enum_to_string(fe_t.family)); \
195#define fe_vector_scalar_error_switch(dim, func_and_args, prefix, suffix) \
197 switch (fe_t.family) \
199 fe_family_vector_case_func(dim, func_and_args, prefix, suffix) \
200 fe_family_scalar_case() \
201 fe_family_horder_case() \
202 libmesh_error_msg("Error: Can only request vector valued elements for RealGradient FEInterface::func_and_args"); \
204 libmesh_error_msg("Unsupported family = " << Utility::enum_to_string(fe_t.family)); \
209#define fe_switch(func_and_args) \
215 fe_family_switch (0, func_and_args, return, ;); \
218 fe_family_switch (1, func_and_args, return, ;); \
221 fe_family_switch (2, func_and_args, return, ;); \
224 fe_family_switch (3, func_and_args, return, ;); \
226 libmesh_error_msg("Invalid dim = " << dim); \
230#define fe_with_vec_switch(func_and_args) \
236 fe_family_with_vec_switch (0, func_and_args, return, ;); \
239 fe_family_with_vec_switch (1, func_and_args, return, ;); \
242 fe_family_with_vec_switch (2, func_and_args, return, ;); \
245 fe_family_with_vec_switch (3, func_and_args, return, ;); \
247 libmesh_error_msg("Invalid dim = " << dim); \
251#define void_fe_with_vec_switch(func_and_args) \
257 fe_family_with_vec_switch (0, func_and_args, , ; return;); \
260 fe_family_with_vec_switch (1, func_and_args, , ; return;); \
263 fe_family_with_vec_switch (2, func_and_args, , ; return;); \
266 fe_family_with_vec_switch (3, func_and_args, , ; return;); \
268 libmesh_error_msg("Invalid dim = " << dim); \
274#ifdef LIBMESH_ENABLE_DEPRECATED
279 libmesh_deprecated();
281#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
287 libmesh_not_implemented();
302 const bool add_p_level)
307#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
320 auto total_order = fe_t.
order + add_p_level*elem->
p_level();
322 fe_with_vec_switch(
n_dofs(elem, total_order));
329 const int extra_order,
335#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
348 auto total_order = fe_t.
order + extra_order;
350 fe_with_vec_switch(
n_dofs(elem, total_order));
355#ifdef LIBMESH_ENABLE_DEPRECATED
360 libmesh_deprecated();
362#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
368 libmesh_not_implemented();
374 fe_with_vec_switch(
n_dofs(t, o));
385 libmesh_deprecated();
396 const bool add_p_level)
401#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
423#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
432 auto total_order = fe_t.
order + extra_order;
434 fe_with_vec_switch(
n_dofs(elem, total_order));
439#ifdef LIBMESH_ENABLE_DEPRECATED
443 const unsigned int n)
445 libmesh_deprecated();
447#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
465 libmesh_deprecated();
488 const unsigned int n,
489 const bool add_p_level)
494#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
502 auto total_order = fe_t.
order + add_p_level*elem->
p_level();
511 const int extra_order,
513 const unsigned int n)
518#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
526 auto total_order = fe_t.
order + extra_order;
533#ifdef LIBMESH_ENABLE_DEPRECATED
538 libmesh_deprecated();
540#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
558 const bool add_p_level)
563#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
571 auto total_order = fe_t.
order + add_p_level*elem->
p_level();
580 const int extra_order,
586#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
594 auto total_order = fe_t.
order + extra_order;
602 const unsigned int dim,
605 std::vector<unsigned int> & di,
606 const bool add_p_level)
610 void_fe_with_vec_switch(
dofs_on_side(elem, o, s, di, add_p_level));
616 const unsigned int dim,
619 std::vector<unsigned int> & di,
620 const bool add_p_level)
624 void_fe_with_vec_switch(
dofs_on_edge(elem, o, e, di, add_p_level));
632 const std::vector<Number> & elem_soln,
633 std::vector<Number> & nodal_soln,
634 const bool add_p_level,
635 const unsigned int vdim)
637#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
656 const unsigned int side,
657 const std::vector<Number> & elem_soln,
658 std::vector<Number> & nodal_soln,
659 const bool add_p_level,
660 const unsigned int vdim)
662#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
666 libmesh_not_implemented();
673 const unsigned int dim = elem->
dim();
680#ifdef LIBMESH_ENABLE_DEPRECATED
686 libmesh_deprecated();
687#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
691 fe_with_vec_switch(
map(elem, p));
700 const Real tolerance,
703 libmesh_deprecated();
704#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
711 fe_with_vec_switch(
inverse_map(elem, p, tolerance, secure));
719 const std::vector<Point> & physical_points,
720 std::vector<Point> & reference_points,
721 const Real tolerance,
724 libmesh_deprecated();
726 const std::size_t n_pts = physical_points.size();
729 reference_points.resize(n_pts);
733 libMesh::err <<
"WARNING: empty vector physical_points!"
739#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
750 void_fe_with_vec_switch(
inverse_map(elem, physical_points, reference_points, tolerance, secure));
767 const unsigned int i,
770 libmesh_deprecated();
772#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
781 fe_switch(
shape(t,o,i,p));
787 const unsigned int i,
790 libmesh_deprecated();
792#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
801 fe_switch(
shape(elem,o,i,p));
810 const unsigned int i,
812 const bool add_p_level)
817#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
829 fe_switch(
shape(elem, fe_t.
order, i, p, add_p_level));
838 const unsigned int i,
844#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
858 auto total_order = fe_t.
order + extra_order;
860 fe_switch(
shape(elem, total_order, i, p,
false));
865#ifdef LIBMESH_ENABLE_DEPRECATED
867void FEInterface::shape<Real>(
const unsigned int dim,
870 const unsigned int i,
874 libmesh_deprecated();
876#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
891 fe_scalar_vec_error_switch(0,
shape(t,o,i,p), phi = , ;
break;);
894 fe_scalar_vec_error_switch(1,
shape(t,o,i,p), phi = , ;
break;);
897 fe_scalar_vec_error_switch(2,
shape(t,o,i,p), phi = , ;
break;);
900 fe_scalar_vec_error_switch(3,
shape(t,o,i,p), phi = , ;
break;);
903 libmesh_error_msg(
"Invalid dimension = " <<
dim);
912void FEInterface::shape<Real>(
const unsigned int dim,
915 const unsigned int i,
919 libmesh_deprecated();
921#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
935 fe_scalar_vec_error_switch(0,
shape(elem,o,i,p), phi = , ;
break;);
938 fe_scalar_vec_error_switch(1,
shape(elem,o,i,p), phi = , ;
break;);
941 fe_scalar_vec_error_switch(2,
shape(elem,o,i,p), phi = , ;
break;);
944 fe_scalar_vec_error_switch(3,
shape(elem,o,i,p), phi = , ;
break;);
947 libmesh_error_msg(
"Invalid dimension = " <<
dim);
957void FEInterface::shape<Real>(
const FEType & fe_t,
959 const unsigned int i,
966#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
981 fe_scalar_vec_error_switch(0,
shape(elem, fe_t.
order, i, p,
true), phi = , ;
break;);
984 fe_scalar_vec_error_switch(1,
shape(elem, fe_t.
order, i, p,
true), phi = , ;
break;);
987 fe_scalar_vec_error_switch(2,
shape(elem, fe_t.
order, i, p,
true), phi = , ;
break;);
990 fe_scalar_vec_error_switch(3,
shape(elem, fe_t.
order, i, p,
true), phi = , ;
break;);
993 libmesh_error_msg(
"Invalid dimension = " <<
dim);
1000void FEInterface::shape<Real>(
const FEType & fe_t,
1003 const unsigned int i,
1010#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1021 auto total_order = fe_t.
order + extra_order;
1032 fe_scalar_vec_error_switch(0,
shape(elem, total_order, i, p,
false), phi = , ;
break;);
1035 fe_scalar_vec_error_switch(1,
shape(elem, total_order, i, p,
false), phi = , ;
break;);
1038 fe_scalar_vec_error_switch(2,
shape(elem, total_order, i, p,
false), phi = , ;
break;);
1041 fe_scalar_vec_error_switch(3,
shape(elem, total_order, i, p,
false), phi = , ;
break;);
1044 libmesh_error_msg(
"Invalid dimension = " <<
dim);
1051void FEInterface::shapes<Real>(
const unsigned int dim,
1054 const unsigned int i,
1055 const std::vector<Point> & p,
1056 std::vector<Real> & phi,
1057 const bool add_p_level)
1059#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1066 phi[qpi] =
ifem_shape(elevated, elem, i, p[qpi]);
1076 fe_scalar_vec_error_switch(0,
shapes(elem,o,i,p,phi,add_p_level), , ;
return;);
1079 fe_scalar_vec_error_switch(1,
shapes(elem,o,i,p,phi,add_p_level), , ;
return;);
1082 fe_scalar_vec_error_switch(2,
shapes(elem,o,i,p,phi,add_p_level), , ;
return;);
1085 fe_scalar_vec_error_switch(3,
shapes(elem,o,i,p,phi,add_p_level), , ;
return;);
1088 libmesh_error_msg(
"Invalid dimension = " <<
dim);
1096void FEInterface::all_shapes<Real>(
const unsigned int dim,
1099 const std::vector<Point> & p,
1100 std::vector<std::vector<Real>> & phi,
1101 const bool add_p_level)
1103#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1108 FEInterface::shapes<Real>(
dim, fe_t, elem, i, p, phi[i], add_p_level);
1118 fe_scalar_vec_error_switch(0,
all_shapes(elem,o,p,phi,add_p_level), , ;
return;);
1121 fe_scalar_vec_error_switch(1,
all_shapes(elem,o,p,phi,add_p_level), , ;
return;);
1124 fe_scalar_vec_error_switch(2,
all_shapes(elem,o,p,phi,add_p_level), , ;
return;);
1127 fe_scalar_vec_error_switch(3,
all_shapes(elem,o,p,phi,add_p_level), , ;
return;);
1130 libmesh_error_msg(
"Invalid dimension = " <<
dim);
1138#ifdef LIBMESH_ENABLE_DEPRECATED
1140void FEInterface::shape<RealGradient>(
const unsigned int dim,
1143 const unsigned int i,
1147 libmesh_deprecated();
1150#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1153 libmesh_not_implemented();
1161 fe_vector_scalar_error_switch(0,
shape(t,o,i,p), phi = , ;
break;);
1164 fe_vector_scalar_error_switch(1,
shape(t,o,i,p), phi = , ;
break;);
1167 fe_vector_scalar_error_switch(2,
shape(t,o,i,p), phi = , ;
break;);
1170 fe_vector_scalar_error_switch(3,
shape(t,o,i,p), phi = , ;
break;);
1173 libmesh_error_msg(
"Invalid dimension = " <<
dim);
1181void FEInterface::shape<RealGradient>(
const FEType & fe_t,
1183 const unsigned int i,
1188#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1191 libmesh_not_implemented();
1207 fe_vector_scalar_error_switch(0,
shape(elem, fe_t.
order, i, p,
true), phi = , ;
break;);
1210 fe_vector_scalar_error_switch(1,
shape(elem, fe_t.
order, i, p,
true), phi = , ;
break;);
1213 fe_vector_scalar_error_switch(2,
shape(elem, fe_t.
order, i, p,
true), phi = , ;
break;);
1216 fe_vector_scalar_error_switch(3,
shape(elem, fe_t.
order, i, p,
true), phi = , ;
break;);
1219 libmesh_error_msg(
"Invalid dimension = " <<
dim);
1226void FEInterface::shape<RealGradient>(
const FEType & fe_t,
1229 const unsigned int i,
1234#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1237 libmesh_not_implemented();
1250 auto total_order = fe_t.
order + extra_order;
1255 fe_vector_scalar_error_switch(0,
shape(elem, total_order, i, p,
false), phi = , ;
break;);
1258 fe_vector_scalar_error_switch(1,
shape(elem, total_order, i, p,
false), phi = , ;
break;);
1261 fe_vector_scalar_error_switch(2,
shape(elem, total_order, i, p,
false), phi = , ;
break;);
1264 fe_vector_scalar_error_switch(3,
shape(elem, total_order, i, p,
false), phi = , ;
break;);
1267 libmesh_error_msg(
"Invalid dimension = " <<
dim);
1274void FEInterface::shapes<RealGradient>(
const unsigned int dim,
1277 const unsigned int i,
1278 const std::vector<Point> & p,
1279 std::vector<RealGradient> & phi,
1280 const bool add_p_level)
1284 libmesh_not_implemented();
1291 fe_vector_scalar_error_switch(0,
shapes(elem,o,i,p,phi,add_p_level), , ;
return;);
1294 fe_vector_scalar_error_switch(1,
shapes(elem,o,i,p,phi,add_p_level), , ;
return;);
1297 fe_vector_scalar_error_switch(2,
shapes(elem,o,i,p,phi,add_p_level), , ;
return;);
1300 fe_vector_scalar_error_switch(3,
shapes(elem,o,i,p,phi,add_p_level), , ;
return;);
1303 libmesh_error_msg(
"Invalid dimension = " <<
dim);
1312void FEInterface::all_shapes<RealGradient>(
const unsigned int dim,
1315 const std::vector<Point> & p,
1316 std::vector<std::vector<RealGradient>> & phi,
1317 const bool add_p_level)
1321 libmesh_not_implemented();
1328 fe_vector_scalar_error_switch(0,
all_shapes(elem,o,p,phi,add_p_level), , ;
return;);
1331 fe_vector_scalar_error_switch(1,
all_shapes(elem,o,p,phi,add_p_level), , ;
return;);
1334 fe_vector_scalar_error_switch(2,
all_shapes(elem,o,p,phi,add_p_level), , ;
return;);
1337 fe_vector_scalar_error_switch(3,
all_shapes(elem,o,p,phi,add_p_level), , ;
return;);
1340 libmesh_error_msg(
"Invalid dimension = " <<
dim);
1347#ifdef LIBMESH_ENABLE_DEPRECATED
1353 libmesh_deprecated();
1355#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1358 inf_fe_switch(
shape);
1374#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1376 inf_fe_switch(
shape);
1383#ifdef LIBMESH_ENABLE_DEPRECATED
1387 const unsigned int i,
1388 const unsigned int j,
1391 libmesh_deprecated();
1393 libmesh_assert_greater (
dim,j);
1394#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1411 const unsigned int i,
1412 const unsigned int j,
1415 libmesh_deprecated();
1417 libmesh_assert_greater (
dim,j);
1418#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1431 fe_family_switch (0,
shape_deriv(elem, o, i, j, p),
return , ;);
1433 fe_family_switch (1,
shape_deriv(elem, o, i, j, p),
return , ;);
1435 fe_family_switch (2,
shape_deriv(elem, o, i, j, p),
return , ;);
1437 fe_family_switch (3,
shape_deriv(elem, o, i, j, p),
return , ;);
1439 libmesh_error_msg(
"Invalid dimension = " <<
dim);
1449 const unsigned int i,
1450 const unsigned int j,
1455 libmesh_assert_greater (
dim, j);
1456#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1478 const unsigned int i,
1479 const unsigned int j,
1484 libmesh_assert_greater (
dim, j);
1485#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1495 auto total_order = fe_t.
order + extra_order;
1502 fe_family_switch (0,
shape_deriv(elem, total_order, i, j, p,
false),
return , ;);
1504 fe_family_switch (1,
shape_deriv(elem, total_order, i, j, p,
false),
return , ;);
1506 fe_family_switch (2,
shape_deriv(elem, total_order, i, j, p,
false),
return , ;);
1508 fe_family_switch (3,
shape_deriv(elem, total_order, i, j, p,
false),
return , ;);
1510 libmesh_error_msg(
"Invalid dimension = " <<
dim);
1520void FEInterface::shape_derivs<Real>(
const FEType & fe_t,
1522 const unsigned int i,
1523 const unsigned int j,
1524 const std::vector<Point> & p,
1525 std::vector<Real> & dphi,
1526 const bool add_p_level)
1533 fe_scalar_vec_error_switch(0,
shape_derivs(elem,o,i,j,p,dphi,add_p_level), , ;
break;);
1536 fe_scalar_vec_error_switch(1,
shape_derivs(elem,o,i,j,p,dphi,add_p_level), , ;
break;);
1539 fe_scalar_vec_error_switch(2,
shape_derivs(elem,o,i,j,p,dphi,add_p_level), , ;
break;);
1542 fe_scalar_vec_error_switch(3,
shape_derivs(elem,o,i,j,p,dphi,add_p_level), , ;
break;);
1545 libmesh_error_msg(
"Invalid dimension = " << elem->
dim());
1556void FEInterface::all_shape_derivs<Real>(
const unsigned int dim,
1559 const std::vector<Point> & p,
1560 std::vector<std::vector<Real>> * comps[3],
1561 const bool add_p_level)
1563#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1569 FEInterface::shape_derivs<Real>(fe_t, elem, i, j, p, (*comps[j])[i], add_p_level);
1579 fe_scalar_vec_error_switch(0,
all_shape_derivs(elem,o,p,comps,add_p_level), , ;
return;);
1582 fe_scalar_vec_error_switch(1,
all_shape_derivs(elem,o,p,comps,add_p_level), , ;
return;);
1585 fe_scalar_vec_error_switch(2,
all_shape_derivs(elem,o,p,comps,add_p_level), , ;
return;);
1588 fe_scalar_vec_error_switch(3,
all_shape_derivs(elem,o,p,comps,add_p_level), , ;
return;);
1591 libmesh_error_msg(
"Invalid dimension = " <<
dim);
1600void FEInterface::shape_derivs<RealGradient>(
const FEType & fe_t,
1602 const unsigned int i,
1603 const unsigned int j,
1604 const std::vector<Point> & p,
1605 std::vector<RealGradient> & dphi,
1606 const bool add_p_level)
1613 fe_vector_scalar_error_switch(0,
shape_derivs(elem,o,i,j,p,dphi,add_p_level), , ;
break;);
1616 fe_vector_scalar_error_switch(1,
shape_derivs(elem,o,i,j,p,dphi,add_p_level), , ;
break;);
1619 fe_vector_scalar_error_switch(2,
shape_derivs(elem,o,i,j,p,dphi,add_p_level), , ;
break;);
1622 fe_vector_scalar_error_switch(3,
shape_derivs(elem,o,i,j,p,dphi,add_p_level), , ;
break;);
1625 libmesh_error_msg(
"Invalid dimension = " << elem->
dim());
1633#ifdef LIBMESH_ENABLE_DEPRECATED
1639 libmesh_deprecated();
1641#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1660#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1670#ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
1671#ifdef LIBMESH_ENABLE_DEPRECATED
1675 const unsigned int i,
1676 const unsigned int j,
1679 libmesh_deprecated();
1681 libmesh_assert_greater_equal (
dim*(
dim-1),j);
1682#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1684 libmesh_not_implemented();
1700 libmesh_error_msg(
"Invalid dimension = " <<
dim);
1709 const unsigned int i,
1710 const unsigned int j,
1713 libmesh_deprecated();
1715 libmesh_assert_greater_equal (
dim*(
dim-1),j);
1718 libmesh_not_implemented();
1733 libmesh_error_msg(
"Invalid dimension = " <<
dim);
1743 const unsigned int i,
1744 const unsigned int j,
1749 libmesh_assert_greater_equal (
dim*(
dim-1),j);
1750#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1752 libmesh_not_implemented();
1769 libmesh_error_msg(
"Invalid dimension = " <<
dim);
1781 const unsigned int i,
1782 const unsigned int j,
1787 libmesh_assert_greater_equal (
dim*(
dim-1),j);
1790 libmesh_not_implemented();
1794 auto total_order = fe_t.
order + extra_order;
1802 fe_family_switch (0,
shape_second_deriv(elem, total_order, i, j, p,
false),
return , ;);
1804 fe_family_switch (1,
shape_second_deriv(elem, total_order, i, j, p,
false),
return , ;);
1806 fe_family_switch (2,
shape_second_deriv(elem, total_order, i, j, p,
false),
return , ;);
1808 fe_family_switch (3,
shape_second_deriv(elem, total_order, i, j, p,
false),
return , ;);
1810 libmesh_error_msg(
"Invalid dimension = " <<
dim);
1819#ifdef LIBMESH_ENABLE_DEPRECATED
1825 libmesh_deprecated();
1827#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1829 libmesh_not_implemented();
1843#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1845 libmesh_not_implemented();
1853#ifdef LIBMESH_ENABLE_DEPRECATED
1855void FEInterface::shape<RealGradient>(
const unsigned int dim,
1858 const unsigned int i,
1862 libmesh_deprecated();
1866 libmesh_not_implemented();
1873 fe_vector_scalar_error_switch(0,
shape(elem,o,i,p), phi = , ;
break;);
1876 fe_vector_scalar_error_switch(1,
shape(elem,o,i,p), phi = , ;
break;);
1879 fe_vector_scalar_error_switch(2,
shape(elem,o,i,p), phi = , ;
break;);
1882 fe_vector_scalar_error_switch(3,
shape(elem,o,i,p), phi = , ;
break;);
1885 libmesh_error_msg(
"Invalid dimension = " <<
dim);
1898#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1909 const unsigned int n_dof =
n_dofs (fe_t, elem);
1910 const Point & p = data.
p;
1911 data.
shape.resize(n_dof);
1915 data.
dshape.resize(n_dof);
1918 for (
unsigned int d=0; d<
dim; d++)
1922 std::vector<Point> pt = {p};
1924 fe->reinit(elem, &pt);
1947 for (
unsigned int n=0; n<n_dof; n++)
1957 for (
unsigned int j=0; j<
dim; j++)
1965#ifdef LIBMESH_ENABLE_AMR
1969 const unsigned int variable_number,
1976 switch (elem->
dim())
2093 libmesh_error_msg(
"Invalid dimension = " << elem->
dim());
2101#ifdef LIBMESH_ENABLE_PERIODIC
2108 const unsigned int variable_number,
2119 constraints, dof_map, boundaries,
mesh, point_locator, variable_number, elem);
2123 constraints, dof_map, boundaries,
mesh, point_locator, variable_number, elem);
2127 "compute_periodic_constraints only set up for vector or scalar FEFieldTypes");
2142 const unsigned int unlimited = 11;
2146 const unsigned int unknown = unlimited;
2271#ifdef LIBMESH_ENABLE_HIGHER_ORDER_SHAPES
2663 fe_family_horder_case()
2678 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...