956 if (!ref_type) {
return; }
962 char remaining = ref_type & ~el.
ref_type;
986 for (
int i = 0; i < gi.
nf; i++)
988 const int* fv = gi.
faces[i];
989 Face* face =
faces.Find(no[fv[0]], no[fv[1]], no[fv[2]], no[fv[3]]);
1018 no[4], mid45, mid67, no[7], attr,
1019 fa[0], fa[1], -1, fa[3], fa[4], fa[5]);
1022 mid45, no[5], no[6], mid67, attr,
1023 fa[0], fa[1], fa[2], fa[3], -1, fa[5]);
1038 no[4], no[5], mid56, mid74, attr,
1039 fa[0], fa[1], fa[2], -1, fa[4], fa[5]);
1042 mid74, mid56, no[6], no[7], attr,
1043 fa[0], -1, fa[2], fa[3], fa[4], fa[5]);
1058 mid04, mid15, mid26, mid37, attr,
1059 fa[0], fa[1], fa[2], fa[3], fa[4], -1);
1062 no[4], no[5], no[6], no[7], attr,
1063 -1, fa[1], fa[2], fa[3], fa[4], fa[5]);
1086 no[4], mid45, midf5, mid74, attr,
1087 fa[0], fa[1], -1, -1, fa[4], fa[5]);
1090 mid45, no[5], mid56, midf5, attr,
1091 fa[0], fa[1], fa[2], -1, -1, fa[5]);
1094 midf5, mid56, no[6], mid67, attr,
1095 fa[0], -1, fa[2], fa[3], -1, fa[5]);
1098 mid74, midf5, mid67, no[7], attr,
1099 fa[0], -1, -1, fa[3], fa[4], fa[5]);
1106 CheckIsoFace(no[3], no[2], no[1], no[0], mid23, mid12, mid01, mid30, midf0);
1107 CheckIsoFace(no[4], no[5], no[6], no[7], mid45, mid56, mid67, mid74, midf5);
1125 mid04, midf1, midf3, mid37, attr,
1126 fa[0], fa[1], -1, fa[3], fa[4], -1);
1129 midf1, mid15, mid26, midf3, attr,
1130 fa[0], fa[1], fa[2], fa[3], -1, -1);
1133 mid45, no[5], no[6], mid67, attr,
1134 -1, fa[1], fa[2], fa[3], -1, fa[5]);
1137 no[4], mid45, mid67, no[7], attr,
1138 -1, fa[1], -1, fa[3], fa[4], fa[5]);
1145 CheckIsoFace(no[0], no[1], no[5], no[4], mid01, mid15, mid45, mid04, midf1);
1146 CheckIsoFace(no[2], no[3], no[7], no[6], mid23, mid37, mid67, mid26, midf3);
1164 mid04, mid15, midf2, midf4, attr,
1165 fa[0], fa[1], fa[2], -1, fa[4], -1);
1168 midf4, midf2, mid26, mid37, attr,
1169 fa[0], -1, fa[2], fa[3], fa[4], -1);
1172 no[4], no[5], mid56, mid74, attr,
1173 -1, fa[1], fa[2], -1, fa[4], fa[5]);
1176 mid74, mid56, no[6], no[7], attr,
1177 -1, -1, fa[2], fa[3], fa[4], fa[5]);
1184 CheckIsoFace(no[1], no[2], no[6], no[5], mid12, mid26, mid56, mid15, midf2);
1185 CheckIsoFace(no[3], no[0], no[4], no[7], mid30, mid04, mid74, mid37, midf4);
1214 mid04, midf1, midel, midf4, attr,
1215 fa[0], fa[1], -1, -1, fa[4], -1);
1218 midf1, mid15, midf2, midel, attr,
1219 fa[0], fa[1], fa[2], -1, -1, -1);
1222 midel, midf2, mid26, midf3, attr,
1223 fa[0], -1, fa[2], fa[3], -1, -1);
1226 midf4, midel, midf3, mid37, attr,
1227 fa[0], -1, -1, fa[3], fa[4], -1);
1230 no[4], mid45, midf5, mid74, attr,
1231 -1, fa[1], -1, -1, fa[4], fa[5]);
1234 mid45, no[5], mid56, midf5, attr,
1235 -1, fa[1], fa[2], -1, -1, fa[5]);
1238 midf5, mid56, no[6], mid67, attr,
1239 -1, -1, fa[2], fa[3], -1, fa[5]);
1242 mid74, midf5, mid67, no[7], attr,
1243 -1, -1, -1, fa[3], fa[4], fa[5]);
1245 CheckIsoFace(no[3], no[2], no[1], no[0], mid23, mid12, mid01, mid30, midf0);
1246 CheckIsoFace(no[0], no[1], no[5], no[4], mid01, mid15, mid45, mid04, midf1);
1247 CheckIsoFace(no[1], no[2], no[6], no[5], mid12, mid26, mid56, mid15, midf2);
1248 CheckIsoFace(no[2], no[3], no[7], no[6], mid23, mid37, mid67, mid26, midf3);
1249 CheckIsoFace(no[3], no[0], no[4], no[7], mid30, mid04, mid74, mid37, midf4);
1250 CheckIsoFace(no[4], no[5], no[6], no[7], mid45, mid56, mid67, mid74, midf5);
1254 MFEM_ABORT(
"invalid refinement type.");
1287 child[0] =
NewWedge(no[0], mid01, mid20,
1288 no[3], mid34, mid53, attr,
1289 fa[0], fa[1], fa[2], -1, fa[4]);
1291 child[1] =
NewWedge(mid01, no[1], mid12,
1292 mid34, no[4], mid45, attr,
1293 fa[0], fa[1], fa[2], fa[3], -1);
1295 child[2] =
NewWedge(mid20, mid12, no[2],
1296 mid53, mid45, no[5], attr,
1297 fa[0], fa[1], -1, fa[3], fa[4]);
1299 child[3] =
NewWedge(mid12, mid20, mid01,
1300 mid45, mid53, mid34, attr,
1301 fa[0], fa[1], -1, -1, -1);
1313 child[0] =
NewWedge(no[0], no[1], no[2],
1314 mid03, mid14, mid25, attr,
1315 fa[0], -1, fa[2], fa[3], fa[4]);
1317 child[1] =
NewWedge(mid03, mid14, mid25,
1318 no[3], no[4], no[5], attr,
1319 -1, fa[1], fa[2], fa[3], fa[4]);
1345 child[0] =
NewWedge(no[0], mid01, mid20,
1346 mid03, midf2, midf4, attr,
1347 fa[0], -1, fa[2], -1, fa[4]);
1349 child[1] =
NewWedge(mid01, no[1], mid12,
1350 midf2, mid14, midf3, attr,
1351 fa[0], -1, fa[2], fa[3], -1);
1353 child[2] =
NewWedge(mid20, mid12, no[2],
1354 midf4, midf3, mid25, attr,
1355 fa[0], -1, -1, fa[3], fa[4]);
1357 child[3] =
NewWedge(mid12, mid20, mid01,
1358 midf3, midf4, midf2, attr,
1359 fa[0], -1, -1, -1, -1);
1361 child[4] =
NewWedge(mid03, midf2, midf4,
1362 no[3], mid34, mid53, attr,
1363 -1, fa[1], fa[2], -1, fa[4]);
1365 child[5] =
NewWedge(midf2, mid14, midf3,
1366 mid34, no[4], mid45, attr,
1367 -1, fa[1], fa[2], fa[3], -1);
1369 child[6] =
NewWedge(midf4, midf3, mid25,
1370 mid53, mid45, no[5], attr,
1371 -1, fa[1], -1, fa[3], fa[4]);
1373 child[7] =
NewWedge(midf3, midf4, midf2,
1374 mid45, mid53, mid34, attr,
1375 -1, fa[1], -1, -1, -1);
1377 CheckIsoFace(no[0], no[1], no[4], no[3], mid01, mid14, mid34, mid03, midf2);
1378 CheckIsoFace(no[1], no[2], no[5], no[4], mid12, mid25, mid45, mid14, midf3);
1379 CheckIsoFace(no[2], no[0], no[3], no[5], mid20, mid03, mid53, mid25, midf4);
1410 -1, fa[1], fa[2], fa[3]);
1413 fa[0], -1, fa[2], fa[3]);
1416 fa[0], fa[1], -1, fa[3]);
1419 fa[0], fa[1], fa[2], -1);
1499 child[0] =
NewPyramid(no[0], mid01, midf0, mid03, mid04,
1500 attr, fa[0], fa[1], -1, -1, fa[4]);
1502 child[1] =
NewPyramid(mid01, no[1], mid12, midf0, mid14,
1503 attr, fa[0], fa[1], fa[2], -1, -1);
1505 child[2] =
NewPyramid(midf0, mid12, no[2], mid23, mid24,
1506 attr, fa[0], -1, fa[2], fa[3], -1);
1508 child[3] =
NewPyramid(mid03, midf0, mid23, no[3], mid34,
1509 attr, fa[0], -1, -1, fa[3], fa[4]);
1511 child[4] =
NewPyramid(mid24, mid14, mid04, mid34, midf0,
1512 attr, -1, -1, -1, -1, -1);
1514 child[5] =
NewPyramid(mid04, mid14, mid24, mid34, no[4],
1515 attr, -1, fa[1], fa[2], fa[3], fa[4]);
1518 attr, -1, -1, -1, fa[1]);
1521 attr, -1, -1, fa[2], -1);
1524 attr, -1, -1, fa[3], -1);
1527 attr, -1, fa[4], -1, -1);
1529 CheckIsoFace(no[3], no[2], no[1], no[0], mid23, mid12, mid01, mid03, midf0);
1537 int mid01 =
nodes.GetId(no[0], no[1]);
1538 int mid23 =
nodes.GetId(no[2], no[3]);
1541 attr, fa[0], -1, fa[2], fa[3]);
1544 attr, fa[0], fa[1], fa[2], -1);
1548 int mid12 =
nodes.GetId(no[1], no[2]);
1549 int mid30 =
nodes.GetId(no[3], no[0]);
1552 attr, fa[0], fa[1], -1, fa[3]);
1555 attr, -1, fa[1], fa[2], fa[3]);
1559 int mid01 =
nodes.GetId(no[0], no[1]);
1560 int mid12 =
nodes.GetId(no[1], no[2]);
1561 int mid23 =
nodes.GetId(no[2], no[3]);
1562 int mid30 =
nodes.GetId(no[3], no[0]);
1564 int midel =
nodes.GetId(mid01, mid23);
1567 attr, fa[0], -1, -1, fa[3]);
1570 attr, fa[0], fa[1], -1, -1);
1573 attr, -1, fa[1], fa[2], -1);
1576 attr, -1, -1, fa[2], fa[3]);
1580 MFEM_ABORT(
"Invalid refinement type.");
1590 int mid01 =
nodes.GetId(no[0], no[1]);
1591 int mid12 =
nodes.GetId(no[1], no[2]);
1592 int mid20 =
nodes.GetId(no[2], no[0]);
1594 child[0] =
NewTriangle(no[0], mid01, mid20, attr, fa[0], -1, fa[2]);
1595 child[1] =
NewTriangle(mid01, no[1], mid12, attr, fa[0], fa[1], -1);
1596 child[2] =
NewTriangle(mid20, mid12, no[2], attr, -1, fa[1], fa[2]);
1597 child[3] =
NewTriangle(mid12, mid20, mid01, attr, -1, -1, -1);
1603 int mid =
nodes.GetId(no[0], no[1]);
1604 child[0] =
NewSegment(no[0], mid, attr, fa[0], -1);
1605 child[1] =
NewSegment(mid, no[1], attr, -1, fa[1]);
1609 MFEM_ABORT(
"Unsupported element geometry.");
1613 for (
int i = 0; i < MaxElemChildren && child[i] >= 0; i++)
1626 for (
int i = 0; i < MaxElemChildren && child[i] >= 0; i++)
1635 for (
int i = 0; i < MaxElemChildren && child[i] >= 0; i++)
1644 std::memcpy(el.
child, child,
sizeof(el.
child));
4151 int ref_type = *ref_path++;
4152 int child = *ref_path++;
4160 Point mid01(pm(0), pm(1)), mid23(pm(2), pm(3));
4161 Point mid67(pm(6), pm(7)), mid45(pm(4), pm(5));
4166 pm(4), mid45, mid67, pm(7));
4168 else if (child == 1)
4171 mid45, pm(5), pm(6), mid67);
4174 else if (ref_type == 2)
4176 Point mid12(pm(1), pm(2)), mid30(pm(3), pm(0));
4177 Point mid56(pm(5), pm(6)), mid74(pm(7), pm(4));
4182 pm(4), pm(5), mid56, mid74);
4184 else if (child == 1)
4187 mid74, mid56, pm(6), pm(7));
4190 else if (ref_type == 4)
4192 Point mid04(pm(0), pm(4)), mid15(pm(1), pm(5));
4193 Point mid26(pm(2), pm(6)), mid37(pm(3), pm(7));
4198 mid04, mid15, mid26, mid37);
4200 else if (child == 1)
4203 pm(4), pm(5), pm(6), pm(7));
4206 else if (ref_type == 3)
4208 Point mid01(pm(0), pm(1)), mid12(pm(1), pm(2));
4209 Point mid23(pm(2), pm(3)), mid30(pm(3), pm(0));
4210 Point mid45(pm(4), pm(5)), mid56(pm(5), pm(6));
4211 Point mid67(pm(6), pm(7)), mid74(pm(7), pm(4));
4213 Point midf0(mid23, mid12, mid01, mid30);
4214 Point midf5(mid45, mid56, mid67, mid74);
4219 pm(4), mid45, midf5, mid74);
4221 else if (child == 1)
4224 mid45, pm(5), mid56, midf5);
4226 else if (child == 2)
4229 midf5, mid56, pm(6), mid67);
4231 else if (child == 3)
4234 mid74, midf5, mid67, pm(7));
4237 else if (ref_type == 5)
4239 Point mid01(pm(0), pm(1)), mid23(pm(2), pm(3));
4240 Point mid45(pm(4), pm(5)), mid67(pm(6), pm(7));
4241 Point mid04(pm(0), pm(4)), mid15(pm(1), pm(5));
4242 Point mid26(pm(2), pm(6)), mid37(pm(3), pm(7));
4244 Point midf1(mid01, mid15, mid45, mid04);
4245 Point midf3(mid23, mid37, mid67, mid26);
4250 mid04, midf1, midf3, mid37);
4252 else if (child == 1)
4255 midf1, mid15, mid26, midf3);
4257 else if (child == 2)
4260 mid45, pm(5), pm(6), mid67);
4262 else if (child == 3)
4265 pm(4), mid45, mid67, pm(7));
4268 else if (ref_type == 6)
4270 Point mid12(pm(1), pm(2)), mid30(pm(3), pm(0));
4271 Point mid56(pm(5), pm(6)), mid74(pm(7), pm(4));
4272 Point mid04(pm(0), pm(4)), mid15(pm(1), pm(5));
4273 Point mid26(pm(2), pm(6)), mid37(pm(3), pm(7));
4275 Point midf2(mid12, mid26, mid56, mid15);
4276 Point midf4(mid30, mid04, mid74, mid37);
4281 mid04, mid15, midf2, midf4);
4283 else if (child == 1)
4286 midf4, midf2, mid26, mid37);
4288 else if (child == 2)
4291 pm(4), pm(5), mid56, mid74);
4293 else if (child == 3)
4296 mid74, mid56, pm(6), pm(7));
4299 else if (ref_type == 7)
4301 Point mid01(pm(0), pm(1)), mid12(pm(1), pm(2));
4302 Point mid23(pm(2), pm(3)), mid30(pm(3), pm(0));
4303 Point mid45(pm(4), pm(5)), mid56(pm(5), pm(6));
4304 Point mid67(pm(6), pm(7)), mid74(pm(7), pm(4));
4305 Point mid04(pm(0), pm(4)), mid15(pm(1), pm(5));
4306 Point mid26(pm(2), pm(6)), mid37(pm(3), pm(7));
4308 Point midf0(mid23, mid12, mid01, mid30);
4309 Point midf1(mid01, mid15, mid45, mid04);
4310 Point midf2(mid12, mid26, mid56, mid15);
4311 Point midf3(mid23, mid37, mid67, mid26);
4312 Point midf4(mid30, mid04, mid74, mid37);
4313 Point midf5(mid45, mid56, mid67, mid74);
4315 Point midel(midf1, midf3);
4320 mid04, midf1, midel, midf4);
4322 else if (child == 1)
4325 midf1, mid15, midf2, midel);
4327 else if (child == 2)
4330 midel, midf2, mid26, midf3);
4332 else if (child == 3)
4335 midf4, midel, midf3, mid37);
4337 else if (child == 4)
4340 pm(4), mid45, midf5, mid74);
4342 else if (child == 5)
4345 mid45, pm(5), mid56, midf5);
4347 else if (child == 6)
4350 midf5, mid56, pm(6), mid67);
4352 else if (child == 7)
4355 mid74, midf5, mid67, pm(7));
4363 Point mid01(pm(0), pm(1)), mid12(pm(1), pm(2));
4364 Point mid20(pm(2), pm(0)), mid34(pm(3), pm(4));
4365 Point mid45(pm(4), pm(5)), mid53(pm(5), pm(3));
4369 pm =
PointMatrix(pm(0), mid01, mid20, pm(3), mid34, mid53);
4371 else if (child == 1)
4373 pm =
PointMatrix(mid01, pm(1), mid12, mid34, pm(4), mid45);
4375 else if (child == 2)
4377 pm =
PointMatrix(mid20, mid12, pm(2), mid53, mid45, pm(5));
4379 else if (child == 3)
4381 pm =
PointMatrix(mid12, mid20, mid01, mid45, mid53, mid34);
4384 else if (ref_type == 4)
4386 Point mid03(pm(0), pm(3)), mid14(pm(1), pm(4)), mid25(pm(2), pm(5));
4390 pm =
PointMatrix(pm(0), pm(1), pm(2), mid03, mid14, mid25);
4392 else if (child == 1)
4394 pm =
PointMatrix(mid03, mid14, mid25, pm(3), pm(4), pm(5));
4399 Point mid01(pm(0), pm(1)), mid12(pm(1), pm(2)), mid20(pm(2), pm(0));
4400 Point mid34(pm(3), pm(4)), mid45(pm(4), pm(5)), mid53(pm(5), pm(3));
4401 Point mid03(pm(0), pm(3)), mid14(pm(1), pm(4)), mid25(pm(2), pm(5));
4403 Point midf2(mid01, mid14, mid34, mid03);
4404 Point midf3(mid12, mid25, mid45, mid14);
4405 Point midf4(mid20, mid03, mid53, mid25);
4409 pm =
PointMatrix(pm(0), mid01, mid20, mid03, midf2, midf4);
4411 else if (child == 1)
4413 pm =
PointMatrix(mid01, pm(1), mid12, midf2, mid14, midf3);
4415 else if (child == 2)
4417 pm =
PointMatrix(mid20, mid12, pm(2), midf4, midf3, mid25);
4419 else if (child == 3)
4421 pm =
PointMatrix(mid12, mid20, mid01, midf3, midf4, midf2);
4423 else if (child == 4)
4425 pm =
PointMatrix(mid03, midf2, midf4, pm(3), mid34, mid53);
4427 else if (child == 5)
4429 pm =
PointMatrix(midf2, mid14, midf3, mid34, pm(4), mid45);
4431 else if (child == 6)
4433 pm =
PointMatrix(midf4, midf3, mid25, mid53, mid45, pm(5));
4435 else if (child == 7)
4437 pm =
PointMatrix(midf3, midf4, midf2, mid45, mid53, mid34);
4443 Point mid01(pm(0), pm(1)), mid23(pm(2), pm(3));
4444 Point mid03(pm(0), pm(3)), mid12(pm(1), pm(2));
4445 Point mid04(pm(0), pm(4)), mid14(pm(1), pm(4));
4446 Point mid24(pm(2), pm(4)), mid34(pm(3), pm(4));
4447 Point midf0(mid23, mid12, mid01, mid03);
4451 pm =
PointMatrix(pm(0), mid01, midf0, mid03, mid04);
4453 else if (child == 1)
4455 pm =
PointMatrix(mid01, pm(1), mid12, midf0, mid14);
4457 else if (child == 2)
4459 pm =
PointMatrix(midf0, mid12, pm(2), mid23, mid24);
4461 else if (child == 3)
4463 pm =
PointMatrix(mid03, midf0, mid23, pm(3), mid34);
4465 else if (child == 4)
4467 pm =
PointMatrix(mid24, mid14, mid04, mid34, midf0);
4469 else if (child == 5)
4471 pm =
PointMatrix(mid04, mid14, mid24, mid34, pm(4));
4473 else if (child == 6)
4477 else if (child == 7)
4481 else if (child == 8)
4485 else if (child == 9)
4492 Point mid01(pm(0), pm(1)), mid12(pm(1), pm(2)), mid02(pm(2), pm(0));
4493 Point mid03(pm(0), pm(3)), mid13(pm(1), pm(3)), mid23(pm(2), pm(3));
4499 else if (child == 1)
4503 else if (child == 2)
4507 else if (child == 3)
4511 else if (child == 4)
4515 else if (child == 5)
4519 else if (child == 6)
4523 else if (child == 7)
4532 Point mid01(pm(0), pm(1)), mid23(pm(2), pm(3));
4538 else if (child == 1)
4543 else if (ref_type == 2)
4545 Point mid12(pm(1), pm(2)), mid30(pm(3), pm(0));
4551 else if (child == 1)
4556 else if (ref_type == 3)
4558 Point mid01(pm(0), pm(1)), mid12(pm(1), pm(2));
4559 Point mid23(pm(2), pm(3)), mid30(pm(3), pm(0));
4560 Point midel(mid01, mid23);
4566 else if (child == 1)
4570 else if (child == 2)
4574 else if (child == 3)
4582 Point mid01(pm(0), pm(1)), mid12(pm(1), pm(2)), mid20(pm(2), pm(0));
4588 else if (child == 1)
4592 else if (child == 2)
4596 else if (child == 3)
4603 Point mid01(pm(0), pm(1));
4609 else if (child == 1)
4617 for (
int i = 0; i < pm.
np; i++)
4619 for (
int j = 0; j < pm(i).dim; j++)
4621 matrix(j, i) = pm(i).coord[j];