13 #include "../mesh/wedge.hpp"
19 {
"Point",
"Segment",
"Triangle",
"Square",
"Tetrahedron",
"Cube",
"Prism" };
22 { 1.0, 1.0, 0.5, 1.0, 1./6, 1.0, 0.5 };
142 GeomCenter[
POINT].
x = 0.0;
143 GeomCenter[
POINT].
y = 0.0;
144 GeomCenter[
POINT].
z = 0.0;
162 GeomCenter[
CUBE].
x = 0.5;
163 GeomCenter[
CUBE].
y = 0.5;
164 GeomCenter[
CUBE].
z = 0.5;
166 GeomCenter[
PRISM].
x = 1.0 / 3.0;
167 GeomCenter[
PRISM].
y = 1.0 / 3.0;
168 GeomCenter[
PRISM].
z = 0.5;
170 GeomToPerfGeomJac[
POINT] = NULL;
178 PerfGeomToGeomJac[
POINT] = NULL;
179 PerfGeomToGeomJac[
SEGMENT] = NULL;
181 PerfGeomToGeomJac[
SQUARE] = NULL;
183 PerfGeomToGeomJac[
CUBE] = NULL;
204 GeomToPerfGeomJac[
CUBE]->
Diag(1.0, 3);
217 for (
int i = 0; i <
NumGeom; i++)
219 delete PerfGeomToGeomJac[i];
220 delete GeomToPerfGeomJac[i];
252 ip.
x = double(rand()) / RAND_MAX;
255 ip.
x = double(rand()) / RAND_MAX;
256 ip.
y = double(rand()) / RAND_MAX;
257 if (ip.
x + ip.
y > 1.0)
264 ip.
x = double(rand()) / RAND_MAX;
265 ip.
y = double(rand()) / RAND_MAX;
268 ip.
x = double(rand()) / RAND_MAX;
269 ip.
y = double(rand()) / RAND_MAX;
270 ip.
z = double(rand()) / RAND_MAX;
273 if (ip.
x + ip.
y > 1.0)
280 if (ip.
x + ip.
z > 1.0)
283 ip.
x = ip.
x + ip.
z - 1.0;
288 else if (ip.
x + ip.
y + ip.
z > 1.0)
292 ip.
x = 1.0 - x - ip.
z;
293 ip.
y = 1.0 - x - ip.
y;
299 ip.
x = double(rand()) / RAND_MAX;
300 ip.
y = double(rand()) / RAND_MAX;
301 ip.
z = double(rand()) / RAND_MAX;
304 ip.
x = double(rand()) / RAND_MAX;
305 ip.
y = double(rand()) / RAND_MAX;
306 ip.
z = double(rand()) / RAND_MAX;
307 if (ip.
x + ip.
y > 1.0)
314 MFEM_ABORT(
"Unknown type of reference element!");
323 inline bool NearlyEqual(
double x,
double y,
double eps)
325 return std::abs(x-y) <= eps;
330 inline bool FuzzyGT(
double x,
double y,
double eps)
332 return (x > y + eps);
337 inline bool FuzzyLT(
double x,
double y,
double eps)
339 return (x < y - eps);
350 if (ip.
x != 0.0) {
return false; }
353 if (ip.
x < 0.0 || ip.
x > 1.0) {
return false; }
356 if (ip.
x < 0.0 || ip.
y < 0.0 || ip.
x+ip.
y > 1.0) {
return false; }
359 if (ip.
x < 0.0 || ip.
x > 1.0 || ip.
y < 0.0 || ip.
y > 1.0)
363 if (ip.
x < 0.0 || ip.
y < 0.0 || ip.
z < 0.0 ||
364 ip.
x+ip.
y+ip.
z > 1.0) {
return false; }
367 if (ip.
x < 0.0 || ip.
x > 1.0 || ip.
y < 0.0 || ip.
y > 1.0 ||
368 ip.
z < 0.0 || ip.
z > 1.0) {
return false; }
371 if (ip.
x < 0.0 || ip.
y < 0.0 || ip.
x+ip.
y > 1.0 ||
372 ip.
z < 0.0 || ip.
z > 1.0) {
return false; }
375 MFEM_ABORT(
"Unknown type of reference element!");
385 if (! internal::NearlyEqual(ip.
x, 0.0, eps))
391 if ( internal::FuzzyLT(ip.
x, 0.0, eps)
392 || internal::FuzzyGT(ip.
x, 1.0, eps) )
398 if ( internal::FuzzyLT(ip.
x, 0.0, eps)
399 || internal::FuzzyLT(ip.
y, 0.0, eps)
400 || internal::FuzzyGT(ip.
x+ip.
y, 1.0, eps) )
406 if ( internal::FuzzyLT(ip.
x, 0.0, eps)
407 || internal::FuzzyGT(ip.
x, 1.0, eps)
408 || internal::FuzzyLT(ip.
y, 0.0, eps)
409 || internal::FuzzyGT(ip.
y, 1.0, eps) )
415 if ( internal::FuzzyLT(ip.
x, 0.0, eps)
416 || internal::FuzzyLT(ip.
y, 0.0, eps)
417 || internal::FuzzyLT(ip.
z, 0.0, eps)
418 || internal::FuzzyGT(ip.
x+ip.
y+ip.
z, 1.0, eps) )
424 if ( internal::FuzzyLT(ip.
x, 0.0, eps)
425 || internal::FuzzyGT(ip.
x, 1.0, eps)
426 || internal::FuzzyLT(ip.
y, 0.0, eps)
427 || internal::FuzzyGT(ip.
y, 1.0, eps)
428 || internal::FuzzyLT(ip.
z, 0.0, eps)
429 || internal::FuzzyGT(ip.
z, 1.0, eps) )
435 if ( internal::FuzzyLT(ip.
x, 0.0, eps)
436 || internal::FuzzyLT(ip.
y, 0.0, eps)
437 || internal::FuzzyGT(ip.
x+ip.
y, 1.0, eps)
438 || internal::FuzzyLT(ip.
z, 0.0, eps)
439 || internal::FuzzyGT(ip.
z, 1.0, eps) )
445 MFEM_ABORT(
"Unknown type of reference element!");
454 template <
int N,
int dim>
455 inline bool IntersectSegment(
double lbeg[N],
double lend[N],
460 for (
int i = 0; i < N; i++)
462 lbeg[i] = std::max(lbeg[i], 0.0);
466 t = std::min(t, lbeg[i]/(lbeg[i]-lend[i]));
471 if (
dim >= 1) { end.
x = t*lend[0] + (1.0-
t)*lbeg[0]; }
472 if (
dim >= 2) { end.
y = t*lend[1] + (1.0-
t)*lbeg[1]; }
473 if (
dim >= 3) { end.
z = t*lend[2] + (1.0-
t)*lbeg[2]; }
479 inline bool ProjectTriangle(
double &x,
double &y)
484 if (y < 0.0) { y = 0.0; }
485 else if (y > 1.0) { y = 1.0; }
490 if (x > 1.0) { x = 1.0; }
494 const double l3 = 1.0-x-y;
497 if (y - x > 1.0) { x = 0.0; y = 1.0; }
498 else if (y - x < -1.0) { x = 1.0; y = 0.0; }
499 else { x += l3/2; y += l3/2; }
515 if (end.
x != 0.0) { end.
x = 0.0;
return false; }
520 if (end.
x < 0.0) { end.
x = 0.0;
return false; }
521 if (end.
x > 1.0) { end.
x = 1.0;
return false; }
526 double lend[3] = { end.
x, end.
y, 1.0-end.
x-end.
y };
527 double lbeg[3] = { beg.
x, beg.
y, 1.0-beg.
x-beg.
y };
528 return internal::IntersectSegment<3,2>(lbeg, lend, end);
532 double lend[4] = { end.
x, end.
y, 1.0-end.
x, 1.0-end.
y };
533 double lbeg[4] = { beg.
x, beg.
y, 1.0-beg.
x, 1.0-beg.
y };
534 return internal::IntersectSegment<4,2>(lbeg, lend, end);
538 double lend[4] = { end.
x, end.
y, end.
z, 1.0-end.
x-end.
y-end.
z };
539 double lbeg[4] = { beg.
x, beg.
y, beg.
z, 1.0-beg.
x-beg.
y-beg.
z };
540 return internal::IntersectSegment<4,3>(lbeg, lend, end);
544 double lend[6] = { end.
x, end.
y, end.
z,
545 1.0-end.
x, 1.0-end.
y, 1.0-end.
z
547 double lbeg[6] = { beg.
x, beg.
y, beg.
z,
548 1.0-beg.
x, 1.0-beg.
y, 1.0-beg.
z
550 return internal::IntersectSegment<6,3>(lbeg, lend, end);
554 double lend[5] = { end.
x, end.
y, end.
z, 1.0-end.
x-end.
y, 1.0-end.
z };
555 double lbeg[5] = { beg.
x, beg.
y, beg.
z, 1.0-beg.
x-beg.
y, 1.0-beg.
z };
556 return internal::IntersectSegment<5,3>(lbeg, lend, end);
559 MFEM_ABORT(
"Unknown type of reference element!");
575 if (ip.
x < 0.0) { ip.
x = 0.0;
return false; }
576 else if (ip.
x > 1.0) { ip.
x = 1.0;
return false; }
582 return internal::ProjectTriangle(ip.
x, ip.
y);
588 if (ip.
x < 0.0) { in_x =
false; ip.
x = 0.0; }
589 else if (ip.
x > 1.0) { in_x =
false; ip.
x = 1.0; }
590 else { in_x =
true; }
591 if (ip.
y < 0.0) { in_y =
false; ip.
y = 0.0; }
592 else if (ip.
y > 1.0) { in_y =
false; ip.
y = 1.0; }
593 else { in_y =
true; }
602 internal::ProjectTriangle(ip.
x, ip.
y);
608 internal::ProjectTriangle(ip.
x, ip.
z);
614 internal::ProjectTriangle(ip.
y, ip.
z);
617 const double l4 = 1.0-ip.
x-ip.
y-ip.
z;
620 const double l4_3 = l4/3;
623 internal::ProjectTriangle(ip.
x, ip.
y);
624 ip.
z = 1.0-ip.
x-ip.
y;
632 bool in_x, in_y, in_z;
633 if (ip.
x < 0.0) { in_x =
false; ip.
x = 0.0; }
634 else if (ip.
x > 1.0) { in_x =
false; ip.
x = 1.0; }
635 else { in_x =
true; }
636 if (ip.
y < 0.0) { in_y =
false; ip.
y = 0.0; }
637 else if (ip.
y > 1.0) { in_y =
false; ip.
y = 1.0; }
638 else { in_y =
true; }
639 if (ip.
z < 0.0) { in_z =
false; ip.
z = 0.0; }
640 else if (ip.
z > 1.0) { in_z =
false; ip.
z = 1.0; }
641 else { in_z =
true; }
642 return in_x && in_y && in_z;
648 in_tri = internal::ProjectTriangle(ip.
x, ip.
y);
649 if (ip.
z < 0.0) { in_z =
false; ip.
z = 0.0; }
650 else if (ip.
z > 1.0) { in_z =
false; ip.
z = 1.0; }
651 else { in_z =
true; }
652 return in_tri && in_z;
656 MFEM_ABORT(
"Reference element type is not supported!");
676 pm(0,0) = 0.0; pm(1,0) = 0.0;
677 pm(0,1) = 1.0; pm(1,1) = 0.0;
678 pm(0,2) = 0.5; pm(1,2) = 0.86602540378443864676;
685 pm(0,0) = 0.0; pm(1,0) = 0.0;
686 pm(0,1) = 1.0; pm(1,1) = 0.0;
687 pm(0,2) = 1.0; pm(1,2) = 1.0;
688 pm(0,3) = 0.0; pm(1,3) = 1.0;
695 pm(0,0) = 0.0; pm(1,0) = 0.0; pm(2,0) = 0.0;
696 pm(0,1) = 1.0; pm(1,1) = 0.0; pm(2,1) = 0.0;
697 pm(0,2) = 0.5; pm(1,2) = 0.86602540378443864676; pm(2,2) = 0.0;
698 pm(0,3) = 0.5; pm(1,3) = 0.28867513459481288225;
699 pm(2,3) = 0.81649658092772603273;
706 pm(0,0) = 0.0; pm(1,0) = 0.0; pm(2,0) = 0.0;
707 pm(0,1) = 1.0; pm(1,1) = 0.0; pm(2,1) = 0.0;
708 pm(0,2) = 1.0; pm(1,2) = 1.0; pm(2,2) = 0.0;
709 pm(0,3) = 0.0; pm(1,3) = 1.0; pm(2,3) = 0.0;
710 pm(0,4) = 0.0; pm(1,4) = 0.0; pm(2,4) = 1.0;
711 pm(0,5) = 1.0; pm(1,5) = 0.0; pm(2,5) = 1.0;
712 pm(0,6) = 1.0; pm(1,6) = 1.0; pm(2,6) = 1.0;
713 pm(0,7) = 0.0; pm(1,7) = 1.0; pm(2,7) = 1.0;
720 pm(0,0) = 0.0; pm(1,0) = 0.0; pm(2,0) = 0.0;
721 pm(0,1) = 1.0; pm(1,1) = 0.0; pm(2,1) = 0.0;
722 pm(0,2) = 0.5; pm(1,2) = 0.86602540378443864676; pm(2,2) = 0.0;
723 pm(0,3) = 0.0; pm(1,3) = 0.0; pm(2,3) = 1.0;
724 pm(0,4) = 1.0; pm(1,4) = 0.0; pm(2,4) = 1.0;
725 pm(0,5) = 0.5; pm(1,5) = 0.86602540378443864676; pm(2,5) = 1.0;
730 mfem_error (
"Geometry::GetPerfPointMat (...)");
737 if (PerfGeomToGeomJac[GeomType])
739 Mult(J, *PerfGeomToGeomJac[GeomType], PJ);
750 { POINT, SEGMENT, TRIANGLE, TETRAHEDRON, NUM_GEOMETRIES };
778 {0, 1, 2}, {1, 0, 2}, {2, 0, 1},
779 {2, 1, 0}, {1, 2, 0}, {0, 2, 1}
790 {{1, 0}, {3, -4}, {2, 1}, {3, 2}};
796 {0, 1, 2, 3}, {0, 3, 2, 1}, {1, 2, 3, 0}, {1, 0, 3, 2},
797 {2, 3, 0, 1}, {2, 1, 0, 3}, {3, 0, 1, 2}, {3, 2, 1, 0}
804 {{0, 1}, {0, 2}, {0, 3}, {1, 2}, {1, 3}, {2, 3}};
813 {{1, 2, 3}, {0, 3, 2}, {0, 1, 3}, {0, 2, 1}};
819 {1, 0}, {2, 1}, {3, 2},
826 {0, 1, 2, 3}, {0, 1, 3, 2}, {0, 2, 3, 1}, {0, 2, 1, 3},
827 {0, 3, 1, 2}, {0, 3, 2, 1},
828 {1, 2, 0, 3}, {1, 2, 3, 0}, {1, 3, 2, 0}, {1, 3, 0, 2},
829 {1, 0, 3, 2}, {1, 0, 2, 3},
830 {2, 3, 0, 1}, {2, 3, 1, 0}, {2, 0, 1, 3}, {2, 0, 3, 1},
831 {2, 1, 3, 0}, {2, 1, 0, 3},
832 {3, 0, 2, 1}, {3, 0, 1, 2}, {3, 1, 0, 2}, {3, 1, 2, 0},
833 {3, 2, 1, 0}, {3, 2, 0, 1}
839 14, 19, 18, 15, 10, 11,
840 12, 23, 6, 9, 20, 17,
847 {0, 1}, {1, 2}, {3, 2}, {0, 3}, {4, 5}, {5, 6},
848 {7, 6}, {4, 7}, {0, 4}, {1, 5}, {2, 6}, {3, 7}
859 {3, 2, 1, 0}, {0, 1, 5, 4}, {1, 2, 6, 5},
860 {2, 3, 7, 6}, {3, 0, 4, 7}, {4, 5, 6, 7}
867 {1, 0}, {3, 3}, {4, 8},
878 {{0, 1}, {1, 2}, {2, 0}, {3, 4}, {4, 5}, {5, 3}, {0, 3}, {1, 4}, {2, 5}};
887 {{0, 2, 1, -1}, {3, 4, 5, -1}, {0, 1, 4, 3}, {1, 2, 5, 4}, {2, 0, 3, 5}};
893 {1, 0}, {2, -3}, {3, 6},
910 for (
int j = 0; j < RGeom[i].Size(); j++) {
delete RGeom[i][j]; }
911 for (
int j = 0; j < IntPts[i].Size(); j++) {
delete IntPts[i][j]; }
916 int Times,
int ETimes,
920 for (
int i = 0; i < RGA.
Size(); i++)
931 IntegrationRule *GeometryRefiner::FindInIntPts(
Geometry::Type Geom,
int NPts)
933 Array<IntegrationRule *> &IPA = IntPts[Geom];
934 for (
int i = 0; i < IPA.Size(); i++)
936 IntegrationRule &ir = *IPA[i];
937 if (ir.GetNPoints() == NPts) {
return &ir; }
943 int Times,
int ETimes)
947 Times = std::max(Times, 1);
952 if (RG) {
return RG; }
975 for (i = 0; i <= Times; i++)
981 for (i = 0; i < Times; i++)
994 3*Times*(ETimes+1), 3*Times);
998 for (k = j = 0; j <= Times; j++)
999 for (i = 0; i <= Times-j; i++, k++)
1002 ip.
x = cp[i]/(cp[i] + cp[j] + cp[Times-i-j]);
1003 ip.
y = cp[j]/(cp[i] + cp[j] + cp[Times-i-j]);
1006 for (l = k = j = 0; j < Times; j++, k++)
1007 for (i = 0; i < Times-j; i++, k++)
1011 G[l++] = k+Times-j+1;
1015 G[l++] = k+Times-j+2;
1016 G[l++] = k+Times-j+1;
1022 for (k = 0; k < Times; k += Times/ETimes)
1024 int < = (k == 0) ? lb : li;
1025 j = k*(Times+1)-((k-1)*k)/2;
1026 for (i = 0; i < Times-k; i++)
1033 for (k = Times; k > 0; k -= Times/ETimes)
1035 int < = (k == Times) ? lb : li;
1037 for (i = 0; i < k; i++)
1039 E[lt++] = j; j += Times-i;
1044 for (k = 0; k < Times; k += Times/ETimes)
1046 int < = (k == 0) ? lb : li;
1048 for (i = 0; i < Times-k; i++)
1050 E[lt++] = j; j += Times-i+1;
1062 4*(ETimes+1)*Times, 4*Times);
1066 for (k = j = 0; j <= Times; j++)
1067 for (i = 0; i <= Times; i++, k++)
1074 for (l = k = j = 0; j < Times; j++, k++)
1075 for (i = 0; i < Times; i++, k++)
1085 for (k = 0; k <= Times; k += Times/ETimes)
1087 int < = (k == 0 || k == Times) ? lb : li;
1088 for (i = 0, j = k*(Times+1); i < Times; i++)
1095 for (k = Times; k >= 0; k -= Times/ETimes)
1097 int < = (k == Times || k == 0) ? lb : li;
1098 for (i = 0, j = k; i < Times; i++)
1100 E[lt++] = j; j += Times+1;
1112 8*Times*Times*Times, 0);
1116 for (l = k = 0; k <= Times; k++)
1117 for (j = 0; j <= Times; j++)
1118 for (i = 0; i <= Times; i++, l++)
1126 for (l = k = 0; k < Times; k++)
1127 for (j = 0; j < Times; j++)
1128 for (i = 0; i < Times; i++)
1130 G[l++] = i+0 + (j+0 + (k+0) * (Times+1)) * (Times+1);
1131 G[l++] = i+1 + (j+0 + (k+0) * (Times+1)) * (Times+1);
1132 G[l++] = i+1 + (j+1 + (k+0) * (Times+1)) * (Times+1);
1133 G[l++] = i+0 + (j+1 + (k+0) * (Times+1)) * (Times+1);
1134 G[l++] = i+0 + (j+0 + (k+1) * (Times+1)) * (Times+1);
1135 G[l++] = i+1 + (j+0 + (k+1) * (Times+1)) * (Times+1);
1136 G[l++] = i+1 + (j+1 + (k+1) * (Times+1)) * (Times+1);
1137 G[l++] = i+0 + (j+1 + (k+1) * (Times+1)) * (Times+1);
1159 const int n = Times;
1171 for (
int kk = 0; kk <= n; kk++)
1172 for (
int jj = 0; jj <= n-kk; jj++)
1173 for (
int ii = 0; ii <= n-jj-kk; ii++)
1176 double w = cp[ii] + cp[jj] + cp[kk] + cp[Times-ii-jj-kk];
1186 l = i + (j + k * (n+1)) * (n+1);
1193 if (m != (n+3)*(n+2)*(n+1)/6)
1195 mfem_error(
"GeometryRefiner::Refine() for TETRAHEDRON #1");
1200 for (k = 0; k < n; k++)
1201 for (j = 0; j <= k; j++)
1202 for (i = 0; i <= j; i++)
1212 G[m++] = vi[i+0 + (j+0 + (k+0) * (n+1)) * (n+1)];
1213 G[m++] = vi[i+0 + (j+0 + (k+1) * (n+1)) * (n+1)];
1214 G[m++] = vi[i+1 + (j+1 + (k+1) * (n+1)) * (n+1)];
1215 G[m++] = vi[i+0 + (j+1 + (k+1) * (n+1)) * (n+1)];
1219 G[m++] = vi[i+0 + (j+0 + (k+0) * (n+1)) * (n+1)];
1220 G[m++] = vi[i+1 + (j+1 + (k+1) * (n+1)) * (n+1)];
1221 G[m++] = vi[i+0 + (j+1 + (k+0) * (n+1)) * (n+1)];
1222 G[m++] = vi[i+0 + (j+1 + (k+1) * (n+1)) * (n+1)];
1224 G[m++] = vi[i+0 + (j+0 + (k+0) * (n+1)) * (n+1)];
1225 G[m++] = vi[i+0 + (j+1 + (k+0) * (n+1)) * (n+1)];
1226 G[m++] = vi[i+1 + (j+1 + (k+1) * (n+1)) * (n+1)];
1227 G[m++] = vi[i+1 + (j+1 + (k+0) * (n+1)) * (n+1)];
1232 G[m++] = vi[i+0 + (j+0 + (k+0) * (n+1)) * (n+1)];
1233 G[m++] = vi[i+1 + (j+0 + (k+0) * (n+1)) * (n+1)];
1234 G[m++] = vi[i+1 + (j+1 + (k+1) * (n+1)) * (n+1)];
1235 G[m++] = vi[i+1 + (j+0 + (k+1) * (n+1)) * (n+1)];
1239 G[m++] = vi[i+0 + (j+0 + (k+0) * (n+1)) * (n+1)];
1240 G[m++] = vi[i+1 + (j+1 + (k+1) * (n+1)) * (n+1)];
1241 G[m++] = vi[i+1 + (j+0 + (k+0) * (n+1)) * (n+1)];
1242 G[m++] = vi[i+1 + (j+1 + (k+0) * (n+1)) * (n+1)];
1245 G[m++] = vi[i+0 + (j+0 + (k+0) * (n+1)) * (n+1)];
1246 G[m++] = vi[i+1 + (j+1 + (k+1) * (n+1)) * (n+1)];
1247 G[m++] = vi[i+0 + (j+0 + (k+1) * (n+1)) * (n+1)];
1248 G[m++] = vi[i+1 + (j+0 + (k+1) * (n+1)) * (n+1)];
1253 mfem_error(
"GeometryRefiner::Refine() for TETRAHEDRON #2");
1255 for (i = 0; i < m; i++)
1258 mfem_error(
"GeometryRefiner::Refine() for TETRAHEDRON #3");
1267 const int n = Times;
1274 for (l = k = 0; k <= n; k++)
1275 for (j = 0; j <= n; j++)
1276 for (i = 0; i <= n-j; i++, l++)
1279 ip.
x = cp[i]/(cp[i] + cp[j] + cp[n-i-j]);
1280 ip.
y = cp[j]/(cp[i] + cp[j] + cp[n-i-j]);
1284 if (m != (n+1)*(n+1)*(n+2)/2)
1286 mfem_error(
"GeometryRefiner::Refine() for PRISM #1");
1291 for (m = k = 0; k < n; k++)
1292 for (l = j = 0; j < n; j++, l++)
1293 for (i = 0; i < n-j; i++, l++)
1295 G[m++] = l + (k+0) * (n+1) * (n+2) / 2;
1296 G[m++] = l + 1 + (k+0) * (n+1) * (n+2) / 2;
1297 G[m++] = l - j + (2 + (k+0) * (n+2)) * (n+1) / 2;
1298 G[m++] = l + (k+1) * (n+1) * (n+2) / 2;
1299 G[m++] = l + 1 + (k+1) * (n+1) * (Times+2) / 2;
1300 G[m++] = l - j + (2 + (k+1) * (n+2)) * (n+1) / 2;
1303 G[m++] = l + 1 + (k+0) * (n+1) * (n+2)/2;
1304 G[m++] = l - j + (2 + (k+0) * (n+1)) * (n+2) / 2;
1305 G[m++] = l - j + (2 + (k+0) * (n+2)) * (n+1) / 2;
1306 G[m++] = l + 1 + (k+1) * (n+1) * (n+2) / 2;
1307 G[m++] = l - j + (2 + (k+1) * (n+1)) * (n+2) / 2;
1308 G[m++] = l - j + (2 + (k+1) * (n+2)) * (n+1) / 2;
1313 mfem_error(
"GeometryRefiner::Refine() for PRISM #2");
1315 for (i = 0; i < m; i++)
1318 mfem_error(
"GeometryRefiner::Refine() for PRISM #3");
1344 ir = FindInIntPts(Geom, Times-1);
1345 if (ir) {
return ir; }
1348 for (
int i = 1; i < Times; i++)
1351 ip.
x = double(i) / Times;
1363 ir = FindInIntPts(Geom, ((Times-1)*(Times-2))/2);
1364 if (ir) {
return ir; }
1367 for (
int k = 0, j = 1; j < Times-1; j++)
1368 for (
int i = 1; i < Times-j; i++, k++)
1371 ip.
x = double(i) / Times;
1372 ip.
y = double(j) / Times;
1384 ir = FindInIntPts(Geom, (Times-1)*(Times-1));
1385 if (ir) {
return ir; }
1388 for (
int k = 0, j = 1; j < Times; j++)
1389 for (
int i = 1; i < Times; i++, k++)
1392 ip.
x = double(i) / Times;
1393 ip.
y = double(j) / Times;
1400 mfem_error(
"GeometryRefiner::RefineInterior(...)");
1403 MFEM_ASSERT(ir != NULL,
"Failed to construct the refined IntegrationRule.");
1404 IntPts[Geom].Append(ir);
1424 for (
int n = 0, np = 0; (n < 15) && (np < Npts) ; n++)
1427 if (np == Npts) {
return n; }
1433 for (
int n = 0, np = 0; (n < 15) && (np < Npts) ; n++)
1436 if (np == Npts) {
return n; }
1442 for (
int n = 0, np = 0; (n < 15) && (np < Npts) ; n++)
1444 np = (n+1)*(n+1)*(n+1);
1445 if (np == Npts) {
return n; }
1451 for (
int n = 0, np = 0; (n < 15) && (np < Npts) ; n++)
1453 np = (n+3)*(n+2)*(n+1)/6;
1454 if (np == Npts) {
return n; }
1460 for (
int n = 0, np = 0; (n < 15) && (np < Npts) ; n++)
1462 np = (n+1)*(n+1)*(n+2)/2;
1463 if (np == Npts) {
return n; }
1492 for (
int n = 0; (n < 15) && (n*n < Nels+1) ; n++)
1494 if (n*n == Nels) {
return n-1; }
1502 for (
int n = 0; (n < 15) && (n*n*n < Nels+1) ; n++)
1504 if (n*n*n == Nels) {
return n-1; }
int Size() const
Return the logical size of the array.
static const int InvOrient[NumOrient]
Class for an integration rule - an Array of IntegrationPoint.
static const int I[NumVert]
static const int J[NumEdges][2]
static int GetNodalBasis(int qpt_type)
Return the nodal BasisType corresponding to the Quadrature1D type.
void JacToPerfJac(int GeomType, const DenseMatrix &J, DenseMatrix &PJ) const
static void GetRandomPoint(int GeomType, IntegrationPoint &ip)
Get a random point in the reference element specified by GeomType.
void Mult(const Table &A, const Table &B, Table &C)
C = A * B (as boolean matrices)
static const int J[NumEdges][2]
static const int FaceVert[NumFaces][MaxFaceVert]
static const int FaceVert[NumFaces][MaxFaceVert]
static const int Edges[NumEdges][2]
Data type dense matrix using column-major storage.
static const double Volume[NumGeom]
static const int I[NumVert]
static const int NumEdges[NumGeom]
const IntegrationRule * GetVertices(int GeomType)
Return an IntegrationRule consisting of all vertices of the given Geometry::Type, GeomType...
const IntegrationRule * RefineInterior(Geometry::Type Geom, int Times)
const double * GetPoints(const int p, const int btype)
Get the coordinates of the points of the given BasisType, btype.
static const int NumFaces[NumGeom]
static const int InvOrient[NumOrient]
IntegrationPoint & IntPoint(int i)
Returns a reference to the i-th integration point.
static const int Edges[NumEdges][2]
static const int Dimension[NumGeom]
static const int FaceTypes[NumFaces]
void mfem_error(const char *msg)
Function called when an error is encountered. Used by the macros MFEM_ABORT, MFEM_ASSERT, MFEM_VERIFY.
static const int J[NumEdges][2]
static const int FaceTypes[NumFaces]
static const int NumVerts[NumGeom]
static const int Edges[NumEdges][2]
GeometryRefiner GlobGeometryRefiner
static const int NumBdrArray[NumGeom]
RefinedGeometry * Refine(Geometry::Type Geom, int Times, int ETimes=1)
static const int InvOrient[NumOrient]
static const int Orient[NumOrient][NumVert]
virtual int GetRefinementLevelFromElems(Geometry::Type geom, int Npts)
Get the Refinement level based on number of elements.
static const int Edges[NumEdges][2]
static const char * Name[NumGeom]
static const int InvOrient[NumOrient]
class H1_WedgeElement WedgeFE
static const int I[NumVert]
void CalcInverse(const DenseMatrix &a, DenseMatrix &inva)
static const int InvOrient[NumOrient]
static const int Edges[NumEdges][2]
static bool ProjectPoint(int GeomType, const IntegrationPoint &beg, IntegrationPoint &end)
Project a point end, onto the given Geometry::Type, GeomType.
void GetPerfPointMat(int GeomType, DenseMatrix &pm)
class Linear3DFiniteElement TetrahedronFE
Linear2DFiniteElement TriangleFE
static const int FaceVert[NumFaces][MaxFaceVert]
static const int J[NumEdges][2]
static const int I[NumVert]
static const int FaceVert[NumFaces][NumVert]
Class for integration point with weight.
virtual int GetRefinementLevelFromPoints(Geometry::Type Geom, int Npts)
Get the Refinement level based on number of points.
static const int DimStart[MaxDim+2]
void Diag(double c, int n)
Creates n x n diagonal matrix with diagonal elements c.
static const int FaceTypes[NumFaces]
static const int FaceVert[NumFaces][NumVert]
static const int Orient[NumOrient][NumVert]
static const int Edges[NumEdges][2]
static const int Orient[NumOrient][NumVert]
static const int Orient[NumOrient][NumVert]
static bool CheckPoint(int GeomType, const IntegrationPoint &ip)
Check if the given point is inside the given reference element.
void SetSize(int s)
Change the size of the DenseMatrix to s x s.
OutStream out(std::cout)
Global stream used by the library for standard output. Initially it uses the same std::streambuf as s...
static const int I[NumVert]
static const int Orient[NumOrient][NumVert]
static const int J[NumEdges][2]