/usr/include/deal.II/base/geometry_info.h is in libdeal.ii-dev 8.1.0-6ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 | // ---------------------------------------------------------------------
// $Id: geometry_info.h 31932 2013-12-08 02:15:54Z heister $
//
// Copyright (C) 1998 - 2013 by the deal.II authors
//
// This file is part of the deal.II library.
//
// The deal.II library is free software; you can use it, redistribute
// it, and/or modify it under the terms of the GNU Lesser General
// Public License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
// The full text of the license can be found in the file LICENSE at
// the top level of the deal.II distribution.
//
// ---------------------------------------------------------------------
#ifndef __deal2__geometry_info_h
#define __deal2__geometry_info_h
#include <deal.II/base/config.h>
#include <deal.II/base/exceptions.h>
#include <deal.II/base/point.h>
DEAL_II_NAMESPACE_OPEN
/**
* A class that provides possible choices for isotropic and
* anisotropic refinement flags in the current space dimension.
*
* This general template is unused except in some weird template
* constructs. Actual is made, however, of the specializations
* <code>RefinementPossibilities@<1@></code>,
* <code>RefinementPossibilities@<2@></code>, and
* <code>RefinementPossibilities@<3@></code>.
*
* @ingroup aniso
* @author Ralf Hartmann, 2005, Wolfgang Bangerth, 2007
*/
template <int dim>
struct RefinementPossibilities
{
/**
* Possible values for refinement
* cases in the current
* dimension.
*
* Note the construction of the
* values: the lowest bit
* describes a cut of the x-axis,
* the second to lowest bit
* corresponds to a cut of the
* y-axis and the third to lowest
* bit corresponds to a cut of
* the z-axis. Thus, the
* following relations hold
* (among others):
*
* @code
* cut_xy == cut_x | cut_y
* cut_xyz == cut_xy | cut_xz
* cut_x == cut_xy & cut_xz
* @endcode
*
* Only those cuts that are
* reasonable in a given space
* dimension are offered, of
* course.
*
* In addition, the tag
* <code>isotropic_refinement</code>
* denotes isotropic refinement
* in the space dimension
* selected by the template
* argument of this class.
*/
enum Possibilities
{
no_refinement= 0,
isotropic_refinement = static_cast<unsigned char>(-1)
};
};
/**
* A class that provides possible choices for isotropic and
* anisotropic refinement flags in the current space dimension.
*
* This specialization is used for <code>dim=1</code>, where it offers
* refinement in x-direction.
*
* @ingroup aniso
* @author Ralf Hartmann, 2005, Wolfgang Bangerth, 2007
*/
template <>
struct RefinementPossibilities<1>
{
/**
* Possible values for refinement
* cases in the current
* dimension.
*
* Note the construction of the
* values: the lowest bit
* describes a cut of the x-axis,
* the second to lowest bit
* corresponds to a cut of the
* y-axis and the third to lowest
* bit corresponds to a cut of
* the z-axis. Thus, the
* following relations hold
* (among others):
*
* @code
* cut_xy == cut_x | cut_y
* cut_xyz == cut_xy | cut_xz
* cut_x == cut_xy & cut_xz
* @endcode
*
* Only those cuts that are
* reasonable in a given space
* dimension are offered, of
* course.
*
* In addition, the tag
* <code>isotropic_refinement</code>
* denotes isotropic refinement
* in the space dimension
* selected by the template
* argument of this class.
*/
enum Possibilities
{
no_refinement= 0,
cut_x = 1,
isotropic_refinement = cut_x
};
};
/**
* A class that provides possible choices for isotropic and
* anisotropic refinement flags in the current space dimension.
*
* This specialization is used for <code>dim=2</code>, where it offers
* refinement in x- and y-direction separately, as well as isotropic
* refinement in both directions at the same time.
*
* @ingroup aniso
* @author Ralf Hartmann, 2005, Wolfgang Bangerth, 2007
*/
template <>
struct RefinementPossibilities<2>
{
/**
* Possible values for refinement
* cases in the current
* dimension.
*
* Note the construction of the
* values: the lowest bit
* describes a cut of the x-axis,
* the second to lowest bit
* corresponds to a cut of the
* y-axis and the third to lowest
* bit corresponds to a cut of
* the z-axis. Thus, the
* following relations hold
* (among others):
*
* @code
* cut_xy == cut_x | cut_y
* cut_xyz == cut_xy | cut_xz
* cut_x == cut_xy & cut_xz
* @endcode
*
* Only those cuts that are
* reasonable in a given space
* dimension are offered, of
* course.
*
* In addition, the tag
* <code>isotropic_refinement</code>
* denotes isotropic refinement
* in the space dimension
* selected by the template
* argument of this class.
*/
enum Possibilities
{
no_refinement= 0,
cut_x = 1,
cut_y = 2,
cut_xy = cut_x | cut_y,
isotropic_refinement = cut_xy
};
};
/**
* A class that provides possible choices for isotropic and
* anisotropic refinement flags in the current space dimension.
*
* This specialization is used for <code>dim=3</code>, where it offers
* refinement in x-, y- and z-direction separately, as well as
* combinations of these and isotropic refinement in all directions at
* the same time.
*
* @ingroup aniso
* @author Ralf Hartmann, 2005, Wolfgang Bangerth, 2007
*/
template <>
struct RefinementPossibilities<3>
{
/**
* Possible values for refinement
* cases in the current
* dimension.
*
* Note the construction of the
* values: the lowest bit
* describes a cut of the x-axis,
* the second to lowest bit
* corresponds to a cut of the
* y-axis and the third to lowest
* bit corresponds to a cut of
* the z-axis. Thus, the
* following relations hold
* (among others):
*
* @code
* cut_xy == cut_x | cut_y
* cut_xyz == cut_xy | cut_xz
* cut_x == cut_xy & cut_xz
* @endcode
*
* Only those cuts that are
* reasonable in a given space
* dimension are offered, of
* course.
*
* In addition, the tag
* <code>isotropic_refinement</code>
* denotes isotropic refinement
* in the space dimension
* selected by the template
* argument of this class.
*/
enum Possibilities
{
no_refinement= 0,
cut_x = 1,
cut_y = 2,
cut_xy = cut_x | cut_y,
cut_z = 4,
cut_xz = cut_x | cut_z,
cut_yz = cut_y | cut_z,
cut_xyz = cut_x | cut_y | cut_z,
isotropic_refinement = cut_xyz
};
};
/**
* A class storing the possible anisotropic and isotropic refinement
* cases of an object with <code>dim</code> dimensions (for example,
* for a line <code>dim=1</code> in whatever space dimension we are,
* for a quad <code>dim=2</code>, etc.). Possible values of this class
* are the ones listed in the enumeration declared within the class.
*
* @ingroup aniso
* @author Ralf Hartmann, 2005, Wolfgang Bangerth, 2007
*/
template <int dim>
class RefinementCase : public RefinementPossibilities<dim>
{
public:
/**
* Default constructor. Initialize the
* refinement case with no_refinement.
*/
RefinementCase ();
/**
* Constructor. Take and store a
* value indicating a particular
* refinement from the list of
* possible refinements specified
* in the base class.
*/
RefinementCase (const typename RefinementPossibilities<dim>::Possibilities refinement_case);
/**
* Constructor. Take and store a
* value indicating a particular
* refinement as a bit field. To
* avoid implicit conversions to
* and from integral values, this
* constructor is marked as
* explicit.
*/
explicit RefinementCase (const unsigned char refinement_case);
/**
* Return the numeric value
* stored by this class. While
* the presence of this operator
* might seem dangerous, it is
* useful in cases where one
* would like to have code like
* <tt>switch
* (refinement_flag)... case
* RefinementCase<dim>::cut_x:
* ... </tt>, which can be
* written as <code>switch
* (static_cast@<unsigned
* char@>(refinement_flag)</code>. Another
* application is to use an
* object of the current type as
* an index into an array;
* however, this use is
* deprecated as it assumes a
* certain mapping from the
* symbolic flags defined in the
* RefinementPossibilities base
* class to actual numerical
* values (the array indices).
*/
operator unsigned char () const;
/**
* Return the union of the
* refinement flags represented
* by the current object and the
* one given as argument.
*/
RefinementCase operator | (const RefinementCase &r) const;
/**
* Return the intersection of the
* refinement flags represented
* by the current object and the
* one given as argument.
*/
RefinementCase operator & (const RefinementCase &r) const;
/**
* Return the negation of the
* refinement flags represented
* by the current object. For
* example, in 2d, if the current
* object holds the flag
* <code>cut_x</code>, then the
* returned value will be
* <code>cut_y</code>; if the
* current value is
* <code>isotropic_refinement</code>
* then the result will be
* <code>no_refinement</code>;
* etc.
*/
RefinementCase operator ~ () const;
/**
* Return the flag that
* corresponds to cutting a cell
* along the axis given as
* argument. For example, if
* <code>i=0</code> then the
* returned value is
* <tt>RefinementPossibilities<dim>::cut_x</tt>.
*/
static
RefinementCase cut_axis (const unsigned int i);
/**
* Return the amount of memory
* occupied by an object of this
* type.
*/
static std::size_t memory_consumption ();
/**
* Read or write the data of this object to or
* from a stream for the purpose of serialization
*/
template <class Archive>
void serialize(Archive &ar,
const unsigned int version);
/**
* Exception.
*/
DeclException1 (ExcInvalidRefinementCase,
int,
<< "The refinement flags given (" << arg1 << ") contain set bits that do not "
<< "make sense for the space dimension of the object to which they are applied.");
private:
/**
* Store the refinement case as a
* bit field with as many bits as
* are necessary in any given
* dimension.
*/
unsigned char value :
(dim > 0 ? dim : 1);
};
namespace internal
{
/**
* A class that provides all possible situations a face (in the
* current space dimension @p dim) might be subdivided into
* subfaces. For <code>dim=1</code> and <code>dim=2</code> they
* correspond to the cases given in
* <code>RefinementPossibilities@<dim-1@></code>. However,
* <code>SubfacePossibilities@<3@></code> includes the refinement
* cases of <code>RefinementPossibilities@<2@></code>, but
* additionally some subface possibilities a face might be subdivided
* into which occur through repeated anisotropic refinement steps
* performed on one of two neighboring cells.
*
* This general template is unused except in some weird template
* constructs. Actual is made, however, of the specializations
* <code>SubfacePossibilities@<1@></code>,
* <code>SubfacePossibilities@<2@></code> and
* <code>SubfacePossibilities@<3@></code>.
*
* @ingroup aniso
* @author Tobias Leicht 2007, Ralf Hartmann, 2008
*/
template <int dim>
struct SubfacePossibilities
{
/**
* Possible cases of faces
* being subdivided into
* subface.
*/
enum Possibilities
{
case_none = 0,
case_isotropic = static_cast<unsigned char>(-1)
};
};
/**
* A class that provides all possible situations a face (in the
* current space dimension @p dim) might be subdivided into
* subfaces.
*
* For <code>dim=0</code> we provide a dummy implementation only.
*
* @ingroup aniso
* @author Ralf Hartmann, 2008
*/
template <>
struct SubfacePossibilities<0>
{
/**
* Possible cases of faces
* being subdivided into
* subface.
*
* Dummy implementation.
*/
enum Possibilities
{
case_none = 0,
case_isotropic = case_none
};
};
/**
* A class that provides all possible situations a face (in the
* current space dimension @p dim) might be subdivided into
* subfaces.
*
* For <code>dim=1</code> there are no faces. Thereby, there are no
* subface possibilities.
*
* @ingroup aniso
* @author Ralf Hartmann, 2008
*/
template <>
struct SubfacePossibilities<1>
{
/**
* Possible cases of faces
* being subdivided into
* subface.
*
* In 1d there are no faces,
* thus no subface
* possibilities.
*/
enum Possibilities
{
case_none = 0,
case_isotropic = case_none
};
};
/**
* A class that provides all possible situations a face (in the
* current space dimension @p dim) might be subdivided into
* subfaces.
*
* This specialization is used for <code>dim=2</code>, where it offers
* the following possibilities: a face (line) being refined
* (<code>case_x</code>) or not refined (<code>case_no</code>).
*
* @ingroup aniso
* @author Ralf Hartmann, 2008
*/
template <>
struct SubfacePossibilities<2>
{
/**
* Possible cases of faces
* being subdivided into
* subface.
*
* In 2d there are following
* possibilities: a face (line)
* being refined *
* (<code>case_x</code>) or not
* refined
* (<code>case_no</code>).
*/
enum Possibilities
{
case_none = 0,
case_x = 1,
case_isotropic = case_x
};
};
/**
* A class that provides all possible situations a face (in the
* current space dimension @p dim) might be subdivided into
* subfaces.
*
* This specialization is used for dim=3, where it offers following
* possibilities: a face (quad) being refined in x- or y-direction (in
* the face-intern coordinate system) separately, (<code>case_x</code>
* or (<code>case_y</code>), and in both directions
* (<code>case_x</code> which corresponds to
* (<code>case_isotropic</code>). Additionally, it offers the
* possibilities a face can have through repeated anisotropic
* refinement steps performed on one of the two neighboring cells. It
* might be possible for example, that a face (quad) is refined with
* <code>cut_x</code> and afterwards the left child is again refined
* with <code>cut_y</code>, so that there are three active
* subfaces. Note, however, that only refinement cases are allowed
* such that each line on a face between two hexes has not more than
* one hanging node. Furthermore, it is not allowed that two
* neighboring hexes are refined such that one of the hexes refines
* the common face with <code>cut_x</code> and the other hex refines
* that face with <code>cut_y</code>. In fact,
* Triangulation::prepare_coarsening_and_refinement takes care of this
* situation and ensures that each face of a refined cell is
* completely contained in a single face of neighboring cells.
*
* The following drawings explain the SubfacePossibilities and give
* the corresponding subface numbers:
* @code
*-------*
| |
| 0 | case_none
| |
*-------*
*---*---*
| | |
| 0 | 1 | case_x
| | |
*---*---*
*---*---*
| 1 | |
*---* 2 | case_x1y
| 0 | |
*---*---*
*---*---*
| | 2 |
| 0 *---* case_x2y
| | 1 |
*---*---*
*---*---*
| 1 | 3 |
*---*---* case_x1y2y (successive refinement: first cut_x, then cut_y for both children)
| 0 | 2 |
*---*---*
*-------*
| 1 |
*-------* case_y
| 0 |
*-------*
*-------*
| 2 |
*---*---* case_y1x
| 0 | 1 |
*---*---*
*---*---*
| 1 | 2 |
*---*---* case_y2x
| 0 |
*-------*
*---*---*
| 2 | 3 |
*---*---* case_y1x2x (successive refinement: first cut_y, then cut_x for both children)
| 0 | 1 |
*---+---*
*---*---*
| 2 | 3 |
*---*---* case_xy (one isotropic refinement step)
| 0 | 1 |
*---*---*
* @endcode
*
* @ingroup aniso
* @author Tobias Leicht 2007, Ralf Hartmann, 2008
*/
template <>
struct SubfacePossibilities<3>
{
/**
* Possible cases of faces
* being subdivided into
* subface.
*
* See documentation to the
* SubfacePossibilities<3> for
* more details on the subface
* possibilities.
*/
enum Possibilities
{
case_none = 0,
case_x = 1,
case_x1y = 2,
case_x2y = 3,
case_x1y2y = 4,
case_y = 5,
case_y1x = 6,
case_y2x = 7,
case_y1x2x = 8,
case_xy = 9,
case_isotropic = case_xy
};
};
/**
* A class that provides all possible cases a face (in the
* current space dimension @p dim) might be subdivided into
* subfaces.
*
* @ingroup aniso
* @author Ralf Hartmann, 2008
*/
template <int dim>
class SubfaceCase : public SubfacePossibilities<dim>
{
public:
/**
* Constructor. Take and store
* a value indicating a
* particular subface
* possibility in the list of
* possible situations
* specified in the base class.
*/
SubfaceCase (const typename SubfacePossibilities<dim>::Possibilities subface_possibility);
/**
* Return the numeric value
* stored by this class. While
* the presence of this operator
* might seem dangerous, it is
* useful in cases where one
* would like to have code like
* <code>switch
* (subface_case)... case
* SubfaceCase::case_x:
* ... </code>, which can be
* written as <code>switch
* (static_cast@<unsigned
* char@>(subface_case)</code>. Another
* application is to use an
* object of the current type as
* an index into an array;
* however, this use is
* deprecated as it assumes a
* certain mapping from the
* symbolic flags defined in the
* SubfacePossibilities
* base class to actual numerical
* values (the array indices).
*/
operator unsigned char () const;
/**
* Return the amount of memory
* occupied by an object of this
* type.
*/
static std::size_t memory_consumption ();
/**
* Exception.
*/
DeclException1 (ExcInvalidSubfaceCase,
int,
<< "The subface case given (" << arg1 << ") does not make sense "
<< "for the space dimension of the object to which they are applied.");
private:
/**
* Store the refinement case as a
* bit field with as many bits as
* are necessary in any given
* dimension.
*/
unsigned char value :
(dim == 3 ? 4 : 1);
};
} // namespace internal
template <int dim> struct GeometryInfo;
/**
* Topological description of zero dimensional cells,
* i.e. points. This class might not look too useful but often is if
* in a certain dimension we would like to enquire information about
* objects with dimension one lower than the present, e.g. about
* faces.
*
* This class contains as static members information on vertices and
* faces of a @p dim-dimensional grid cell. The interface is the same
* for all dimensions. If a value is of no use in a low dimensional
* cell, it is (correctly) set to zero, e.g. #max_children_per_face in
* 1d.
*
* This information should always replace hard-coded numbers of
* vertices, neighbors and so on, since it can be used dimension
* independently.
*
* @ingroup grid geomprimitives aniso
* @author Wolfgang Bangerth, 1998
*/
template <>
struct GeometryInfo<0>
{
/**
* Maximum number of children of
* a cell, i.e. the number of
* children of an isotropically
* refined cell.
*
* If a cell is refined
* anisotropically, the actual
* number of children may be less
* than the value given here.
*/
static const unsigned int max_children_per_cell = 1;
/**
* Number of faces a cell has.
*/
static const unsigned int faces_per_cell = 0;
/**
* Maximum number of children of
* a refined face, i.e. the
* number of children of an
* isotropically refined face.
*
* If a cell is refined
* anisotropically, the actual
* number of children may be less
* than the value given here.
*/
static const unsigned int max_children_per_face = 0;
/**
* Return the number of children
* of a cell (or face) refined
* with <tt>ref_case</tt>. Since
* we are concerned here with
* points, the number of children
* is equal to one.
*/
static unsigned int n_children(const RefinementCase<0> &refinement_case);
/**
* Number of vertices a cell has.
*/
static const unsigned int vertices_per_cell = 1;
/**
* Number of vertices each face has.
* Since this is not useful in one
* dimension, we provide a useless
* number (in the hope that a compiler
* may warn when it sees constructs like
* <tt>for (i=0; i<vertices_per_face; ++i)</tt>,
* at least if @p i is an <tt>unsigned int</tt>.
*/
static const unsigned int vertices_per_face = 0;
/**
* Number of lines each face has.
*/
static const unsigned int lines_per_face = 0;
/**
* Number of quads on each face.
*/
static const unsigned int quads_per_face = 0;
/**
* Number of lines of a cell.
*/
static const unsigned int lines_per_cell = 0;
/**
* Number of quadrilaterals of a
* cell.
*/
static const unsigned int quads_per_cell = 0;
/**
* Number of hexahedra of a
* cell.
*/
static const unsigned int hexes_per_cell = 0;
};
/**
* This class provides dimension independent information to all topological
* structures that make up the unit, or
* @ref GlossReferenceCell "reference cell".
*
* It is the one central point in the library where information about the
* numbering of vertices, lines, or faces of the reference cell is
* collected. Consequently, the information of this class is used extensively
* in the geometric description of Triangulation objects, as well as in
* various other parts of the code. In particular, it also serves as the focus
* of writing code in a dimension independent way; for example, instead of
* writing a loop over vertices 0<=v<4 in 2d, one would write it as
* 0<=v<GeometryInfo<dim>::vertices_per_cell, thus allowing the code to work
* in 3d as well without changes.
*
* The most frequently used parts of the class are its static members like
* vertices_per_cell, faces_per_cell, etc. However, the class also offers
* information about more abstract questions like the orientation of faces,
* etc. The following documentation gives a textual description of many of
* these concepts.
*
*
* <h3>Implementation conventions for two spatial dimensions</h3>
*
* From version 5.2 onwards deal.II is based on a numbering scheme
* that uses a lexicographic ordering (with x running fastest)
* wherever possible, hence trying to adopt a kind of 'canonical'
* ordering.
*
* The ordering of vertices and faces (lines) in 2d is defined by
*
* - Vertices are numbered in lexicographic ordering
*
* - Faces (lines in 2d): first the two faces with normals in x-
* and then y-direction. For each two faces: first the face with
* normal in negative coordinate direction, then the one with normal
* in positive direction, i.e. the faces are ordered according to
* their normals pointing in -x, x, -y, y direction.
*
* - The direction of a line is represented by the direction of
* point 0 towards point 1 and is always in one of the coordinate
* directions
*
* - Face lines in 3d are ordered, such that the induced 2d local
* coordinate system (x,y) implies (right hand rule) a normal in
* face normal direction, see N2/.
*
* The resulting numbering of vertices and faces (lines) in 2d as
* well as the directions of lines is shown in the following.
* @verbatim
* 3
* 2-->--3
* | |
* 0^ ^1
* | |
* 0-->--1
* 2
* @endverbatim
*
* Note that the orientation of lines has to be correct upon construction of a
* grid; however, it is automatically preserved upon refinement.
*
* Further we define that child lines have the same direction as their parent,
* i.e. that <tt>line->child(0)->vertex(0)==line->vertex(0)</tt> and
* <tt>line->child(1)->vertex(1)==line->vertex(1)</tt>. This also implies,
* that the first sub-line (<tt>line->child(0)</tt>) is the one at vertex(0)
* of the old line.
*
* Similarly we define, that the four children of a quad are adjacent to the
* vertex with the same number of the old quad.
*
* Note that information about several of these conventions can be
* extracted at run- or compile-time from the member functions and
* variables of the present class.
*
*
* <h4>Coordinate systems</h4>
*
* When explicit coordinates are required for points in a cell (e.g for
* quadrature formulae or the point of definition of trial functions), we
* define the following coordinate system for the unit cell:
* @verbatim
* y^ 2-----3
* | | |
* | | |
* | | |
* | 0-----1
* *------------>x
* @endverbatim
*
* Here, vertex 0 is the origin of the coordinate system, vertex 1 has
* coordinates <tt>(1,0)</tt>, vertex 2 at <tt>(0,1)</tt> and vertex 3 at
* <tt>(1,1)</tt>. The GeometryInfo<dim>::unit_cell_vertex() function can be
* used to query this information at run-time.
*
*
* <h3>Implementation conventions for three spatial dimensions</h3>
*
* By convention, we will use the following numbering conventions
* for vertices, lines and faces of hexahedra in three space
* dimensions. Before giving these conventions we declare the
* following sketch to be the standard way of drawing 3d pictures of
* hexahedra:
* @verbatim
* *-------* *-------*
* /| | / /|
* / | | / / |
* z / | | / / |
* ^ * | | *-------* |
* | ^y | *-------* | | *
* | / | / / | | /
* | / | / / | | /
* |/ |/ / | |/
* *------>x *-------* *-------*
* @endverbatim
* The left part of the picture shows the left, bottom and back face of the
* cube, while the right one shall be the top, right and front face. You may
* recover the whole cube by moving the two parts together into one.
*
* Note again that information about several of the following
* conventions can be extracted at run- or compile-time from the
* member functions and variables of the present class.
*
* <h4>Vertices</h4>
*
* The ordering of vertices in 3d is defined by the same rules as in
* the 2d case. In particular, the following is still true:
*
* - Vertices are numbered in lexicographic ordering.
*
* Hence, the vertices are numbered as follows
* @verbatim
* 6-------7 6-------7
* /| | / /|
* / | | / / |
* / | | / / |
* 4 | | 4-------5 |
* | 2-------3 | | 3
* | / / | | /
* | / / | | /
* |/ / | |/
* 0-------1 0-------1
* @endverbatim
*
* We note, that first the vertices on the bottom face (z=0) are numbered
* exactly the same way as are the vertices on a quadrilateral. Then the
* vertices on the top face (z=1) are numbered similarly by moving the bottom
* face to the top. Again, the GeometryInfo<dim>::unit_cell_vertex() function
* can be used to query this information at run-time.
*
*
* <h4>Lines</h4>
*
* Here, the same holds as for the vertices:
*
* - Line ordering in 3d:
* <ul>
* <li>first the lines of face (z=0) in 2d line ordering,
* <li>then the lines of face (z=1) in 2d line ordering,
* <li>finally the lines in z direction in lexicographic ordering
* </ul>
* @verbatim
* *---7---* *---7---*
* /| | / /|
* 4 | 11 4 5 11
* / 10 | / / |
* * | | *---6---* |
* | *---3---* | | *
* | / / | 9 /
* 8 0 1 8 | 1
* |/ / | |/
* *---2---* *---2---*
* @endverbatim
* As in 2d lines are directed in coordinate directions.
* @verbatim
* *--->---* *--->---*
* /| | / /|
* ^ | ^ ^ ^ ^
* / ^ | / / |
* * | | *--->---* |
* | *--->---* | | *
* | / / | ^ /
* ^ ^ ^ ^ | ^
* |/ / | |/
* *--->---* *--->---*
* @endverbatim
*
* The fact that edges (just as vertices and faces) are entities that
* are stored in their own right rather than constructed from cells
* each time they are needed, means that adjacent cells actually have
* pointers to edges that are thus shared between them. This implies
* that the convention that sets of parallel edges have parallel
* directions is not only a local condition. Before a list of cells is
* passed to an object of the Triangulation class for creation of a
* triangulation, you therefore have to make sure that cells are
* oriented in a compatible fashion, so that edge directions are
* globally according to above convention. However, the GridReordering
* class can do this for you, by reorienting cells and edges of an
* arbitrary list of input cells that need not be already sorted.
*
* <h4>Faces</h4>
*
* The numbering of faces in 3d is defined by a rule analogous to 2d:
*
* - Faces (quads in 3d): first the two faces with normals in x-,
* then y- and z-direction. For each two faces: first the face with
* normal in negative coordinate direction, then the one with normal
* in positive direction, i.e. the faces are ordered according to
* their normals pointing in -x, x, -y, y, -z, z direction.
*
* Therefore, the faces are numbered in the ordering: left, right,
* front, back, bottom and top face:
* @verbatim
* *-------* *-------*
* /| | / /|
* / | 3 | / 5 / |
* / | | / / |
* * | | *-------* |
* | 0 *-------* | | 1 *
* | / / | | /
* | / 4 / | 2 | /
* |/ / | |/
* *-------* *-------*
* @endverbatim
*
* The <em>standard</em> direction of the faces is such, that the
* induced 2d local coordinate system (x,y) implies (right hand
* rule) a normal in face normal direction, see N2a). In the
* following we show the local coordinate system and the numbering
* of face lines:
* <ul>
* <li> Faces 0 and 1:
* @verbatim
* Face 0 Face 1
* *-------* *-------*
* /| | / /|
* 3 1 | / 3 1
* y/ | | / y/ |
* * |x | *-------* |x
* | *-------* | | *
* 0 / / | 0 /
* | 2 / | | 2
* |/ / | |/
* *-------* *-------*
* @endverbatim
*
* <li> Faces 2 and 3:
* @verbatim
* x Face 3 Face 2
* *---1---* *-------*
* /| | / /|
* / | 3 / / |
* / 2 | x/ / |
* * | | *---1---* |
* | *---0---*y | | *
* | / / | 3 /
* | / / 2 | /
* |/ / | |/
* *-------* *---0---*y
* @endverbatim
*
* <li> Faces 4 and 5:
* @verbatim
* Face 4 y Face 5
* *-------* *---3---*
* /| | / /|
* / | | 0 1 |
* / | | / / |
* * |y | *---2---* x |
* | *---3---* | | *
* | / / | | /
* | 0 1 | | /
* |/ / | |/
* *---2---* x *-------*
* @endverbatim
* </ul>
*
* The face line numbers (0,1,2,3) correspond to following cell line
* numbers.
* <ul>
* <li> Face 0: lines 8, 10, 0, 4;
* <li> Face 1: lines 9, 11, 1, 5;
* <li> Face 2: lines 2, 6, 8, 9;
* <li> Face 3: lines 3, 7, 10, 11;
* <li> Face 4: lines 0, 1, 2, 3;
* <li> Face 5: lines 4, 5, 6, 7;
* </ul>
* You can get these numbers using the
* GeometryInfo<3>::face_to_cell_lines() function.
*
* The face normals can be deduced from the face orientation by
* applying the right hand side rule (x,y -> normal). We note, that
* in the standard orientation of faces in 2d, faces 0 and 2 have
* normals that point into the cell, and faces 1 and 3 have normals
* pointing outward. In 3d, faces 0, 2, and 4
* have normals that point into the cell, while the normals of faces
* 1, 3, and 5 point outward. This information, again, can be queried from
* GeometryInfo<dim>::unit_normal_orientation.
*
* However, it turns out that a significant number of 3d meshes cannot
* satisfy this convention. This is due to the fact that the face
* convention for one cell already implies something for the
* neighbor, since they share a common face and fixing it for the
* first cell also fixes the normal vectors of the opposite faces of
* both cells. It is easy to construct cases of loops of cells for
* which this leads to cases where we cannot find orientations for
* all faces that are consistent with this convention.
*
* For this reason, above convention is only what we call the <em>standard
* orientation</em>. deal.II actually allows faces in 3d to have either the
* standard direction, or its opposite, in which case the lines that make up a
* cell would have reverted orders, and the above line equivalences would not
* hold any more. You can ask a cell whether a given face has standard
* orientation by calling <tt>cell->face_orientation(face_no)</tt>: if the
* result is @p true, then the face has standard orientation, otherwise its
* normal vector is pointing the other direction. There are not very many
* places in application programs where you need this information actually,
* but a few places in the library make use of this. Note that in 2d, the
* result is always @p true. More information on the topic can be found in this
* @ref GlossFaceOrientation "glossary" article.
*
* In order to allow all kinds of meshes in 3d, including
* <em>Moebius</em>-loops, a face might even be rotated looking
* from one cell, whereas it is according to the standard looking at it from the
* neighboring cell sharing that particular face. In order to cope with this,
* two flags <tt>face_flip</tt> and <tt>face_rotation</tt> are available, to
* represent rotations by 180 and 90 degree, respectively. Setting both flags
* amounts to a rotation of 270 degrees (all counterclockwise). You can ask
* the cell for these flags like for the <tt>face_orientation</tt>. In order to
* enable rotated faces, even lines can deviate from their standard direction in
* 3d. This information is available as the <tt>line_orientation</tt> flag for
* cells and faces in 3d. Again, this is something that should be internal to
* the library and application program will probably never have to bother about
* it. For more information on this see also
* @ref GlossFaceOrientation "this glossary entry" .
*
*
* <h4>Children</h4>
*
* The eight children of an isotropically refined cell are numbered according to
* the vertices they are adjacent to:
* @verbatim
* *----*----* *----*----*
* /| 6 | 7 | / 6 / 7 /|
* *6| | | *----*----*7|
* /| *----*----* / 4 / 5 /| *
* * |/| | | *----*----* |/|
* |4* | 2 | 3 | | 4 | 5 |5*3|
* |/|2*----*----* | | |/| *
* * |/ 2 / 3 / *----*----* |/
* |0*----*----* | | |1*
* |/0 / 1 / | 0 | 1 |/
* *----*----* *----*----*
* @endverbatim
*
* Taking into account the orientation of the faces, the following
* children are adjacent to the respective faces:
* <ul>
* <li> Face 0: children 0, 2, 4, 6;
* <li> Face 1: children 1, 3, 5, 7;
* <li> Face 2: children 0, 4, 1, 5;
* <li> Face 3: children 2, 6, 3, 7;
* <li> Face 4: children 0, 1, 2, 3;
* <li> Face 5: children 4, 5, 6, 7.
* </ul>
* You can get these numbers using the
* GeometryInfo<3>::child_cell_on_face() function. As each child is
* adjacent to the vertex with the same number these numbers are
* also given by the GeometryInfo<3>::face_to_cell_vertices()
* function.
*
* Note that, again, the above list only holds for faces in their
* standard orientation. If a face is not in standard orientation,
* then the children at positions 1 and 2 (counting from 0 to 3)
* would be swapped. In fact, this is what the child_cell_on_face
* and the face_to_cell_vertices functions of GeometryInfo<3> do,
* when invoked with a <tt>face_orientation=false</tt> argument.
*
* The information which child cell is at which position of which face
* is most often used when computing jump terms across faces with
* hanging nodes, using objects of type FESubfaceValues. Sitting on
* one cell, you would look at a face and figure out which child of
* the neighbor is sitting on a given subface between the present and
* the neighboring cell. To avoid having to query the standard
* orientation of the faces of the two cells every time in such cases,
* you should use a function call like
* <tt>cell->neighbor_child_on_subface(face_no,subface_no)</tt>, which
* returns the correct result both in 2d (where face orientations are
* immaterial) and 3d (where it is necessary to use the face
* orientation as additional argument to
* <tt>GeometryInfo<3>::child_cell_on_face</tt>).
*
* For anisotropic refinement, the child cells can not be numbered according to
* adjacent vertices, thus the following conventions are used:
* @verbatim
* RefinementCase<3>::cut_x
*
* *----*----* *----*----*
* /| | | / / /|
* / | | | / 0 / 1 / |
* / | 0 | 1 | / / / |
* * | | | *----*----* |
* | 0 | | | | | | 1 |
* | *----*----* | | | *
* | / / / | 0 | 1 | /
* | / 0 / 1 / | | | /
* |/ / / | | |/
* *----*----* *----*----*
* @endverbatim
*
* @verbatim
* RefinementCase<3>::cut_y
*
* *---------* *---------*
* /| | / 1 /|
* * | | *---------* |
* /| | 1 | / 0 /| |
* * |1| | *---------* |1|
* | | | | | | | |
* |0| *---------* | |0| *
* | |/ 1 / | 0 | |/
* | *---------* | | *
* |/ 0 / | |/
* *---------* *---------*
* @endverbatim
*
* @verbatim
* RefinementCase<3>::cut_z
*
* *---------* *---------*
* /| 1 | / /|
* / | | / 1 / |
* / *---------* / / *
* * 1/| | *---------* 1/|
* | / | 0 | | 1 | / |
* |/ *---------* | |/ *
* * 0/ / *---------* 0/
* | / 0 / | | /
* |/ / | 0 |/
* *---------* *---------*
* @endverbatim
*
* @verbatim
* RefinementCase<3>::cut_xy
*
* *----*----* *----*----*
* /| | | / 2 / 3 /|
* * | | | *----*----* |
* /| | 2 | 3 | / 0 / 1 /| |
* * |2| | | *----*----* |3|
* | | | | | | | | | |
* |0| *----*----* | | |1| *
* | |/ 2 / 3 / | 0 | 1 | |/
* | *----*----* | | | *
* |/ 0 / 1 / | | |/
* *----*----* *----*----*
* @endverbatim
*
* @verbatim
* RefinementCase<3>::cut_xz
*
* *----*----* *----*----*
* /| 1 | 3 | / / /|
* / | | | / 1 / 3 / |
* / *----*----* / / / *
* * 1/| | | *----*----* 3/|
* | / | 0 | 2 | | 1 | 3 | / |
* |/ *----*----* | | |/ *
* * 0/ / / *----*----* 2/
* | / 0 / 2 / | | | /
* |/ / / | 0 | 2 |/
* *----*----* *----*----*
* @endverbatim
*
* @verbatim
* RefinementCase<3>::cut_yz
*
* *---------* *---------*
* /| 3 | / 3 /|
* * | | *---------* |
* /|3*---------* / 2 /|3*
* * |/| | *---------* |/|
* |2* | 1 | | 2 |2* |
* |/|1*---------* | |/|1*
* * |/ 1 / *---------* |/
* |0*---------* | |0*
* |/ 0 / | 0 |/
* *---------* *---------*
* @endverbatim
*
* This information can also be obtained by the
* <tt>GeometryInfo<3>::child_cell_on_face</tt> function.
*
* <h4>Coordinate systems</h4>
*
* We define the following coordinate system for the explicit coordinates of
* the vertices of the unit cell:
* @verbatim
* 6-------7 6-------7
* /| | / /|
* / | | / / |
* z / | | / / |
* ^ 4 | | 4-------5 |
* | ^y | 2-------3 | | 3
* | / | / / | | /
* | / | / / | | /
* |/ |/ / | |/
* *------>x 0-------1 0-------1
* @endverbatim
*
* By the convention laid down as above, the vertices have the following
* coordinates (lexicographic, with x running fastest):
* <ul>
* <li> Vertex 0: <tt>(0,0,0)</tt>;
* <li> Vertex 1: <tt>(1,0,0)</tt>;
* <li> Vertex 2: <tt>(0,1,0)</tt>;
* <li> Vertex 3: <tt>(1,1,0)</tt>;
* <li> Vertex 4: <tt>(0,0,1)</tt>;
* <li> Vertex 5: <tt>(1,0,1)</tt>;
* <li> Vertex 6: <tt>(0,1,1)</tt>;
* <li> Vertex 7: <tt>(1,1,1)</tt>.
* </ul>
*
*
*
* @note Instantiations for this template are provided for dimensions 1,2,3,4,
* and there is a specialization for dim=0 (see the section on @ref
* Instantiations in the manual).
*
* @ingroup grid geomprimitives aniso
* @author Wolfgang Bangerth, 1998, Ralf Hartmann, 2005, Tobias Leicht, 2007
*/
template <int dim>
struct GeometryInfo
{
/**
* Maximum number of children of
* a refined cell, i.e. the
* number of children of an
* isotropically refined cell.
*
* If a cell is refined
* anisotropically, the actual
* number of children may be less
* than the value given here.
*/
static const unsigned int max_children_per_cell = 1 << dim;
/**
* Number of faces of a cell.
*/
static const unsigned int faces_per_cell = 2 * dim;
/**
* Maximum number of children of
* a refined face, i.e. the
* number of children of an
* isotropically refined face.
*
* If a cell is refined
* anisotropically, the actual
* number of children may be less
* than the value given here.
*/
static const unsigned int max_children_per_face = GeometryInfo<dim-1>::max_children_per_cell;
/**
* Number of vertices of a cell.
*/
static const unsigned int vertices_per_cell = 1 << dim;
/**
* Number of vertices on each
* face.
*/
static const unsigned int vertices_per_face = GeometryInfo<dim-1>::vertices_per_cell;
/**
* Number of lines on each face.
*/
static const unsigned int lines_per_face
= GeometryInfo<dim-1>::lines_per_cell;
/**
* Number of quads on each face.
*/
static const unsigned int quads_per_face
= GeometryInfo<dim-1>::quads_per_cell;
/**
* Number of lines of a cell.
*
* The formula to compute this makes use
* of the fact that when going from one
* dimension to the next, the object of
* the lower dimension is copied once
* (thus twice the old number of lines)
* and then a new line is inserted
* between each vertex of the old object
* and the corresponding one in the copy.
*/
static const unsigned int lines_per_cell
= (2*GeometryInfo<dim-1>::lines_per_cell +
GeometryInfo<dim-1>::vertices_per_cell);
/**
* Number of quadrilaterals of a
* cell.
*
* This number is computed recursively
* just as the previous one, with the
* exception that new quads result from
* connecting an original line and its
* copy.
*/
static const unsigned int quads_per_cell
= (2*GeometryInfo<dim-1>::quads_per_cell +
GeometryInfo<dim-1>::lines_per_cell);
/**
* Number of hexahedra of a
* cell.
*/
static const unsigned int hexes_per_cell
= (2*GeometryInfo<dim-1>::hexes_per_cell +
GeometryInfo<dim-1>::quads_per_cell);
/**
* Rearrange vertices for UCD
* output. For a cell being
* written in UCD format, each
* entry in this field contains
* the number of a vertex in
* <tt>deal.II</tt> that corresponds
* to the UCD numbering at this
* location.
*
* Typical example: write a cell
* and arrange the vertices, such
* that UCD understands them.
*
* @code
* for (i=0; i< n_vertices; ++i)
* out << cell->vertex(ucd_to_deal[i]);
* @endcode
*
* As the vertex numbering in
* deal.II versions <= 5.1
* happened to coincide with the
* UCD numbering, this field can
* also be used like a
* old_to_lexicographic mapping.
*/
static const unsigned int ucd_to_deal[vertices_per_cell];
/**
* Rearrange vertices for OpenDX
* output. For a cell being
* written in OpenDX format, each
* entry in this field contains
* the number of a vertex in
* <tt>deal.II</tt> that corresponds
* to the DX numbering at this
* location.
*
* Typical example: write a cell
* and arrange the vertices, such
* that OpenDX understands them.
*
* @code
* for (i=0; i< n_vertices; ++i)
* out << cell->vertex(dx_to_deal[i]);
* @endcode
*/
static const unsigned int dx_to_deal[vertices_per_cell];
/**
* This field stores for each vertex
* to which faces it belongs. In any
* given dimension, the number of
* faces is equal to the dimension.
* The first index in this 2D-array
* runs over all vertices, the second
* index over @p dim faces to which
* the vertex belongs.
*
* The order of the faces for
* each vertex is such that the
* first listed face bounds the
* reference cell in <i>x</i>
* direction, the second in
* <i>y</i> direction, and so on.
*/
static const unsigned int vertex_to_face[vertices_per_cell][dim];
/**
* Return the number of children
* of a cell (or face) refined
* with <tt>ref_case</tt>.
*/
static
unsigned int
n_children(const RefinementCase<dim> &refinement_case);
/**
* Return the number of subfaces
* of a face refined according to
* internal::SubfaceCase
* @p face_ref_case.
*/
static
unsigned int
n_subfaces(const internal::SubfaceCase<dim> &subface_case);
/**
* Given a face on the reference
* element with a
* <code>internal::SubfaceCase@<dim@></code>
* @p face_refinement_case this
* function returns the ratio
* between the area of the @p
* subface_no th subface and the
* area(=1) of the face.
*
* E.g. for
* internal::SubfaceCase::cut_xy
* the ratio is 1/4 for each of
* the subfaces.
*/
static
double
subface_ratio(const internal::SubfaceCase<dim> &subface_case,
const unsigned int subface_no);
/**
* Given a cell refined with the
* <code>RefinementCase</code>
* @p cell_refinement_case
* return the
* <code>SubfaceCase</code> of
* the @p face_no th face.
*/
static
RefinementCase<dim-1>
face_refinement_case (const RefinementCase<dim> &cell_refinement_case,
const unsigned int face_no,
const bool face_orientation = true,
const bool face_flip = false,
const bool face_rotation = false);
/**
* Given the SubfaceCase @p
* face_refinement_case of the @p
* face_no th face, return the
* smallest RefinementCase of the
* cell, which corresponds to
* that refinement of the face.
*/
static
RefinementCase<dim>
min_cell_refinement_case_for_face_refinement
(const RefinementCase<dim-1> &face_refinement_case,
const unsigned int face_no,
const bool face_orientation = true,
const bool face_flip = false,
const bool face_rotation = false);
/**
* Given a cell refined with the
* RefinementCase @p
* cell_refinement_case return
* the RefinementCase of the @p
* line_no th face.
*/
static
RefinementCase<1>
line_refinement_case(const RefinementCase<dim> &cell_refinement_case,
const unsigned int line_no);
/**
* Return the minimal / smallest
* RefinementCase of the cell, which
* ensures refinement of line
* @p line_no.
*/
static
RefinementCase<dim>
min_cell_refinement_case_for_line_refinement(const unsigned int line_no);
/**
* This field stores which child
* cells are adjacent to a
* certain face of the mother
* cell.
*
* For example, in 2D the layout of
* a cell is as follows:
* @verbatim
* . 3
* . 2-->--3
* . | |
* . 0 ^ ^ 1
* . | |
* . 0-->--1
* . 2
* @endverbatim
* Vertices and faces are indicated
* with their numbers, faces also with
* their directions.
*
* Now, when refined, the layout is
* like this:
* @verbatim
* *--*--*
* | 2|3 |
* *--*--*
* | 0|1 |
* *--*--*
* @endverbatim
*
* Thus, the child cells on face
* 0 are (ordered in the
* direction of the face) 0 and
* 2, on face 3 they are 2 and 3,
* etc.
*
* For three spatial dimensions, the exact
* order of the children is laid down in
* the general documentation of this
* class.
*
* Through the <tt>face_orientation</tt>,
* <tt>face_flip</tt> and
* <tt>face_rotation</tt> arguments this
* function handles faces oriented in the
* standard and non-standard orientation.
* <tt>face_orientation</tt> defaults to
* <tt>true</tt>, <tt>face_flip</tt> and
* <tt>face_rotation</tt> default to
* <tt>false</tt> (standard orientation)
* and has no effect in 2d. The concept of
* face orientations is explained in this
* @ref GlossFaceOrientation "glossary"
* entry.
*
* In the case of anisotropically refined
* cells and faces, the @p RefinementCase of
* the face, <tt>face_ref_case</tt>,
* might have an influence on
* which child is behind which given
* subface, thus this is an additional
* argument, defaulting to isotropic
* refinement of the face.
*/
static
unsigned int
child_cell_on_face (const RefinementCase<dim> &ref_case,
const unsigned int face,
const unsigned int subface,
const bool face_orientation = true,
const bool face_flip = false,
const bool face_rotation = false,
const RefinementCase<dim-1> &face_refinement_case
= RefinementCase<dim-1>::isotropic_refinement);
/**
* Map line vertex number to cell
* vertex number, i.e. give the
* cell vertex number of the
* <tt>vertex</tt>th vertex of
* line <tt>line</tt>, e.g.
* <tt>GeometryInfo<2>::line_to_cell_vertices(3,0)=2</tt>.
*
* The order of the lines, as well as
* their direction (which in turn
* determines which is the first and
* which the second vertex on a line) is
* the canonical one in deal.II, as
* described in the general documentation
* of this class.
*
* For <tt>dim=2</tt> this call
* is simply passed down to the
* face_to_cell_vertices()
* function.
*/
static
unsigned int
line_to_cell_vertices (const unsigned int line,
const unsigned int vertex);
/**
* Map face vertex number to cell
* vertex number, i.e. give the
* cell vertex number of the
* <tt>vertex</tt>th vertex of
* face <tt>face</tt>, e.g.
* <tt>GeometryInfo<2>::face_to_cell_vertices(3,0)=2</tt>,
* see the image under point N4
* in the 2d section of this
* class's documentation.
*
* Through the <tt>face_orientation</tt>,
* <tt>face_flip</tt> and
* <tt>face_rotation</tt> arguments this
* function handles faces oriented in the
* standard and non-standard orientation.
* <tt>face_orientation</tt> defaults to
* <tt>true</tt>, <tt>face_flip</tt> and
* <tt>face_rotation</tt> default to
* <tt>false</tt> (standard orientation).
* In 2d only <tt>face_flip</tt> is considered.
* See this @ref GlossFaceOrientation "glossary"
* article for more information.
*
* As the children of a cell are
* ordered according to the
* vertices of the cell, this
* call is passed down to the
* child_cell_on_face() function.
* Hence this function is simply
* a wrapper of
* child_cell_on_face() giving it
* a suggestive name.
*/
static
unsigned int
face_to_cell_vertices (const unsigned int face,
const unsigned int vertex,
const bool face_orientation = true,
const bool face_flip = false,
const bool face_rotation = false);
/**
* Map face line number to cell
* line number, i.e. give the
* cell line number of the
* <tt>line</tt>th line of face
* <tt>face</tt>, e.g.
* <tt>GeometryInfo<3>::face_to_cell_lines(5,0)=4</tt>.
*
* Through the <tt>face_orientation</tt>,
* <tt>face_flip</tt> and
* <tt>face_rotation</tt> arguments this
* function handles faces oriented in the
* standard and non-standard orientation.
* <tt>face_orientation</tt> defaults to
* <tt>true</tt>, <tt>face_flip</tt> and
* <tt>face_rotation</tt> default to
* <tt>false</tt> (standard orientation)
* and has no effect in 2d.
*/
static
unsigned int
face_to_cell_lines (const unsigned int face,
const unsigned int line,
const bool face_orientation = true,
const bool face_flip = false,
const bool face_rotation = false);
/**
* Map the vertex index @p vertex of a face
* in standard orientation to one of a face
* with arbitrary @p face_orientation, @p
* face_flip and @p face_rotation. The
* values of these three flags default to
* <tt>true</tt>, <tt>false</tt> and
* <tt>false</tt>, respectively. this
* combination describes a face in standard
* orientation.
*
* This function is only implemented in 3D.
*/
static
unsigned int
standard_to_real_face_vertex (const unsigned int vertex,
const bool face_orientation = true,
const bool face_flip = false,
const bool face_rotation = false);
/**
* Map the vertex index @p vertex of a face
* with arbitrary @p face_orientation, @p
* face_flip and @p face_rotation to a face
* in standard orientation. The values of
* these three flags default to
* <tt>true</tt>, <tt>false</tt> and
* <tt>false</tt>, respectively. this
* combination describes a face in standard
* orientation.
*
* This function is only implemented in 3D.
*/
static
unsigned int
real_to_standard_face_vertex (const unsigned int vertex,
const bool face_orientation = true,
const bool face_flip = false,
const bool face_rotation = false);
/**
* Map the line index @p line of a face
* in standard orientation to one of a face
* with arbitrary @p face_orientation, @p
* face_flip and @p face_rotation. The
* values of these three flags default to
* <tt>true</tt>, <tt>false</tt> and
* <tt>false</tt>, respectively. this
* combination describes a face in standard
* orientation.
*
* This function is only implemented in 3D.
*/
static
unsigned int
standard_to_real_face_line (const unsigned int line,
const bool face_orientation = true,
const bool face_flip = false,
const bool face_rotation = false);
/**
* Map the line index @p line of a face
* with arbitrary @p face_orientation, @p
* face_flip and @p face_rotation to a face
* in standard orientation. The values of
* these three flags default to
* <tt>true</tt>, <tt>false</tt> and
* <tt>false</tt>, respectively. this
* combination describes a face in standard
* orientation.
*
* This function is only implemented in 3D.
*/
static
unsigned int
real_to_standard_face_line (const unsigned int line,
const bool face_orientation = true,
const bool face_flip = false,
const bool face_rotation = false);
/**
* Return the position of the @p ith
* vertex on the unit cell. The order of
* vertices is the canonical one in
* deal.II, as described in the general
* documentation of this class.
*/
static
Point<dim>
unit_cell_vertex (const unsigned int vertex);
/**
* Given a point @p p in unit
* coordinates, return the number
* of the child cell in which it
* would lie in. If the point
* lies on the interface of two
* children, return any one of
* their indices. The result is
* always less than
* GeometryInfo<dimension>::max_children_per_cell.
*
* The order of child cells is described
* the general documentation of this
* class.
*/
static
unsigned int
child_cell_from_point (const Point<dim> &p);
/**
* Given coordinates @p p on the
* unit cell, return the values
* of the coordinates of this
* point in the coordinate system
* of the given child. Neither
* original nor returned
* coordinates need actually be
* inside the cell, we simply
* perform a scale-and-shift
* operation with a shift that
* depends on the number of the
* child.
*/
static
Point<dim>
cell_to_child_coordinates (const Point<dim> &p,
const unsigned int child_index,
const RefinementCase<dim> refine_case
= RefinementCase<dim>::isotropic_refinement);
/**
* The reverse function to the
* one above: take a point in the
* coordinate system of the
* child, and transform it to the
* coordinate system of the
* mother cell.
*/
static
Point<dim>
child_to_cell_coordinates (const Point<dim> &p,
const unsigned int child_index,
const RefinementCase<dim> refine_case
= RefinementCase<dim>::isotropic_refinement);
/**
* Return true if the given point
* is inside the unit cell of the
* present space dimension.
*/
static
bool
is_inside_unit_cell (const Point<dim> &p);
/**
* Return true if the given point
* is inside the unit cell of the
* present space dimension. This
* * function accepts an
* additional * parameter which
* specifies how * much the point
* position may * actually be
* outside the true * unit
* cell. This is useful because
* in practice we may often not
* be able to compute the
* coordinates of a point in
* reference coordinates exactly,
* but only up to numerical
* roundoff.
*
* The tolerance parameter may be
* less than zero, indicating
* that the point should be
* safely inside the cell.
*/
static
bool
is_inside_unit_cell (const Point<dim> &p,
const double eps);
/**
* Projects a given point onto the
* unit cell, i.e. each coordinate
* outside [0..1] is modified
* to lie within that interval.
*/
static
Point<dim>
project_to_unit_cell (const Point<dim> &p);
/**
* Returns the infinity norm of
* the vector between a given point @p p
* outside the unit cell to the closest
* unit cell boundary.
* For points inside the cell, this is
* defined as zero.
*/
static
double
distance_to_unit_cell (const Point<dim> &p);
/**
* Compute the value of the $i$-th
* $d$-linear (i.e. (bi-,tri-)linear)
* shape function at location $\xi$.
*/
static
double
d_linear_shape_function (const Point<dim> &xi,
const unsigned int i);
/**
* Compute the gradient of the $i$-th
* $d$-linear (i.e. (bi-,tri-)linear)
* shape function at location $\xi$.
*/
static
Tensor<1,dim>
d_linear_shape_function_gradient (const Point<dim> &xi,
const unsigned int i);
/**
* For a (bi-, tri-)linear
* mapping from the reference
* cell, face, or edge to the
* object specified by the given
* vertices, compute the
* alternating form of the
* transformed unit vectors
* vertices. For an object of
* dimensionality @p dim, there
* are @p dim vectors with @p
* spacedim components each, and
* the alternating form is a
* tensor of rank spacedim-dim
* that corresponds to the wedge
* product of the @p dim unit
* vectors, and it corresponds to
* the volume and normal vectors
* of the mapping from reference
* element to the element
* described by the vertices.
*
* For example, if dim==spacedim==2, then
* the alternating form is a scalar
* (because spacedim-dim=0) and its value
* equals $\mathbf v_1\wedge \mathbf
* v_2=\mathbf v_1^\perp \cdot\mathbf
* v_2$, where $\mathbf v_1^\perp$ is a
* vector that is rotated to the right by
* 90 degrees from $\mathbf v_1$. If
* dim==spacedim==3, then the result is
* again a scalar with value $\mathbf
* v_1\wedge \mathbf v_2 \wedge \mathbf
* v_3 = (\mathbf v_1\times \mathbf
* v_2)\cdot \mathbf v_3$, where $\mathbf
* v_1, \mathbf v_2, \mathbf v_3$ are the
* images of the unit vectors at a vertex
* of the unit dim-dimensional cell under
* transformation to the dim-dimensional
* cell in spacedim-dimensional space. In
* both cases, i.e. for dim==2 or 3, the
* result happens to equal the
* determinant of the Jacobian of the
* mapping from reference cell to cell in
* real space. Note that it is the actual
* determinant, not its absolute value as
* often used in transforming integrals
* from one coordinate system to
* another. In particular, if the object
* specified by the vertices is a
* parallelogram (i.e. a linear
* transformation of the reference cell)
* then the computed values are the same
* at all vertices and equal the (signed)
* area of the cell; similarly, for
* parallel-epipeds, it is the volume of
* the cell.
*
* Likewise, if we have dim==spacedim-1
* (e.g. we have a quad in 3d space, or a
* line in 2d), then the alternating
* product denotes the normal vector
* (i.e. a rank-1 tensor, since
* spacedim-dim=1) to the object at each
* vertex, where the normal vector's
* magnitude denotes the area element of
* the transformation from the reference
* object to the object given by the
* vertices. In particular, if again the
* mapping from reference object to the
* object under consideration here is
* linear (not bi- or trilinear), then
* the returned vectors are all
* %parallel, perpendicular to the mapped
* object described by the vertices, and
* have a magnitude equal to the
* area/volume of the mapped object. If
* dim=1, spacedim=2, then the returned
* value is $\mathbf v_1^\perp$, where
* $\mathbf v_1$ is the image of the sole
* unit vector of a line mapped to the
* line in 2d given by the vertices; if
* dim=2, spacedim=3, then the returned
* values are $\mathbf v_1 \wedge \mathbf
* v_2=\mathbf v_1 \times \mathbf v_2$
* where $\mathbf v_1,\mathbf v_2$ are
* the two three-dimensional vectors that
* are tangential to the quad mapped into
* three-dimensional space.
*
* This function is used in order to
* determine how distorted a cell is (see
* the entry on
* @ref GlossDistorted "distorted cells"
* in the glossary).
*/
template <int spacedim>
static void
alternating_form_at_vertices
#ifndef DEAL_II_CONSTEXPR_BUG
(const Point<spacedim> (&vertices)[vertices_per_cell],
Tensor<spacedim-dim,spacedim> (&forms)[vertices_per_cell]);
#else
(const Point<spacedim> *vertices,
Tensor<spacedim-dim,spacedim> *forms);
#endif
/**
* For each face of the reference
* cell, this field stores the
* coordinate direction in which
* its normal vector points. In
* <tt>dim</tt> dimension these
* are the <tt>2*dim</tt> first
* entries of
* <tt>{0,0,1,1,2,2,3,3}</tt>.
*
* Note that this is only the
* coordinate number. The actual
* direction of the normal vector
* is obtained by multiplying the
* unit vector in this direction
* with #unit_normal_orientation.
*/
static const unsigned int unit_normal_direction[faces_per_cell];
/**
* Orientation of the unit normal
* vector of a face of the
* reference cell. In
* <tt>dim</tt> dimension these
* are the <tt>2*dim</tt> first
* entries of
* <tt>{-1,1,-1,1,-1,1,-1,1}</tt>.
*
* Each value is either
* <tt>1</tt> or <tt>-1</tt>,
* corresponding to a normal
* vector pointing in the
* positive or negative
* coordinate direction,
* respectively.
*
* Note that this is only the
* <em>standard orientation</em>
* of faces. At least in 3d,
* actual faces of cells in a
* triangulation can also have
* the opposite orientation,
* depending on a flag that one
* can query from the cell it
* belongs to. For more
* information, see the
* @ref GlossFaceOrientation "glossary"
* entry on
* face orientation.
*/
static const int unit_normal_orientation[faces_per_cell];
/**
* List of numbers which denotes which
* face is opposite to a given face. Its
* entries are the first <tt>2*dim</tt>
* entries of
* <tt>{ 1, 0, 3, 2, 5, 4, 7, 6}</tt>.
*/
static const unsigned int opposite_face[faces_per_cell];
/**
* Exception
*/
DeclException1 (ExcInvalidCoordinate,
double,
<< "The coordinates must satisfy 0 <= x_i <= 1, "
<< "but here we have x_i=" << arg1);
/**
* Exception
*/
DeclException3 (ExcInvalidSubface,
int, int, int,
<< "RefinementCase<dim> " << arg1 << ": face " << arg2
<< " has no subface " << arg3);
};
#ifndef DOXYGEN
/* -------------- declaration of explicit specializations ------------- */
#ifndef DEAL_II_MEMBER_ARRAY_SPECIALIZATION_BUG
template <>
const unsigned int GeometryInfo<1>::unit_normal_direction[faces_per_cell];
template <>
const unsigned int GeometryInfo<2>::unit_normal_direction[faces_per_cell];
template <>
const unsigned int GeometryInfo<3>::unit_normal_direction[faces_per_cell];
template <>
const unsigned int GeometryInfo<4>::unit_normal_direction[faces_per_cell];
template <>
const int GeometryInfo<1>::unit_normal_orientation[faces_per_cell];
template <>
const int GeometryInfo<2>::unit_normal_orientation[faces_per_cell];
template <>
const int GeometryInfo<3>::unit_normal_orientation[faces_per_cell];
template <>
const int GeometryInfo<4>::unit_normal_orientation[faces_per_cell];
template <>
const unsigned int GeometryInfo<1>::opposite_face[faces_per_cell];
template <>
const unsigned int GeometryInfo<2>::opposite_face[faces_per_cell];
template <>
const unsigned int GeometryInfo<3>::opposite_face[faces_per_cell];
template <>
const unsigned int GeometryInfo<4>::opposite_face[faces_per_cell];
#endif
template <>
Tensor<1,1>
GeometryInfo<1>::
d_linear_shape_function_gradient (const Point<1> &xi,
const unsigned int i);
template <>
Tensor<1,2>
GeometryInfo<2>::
d_linear_shape_function_gradient (const Point<2> &xi,
const unsigned int i);
template <>
Tensor<1,3>
GeometryInfo<3>::
d_linear_shape_function_gradient (const Point<3> &xi,
const unsigned int i);
/* -------------- inline functions ------------- */
namespace internal
{
template <int dim>
inline
SubfaceCase<dim>::SubfaceCase (const typename SubfacePossibilities<dim>::Possibilities subface_possibility)
:
value (subface_possibility)
{}
template <int dim>
inline
SubfaceCase<dim>::operator unsigned char () const
{
return value;
}
} // namespace internal
template <int dim>
inline
RefinementCase<dim>
RefinementCase<dim>::cut_axis (const unsigned int)
{
Assert (false, ExcInternalError());
return static_cast<unsigned char>(-1);
}
template <>
inline
RefinementCase<1>
RefinementCase<1>::cut_axis (const unsigned int i)
{
const unsigned int dim = 1;
Assert (i < dim, ExcIndexRange(i, 0, dim));
static const RefinementCase options[dim] = { RefinementPossibilities<1>::cut_x };
return options[i];
}
template <>
inline
RefinementCase<2>
RefinementCase<2>::cut_axis (const unsigned int i)
{
const unsigned int dim = 2;
Assert (i < dim, ExcIndexRange(i, 0, dim));
static const RefinementCase options[dim] = { RefinementPossibilities<2>::cut_x,
RefinementPossibilities<2>::cut_y
};
return options[i];
}
template <>
inline
RefinementCase<3>
RefinementCase<3>::cut_axis (const unsigned int i)
{
const unsigned int dim = 3;
Assert (i < dim, ExcIndexRange(i, 0, dim));
static const RefinementCase options[dim] = { RefinementPossibilities<3>::cut_x,
RefinementPossibilities<3>::cut_y,
RefinementPossibilities<3>::cut_z
};
return options[i];
}
template <int dim>
inline
RefinementCase<dim>::RefinementCase ()
:
value (RefinementPossibilities<dim>::no_refinement)
{}
template <int dim>
inline
RefinementCase<dim>::
RefinementCase (const typename RefinementPossibilities<dim>::Possibilities refinement_case)
:
value (refinement_case)
{
// check that only those bits of
// the given argument are set that
// make sense for a given space
// dimension
Assert ((refinement_case & RefinementPossibilities<dim>::isotropic_refinement) ==
refinement_case,
ExcInvalidRefinementCase (refinement_case));
}
template <int dim>
inline
RefinementCase<dim>::RefinementCase (const unsigned char refinement_case)
:
value (refinement_case)
{
// check that only those bits of
// the given argument are set that
// make sense for a given space
// dimension
Assert ((refinement_case & RefinementPossibilities<dim>::isotropic_refinement) ==
refinement_case,
ExcInvalidRefinementCase (refinement_case));
}
template <int dim>
inline
RefinementCase<dim>::operator unsigned char () const
{
return value;
}
template <int dim>
inline
RefinementCase<dim>
RefinementCase<dim>::operator | (const RefinementCase<dim> &r) const
{
return RefinementCase<dim>(static_cast<unsigned char> (value | r.value));
}
template <int dim>
inline
RefinementCase<dim>
RefinementCase<dim>::operator & (const RefinementCase<dim> &r) const
{
return RefinementCase<dim>(static_cast<unsigned char> (value & r.value));
}
template <int dim>
inline
RefinementCase<dim>
RefinementCase<dim>::operator ~ () const
{
return RefinementCase<dim>(static_cast<unsigned char> (
(~value) & RefinementPossibilities<dim>::isotropic_refinement));
}
template <int dim>
inline
std::size_t
RefinementCase<dim>::memory_consumption ()
{
return sizeof(RefinementCase<dim>);
}
template <int dim>
template <class Archive>
void RefinementCase<dim>::serialize (Archive &ar,
const unsigned int)
{
// serialization can't deal with bitfields, so copy from/to a full sized
// unsigned char
unsigned char uchar_value = value;
ar &uchar_value;
value = uchar_value;
}
template <>
inline
Point<1>
GeometryInfo<1>::unit_cell_vertex (const unsigned int vertex)
{
Assert (vertex < vertices_per_cell,
ExcIndexRange (vertex, 0, vertices_per_cell));
return Point<1>(static_cast<double>(vertex));
}
template <>
inline
Point<2>
GeometryInfo<2>::unit_cell_vertex (const unsigned int vertex)
{
Assert (vertex < vertices_per_cell,
ExcIndexRange (vertex, 0, vertices_per_cell));
return Point<2>(vertex%2, vertex/2);
}
template <>
inline
Point<3>
GeometryInfo<3>::unit_cell_vertex (const unsigned int vertex)
{
Assert (vertex < vertices_per_cell,
ExcIndexRange (vertex, 0, vertices_per_cell));
return Point<3>(vertex%2, vertex/2%2, vertex/4);
}
template <int dim>
inline
Point<dim>
GeometryInfo<dim>::unit_cell_vertex (const unsigned int)
{
Assert(false, ExcNotImplemented());
return Point<dim> ();
}
template <>
inline
unsigned int
GeometryInfo<1>::child_cell_from_point (const Point<1> &p)
{
Assert ((p[0] >= 0) && (p[0] <= 1), ExcInvalidCoordinate(p[0]));
return (p[0] <= 0.5 ? 0 : 1);
}
template <>
inline
unsigned int
GeometryInfo<2>::child_cell_from_point (const Point<2> &p)
{
Assert ((p[0] >= 0) && (p[0] <= 1), ExcInvalidCoordinate(p[0]));
Assert ((p[1] >= 0) && (p[1] <= 1), ExcInvalidCoordinate(p[1]));
return (p[0] <= 0.5 ?
(p[1] <= 0.5 ? 0 : 2) :
(p[1] <= 0.5 ? 1 : 3));
}
template <>
inline
unsigned int
GeometryInfo<3>::child_cell_from_point (const Point<3> &p)
{
Assert ((p[0] >= 0) && (p[0] <= 1), ExcInvalidCoordinate(p[0]));
Assert ((p[1] >= 0) && (p[1] <= 1), ExcInvalidCoordinate(p[1]));
Assert ((p[2] >= 0) && (p[2] <= 1), ExcInvalidCoordinate(p[2]));
return (p[0] <= 0.5 ?
(p[1] <= 0.5 ?
(p[2] <= 0.5 ? 0 : 4) :
(p[2] <= 0.5 ? 2 : 6)) :
(p[1] <= 0.5 ?
(p[2] <= 0.5 ? 1 : 5) :
(p[2] <= 0.5 ? 3 : 7)));
}
template <int dim>
inline
unsigned int
GeometryInfo<dim>::child_cell_from_point (const Point<dim> &)
{
Assert(false, ExcNotImplemented());
return 0;
}
template <>
inline
Point<1>
GeometryInfo<1>::cell_to_child_coordinates (const Point<1> &p,
const unsigned int child_index,
const RefinementCase<1> refine_case)
{
Assert (child_index < 2,
ExcIndexRange (child_index, 0, 2));
Assert (refine_case==RefinementCase<1>::cut_x,
ExcInternalError());
(void)refine_case; // removes -Wunused-parameter warning in optimized mode
return p*2.0-unit_cell_vertex(child_index);
}
template <>
inline
Point<2>
GeometryInfo<2>::cell_to_child_coordinates (const Point<2> &p,
const unsigned int child_index,
const RefinementCase<2> refine_case)
{
Assert (child_index < GeometryInfo<2>::n_children(refine_case),
ExcIndexRange (child_index, 0, GeometryInfo<2>::n_children(refine_case)));
Point<2> point=p;
switch (refine_case)
{
case RefinementCase<2>::cut_x:
point[0]*=2.0;
if (child_index==1)
point[0]-=1.0;
break;
case RefinementCase<2>::cut_y:
point[1]*=2.0;
if (child_index==1)
point[1]-=1.0;
break;
case RefinementCase<2>::cut_xy:
point*=2.0;
point-=unit_cell_vertex(child_index);
break;
default:
Assert(false, ExcInternalError());
}
return point;
}
template <>
inline
Point<3>
GeometryInfo<3>::cell_to_child_coordinates (const Point<3> &p,
const unsigned int child_index,
const RefinementCase<3> refine_case)
{
Assert (child_index < GeometryInfo<3>::n_children(refine_case),
ExcIndexRange (child_index, 0, GeometryInfo<3>::n_children(refine_case)));
Point<3> point=p;
// there might be a cleverer way to do
// this, but since this function is called
// in very few places for initialization
// purposes only, I don't care at the
// moment
switch (refine_case)
{
case RefinementCase<3>::cut_x:
point[0]*=2.0;
if (child_index==1)
point[0]-=1.0;
break;
case RefinementCase<3>::cut_y:
point[1]*=2.0;
if (child_index==1)
point[1]-=1.0;
break;
case RefinementCase<3>::cut_z:
point[2]*=2.0;
if (child_index==1)
point[2]-=1.0;
break;
case RefinementCase<3>::cut_xy:
point[0]*=2.0;
point[1]*=2.0;
if (child_index%2==1)
point[0]-=1.0;
if (child_index/2==1)
point[1]-=1.0;
break;
case RefinementCase<3>::cut_xz:
// careful, this is slightly
// different from xy and yz due to
// different internal numbering of
// children!
point[0]*=2.0;
point[2]*=2.0;
if (child_index/2==1)
point[0]-=1.0;
if (child_index%2==1)
point[2]-=1.0;
break;
case RefinementCase<3>::cut_yz:
point[1]*=2.0;
point[2]*=2.0;
if (child_index%2==1)
point[1]-=1.0;
if (child_index/2==1)
point[2]-=1.0;
break;
case RefinementCase<3>::cut_xyz:
point*=2.0;
point-=unit_cell_vertex(child_index);
break;
default:
Assert(false, ExcInternalError());
}
return point;
}
template <int dim>
inline
Point<dim>
GeometryInfo<dim>::cell_to_child_coordinates (const Point<dim> &/*p*/,
const unsigned int /*child_index*/,
const RefinementCase<dim> /*refine_case*/)
{
AssertThrow (false, ExcNotImplemented());
return Point<dim>();
}
template <>
inline
Point<1>
GeometryInfo<1>::child_to_cell_coordinates (const Point<1> &p,
const unsigned int child_index,
const RefinementCase<1> refine_case)
{
Assert (child_index < 2,
ExcIndexRange (child_index, 0, 2));
Assert (refine_case==RefinementCase<1>::cut_x,
ExcInternalError());
(void)refine_case; // removes -Wunused-parameter warning in optimized mode
return (p+unit_cell_vertex(child_index))*0.5;
}
template <>
inline
Point<3>
GeometryInfo<3>::child_to_cell_coordinates (const Point<3> &p,
const unsigned int child_index,
const RefinementCase<3> refine_case)
{
Assert (child_index < GeometryInfo<3>::n_children(refine_case),
ExcIndexRange (child_index, 0, GeometryInfo<3>::n_children(refine_case)));
Point<3> point=p;
// there might be a cleverer way to do
// this, but since this function is called
// in very few places for initialization
// purposes only, I don't care at the
// moment
switch (refine_case)
{
case RefinementCase<3>::cut_x:
if (child_index==1)
point[0]+=1.0;
point[0]*=0.5;
break;
case RefinementCase<3>::cut_y:
if (child_index==1)
point[1]+=1.0;
point[1]*=0.5;
break;
case RefinementCase<3>::cut_z:
if (child_index==1)
point[2]+=1.0;
point[2]*=0.5;
break;
case RefinementCase<3>::cut_xy:
if (child_index%2==1)
point[0]+=1.0;
if (child_index/2==1)
point[1]+=1.0;
point[0]*=0.5;
point[1]*=0.5;
break;
case RefinementCase<3>::cut_xz:
// careful, this is slightly
// different from xy and yz due to
// different internal numbering of
// children!
if (child_index/2==1)
point[0]+=1.0;
if (child_index%2==1)
point[2]+=1.0;
point[0]*=0.5;
point[2]*=0.5;
break;
case RefinementCase<3>::cut_yz:
if (child_index%2==1)
point[1]+=1.0;
if (child_index/2==1)
point[2]+=1.0;
point[1]*=0.5;
point[2]*=0.5;
break;
case RefinementCase<3>::cut_xyz:
point+=unit_cell_vertex(child_index);
point*=0.5;
break;
default:
Assert(false, ExcInternalError());
}
return point;
}
template <>
inline
Point<2>
GeometryInfo<2>::child_to_cell_coordinates (const Point<2> &p,
const unsigned int child_index,
const RefinementCase<2> refine_case)
{
Assert (child_index < GeometryInfo<2>::n_children(refine_case),
ExcIndexRange (child_index, 0, GeometryInfo<2>::n_children(refine_case)));
Point<2> point=p;
switch (refine_case)
{
case RefinementCase<2>::cut_x:
if (child_index==1)
point[0]+=1.0;
point[0]*=0.5;
break;
case RefinementCase<2>::cut_y:
if (child_index==1)
point[1]+=1.0;
point[1]*=0.5;
break;
case RefinementCase<2>::cut_xy:
point+=unit_cell_vertex(child_index);
point*=0.5;
break;
default:
Assert(false, ExcInternalError());
}
return point;
}
template <int dim>
inline
Point<dim>
GeometryInfo<dim>::child_to_cell_coordinates (const Point<dim> &/*p*/,
const unsigned int /*child_index*/,
const RefinementCase<dim> /*refine_case*/)
{
AssertThrow (false, ExcNotImplemented());
return Point<dim>();
}
template <>
inline
bool
GeometryInfo<1>::is_inside_unit_cell (const Point<1> &p)
{
return (p[0] >= 0.) && (p[0] <= 1.);
}
template <>
inline
bool
GeometryInfo<2>::is_inside_unit_cell (const Point<2> &p)
{
return (p[0] >= 0.) && (p[0] <= 1.) &&
(p[1] >= 0.) && (p[1] <= 1.);
}
template <>
inline
bool
GeometryInfo<3>::is_inside_unit_cell (const Point<3> &p)
{
return (p[0] >= 0.) && (p[0] <= 1.) &&
(p[1] >= 0.) && (p[1] <= 1.) &&
(p[2] >= 0.) && (p[2] <= 1.);
}
template <>
inline
bool
GeometryInfo<1>::is_inside_unit_cell (const Point<1> &p,
const double eps)
{
return (p[0] >= -eps) && (p[0] <= 1.+eps);
}
template <>
inline
bool
GeometryInfo<2>::is_inside_unit_cell (const Point<2> &p,
const double eps)
{
const double l = -eps, u = 1+eps;
return (p[0] >= l) && (p[0] <= u) &&
(p[1] >= l) && (p[1] <= u);
}
template <>
inline
bool
GeometryInfo<3>::is_inside_unit_cell (const Point<3> &p,
const double eps)
{
const double l = -eps, u = 1.0+eps;
return (p[0] >= l) && (p[0] <= u) &&
(p[1] >= l) && (p[1] <= u) &&
(p[2] >= l) && (p[2] <= u);
}
#endif // DOXYGEN
DEAL_II_NAMESPACE_CLOSE
#endif
|