37 libmesh_error_msg(
"XYZ polynomials require the element because the centroid is needed.");
45 const Order libmesh_dbg_var(order),
47 const Point & point_in)
54 for (
unsigned int p = 0; p < elem->
n_nodes(); p++)
55 for (
unsigned int d = 0; d < 3; d++)
58 max_distance(d) =
std::max(distance, max_distance(d));
61 const Real x = point_in(0);
62 const Real y = point_in(1);
63 const Real z = point_in(2);
64 const Real xc = centroid(0);
65 const Real yc = centroid(1);
66 const Real zc = centroid(2);
67 const Real distx = max_distance(0);
68 const Real disty = max_distance(1);
69 const Real distz = max_distance(2);
70 const Real dx = (x - xc)/distx;
71 const Real dy = (y - yc)/disty;
72 const Real dz = (z - zc)/distz;
77 const unsigned int totalorder = order + elem->
p_level();
79 libmesh_assert_less (i, (static_cast<unsigned int>(totalorder)+1)*
80 (static_cast<unsigned int>(totalorder)+2)*
81 (static_cast<unsigned int>(totalorder)+3)/6);
198 for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
199 unsigned int i2 = i - (o*(o+1)*(o+2)/6);
200 unsigned int block=o, nz = 0;
201 for (; block < i2; block += (o-nz+1)) { nz++; }
202 const unsigned int nx = block - i2;
203 const unsigned int ny = o - nx - nz;
205 for (
unsigned int index=0; index != nx; index++)
207 for (
unsigned int index=0; index != ny; index++)
209 for (
unsigned int index=0; index != nz; index++)
228 libmesh_error_msg(
"XYZ polynomials require the element \nbecause the centroid is needed.");
236 const Order libmesh_dbg_var(order),
237 const unsigned int i,
238 const unsigned int j,
239 const Point & point_in)
243 libmesh_assert(elem);
244 libmesh_assert_less (j, 3);
248 for (
unsigned int p = 0; p < elem->
n_nodes(); p++)
249 for (
unsigned int d = 0; d < 3; d++)
252 max_distance(d) =
std::max(distance, max_distance(d));
255 const Real x = point_in(0);
256 const Real y = point_in(1);
257 const Real z = point_in(2);
258 const Real xc = centroid(0);
259 const Real yc = centroid(1);
260 const Real zc = centroid(2);
261 const Real distx = max_distance(0);
262 const Real disty = max_distance(1);
263 const Real distz = max_distance(2);
264 const Real dx = (x - xc)/distx;
265 const Real dy = (y - yc)/disty;
266 const Real dz = (z - zc)/distz;
271 const unsigned int totalorder =
static_cast<Order>(order + elem->
p_level());
273 libmesh_assert_less (i, (static_cast<unsigned int>(totalorder)+1)*
274 (static_cast<unsigned int>(totalorder)+2)*
275 (static_cast<unsigned int>(totalorder)+3)/6);
319 return 3.*dx*dx/distx;
322 return 2.*dx*dy/distx;
331 return 2.*dx*dz/distx;
350 return 4.*dx*dx*dx/distx;
353 return 3.*dx*dx*dy/distx;
356 return 2.*dx*dy*dy/distx;
359 return dy*dy*dy/distx;
365 return 3.*dx*dx*dz/distx;
368 return 2.*dx*dy*dz/distx;
371 return dy*dy*dz/distx;
377 return 2.*dx*dz*dz/distx;
380 return dy*dz*dz/distx;
386 return dz*dz*dz/distx;
396 for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
397 unsigned int i2 = i - (o*(o+1)*(o+2)/6);
398 unsigned int block=o, nz = 0;
399 for (; block < i2; block += (o-nz+1)) { nz++; }
400 const unsigned int nx = block - i2;
401 const unsigned int ny = o - nx - nz;
403 for (
unsigned int index=1; index < nx; index++)
405 for (
unsigned int index=0; index != ny; index++)
407 for (
unsigned int index=0; index != nz; index++)
460 return 2.*dx*dy/disty;
463 return 3.*dy*dy/disty;
472 return 2.*dy*dz/disty;
488 return dx*dx*dx/disty;
491 return 2.*dx*dx*dy/disty;
494 return 3.*dx*dy*dy/disty;
497 return 4.*dy*dy*dy/disty;
503 return dx*dx*dz/disty;
506 return 2.*dx*dy*dz/disty;
509 return 3.*dy*dy*dz/disty;
515 return dx*dz*dz/disty;
518 return 2.*dy*dz*dz/disty;
524 return dz*dz*dz/disty;
531 for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
532 unsigned int i2 = i - (o*(o+1)*(o+2)/6);
533 unsigned int block=o, nz = 0;
534 for (; block < i2; block += (o-nz+1)) { nz++; }
535 const unsigned int nx = block - i2;
536 const unsigned int ny = o - nx - nz;
538 for (
unsigned int index=0; index != nx; index++)
540 for (
unsigned int index=1; index < ny; index++)
542 for (
unsigned int index=0; index != nz; index++)
610 return 2.*dx*dz/distz;
613 return 2.*dy*dz/distz;
616 return 3.*dz*dz/distz;
635 return dx*dx*dx/distz;
638 return dx*dx*dy/distz;
641 return dx*dy*dy/distz;
644 return dy*dy*dy/distz;
647 return 2.*dx*dx*dz/distz;
650 return 2.*dx*dy*dz/distz;
653 return 2.*dy*dy*dz/distz;
656 return 3.*dx*dz*dz/distz;
659 return 3.*dy*dz*dz/distz;
662 return 4.*dz*dz*dz/distz;
666 for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
667 unsigned int i2 = i - (o*(o+1)*(o+2)/6);
668 unsigned int block=o, nz = 0;
669 for (; block < i2; block += (o-nz+1)) { nz++; }
670 const unsigned int nx = block - i2;
671 const unsigned int ny = o - nx - nz;
673 for (
unsigned int index=0; index != nx; index++)
675 for (
unsigned int index=0; index != ny; index++)
677 for (
unsigned int index=1; index < nz; index++)
685 libmesh_error_msg(
"Invalid j = " << j);
702 libmesh_error_msg(
"XYZ polynomials require the element \nbecause the centroid is needed.");
710 const Order libmesh_dbg_var(order),
711 const unsigned int i,
712 const unsigned int j,
713 const Point & point_in)
717 libmesh_assert(elem);
718 libmesh_assert_less (j, 6);
722 for (
unsigned int p = 0; p < elem->
n_nodes(); p++)
723 for (
unsigned int d = 0; d < 3; d++)
726 max_distance(d) =
std::max(distance, max_distance(d));
729 const Real x = point_in(0);
730 const Real y = point_in(1);
731 const Real z = point_in(2);
732 const Real xc = centroid(0);
733 const Real yc = centroid(1);
734 const Real zc = centroid(2);
735 const Real distx = max_distance(0);
736 const Real disty = max_distance(1);
737 const Real distz = max_distance(2);
738 const Real dx = (x - xc)/distx;
739 const Real dy = (y - yc)/disty;
740 const Real dz = (z - zc)/distz;
741 const Real dist2x =
pow(distx,2.);
742 const Real dist2y =
pow(disty,2.);
743 const Real dist2z =
pow(distz,2.);
744 const Real distxy = distx * disty;
745 const Real distxz = distx * distz;
746 const Real distyz = disty * distz;
751 const unsigned int totalorder =
static_cast<Order>(order + elem->
p_level());
753 libmesh_assert_less (i, (static_cast<unsigned int>(totalorder)+1)*
754 (static_cast<unsigned int>(totalorder)+2)*
755 (static_cast<unsigned int>(totalorder)+3)/6);
808 return 12.*dx*dx/dist2x;
811 return 6.*dx*dy/dist2x;
814 return 2.*dy*dy/dist2x;
821 return 6.*dx*dz/dist2x;
824 return 2.*dy*dz/dist2x;
831 return 2.*dz*dz/dist2x;
842 for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
843 unsigned int i2 = i - (o*(o+1)*(o+2)/6);
844 unsigned int block=o, nz = 0;
845 for (; block < i2; block += (o-nz+1)) { nz++; }
846 const unsigned int nx = block - i2;
847 const unsigned int ny = o - nx - nz;
848 Real val = nx * (nx - 1);
849 for (
unsigned int index=2; index < nx; index++)
851 for (
unsigned int index=0; index != ny; index++)
853 for (
unsigned int index=0; index != nz; index++)
915 return 3.*dx*dx/distxy;
918 return 4.*dx*dy/distxy;
921 return 3.*dy*dy/distxy;
928 return 2.*dx*dz/distxy;
931 return 2.*dy*dz/distxy;
948 for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
949 unsigned int i2 = i - (o*(o+1)*(o+2)/6);
950 unsigned int block=o, nz = 0;
951 for (; block < i2; block += (o-nz+1)) { nz++; }
952 const unsigned int nx = block - i2;
953 const unsigned int ny = o - nx - nz;
955 for (
unsigned int index=1; index < nx; index++)
957 for (
unsigned int index=1; index < ny; index++)
959 for (
unsigned int index=0; index != nz; index++)
1001 return 6.*dy/dist2y;
1008 return 2.*dz/dist2y;
1021 return 2.*dx*dx/dist2y;
1024 return 6.*dx*dy/dist2y;
1027 return 12.*dy*dy/dist2y;
1034 return 2.*dx*dz/dist2y;
1037 return 6.*dy*dz/dist2y;
1044 return 2.*dz*dz/dist2y;
1053 for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
1054 unsigned int i2 = i - (o*(o+1)*(o+2)/6);
1055 unsigned int block=o, nz = 0;
1056 for (; block < i2; block += (o-nz+1)) { nz++; }
1057 const unsigned int nx = block - i2;
1058 const unsigned int ny = o - nx - nz;
1059 Real val = ny * (ny - 1);
1060 for (
unsigned int index=0; index != nx; index++)
1062 for (
unsigned int index=2; index < ny; index++)
1064 for (
unsigned int index=0; index != nz; index++)
1106 return 2.*dx/distxz;
1115 return 2.*dz/distxz;
1130 return 3.*dx*dx/distxz;
1133 return 2.*dx*dy/distxz;
1136 return dy*dy/distxz;
1142 return 4.*dx*dz/distxz;
1145 return 2.*dy*dz/distxz;
1151 return 3.*dz*dz/distxz;
1159 for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
1160 unsigned int i2 = i - (o*(o+1)*(o+2)/6);
1161 unsigned int block=o, nz = 0;
1162 for (; block < i2; block += (o-nz+1)) { nz++; }
1163 const unsigned int nx = block - i2;
1164 const unsigned int ny = o - nx - nz;
1166 for (
unsigned int index=1; index < nx; index++)
1168 for (
unsigned int index=0; index != ny; index++)
1170 for (
unsigned int index=1; index < nz; index++)
1215 return 2.*dy/distyz;
1221 return 2.*dz/distyz;
1236 return dx*dx/distyz;
1239 return 2.*dx*dy/distyz;
1242 return 3.*dy*dy/distyz;
1248 return 2.*dx*dz/distyz;
1251 return 4.*dy*dz/distyz;
1257 return 3.*dz*dz/distyz;
1264 for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
1265 unsigned int i2 = i - (o*(o+1)*(o+2)/6);
1266 unsigned int block=o, nz = 0;
1267 for (; block < i2; block += (o-nz+1)) { nz++; }
1268 const unsigned int nx = block - i2;
1269 const unsigned int ny = o - nx - nz;
1271 for (
unsigned int index=0; index != nx; index++)
1273 for (
unsigned int index=1; index < ny; index++)
1275 for (
unsigned int index=1; index < nz; index++)
1318 return 2.*dx/dist2z;
1321 return 2.*dy/dist2z;
1324 return 6.*dz/dist2z;
1339 return 2.*dx*dx/dist2z;
1342 return 2.*dx*dy/dist2z;
1345 return 2.*dy*dy/dist2z;
1348 return 6.*dx*dz/dist2z;
1351 return 6.*dy*dz/dist2z;
1354 return 12.*dz*dz/dist2z;
1358 for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
1359 unsigned int i2 = i - (o*(o+1)*(o+2)/6);
1360 unsigned int block=o, nz = 0;
1361 for (; block < i2; block += (o-nz+1)) { nz++; }
1362 const unsigned int nx = block - i2;
1363 const unsigned int ny = o - nx - nz;
1364 Real val = nz * (nz - 1);
1365 for (
unsigned int index=0; index != nx; index++)
1367 for (
unsigned int index=0; index != ny; index++)
1369 for (
unsigned int index=2; index < nz; index++)
1377 libmesh_error_msg(
"Invalid j = " << j);
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
The base class for all geometric element types.
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
unsigned int p_level() const
long double max(long double a, double b)
virtual unsigned int n_nodes() const =0
double pow(double a, int b)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
A geometric point in (x,y,z) space.
const Point & point(const unsigned int i) const
virtual Point centroid() const
static OutputShape shape_second_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)