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;
206 GeomToPerfGeomJac[
CUBE]->
Diag(1.0, 3);
220 for (
int i = 0; i <
NumGeom; i++)
222 delete PerfGeomToGeomJac[i];
223 delete GeomToPerfGeomJac[i];
255 ip.
x = double(rand()) / RAND_MAX;
258 ip.
x = double(rand()) / RAND_MAX;
259 ip.
y = double(rand()) / RAND_MAX;
260 if (ip.
x + ip.
y > 1.0)
267 ip.
x = double(rand()) / RAND_MAX;
268 ip.
y = double(rand()) / RAND_MAX;
271 ip.
x = double(rand()) / RAND_MAX;
272 ip.
y = double(rand()) / RAND_MAX;
273 ip.
z = double(rand()) / RAND_MAX;
276 if (ip.
x + ip.
y > 1.0)
283 if (ip.
x + ip.
z > 1.0)
286 ip.
x = ip.
x + ip.
z - 1.0;
291 else if (ip.
x + ip.
y + ip.
z > 1.0)
295 ip.
x = 1.0 - x - ip.
z;
296 ip.
y = 1.0 - x - ip.
y;
302 ip.
x = double(rand()) / RAND_MAX;
303 ip.
y = double(rand()) / RAND_MAX;
304 ip.
z = double(rand()) / RAND_MAX;
307 ip.
x = double(rand()) / RAND_MAX;
308 ip.
y = double(rand()) / RAND_MAX;
309 ip.
z = double(rand()) / RAND_MAX;
310 if (ip.
x + ip.
y > 1.0)
317 MFEM_ABORT(
"Unknown type of reference element!");
326 inline bool NearlyEqual(
double x,
double y,
double eps)
328 return std::abs(x-y) <= eps;
333 inline bool FuzzyGT(
double x,
double y,
double eps)
335 return (x > y + eps);
340 inline bool FuzzyLT(
double x,
double y,
double eps)
342 return (x < y - eps);
353 if (ip.
x != 0.0) {
return false; }
356 if (ip.
x < 0.0 || ip.
x > 1.0) {
return false; }
359 if (ip.
x < 0.0 || ip.
y < 0.0 || ip.
x+ip.
y > 1.0) {
return false; }
362 if (ip.
x < 0.0 || ip.
x > 1.0 || ip.
y < 0.0 || ip.
y > 1.0)
366 if (ip.
x < 0.0 || ip.
y < 0.0 || ip.
z < 0.0 ||
367 ip.
x+ip.
y+ip.
z > 1.0) {
return false; }
370 if (ip.
x < 0.0 || ip.
x > 1.0 || ip.
y < 0.0 || ip.
y > 1.0 ||
371 ip.
z < 0.0 || ip.
z > 1.0) {
return false; }
374 if (ip.
x < 0.0 || ip.
y < 0.0 || ip.
x+ip.
y > 1.0 ||
375 ip.
z < 0.0 || ip.
z > 1.0) {
return false; }
378 MFEM_ABORT(
"Unknown type of reference element!");
388 if (! internal::NearlyEqual(ip.
x, 0.0, eps))
394 if ( internal::FuzzyLT(ip.
x, 0.0, eps)
395 || internal::FuzzyGT(ip.
x, 1.0, eps) )
401 if ( internal::FuzzyLT(ip.
x, 0.0, eps)
402 || internal::FuzzyLT(ip.
y, 0.0, eps)
403 || internal::FuzzyGT(ip.
x+ip.
y, 1.0, eps) )
409 if ( internal::FuzzyLT(ip.
x, 0.0, eps)
410 || internal::FuzzyGT(ip.
x, 1.0, eps)
411 || internal::FuzzyLT(ip.
y, 0.0, eps)
412 || internal::FuzzyGT(ip.
y, 1.0, eps) )
418 if ( internal::FuzzyLT(ip.
x, 0.0, eps)
419 || internal::FuzzyLT(ip.
y, 0.0, eps)
420 || internal::FuzzyLT(ip.
z, 0.0, eps)
421 || internal::FuzzyGT(ip.
x+ip.
y+ip.
z, 1.0, eps) )
427 if ( internal::FuzzyLT(ip.
x, 0.0, eps)
428 || internal::FuzzyGT(ip.
x, 1.0, eps)
429 || internal::FuzzyLT(ip.
y, 0.0, eps)
430 || internal::FuzzyGT(ip.
y, 1.0, eps)
431 || internal::FuzzyLT(ip.
z, 0.0, eps)
432 || internal::FuzzyGT(ip.
z, 1.0, eps) )
438 if ( internal::FuzzyLT(ip.
x, 0.0, eps)
439 || internal::FuzzyLT(ip.
y, 0.0, eps)
440 || internal::FuzzyGT(ip.
x+ip.
y, 1.0, eps)
441 || internal::FuzzyLT(ip.
z, 0.0, eps)
442 || internal::FuzzyGT(ip.
z, 1.0, eps) )
448 MFEM_ABORT(
"Unknown type of reference element!");
457 template <
int N,
int dim>
458 inline bool IntersectSegment(
double lbeg[N],
double lend[N],
463 for (
int i = 0; i < N; i++)
465 lbeg[i] = std::max(lbeg[i], 0.0);
469 t = std::min(t, lbeg[i]/(lbeg[i]-lend[i]));
474 if (
dim >= 1) { end.
x = t*lend[0] + (1.0-t)*lbeg[0]; }
475 if (
dim >= 2) { end.
y = t*lend[1] + (1.0-t)*lbeg[1]; }
476 if (
dim >= 3) { end.
z = t*lend[2] + (1.0-t)*lbeg[2]; }
482 inline bool ProjectTriangle(
double &x,
double &y)
487 if (y < 0.0) { y = 0.0; }
488 else if (y > 1.0) { y = 1.0; }
493 if (x > 1.0) { x = 1.0; }
497 const double l3 = 1.0-x-y;
500 if (y - x > 1.0) { x = 0.0; y = 1.0; }
501 else if (y - x < -1.0) { x = 1.0; y = 0.0; }
502 else { x += l3/2; y += l3/2; }
518 if (end.
x != 0.0) { end.
x = 0.0;
return false; }
523 if (end.
x < 0.0) { end.
x = 0.0;
return false; }
524 if (end.
x > 1.0) { end.
x = 1.0;
return false; }
529 double lend[3] = { end.
x, end.
y, 1.0-end.
x-end.
y };
530 double lbeg[3] = { beg.
x, beg.
y, 1.0-beg.
x-beg.
y };
531 return internal::IntersectSegment<3,2>(lbeg, lend, end);
535 double lend[4] = { end.
x, end.
y, 1.0-end.
x, 1.0-end.
y };
536 double lbeg[4] = { beg.
x, beg.
y, 1.0-beg.
x, 1.0-beg.
y };
537 return internal::IntersectSegment<4,2>(lbeg, lend, end);
541 double lend[4] = { end.
x, end.
y, end.
z, 1.0-end.
x-end.
y-end.
z };
542 double lbeg[4] = { beg.
x, beg.
y, beg.
z, 1.0-beg.
x-beg.
y-beg.
z };
543 return internal::IntersectSegment<4,3>(lbeg, lend, end);
547 double lend[6] = { end.
x, end.
y, end.
z,
548 1.0-end.
x, 1.0-end.
y, 1.0-end.
z
550 double lbeg[6] = { beg.
x, beg.
y, beg.
z,
551 1.0-beg.
x, 1.0-beg.
y, 1.0-beg.
z
553 return internal::IntersectSegment<6,3>(lbeg, lend, end);
557 double lend[5] = { end.
x, end.
y, end.
z, 1.0-end.
x-end.
y, 1.0-end.
z };
558 double lbeg[5] = { beg.
x, beg.
y, beg.
z, 1.0-beg.
x-beg.
y, 1.0-beg.
z };
559 return internal::IntersectSegment<5,3>(lbeg, lend, end);
562 MFEM_ABORT(
"Unknown type of reference element!");
578 if (ip.
x < 0.0) { ip.
x = 0.0;
return false; }
579 else if (ip.
x > 1.0) { ip.
x = 1.0;
return false; }
585 return internal::ProjectTriangle(ip.
x, ip.
y);
591 if (ip.
x < 0.0) { in_x =
false; ip.
x = 0.0; }
592 else if (ip.
x > 1.0) { in_x =
false; ip.
x = 1.0; }
593 else { in_x =
true; }
594 if (ip.
y < 0.0) { in_y =
false; ip.
y = 0.0; }
595 else if (ip.
y > 1.0) { in_y =
false; ip.
y = 1.0; }
596 else { in_y =
true; }
605 internal::ProjectTriangle(ip.
x, ip.
y);
611 internal::ProjectTriangle(ip.
x, ip.
z);
617 internal::ProjectTriangle(ip.
y, ip.
z);
620 const double l4 = 1.0-ip.
x-ip.
y-ip.
z;
623 const double l4_3 = l4/3;
626 internal::ProjectTriangle(ip.
x, ip.
y);
627 ip.
z = 1.0-ip.
x-ip.
y;
635 bool in_x, in_y, in_z;
636 if (ip.
x < 0.0) { in_x =
false; ip.
x = 0.0; }
637 else if (ip.
x > 1.0) { in_x =
false; ip.
x = 1.0; }
638 else { in_x =
true; }
639 if (ip.
y < 0.0) { in_y =
false; ip.
y = 0.0; }
640 else if (ip.
y > 1.0) { in_y =
false; ip.
y = 1.0; }
641 else { in_y =
true; }
642 if (ip.
z < 0.0) { in_z =
false; ip.
z = 0.0; }
643 else if (ip.
z > 1.0) { in_z =
false; ip.
z = 1.0; }
644 else { in_z =
true; }
645 return in_x && in_y && in_z;
651 in_tri = internal::ProjectTriangle(ip.
x, ip.
y);
652 if (ip.
z < 0.0) { in_z =
false; ip.
z = 0.0; }
653 else if (ip.
z > 1.0) { in_z =
false; ip.
z = 1.0; }
654 else { in_z =
true; }
655 return in_tri && in_z;
659 MFEM_ABORT(
"Reference element type is not supported!");
679 pm(0,0) = 0.0; pm(1,0) = 0.0;
680 pm(0,1) = 1.0; pm(1,1) = 0.0;
681 pm(0,2) = 0.5; pm(1,2) = 0.86602540378443864676;
688 pm(0,0) = 0.0; pm(1,0) = 0.0;
689 pm(0,1) = 1.0; pm(1,1) = 0.0;
690 pm(0,2) = 1.0; pm(1,2) = 1.0;
691 pm(0,3) = 0.0; pm(1,3) = 1.0;
698 pm(0,0) = 0.0; pm(1,0) = 0.0; pm(2,0) = 0.0;
699 pm(0,1) = 1.0; pm(1,1) = 0.0; pm(2,1) = 0.0;
700 pm(0,2) = 0.5; pm(1,2) = 0.86602540378443864676; pm(2,2) = 0.0;
701 pm(0,3) = 0.5; pm(1,3) = 0.28867513459481288225;
702 pm(2,3) = 0.81649658092772603273;
709 pm(0,0) = 0.0; pm(1,0) = 0.0; pm(2,0) = 0.0;
710 pm(0,1) = 1.0; pm(1,1) = 0.0; pm(2,1) = 0.0;
711 pm(0,2) = 1.0; pm(1,2) = 1.0; pm(2,2) = 0.0;
712 pm(0,3) = 0.0; pm(1,3) = 1.0; pm(2,3) = 0.0;
713 pm(0,4) = 0.0; pm(1,4) = 0.0; pm(2,4) = 1.0;
714 pm(0,5) = 1.0; pm(1,5) = 0.0; pm(2,5) = 1.0;
715 pm(0,6) = 1.0; pm(1,6) = 1.0; pm(2,6) = 1.0;
716 pm(0,7) = 0.0; pm(1,7) = 1.0; pm(2,7) = 1.0;
723 pm(0,0) = 0.0; pm(1,0) = 0.0; pm(2,0) = 0.0;
724 pm(0,1) = 1.0; pm(1,1) = 0.0; pm(2,1) = 0.0;
725 pm(0,2) = 0.5; pm(1,2) = 0.86602540378443864676; pm(2,2) = 0.0;
726 pm(0,3) = 0.0; pm(1,3) = 0.0; pm(2,3) = 1.0;
727 pm(0,4) = 1.0; pm(1,4) = 0.0; pm(2,4) = 1.0;
728 pm(0,5) = 0.5; pm(1,5) = 0.86602540378443864676; pm(2,5) = 1.0;
733 mfem_error (
"Geometry::GetPerfPointMat (...)");
740 if (PerfGeomToGeomJac[GeomType])
742 Mult(J, *PerfGeomToGeomJac[GeomType], PJ);
753 { POINT, SEGMENT, TRIANGLE, TETRAHEDRON, NUM_GEOMETRIES };
781 {0, 1, 2}, {1, 0, 2}, {2, 0, 1},
782 {2, 1, 0}, {1, 2, 0}, {0, 2, 1}
793 {{1, 0}, {3, -4}, {2, 1}, {3, 2}};
799 {0, 1, 2, 3}, {0, 3, 2, 1}, {1, 2, 3, 0}, {1, 0, 3, 2},
800 {2, 3, 0, 1}, {2, 1, 0, 3}, {3, 0, 1, 2}, {3, 2, 1, 0}
807 {{0, 1}, {0, 2}, {0, 3}, {1, 2}, {1, 3}, {2, 3}};
816 {{1, 2, 3}, {0, 3, 2}, {0, 1, 3}, {0, 2, 1}};
822 {1, 0}, {2, 1}, {3, 2},
830 {0, 1}, {1, 2}, {3, 2}, {0, 3}, {4, 5}, {5, 6},
831 {7, 6}, {4, 7}, {0, 4}, {1, 5}, {2, 6}, {3, 7}
842 {3, 2, 1, 0}, {0, 1, 5, 4}, {1, 2, 6, 5},
843 {2, 3, 7, 6}, {3, 0, 4, 7}, {4, 5, 6, 7}
850 {1, 0}, {3, 3}, {4, 8},
861 {{0, 1}, {1, 2}, {2, 0}, {3, 4}, {4, 5}, {5, 3}, {0, 3}, {1, 4}, {2, 5}};
870 {{0, 2, 1, -1}, {3, 4, 5, -1}, {0, 1, 4, 3}, {1, 2, 5, 4}, {2, 0, 3, 5}};
876 {1, 0}, {2, -3}, {3, 6},
893 for (
int j = 0; j < RGeom[i].Size(); j++) {
delete RGeom[i][j]; }
894 for (
int j = 0; j < IntPts[i].Size(); j++) {
delete IntPts[i][j]; }
899 int Times,
int ETimes,
903 for (
int i = 0; i < RGA.
Size(); i++)
914 IntegrationRule *GeometryRefiner::FindInIntPts(
Geometry::Type Geom,
int NPts)
916 Array<IntegrationRule *> &IPA = IntPts[Geom];
917 for (
int i = 0; i < IPA.Size(); i++)
919 IntegrationRule &ir = *IPA[i];
920 if (ir.GetNPoints() == NPts) {
return &ir; }
926 int Times,
int ETimes)
930 Times = std::max(Times, 1);
931 ETimes = std::max(ETimes, 1);
935 if (RG) {
return RG; }
958 for (i = 0; i <= Times; i++)
964 for (i = 0; i < Times; i++)
977 3*Times*(ETimes+1), 3*Times);
981 for (k = j = 0; j <= Times; j++)
982 for (i = 0; i <= Times-j; i++, k++)
985 ip.
x = cp[i]/(cp[i] + cp[j] + cp[Times-i-j]);
986 ip.
y = cp[j]/(cp[i] + cp[j] + cp[Times-i-j]);
989 for (l = k = j = 0; j < Times; j++, k++)
990 for (i = 0; i < Times-j; i++, k++)
994 G[l++] = k+Times-j+1;
998 G[l++] = k+Times-j+2;
999 G[l++] = k+Times-j+1;
1005 for (k = 0; k < Times; k += Times/ETimes)
1007 int < = (k == 0) ? lb : li;
1008 j = k*(Times+1)-((k-1)*k)/2;
1009 for (i = 0; i < Times-k; i++)
1016 for (k = Times; k > 0; k -= Times/ETimes)
1018 int < = (k == Times) ? lb : li;
1020 for (i = 0; i < k; i++)
1022 E[lt++] = j; j += Times-i;
1027 for (k = 0; k < Times; k += Times/ETimes)
1029 int < = (k == 0) ? lb : li;
1031 for (i = 0; i < Times-k; i++)
1033 E[lt++] = j; j += Times-i+1;
1045 4*(ETimes+1)*Times, 4*Times);
1049 for (k = j = 0; j <= Times; j++)
1050 for (i = 0; i <= Times; i++, k++)
1057 for (l = k = j = 0; j < Times; j++, k++)
1058 for (i = 0; i < Times; i++, k++)
1068 for (k = 0; k <= Times; k += Times/ETimes)
1070 int < = (k == 0 || k == Times) ? lb : li;
1071 for (i = 0, j = k*(Times+1); i < Times; i++)
1078 for (k = Times; k >= 0; k -= Times/ETimes)
1080 int < = (k == Times || k == 0) ? lb : li;
1081 for (i = 0, j = k; i < Times; i++)
1083 E[lt++] = j; j += Times+1;
1095 8*Times*Times*Times, 0);
1099 for (l = k = 0; k <= Times; k++)
1100 for (j = 0; j <= Times; j++)
1101 for (i = 0; i <= Times; i++, l++)
1109 for (l = k = 0; k < Times; k++)
1110 for (j = 0; j < Times; j++)
1111 for (i = 0; i < Times; i++)
1113 G[l++] = i+0 + (j+0 + (k+0) * (Times+1)) * (Times+1);
1114 G[l++] = i+1 + (j+0 + (k+0) * (Times+1)) * (Times+1);
1115 G[l++] = i+1 + (j+1 + (k+0) * (Times+1)) * (Times+1);
1116 G[l++] = i+0 + (j+1 + (k+0) * (Times+1)) * (Times+1);
1117 G[l++] = i+0 + (j+0 + (k+1) * (Times+1)) * (Times+1);
1118 G[l++] = i+1 + (j+0 + (k+1) * (Times+1)) * (Times+1);
1119 G[l++] = i+1 + (j+1 + (k+1) * (Times+1)) * (Times+1);
1120 G[l++] = i+0 + (j+1 + (k+1) * (Times+1)) * (Times+1);
1142 const int n = Times;
1151 for (k = 0; k <= n; k++)
1152 for (j = 0; j <= k; j++)
1153 for (i = 0; i <= j; i++)
1161 double w = cp[k-j] + cp[i] + cp[j-i] + cp[Times-k];
1165 l = i + (j + k * (n+1)) * (n+1);
1169 if (m != (n+3)*(n+2)*(n+1)/6)
1171 mfem_error(
"GeometryRefiner::Refine() for TETRAHEDRON #1");
1176 for (k = 0; k < n; k++)
1177 for (j = 0; j <= k; j++)
1178 for (i = 0; i <= j; i++)
1188 G[m++] = vi[i+0 + (j+0 + (k+0) * (n+1)) * (n+1)];
1189 G[m++] = vi[i+0 + (j+0 + (k+1) * (n+1)) * (n+1)];
1190 G[m++] = vi[i+1 + (j+1 + (k+1) * (n+1)) * (n+1)];
1191 G[m++] = vi[i+0 + (j+1 + (k+1) * (n+1)) * (n+1)];
1195 G[m++] = vi[i+0 + (j+0 + (k+0) * (n+1)) * (n+1)];
1196 G[m++] = vi[i+1 + (j+1 + (k+1) * (n+1)) * (n+1)];
1197 G[m++] = vi[i+0 + (j+1 + (k+0) * (n+1)) * (n+1)];
1198 G[m++] = vi[i+0 + (j+1 + (k+1) * (n+1)) * (n+1)];
1200 G[m++] = vi[i+0 + (j+0 + (k+0) * (n+1)) * (n+1)];
1201 G[m++] = vi[i+0 + (j+1 + (k+0) * (n+1)) * (n+1)];
1202 G[m++] = vi[i+1 + (j+1 + (k+1) * (n+1)) * (n+1)];
1203 G[m++] = vi[i+1 + (j+1 + (k+0) * (n+1)) * (n+1)];
1208 G[m++] = vi[i+0 + (j+0 + (k+0) * (n+1)) * (n+1)];
1209 G[m++] = vi[i+1 + (j+0 + (k+0) * (n+1)) * (n+1)];
1210 G[m++] = vi[i+1 + (j+1 + (k+1) * (n+1)) * (n+1)];
1211 G[m++] = vi[i+1 + (j+0 + (k+1) * (n+1)) * (n+1)];
1215 G[m++] = vi[i+0 + (j+0 + (k+0) * (n+1)) * (n+1)];
1216 G[m++] = vi[i+1 + (j+1 + (k+1) * (n+1)) * (n+1)];
1217 G[m++] = vi[i+1 + (j+0 + (k+0) * (n+1)) * (n+1)];
1218 G[m++] = vi[i+1 + (j+1 + (k+0) * (n+1)) * (n+1)];
1221 G[m++] = vi[i+0 + (j+0 + (k+0) * (n+1)) * (n+1)];
1222 G[m++] = vi[i+1 + (j+1 + (k+1) * (n+1)) * (n+1)];
1223 G[m++] = vi[i+0 + (j+0 + (k+1) * (n+1)) * (n+1)];
1224 G[m++] = vi[i+1 + (j+0 + (k+1) * (n+1)) * (n+1)];
1229 mfem_error(
"GeometryRefiner::Refine() for TETRAHEDRON #2");
1231 for (i = 0; i < m; i++)
1234 mfem_error(
"GeometryRefiner::Refine() for TETRAHEDRON #3");
1243 const int n = Times;
1250 for (l = k = 0; k <= n; k++)
1251 for (j = 0; j <= n; j++)
1252 for (i = 0; i <= n-j; i++, l++)
1257 ip.
x = double(i) / n;
1258 ip.
y = double(j) / n;
1259 ip.
z = double(k) / n;
1263 ip.
x = cp[i]/(cp[i] + cp[j] + cp[n-i-j]);
1264 ip.
y = cp[j]/(cp[i] + cp[j] + cp[n-i-j]);
1269 if (m != (n+1)*(n+1)*(n+2)/2)
1271 mfem_error(
"GeometryRefiner::Refine() for PRISM #1");
1276 for (m = k = 0; k < n; k++)
1277 for (l = j = 0; j < n; j++, l++)
1278 for (i = 0; i < n-j; i++, l++)
1280 G[m++] = l + (k+0) * (n+1) * (n+2) / 2;
1281 G[m++] = l + 1 + (k+0) * (n+1) * (n+2) / 2;
1282 G[m++] = l - j + (2 + (k+0) * (n+2)) * (n+1) / 2;
1283 G[m++] = l + (k+1) * (n+1) * (n+2) / 2;
1284 G[m++] = l + 1 + (k+1) * (n+1) * (Times+2) / 2;
1285 G[m++] = l - j + (2 + (k+1) * (n+2)) * (n+1) / 2;
1288 G[m++] = l + 1 + (k+0) * (n+1) * (n+2)/2;
1289 G[m++] = l - j + (2 + (k+0) * (n+1)) * (n+2) / 2;
1290 G[m++] = l - j + (2 + (k+0) * (n+2)) * (n+1) / 2;
1291 G[m++] = l + 1 + (k+1) * (n+1) * (n+2) / 2;
1292 G[m++] = l - j + (2 + (k+1) * (n+1)) * (n+2) / 2;
1293 G[m++] = l - j + (2 + (k+1) * (n+2)) * (n+1) / 2;
1298 mfem_error(
"GeometryRefiner::Refine() for PRISM #2");
1300 for (i = 0; i < m; i++)
1303 mfem_error(
"GeometryRefiner::Refine() for PRISM #3");
1329 ir = FindInIntPts(Geom, Times-1);
1333 for (
int i = 1; i < Times; i++)
1336 ip.
x = double(i) / Times;
1349 ir = FindInIntPts(Geom, ((Times-1)*(Times-2))/2);
1353 for (
int k = 0, j = 1; j < Times-1; j++)
1354 for (
int i = 1; i < Times-j; i++, k++)
1357 ip.
x = double(i) / Times;
1358 ip.
y = double(j) / Times;
1371 ir = FindInIntPts(Geom, (Times-1)*(Times-1));
1375 for (
int k = 0, j = 1; j < Times; j++)
1376 for (
int i = 1; i < Times; i++, k++)
1379 ip.
x = double(i) / Times;
1380 ip.
y = double(j) / Times;
1388 mfem_error(
"GeometryRefiner::RefineInterior(...)");
1391 if (ir) { IntPts[Geom].Append(ir); }
int Size() const
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]
static const int Edges[NumEdges][2]
static const char * Name[NumGeom]
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.
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 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]