/usr/lib/python2.7/dist-packages/dolfin/cpp/fem.py is in python-dolfin 1.3.0+dfsg-2.
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 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.11
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (3,0,0):
new_instancemethod = lambda func, inst, cls: _fem.SWIG_PyInstanceMethod_New(func)
else:
from new import instancemethod as new_instancemethod
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import dirname
import imp
fp = None
try:
fp, pathname, description = imp.find_module('_fem', [dirname(__file__)])
except ImportError:
import _fem
return _fem
if fp is not None:
try:
_mod = imp.load_module('_fem', fp, pathname, description)
finally:
fp.close()
return _mod
_fem = swig_import_helper()
del swig_import_helper
else:
import _fem
del version_info
try:
_swig_property = property
except NameError:
pass # Python < 2.2 doesn't have 'property'.
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
if (name == "thisown"): return self.this.own(value)
if (name == "this"):
if type(value).__name__ == 'SwigPyObject':
self.__dict__[name] = value
return
method = class_type.__swig_setmethods__.get(name,None)
if method: return method(self,value)
if (not static):
self.__dict__[name] = value
else:
raise AttributeError("You cannot add attributes to %s" % self)
def _swig_setattr(self,class_type,name,value):
return _swig_setattr_nondynamic(self,class_type,name,value,0)
def _swig_getattr(self,class_type,name):
if (name == "thisown"): return self.this.own()
method = class_type.__swig_getmethods__.get(name,None)
if method: return method(self)
raise AttributeError(name)
def _swig_repr(self):
try: strthis = "proxy of " + self.this.__repr__()
except: strthis = ""
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
try:
_object = object
_newclass = 1
except AttributeError:
class _object : pass
_newclass = 0
def _swig_setattr_nondynamic_method(set):
def set_attr(self,name,value):
if (name == "thisown"): return self.this.own(value)
if hasattr(self,name) or (name == "this"):
set(self,name,value)
else:
raise AttributeError("You cannot add attributes to %s" % self)
return set_attr
try:
import weakref
weakref_proxy = weakref.proxy
except:
weakref_proxy = lambda x: x
SHARED_PTR_DISOWN = _fem.SHARED_PTR_DISOWN
import ufc
def _attach_base_to_numpy_array(*args):
return _fem._attach_base_to_numpy_array(*args)
_attach_base_to_numpy_array = _fem._attach_base_to_numpy_array
def dolfin_swigversion(*args):
return _fem.dolfin_swigversion(*args)
dolfin_swigversion = _fem.dolfin_swigversion
tmp = hex(dolfin_swigversion())
__swigversion__ = "%d.%d.%d"%(tuple(map(int, [tmp[-5], tmp[-3], tmp[-2:]])))
del tmp, dolfin_swigversion
def has_petsc4py(*args):
return _fem.has_petsc4py(*args)
has_petsc4py = _fem.has_petsc4py
import common
import la
class HierarchicalMeshFunctionUInt(object):
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
_fem.HierarchicalMeshFunctionUInt_swiginit(self,_fem.new_HierarchicalMeshFunctionUInt(*args))
__swig_destroy__ = _fem.delete_HierarchicalMeshFunctionUInt
HierarchicalMeshFunctionUInt.depth = new_instancemethod(_fem.HierarchicalMeshFunctionUInt_depth,None,HierarchicalMeshFunctionUInt)
HierarchicalMeshFunctionUInt.has_parent = new_instancemethod(_fem.HierarchicalMeshFunctionUInt_has_parent,None,HierarchicalMeshFunctionUInt)
HierarchicalMeshFunctionUInt.has_child = new_instancemethod(_fem.HierarchicalMeshFunctionUInt_has_child,None,HierarchicalMeshFunctionUInt)
HierarchicalMeshFunctionUInt._parent = new_instancemethod(_fem.HierarchicalMeshFunctionUInt__parent,None,HierarchicalMeshFunctionUInt)
HierarchicalMeshFunctionUInt._child = new_instancemethod(_fem.HierarchicalMeshFunctionUInt__child,None,HierarchicalMeshFunctionUInt)
HierarchicalMeshFunctionUInt._root_node = new_instancemethod(_fem.HierarchicalMeshFunctionUInt__root_node,None,HierarchicalMeshFunctionUInt)
HierarchicalMeshFunctionUInt._leaf_node = new_instancemethod(_fem.HierarchicalMeshFunctionUInt__leaf_node,None,HierarchicalMeshFunctionUInt)
HierarchicalMeshFunctionUInt.set_parent = new_instancemethod(_fem.HierarchicalMeshFunctionUInt_set_parent,None,HierarchicalMeshFunctionUInt)
HierarchicalMeshFunctionUInt.clear_child = new_instancemethod(_fem.HierarchicalMeshFunctionUInt_clear_child,None,HierarchicalMeshFunctionUInt)
HierarchicalMeshFunctionUInt.set_child = new_instancemethod(_fem.HierarchicalMeshFunctionUInt_set_child,None,HierarchicalMeshFunctionUInt)
HierarchicalMeshFunctionUInt._debug = new_instancemethod(_fem.HierarchicalMeshFunctionUInt__debug,None,HierarchicalMeshFunctionUInt)
HierarchicalMeshFunctionUInt_swigregister = _fem.HierarchicalMeshFunctionUInt_swigregister
HierarchicalMeshFunctionUInt_swigregister(HierarchicalMeshFunctionUInt)
class HierarchicalMeshFunctionInt(object):
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
_fem.HierarchicalMeshFunctionInt_swiginit(self,_fem.new_HierarchicalMeshFunctionInt(*args))
__swig_destroy__ = _fem.delete_HierarchicalMeshFunctionInt
HierarchicalMeshFunctionInt.depth = new_instancemethod(_fem.HierarchicalMeshFunctionInt_depth,None,HierarchicalMeshFunctionInt)
HierarchicalMeshFunctionInt.has_parent = new_instancemethod(_fem.HierarchicalMeshFunctionInt_has_parent,None,HierarchicalMeshFunctionInt)
HierarchicalMeshFunctionInt.has_child = new_instancemethod(_fem.HierarchicalMeshFunctionInt_has_child,None,HierarchicalMeshFunctionInt)
HierarchicalMeshFunctionInt._parent = new_instancemethod(_fem.HierarchicalMeshFunctionInt__parent,None,HierarchicalMeshFunctionInt)
HierarchicalMeshFunctionInt._child = new_instancemethod(_fem.HierarchicalMeshFunctionInt__child,None,HierarchicalMeshFunctionInt)
HierarchicalMeshFunctionInt._root_node = new_instancemethod(_fem.HierarchicalMeshFunctionInt__root_node,None,HierarchicalMeshFunctionInt)
HierarchicalMeshFunctionInt._leaf_node = new_instancemethod(_fem.HierarchicalMeshFunctionInt__leaf_node,None,HierarchicalMeshFunctionInt)
HierarchicalMeshFunctionInt.set_parent = new_instancemethod(_fem.HierarchicalMeshFunctionInt_set_parent,None,HierarchicalMeshFunctionInt)
HierarchicalMeshFunctionInt.clear_child = new_instancemethod(_fem.HierarchicalMeshFunctionInt_clear_child,None,HierarchicalMeshFunctionInt)
HierarchicalMeshFunctionInt.set_child = new_instancemethod(_fem.HierarchicalMeshFunctionInt_set_child,None,HierarchicalMeshFunctionInt)
HierarchicalMeshFunctionInt._debug = new_instancemethod(_fem.HierarchicalMeshFunctionInt__debug,None,HierarchicalMeshFunctionInt)
HierarchicalMeshFunctionInt_swigregister = _fem.HierarchicalMeshFunctionInt_swigregister
HierarchicalMeshFunctionInt_swigregister(HierarchicalMeshFunctionInt)
class HierarchicalMeshFunctionDouble(object):
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
_fem.HierarchicalMeshFunctionDouble_swiginit(self,_fem.new_HierarchicalMeshFunctionDouble(*args))
__swig_destroy__ = _fem.delete_HierarchicalMeshFunctionDouble
HierarchicalMeshFunctionDouble.depth = new_instancemethod(_fem.HierarchicalMeshFunctionDouble_depth,None,HierarchicalMeshFunctionDouble)
HierarchicalMeshFunctionDouble.has_parent = new_instancemethod(_fem.HierarchicalMeshFunctionDouble_has_parent,None,HierarchicalMeshFunctionDouble)
HierarchicalMeshFunctionDouble.has_child = new_instancemethod(_fem.HierarchicalMeshFunctionDouble_has_child,None,HierarchicalMeshFunctionDouble)
HierarchicalMeshFunctionDouble._parent = new_instancemethod(_fem.HierarchicalMeshFunctionDouble__parent,None,HierarchicalMeshFunctionDouble)
HierarchicalMeshFunctionDouble._child = new_instancemethod(_fem.HierarchicalMeshFunctionDouble__child,None,HierarchicalMeshFunctionDouble)
HierarchicalMeshFunctionDouble._root_node = new_instancemethod(_fem.HierarchicalMeshFunctionDouble__root_node,None,HierarchicalMeshFunctionDouble)
HierarchicalMeshFunctionDouble._leaf_node = new_instancemethod(_fem.HierarchicalMeshFunctionDouble__leaf_node,None,HierarchicalMeshFunctionDouble)
HierarchicalMeshFunctionDouble.set_parent = new_instancemethod(_fem.HierarchicalMeshFunctionDouble_set_parent,None,HierarchicalMeshFunctionDouble)
HierarchicalMeshFunctionDouble.clear_child = new_instancemethod(_fem.HierarchicalMeshFunctionDouble_clear_child,None,HierarchicalMeshFunctionDouble)
HierarchicalMeshFunctionDouble.set_child = new_instancemethod(_fem.HierarchicalMeshFunctionDouble_set_child,None,HierarchicalMeshFunctionDouble)
HierarchicalMeshFunctionDouble._debug = new_instancemethod(_fem.HierarchicalMeshFunctionDouble__debug,None,HierarchicalMeshFunctionDouble)
HierarchicalMeshFunctionDouble_swigregister = _fem.HierarchicalMeshFunctionDouble_swigregister
HierarchicalMeshFunctionDouble_swigregister(HierarchicalMeshFunctionDouble)
class HierarchicalMeshFunctionBool(object):
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
_fem.HierarchicalMeshFunctionBool_swiginit(self,_fem.new_HierarchicalMeshFunctionBool(*args))
__swig_destroy__ = _fem.delete_HierarchicalMeshFunctionBool
HierarchicalMeshFunctionBool.depth = new_instancemethod(_fem.HierarchicalMeshFunctionBool_depth,None,HierarchicalMeshFunctionBool)
HierarchicalMeshFunctionBool.has_parent = new_instancemethod(_fem.HierarchicalMeshFunctionBool_has_parent,None,HierarchicalMeshFunctionBool)
HierarchicalMeshFunctionBool.has_child = new_instancemethod(_fem.HierarchicalMeshFunctionBool_has_child,None,HierarchicalMeshFunctionBool)
HierarchicalMeshFunctionBool._parent = new_instancemethod(_fem.HierarchicalMeshFunctionBool__parent,None,HierarchicalMeshFunctionBool)
HierarchicalMeshFunctionBool._child = new_instancemethod(_fem.HierarchicalMeshFunctionBool__child,None,HierarchicalMeshFunctionBool)
HierarchicalMeshFunctionBool._root_node = new_instancemethod(_fem.HierarchicalMeshFunctionBool__root_node,None,HierarchicalMeshFunctionBool)
HierarchicalMeshFunctionBool._leaf_node = new_instancemethod(_fem.HierarchicalMeshFunctionBool__leaf_node,None,HierarchicalMeshFunctionBool)
HierarchicalMeshFunctionBool.set_parent = new_instancemethod(_fem.HierarchicalMeshFunctionBool_set_parent,None,HierarchicalMeshFunctionBool)
HierarchicalMeshFunctionBool.clear_child = new_instancemethod(_fem.HierarchicalMeshFunctionBool_clear_child,None,HierarchicalMeshFunctionBool)
HierarchicalMeshFunctionBool.set_child = new_instancemethod(_fem.HierarchicalMeshFunctionBool_set_child,None,HierarchicalMeshFunctionBool)
HierarchicalMeshFunctionBool._debug = new_instancemethod(_fem.HierarchicalMeshFunctionBool__debug,None,HierarchicalMeshFunctionBool)
HierarchicalMeshFunctionBool_swigregister = _fem.HierarchicalMeshFunctionBool_swigregister
HierarchicalMeshFunctionBool_swigregister(HierarchicalMeshFunctionBool)
class HierarchicalMeshFunctionSizet(object):
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
_fem.HierarchicalMeshFunctionSizet_swiginit(self,_fem.new_HierarchicalMeshFunctionSizet(*args))
__swig_destroy__ = _fem.delete_HierarchicalMeshFunctionSizet
HierarchicalMeshFunctionSizet.depth = new_instancemethod(_fem.HierarchicalMeshFunctionSizet_depth,None,HierarchicalMeshFunctionSizet)
HierarchicalMeshFunctionSizet.has_parent = new_instancemethod(_fem.HierarchicalMeshFunctionSizet_has_parent,None,HierarchicalMeshFunctionSizet)
HierarchicalMeshFunctionSizet.has_child = new_instancemethod(_fem.HierarchicalMeshFunctionSizet_has_child,None,HierarchicalMeshFunctionSizet)
HierarchicalMeshFunctionSizet._parent = new_instancemethod(_fem.HierarchicalMeshFunctionSizet__parent,None,HierarchicalMeshFunctionSizet)
HierarchicalMeshFunctionSizet._child = new_instancemethod(_fem.HierarchicalMeshFunctionSizet__child,None,HierarchicalMeshFunctionSizet)
HierarchicalMeshFunctionSizet._root_node = new_instancemethod(_fem.HierarchicalMeshFunctionSizet__root_node,None,HierarchicalMeshFunctionSizet)
HierarchicalMeshFunctionSizet._leaf_node = new_instancemethod(_fem.HierarchicalMeshFunctionSizet__leaf_node,None,HierarchicalMeshFunctionSizet)
HierarchicalMeshFunctionSizet.set_parent = new_instancemethod(_fem.HierarchicalMeshFunctionSizet_set_parent,None,HierarchicalMeshFunctionSizet)
HierarchicalMeshFunctionSizet.clear_child = new_instancemethod(_fem.HierarchicalMeshFunctionSizet_clear_child,None,HierarchicalMeshFunctionSizet)
HierarchicalMeshFunctionSizet.set_child = new_instancemethod(_fem.HierarchicalMeshFunctionSizet_set_child,None,HierarchicalMeshFunctionSizet)
HierarchicalMeshFunctionSizet._debug = new_instancemethod(_fem.HierarchicalMeshFunctionSizet__debug,None,HierarchicalMeshFunctionSizet)
HierarchicalMeshFunctionSizet_swigregister = _fem.HierarchicalMeshFunctionSizet_swigregister
HierarchicalMeshFunctionSizet_swigregister(HierarchicalMeshFunctionSizet)
class HierarchicalMesh(object):
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
_fem.HierarchicalMesh_swiginit(self,_fem.new_HierarchicalMesh(*args))
__swig_destroy__ = _fem.delete_HierarchicalMesh
HierarchicalMesh.depth = new_instancemethod(_fem.HierarchicalMesh_depth,None,HierarchicalMesh)
HierarchicalMesh.has_parent = new_instancemethod(_fem.HierarchicalMesh_has_parent,None,HierarchicalMesh)
HierarchicalMesh.has_child = new_instancemethod(_fem.HierarchicalMesh_has_child,None,HierarchicalMesh)
HierarchicalMesh._parent = new_instancemethod(_fem.HierarchicalMesh__parent,None,HierarchicalMesh)
HierarchicalMesh._child = new_instancemethod(_fem.HierarchicalMesh__child,None,HierarchicalMesh)
HierarchicalMesh._root_node = new_instancemethod(_fem.HierarchicalMesh__root_node,None,HierarchicalMesh)
HierarchicalMesh._leaf_node = new_instancemethod(_fem.HierarchicalMesh__leaf_node,None,HierarchicalMesh)
HierarchicalMesh.set_parent = new_instancemethod(_fem.HierarchicalMesh_set_parent,None,HierarchicalMesh)
HierarchicalMesh.clear_child = new_instancemethod(_fem.HierarchicalMesh_clear_child,None,HierarchicalMesh)
HierarchicalMesh.set_child = new_instancemethod(_fem.HierarchicalMesh_set_child,None,HierarchicalMesh)
HierarchicalMesh._debug = new_instancemethod(_fem.HierarchicalMesh__debug,None,HierarchicalMesh)
HierarchicalMesh_swigregister = _fem.HierarchicalMesh_swigregister
HierarchicalMesh_swigregister(HierarchicalMesh)
import mesh
class HierarchicalFunctionSpace(object):
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
_fem.HierarchicalFunctionSpace_swiginit(self,_fem.new_HierarchicalFunctionSpace(*args))
__swig_destroy__ = _fem.delete_HierarchicalFunctionSpace
HierarchicalFunctionSpace.depth = new_instancemethod(_fem.HierarchicalFunctionSpace_depth,None,HierarchicalFunctionSpace)
HierarchicalFunctionSpace.has_parent = new_instancemethod(_fem.HierarchicalFunctionSpace_has_parent,None,HierarchicalFunctionSpace)
HierarchicalFunctionSpace.has_child = new_instancemethod(_fem.HierarchicalFunctionSpace_has_child,None,HierarchicalFunctionSpace)
HierarchicalFunctionSpace._parent = new_instancemethod(_fem.HierarchicalFunctionSpace__parent,None,HierarchicalFunctionSpace)
HierarchicalFunctionSpace._child = new_instancemethod(_fem.HierarchicalFunctionSpace__child,None,HierarchicalFunctionSpace)
HierarchicalFunctionSpace._root_node = new_instancemethod(_fem.HierarchicalFunctionSpace__root_node,None,HierarchicalFunctionSpace)
HierarchicalFunctionSpace._leaf_node = new_instancemethod(_fem.HierarchicalFunctionSpace__leaf_node,None,HierarchicalFunctionSpace)
HierarchicalFunctionSpace.set_parent = new_instancemethod(_fem.HierarchicalFunctionSpace_set_parent,None,HierarchicalFunctionSpace)
HierarchicalFunctionSpace.clear_child = new_instancemethod(_fem.HierarchicalFunctionSpace_clear_child,None,HierarchicalFunctionSpace)
HierarchicalFunctionSpace.set_child = new_instancemethod(_fem.HierarchicalFunctionSpace_set_child,None,HierarchicalFunctionSpace)
HierarchicalFunctionSpace._debug = new_instancemethod(_fem.HierarchicalFunctionSpace__debug,None,HierarchicalFunctionSpace)
HierarchicalFunctionSpace_swigregister = _fem.HierarchicalFunctionSpace_swigregister
HierarchicalFunctionSpace_swigregister(HierarchicalFunctionSpace)
class HierarchicalFunction(object):
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
_fem.HierarchicalFunction_swiginit(self,_fem.new_HierarchicalFunction(*args))
__swig_destroy__ = _fem.delete_HierarchicalFunction
HierarchicalFunction.depth = new_instancemethod(_fem.HierarchicalFunction_depth,None,HierarchicalFunction)
HierarchicalFunction.has_parent = new_instancemethod(_fem.HierarchicalFunction_has_parent,None,HierarchicalFunction)
HierarchicalFunction.has_child = new_instancemethod(_fem.HierarchicalFunction_has_child,None,HierarchicalFunction)
HierarchicalFunction._parent = new_instancemethod(_fem.HierarchicalFunction__parent,None,HierarchicalFunction)
HierarchicalFunction._child = new_instancemethod(_fem.HierarchicalFunction__child,None,HierarchicalFunction)
HierarchicalFunction._root_node = new_instancemethod(_fem.HierarchicalFunction__root_node,None,HierarchicalFunction)
HierarchicalFunction._leaf_node = new_instancemethod(_fem.HierarchicalFunction__leaf_node,None,HierarchicalFunction)
HierarchicalFunction.set_parent = new_instancemethod(_fem.HierarchicalFunction_set_parent,None,HierarchicalFunction)
HierarchicalFunction.clear_child = new_instancemethod(_fem.HierarchicalFunction_clear_child,None,HierarchicalFunction)
HierarchicalFunction.set_child = new_instancemethod(_fem.HierarchicalFunction_set_child,None,HierarchicalFunction)
HierarchicalFunction._debug = new_instancemethod(_fem.HierarchicalFunction__debug,None,HierarchicalFunction)
HierarchicalFunction_swigregister = _fem.HierarchicalFunction_swigregister
HierarchicalFunction_swigregister(HierarchicalFunction)
import function
class HierarchicalForm(object):
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
_fem.HierarchicalForm_swiginit(self,_fem.new_HierarchicalForm(*args))
__swig_destroy__ = _fem.delete_HierarchicalForm
HierarchicalForm.depth = new_instancemethod(_fem.HierarchicalForm_depth,None,HierarchicalForm)
HierarchicalForm.has_parent = new_instancemethod(_fem.HierarchicalForm_has_parent,None,HierarchicalForm)
HierarchicalForm.has_child = new_instancemethod(_fem.HierarchicalForm_has_child,None,HierarchicalForm)
HierarchicalForm._parent = new_instancemethod(_fem.HierarchicalForm__parent,None,HierarchicalForm)
HierarchicalForm._child = new_instancemethod(_fem.HierarchicalForm__child,None,HierarchicalForm)
HierarchicalForm._root_node = new_instancemethod(_fem.HierarchicalForm__root_node,None,HierarchicalForm)
HierarchicalForm._leaf_node = new_instancemethod(_fem.HierarchicalForm__leaf_node,None,HierarchicalForm)
HierarchicalForm.set_parent = new_instancemethod(_fem.HierarchicalForm_set_parent,None,HierarchicalForm)
HierarchicalForm.clear_child = new_instancemethod(_fem.HierarchicalForm_clear_child,None,HierarchicalForm)
HierarchicalForm.set_child = new_instancemethod(_fem.HierarchicalForm_set_child,None,HierarchicalForm)
HierarchicalForm._debug = new_instancemethod(_fem.HierarchicalForm__debug,None,HierarchicalForm)
HierarchicalForm_swigregister = _fem.HierarchicalForm_swigregister
HierarchicalForm_swigregister(HierarchicalForm)
class HierarchicalLinearVariationalProblem(object):
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
_fem.HierarchicalLinearVariationalProblem_swiginit(self,_fem.new_HierarchicalLinearVariationalProblem(*args))
__swig_destroy__ = _fem.delete_HierarchicalLinearVariationalProblem
HierarchicalLinearVariationalProblem.depth = new_instancemethod(_fem.HierarchicalLinearVariationalProblem_depth,None,HierarchicalLinearVariationalProblem)
HierarchicalLinearVariationalProblem.has_parent = new_instancemethod(_fem.HierarchicalLinearVariationalProblem_has_parent,None,HierarchicalLinearVariationalProblem)
HierarchicalLinearVariationalProblem.has_child = new_instancemethod(_fem.HierarchicalLinearVariationalProblem_has_child,None,HierarchicalLinearVariationalProblem)
HierarchicalLinearVariationalProblem._parent = new_instancemethod(_fem.HierarchicalLinearVariationalProblem__parent,None,HierarchicalLinearVariationalProblem)
HierarchicalLinearVariationalProblem._child = new_instancemethod(_fem.HierarchicalLinearVariationalProblem__child,None,HierarchicalLinearVariationalProblem)
HierarchicalLinearVariationalProblem._root_node = new_instancemethod(_fem.HierarchicalLinearVariationalProblem__root_node,None,HierarchicalLinearVariationalProblem)
HierarchicalLinearVariationalProblem._leaf_node = new_instancemethod(_fem.HierarchicalLinearVariationalProblem__leaf_node,None,HierarchicalLinearVariationalProblem)
HierarchicalLinearVariationalProblem.set_parent = new_instancemethod(_fem.HierarchicalLinearVariationalProblem_set_parent,None,HierarchicalLinearVariationalProblem)
HierarchicalLinearVariationalProblem.clear_child = new_instancemethod(_fem.HierarchicalLinearVariationalProblem_clear_child,None,HierarchicalLinearVariationalProblem)
HierarchicalLinearVariationalProblem.set_child = new_instancemethod(_fem.HierarchicalLinearVariationalProblem_set_child,None,HierarchicalLinearVariationalProblem)
HierarchicalLinearVariationalProblem._debug = new_instancemethod(_fem.HierarchicalLinearVariationalProblem__debug,None,HierarchicalLinearVariationalProblem)
HierarchicalLinearVariationalProblem_swigregister = _fem.HierarchicalLinearVariationalProblem_swigregister
HierarchicalLinearVariationalProblem_swigregister(HierarchicalLinearVariationalProblem)
class HierarchicalNonlinearVariationalProblem(object):
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
_fem.HierarchicalNonlinearVariationalProblem_swiginit(self,_fem.new_HierarchicalNonlinearVariationalProblem(*args))
__swig_destroy__ = _fem.delete_HierarchicalNonlinearVariationalProblem
HierarchicalNonlinearVariationalProblem.depth = new_instancemethod(_fem.HierarchicalNonlinearVariationalProblem_depth,None,HierarchicalNonlinearVariationalProblem)
HierarchicalNonlinearVariationalProblem.has_parent = new_instancemethod(_fem.HierarchicalNonlinearVariationalProblem_has_parent,None,HierarchicalNonlinearVariationalProblem)
HierarchicalNonlinearVariationalProblem.has_child = new_instancemethod(_fem.HierarchicalNonlinearVariationalProblem_has_child,None,HierarchicalNonlinearVariationalProblem)
HierarchicalNonlinearVariationalProblem._parent = new_instancemethod(_fem.HierarchicalNonlinearVariationalProblem__parent,None,HierarchicalNonlinearVariationalProblem)
HierarchicalNonlinearVariationalProblem._child = new_instancemethod(_fem.HierarchicalNonlinearVariationalProblem__child,None,HierarchicalNonlinearVariationalProblem)
HierarchicalNonlinearVariationalProblem._root_node = new_instancemethod(_fem.HierarchicalNonlinearVariationalProblem__root_node,None,HierarchicalNonlinearVariationalProblem)
HierarchicalNonlinearVariationalProblem._leaf_node = new_instancemethod(_fem.HierarchicalNonlinearVariationalProblem__leaf_node,None,HierarchicalNonlinearVariationalProblem)
HierarchicalNonlinearVariationalProblem.set_parent = new_instancemethod(_fem.HierarchicalNonlinearVariationalProblem_set_parent,None,HierarchicalNonlinearVariationalProblem)
HierarchicalNonlinearVariationalProblem.clear_child = new_instancemethod(_fem.HierarchicalNonlinearVariationalProblem_clear_child,None,HierarchicalNonlinearVariationalProblem)
HierarchicalNonlinearVariationalProblem.set_child = new_instancemethod(_fem.HierarchicalNonlinearVariationalProblem_set_child,None,HierarchicalNonlinearVariationalProblem)
HierarchicalNonlinearVariationalProblem._debug = new_instancemethod(_fem.HierarchicalNonlinearVariationalProblem__debug,None,HierarchicalNonlinearVariationalProblem)
HierarchicalNonlinearVariationalProblem_swigregister = _fem.HierarchicalNonlinearVariationalProblem_swigregister
HierarchicalNonlinearVariationalProblem_swigregister(HierarchicalNonlinearVariationalProblem)
class HierarchicalDirichletBC(object):
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
_fem.HierarchicalDirichletBC_swiginit(self,_fem.new_HierarchicalDirichletBC(*args))
__swig_destroy__ = _fem.delete_HierarchicalDirichletBC
HierarchicalDirichletBC.depth = new_instancemethod(_fem.HierarchicalDirichletBC_depth,None,HierarchicalDirichletBC)
HierarchicalDirichletBC.has_parent = new_instancemethod(_fem.HierarchicalDirichletBC_has_parent,None,HierarchicalDirichletBC)
HierarchicalDirichletBC.has_child = new_instancemethod(_fem.HierarchicalDirichletBC_has_child,None,HierarchicalDirichletBC)
HierarchicalDirichletBC._parent = new_instancemethod(_fem.HierarchicalDirichletBC__parent,None,HierarchicalDirichletBC)
HierarchicalDirichletBC._child = new_instancemethod(_fem.HierarchicalDirichletBC__child,None,HierarchicalDirichletBC)
HierarchicalDirichletBC._root_node = new_instancemethod(_fem.HierarchicalDirichletBC__root_node,None,HierarchicalDirichletBC)
HierarchicalDirichletBC._leaf_node = new_instancemethod(_fem.HierarchicalDirichletBC__leaf_node,None,HierarchicalDirichletBC)
HierarchicalDirichletBC.set_parent = new_instancemethod(_fem.HierarchicalDirichletBC_set_parent,None,HierarchicalDirichletBC)
HierarchicalDirichletBC.clear_child = new_instancemethod(_fem.HierarchicalDirichletBC_clear_child,None,HierarchicalDirichletBC)
HierarchicalDirichletBC.set_child = new_instancemethod(_fem.HierarchicalDirichletBC_set_child,None,HierarchicalDirichletBC)
HierarchicalDirichletBC._debug = new_instancemethod(_fem.HierarchicalDirichletBC__debug,None,HierarchicalDirichletBC)
HierarchicalDirichletBC_swigregister = _fem.HierarchicalDirichletBC_swigregister
HierarchicalDirichletBC_swigregister(HierarchicalDirichletBC)
class GenericDofMap(common.Variable):
"""
This class provides a generic interface for dof maps
"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract")
__repr__ = _swig_repr
def is_view(self, *args):
"""
True if dof map is a view into another map (is a sub-dofmap)
"""
return _fem.GenericDofMap_is_view(self, *args)
def global_dimension(self, *args):
"""
Return the dimension of the global finite element function
space
"""
return _fem.GenericDofMap_global_dimension(self, *args)
def cell_dimension(self, *args):
"""
Return the dimension of the local finite element function
space on a cell
"""
return _fem.GenericDofMap_cell_dimension(self, *args)
def max_cell_dimension(self, *args):
"""
Return the maximum dimension of the local finite element
function space
"""
return _fem.GenericDofMap_max_cell_dimension(self, *args)
def num_entity_dofs(self, *args):
"""
Return the number of dofs for a given entity dimension
"""
return _fem.GenericDofMap_num_entity_dofs(self, *args)
def num_facet_dofs(self, *args):
"""
Return number of facet dofs
"""
return _fem.GenericDofMap_num_facet_dofs(self, *args)
def restriction(self, *args):
"""
Restriction if any. If the dofmap is not restricted, a null
pointer is returned.
"""
return _fem.GenericDofMap_restriction(self, *args)
def ownership_range(self, *args):
"""
Return the ownership range (dofs in this range are owned by
this process)
"""
return _fem.GenericDofMap_ownership_range(self, *args)
def off_process_owner(self, *args):
"""
Return map from nonlocal-dofs (that appear in local dof map)
to owning process
"""
return _fem.GenericDofMap_off_process_owner(self, *args)
def cell_dofs(self, *args):
"""
Local-to-global mapping of dofs on a cell
"""
return _fem.GenericDofMap_cell_dofs(self, *args)
def tabulate_facet_dofs(self, *args):
"""
Tabulate local-local facet dofs
"""
return _fem.GenericDofMap_tabulate_facet_dofs(self, *args)
def tabulate_entity_dofs(self, *args):
"""
Tabulate the local-to-local mapping of dofs on entity
(dim, local_entity)
"""
return _fem.GenericDofMap_tabulate_entity_dofs(self, *args)
def dof_to_vertex_map(self, *args):
"""
Return a map between vertices and dofs
"""
return _fem.GenericDofMap_dof_to_vertex_map(self, *args)
def vertex_to_dof_map(self, *args):
"""
Return a map between vertices and dofs
"""
return _fem.GenericDofMap_vertex_to_dof_map(self, *args)
def tabulate_all_coordinates(self, *args):
"""
Tabulate the coordinates of all dofs owned by this
process. This function is typically used by preconditioners
that require the spatial coordinates of dofs, for example
for re-partitioning or nullspace computations. The format for
the return vector is [x0, y0, z0, x1, y1, z1, . . .].
"""
return _fem.GenericDofMap_tabulate_all_coordinates(self, *args)
def copy(self, *args):
"""
Create a copy of the dof map
"""
return _fem.GenericDofMap_copy(self, *args)
def create(self, *args):
"""
Create a new dof map on new mesh
"""
return _fem.GenericDofMap_create(self, *args)
def extract_sub_dofmap(self, *args):
"""
Extract sub dofmap component
"""
return _fem.GenericDofMap_extract_sub_dofmap(self, *args)
def collapse(self, *args):
"""
Create a "collapsed" a dofmap (collapses from a sub-dofmap view)
"""
return _fem.GenericDofMap_collapse(self, *args)
def dofs(self, *args):
"""
Return list of global dof indices on this process
"""
return _fem.GenericDofMap_dofs(self, *args)
def set(self, *args):
"""
Set dof entries in vector to a specified value. Parallel
layout of vector must be consistent with dof map range. This
function is typically used to construct the null space of a
matrix operator
"""
return _fem.GenericDofMap_set(self, *args)
def set_x(self, *args):
"""
Set dof entries in vector to the value*x[i], where x[i] is the
spatial coordinate of the dof. Parallel layout of vector must
be consistent with dof map range. This function is typically
used to construct the null space of a matrix operator, e.g. rigid
body rotations.
"""
return _fem.GenericDofMap_set_x(self, *args)
def shared_dofs(self, *args):
"""
Return map from shared dofs to the processes (not including
the current process) that share it.
"""
return _fem.GenericDofMap_shared_dofs(self, *args)
def neighbours(self, *args):
"""
Return set of processes that share dofs with the this process
"""
return _fem.GenericDofMap_neighbours(self, *args)
constrained_domain = _swig_property(_fem.GenericDofMap_constrained_domain_get, _fem.GenericDofMap_constrained_domain_set)
block_size = _swig_property(_fem.GenericDofMap_block_size_get, _fem.GenericDofMap_block_size_set)
def tabulate_coordinates(self, cell, coordinates=None):
""" Tabulate the coordinates of all dofs on a cell
*Arguments*
cell (_Cell_)
The cell.
coordinates (NumPy array)
Optional argument: The coordinates of all dofs on a cell.
*Returns*
coordinates
The coordinates of all dofs on a cell.
"""
import numpy as np
# Check coordinate argument
shape = (self.max_cell_dimension(), self.geometric_dimension())
if coordinates is None:
coordinates = np.zeros(shape, 'd')
if not isinstance(coordinates, np.ndarray) or \
not (coordinates.flags.c_contiguous and \
coordinates.dtype == np.dtype('d') and \
coordinates.shape==shape):
raise TypeError, "expected a C-contiguous numpy array " \
"of 'double' (dtype='d') with shape %s"%str(shape)
# Call the extended method
self._tabulate_coordinates(coordinates, cell)
return coordinates
__swig_destroy__ = _fem.delete_GenericDofMap
GenericDofMap.is_view = new_instancemethod(_fem.GenericDofMap_is_view,None,GenericDofMap)
GenericDofMap.global_dimension = new_instancemethod(_fem.GenericDofMap_global_dimension,None,GenericDofMap)
GenericDofMap.cell_dimension = new_instancemethod(_fem.GenericDofMap_cell_dimension,None,GenericDofMap)
GenericDofMap.max_cell_dimension = new_instancemethod(_fem.GenericDofMap_max_cell_dimension,None,GenericDofMap)
GenericDofMap.num_entity_dofs = new_instancemethod(_fem.GenericDofMap_num_entity_dofs,None,GenericDofMap)
GenericDofMap.geometric_dimension = new_instancemethod(_fem.GenericDofMap_geometric_dimension,None,GenericDofMap)
GenericDofMap.num_facet_dofs = new_instancemethod(_fem.GenericDofMap_num_facet_dofs,None,GenericDofMap)
GenericDofMap.restriction = new_instancemethod(_fem.GenericDofMap_restriction,None,GenericDofMap)
GenericDofMap.ownership_range = new_instancemethod(_fem.GenericDofMap_ownership_range,None,GenericDofMap)
GenericDofMap.off_process_owner = new_instancemethod(_fem.GenericDofMap_off_process_owner,None,GenericDofMap)
GenericDofMap.cell_dofs = new_instancemethod(_fem.GenericDofMap_cell_dofs,None,GenericDofMap)
GenericDofMap.tabulate_facet_dofs = new_instancemethod(_fem.GenericDofMap_tabulate_facet_dofs,None,GenericDofMap)
GenericDofMap.tabulate_entity_dofs = new_instancemethod(_fem.GenericDofMap_tabulate_entity_dofs,None,GenericDofMap)
GenericDofMap.dof_to_vertex_map = new_instancemethod(_fem.GenericDofMap_dof_to_vertex_map,None,GenericDofMap)
GenericDofMap.vertex_to_dof_map = new_instancemethod(_fem.GenericDofMap_vertex_to_dof_map,None,GenericDofMap)
GenericDofMap.tabulate_all_coordinates = new_instancemethod(_fem.GenericDofMap_tabulate_all_coordinates,None,GenericDofMap)
GenericDofMap.copy = new_instancemethod(_fem.GenericDofMap_copy,None,GenericDofMap)
GenericDofMap.create = new_instancemethod(_fem.GenericDofMap_create,None,GenericDofMap)
GenericDofMap.extract_sub_dofmap = new_instancemethod(_fem.GenericDofMap_extract_sub_dofmap,None,GenericDofMap)
GenericDofMap.collapse = new_instancemethod(_fem.GenericDofMap_collapse,None,GenericDofMap)
GenericDofMap.dofs = new_instancemethod(_fem.GenericDofMap_dofs,None,GenericDofMap)
GenericDofMap.set = new_instancemethod(_fem.GenericDofMap_set,None,GenericDofMap)
GenericDofMap.set_x = new_instancemethod(_fem.GenericDofMap_set_x,None,GenericDofMap)
GenericDofMap.shared_dofs = new_instancemethod(_fem.GenericDofMap_shared_dofs,None,GenericDofMap)
GenericDofMap.neighbours = new_instancemethod(_fem.GenericDofMap_neighbours,None,GenericDofMap)
GenericDofMap._tabulate_coordinates = new_instancemethod(_fem.GenericDofMap__tabulate_coordinates,None,GenericDofMap)
GenericDofMap_swigregister = _fem.GenericDofMap_swigregister
GenericDofMap_swigregister(GenericDofMap)
class DofMap(GenericDofMap):
"""
This class handles the mapping of degrees of freedom. It builds
a dof map based on a ufc::dofmap on a specific mesh. It will
reorder the dofs when running in parallel. Sub-dofmaps, both
views and copies, are supported.
"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""
**Overloaded versions**
* DofMap\ (ufc_dofmap, mesh)
Create dof map on mesh (mesh is not stored)
*Arguments*
ufc_dofmap (ufc::dofmap)
The ufc::dofmap.
mesh (:py:class:`Mesh`)
The mesh.
* DofMap\ (ufc_dofmap, mesh, constrained_domain)
Create a periodic dof map on mesh (mesh is not stored)
*Arguments*
ufc_dofmap (ufc::dofmap)
The ufc::dofmap.
mesh (:py:class:`Mesh`)
The mesh.
conatrained_boundary (:py:class:`SubDomain`)
The subdomain marking the constrained (tied) boudaries.
* DofMap\ (ufc_dofmap, restriction)
Create restricted dof map on mesh
*Arguments*
ufc_dofmap (ufc::dofmap)
The ufc::dofmap.
restriction (:py:class:`Restriction`)
The restriction.
"""
_fem.DofMap_swiginit(self,_fem.new_DofMap(*args))
__swig_destroy__ = _fem.delete_DofMap
def is_restricted(self, *args):
"""
True if dof map is restricted
*Returns*
bool
True if dof map is restricted
"""
return _fem.DofMap_is_restricted(self, *args)
def data(self, *args):
"""
Return the underlying dof map data. Intended for internal library
use only.
*Returns*
std::vector<std::vector<dolfin::la_index> >
The local-to-global map for each cell.
"""
return _fem.DofMap_data(self, *args)
DofMap.is_restricted = new_instancemethod(_fem.DofMap_is_restricted,None,DofMap)
DofMap.data = new_instancemethod(_fem.DofMap_data,None,DofMap)
DofMap_swigregister = _fem.DofMap_swigregister
DofMap_swigregister(DofMap)
def dof_to_vertex_map(*args):
"""
Return a map between dofs indices and vertex indices
Only works for FunctionSpace with dofs exclusively on vertices.
For MixedFunctionSpaces vertex index is offset with the number
of dofs per vertex. In parallel the returned map only maps local
(to processor) dofs.
*Arguments*
space (:py:class:`FunctionSpace`)
The FunctionSpace for what the dof to vertex map should be computed for
*Returns*
numpy.array(int)
The dof to vertex map
"""
return _fem.dof_to_vertex_map(*args)
def vertex_to_dof_map(*args):
"""
Return a map between vertex indices and dofs indices
Only works for FunctionSpace with dofs exclusively on vertices.
For MixedFunctionSpaces dof index is offset with the number of
dofs per vertex.
*Arguments*
space (:py:class:`FunctionSpace`)
The FunctionSpace for what the vertex to dof map should be computed for
*Returns*
std::vector<dolfin::la_index>
The vertex to dof map
"""
return _fem.vertex_to_dof_map(*args)
class Equation(object):
"""
This class represents a variational equation lhs == rhs.
The equation can be either linear or nonlinear:
1. Linear (a == L), in which case a must be a bilinear form
and L must be a linear form.
2. Nonlinear (F == 0), in which case F must be a linear form.
"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""
**Overloaded versions**
* Equation\ (a, L)
Create equation a == L
* Equation\ (F, rhs)
Create equation F == 0
"""
_fem.Equation_swiginit(self,_fem.new_Equation(*args))
__swig_destroy__ = _fem.delete_Equation
def is_linear(self, *args):
"""
Check whether equation is linear
"""
return _fem.Equation_is_linear(self, *args)
def lhs(self, *args):
"""
Return form for left-hand side
"""
return _fem.Equation_lhs(self, *args)
def rhs(self, *args):
"""
Return form for right-hand side
"""
return _fem.Equation_rhs(self, *args)
def rhs_int(self, *args):
"""
Return value for right-hand side
"""
return _fem.Equation_rhs_int(self, *args)
Equation.is_linear = new_instancemethod(_fem.Equation_is_linear,None,Equation)
Equation.lhs = new_instancemethod(_fem.Equation_lhs,None,Equation)
Equation.rhs = new_instancemethod(_fem.Equation_rhs,None,Equation)
Equation.rhs_int = new_instancemethod(_fem.Equation_rhs_int,None,Equation)
Equation_swigregister = _fem.Equation_swigregister
Equation_swigregister(Equation)
class FiniteElement(object):
"""
This is a wrapper for a UFC finite element (ufc::finite_element).
"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""
Create finite element from UFC finite element (data may be shared)
"""
_fem.FiniteElement_swiginit(self,_fem.new_FiniteElement(*args))
__swig_destroy__ = _fem.delete_FiniteElement
def signature(self, *args):
"""
Return a string identifying the finite element
"""
return _fem.FiniteElement_signature(self, *args)
def cell_shape(self, *args):
"""
Return the cell shape
"""
return _fem.FiniteElement_cell_shape(self, *args)
def space_dimension(self, *args):
"""
Return the dimension of the finite element function space
"""
return _fem.FiniteElement_space_dimension(self, *args)
def value_rank(self, *args):
"""
Return the rank of the value space
"""
return _fem.FiniteElement_value_rank(self, *args)
def value_dimension(self, *args):
"""
Return the dimension of the value space for axis i
"""
return _fem.FiniteElement_value_dimension(self, *args)
def evaluate_basis(self, *args):
"""
Evaluate basis function i at given point in cell
"""
return _fem.FiniteElement_evaluate_basis(self, *args)
def evaluate_basis_all(self, *args):
"""
Evaluate all basis functions at given point in cell
"""
return _fem.FiniteElement_evaluate_basis_all(self, *args)
def evaluate_basis_derivatives(self, *args):
"""
Evaluate order n derivatives of basis function i at given point in cell
"""
return _fem.FiniteElement_evaluate_basis_derivatives(self, *args)
def evaluate_basis_derivatives_all(self, *args):
"""
Evaluate order n derivatives of all basis functions at given
point in cell
"""
return _fem.FiniteElement_evaluate_basis_derivatives_all(self, *args)
def evaluate_dof(self, *args):
"""
**Overloaded versions**
* evaluate_dof\ (i, function, vertex_coordinates, cell_orientation, c)
Evaluate linear functional for dof i on the function f
* evaluate_dof\ (i, function, c)
Evaluate linear functional for dof i on the function f
"""
return _fem.FiniteElement_evaluate_dof(self, *args)
def evaluate_dofs(self, *args):
"""
**Overloaded versions**
* evaluate_dofs\ (values, f, vertex_coordinates, cell_orientation, c)
Evaluate linear functionals for all dofs on the function f
* evaluate_dofs\ (values, f, c)
Evaluate linear functionals for all dofs on the function f
"""
return _fem.FiniteElement_evaluate_dofs(self, *args)
def interpolate_vertex_values(self, *args):
"""
Interpolate vertex values from dof values
"""
return _fem.FiniteElement_interpolate_vertex_values(self, *args)
def map_from_reference_cell(self, *args):
"""
Map coordinate xhat from reference cell to coordinate x in cell
"""
return _fem.FiniteElement_map_from_reference_cell(self, *args)
def map_to_reference_cell(self, *args):
"""
Map from coordinate x in cell to coordinate xhat in reference cell
"""
return _fem.FiniteElement_map_to_reference_cell(self, *args)
def num_sub_elements(self, *args):
"""
Return the number of sub elements (for a mixed element)
"""
return _fem.FiniteElement_num_sub_elements(self, *args)
def hash(self, *args):
"""
Return simple hash of the signature string
"""
return _fem.FiniteElement_hash(self, *args)
def create_sub_element(self, *args):
"""
Create a new finite element for sub element i (for a mixed element)
"""
return _fem.FiniteElement_create_sub_element(self, *args)
def create(self, *args):
"""
Create a new class instance
"""
return _fem.FiniteElement_create(self, *args)
def extract_sub_element(self, *args):
"""
Extract sub finite element for component
"""
return _fem.FiniteElement_extract_sub_element(self, *args)
FiniteElement.signature = new_instancemethod(_fem.FiniteElement_signature,None,FiniteElement)
FiniteElement.cell_shape = new_instancemethod(_fem.FiniteElement_cell_shape,None,FiniteElement)
FiniteElement.topological_dimension = new_instancemethod(_fem.FiniteElement_topological_dimension,None,FiniteElement)
FiniteElement.geometric_dimension = new_instancemethod(_fem.FiniteElement_geometric_dimension,None,FiniteElement)
FiniteElement.space_dimension = new_instancemethod(_fem.FiniteElement_space_dimension,None,FiniteElement)
FiniteElement.value_rank = new_instancemethod(_fem.FiniteElement_value_rank,None,FiniteElement)
FiniteElement.value_dimension = new_instancemethod(_fem.FiniteElement_value_dimension,None,FiniteElement)
FiniteElement.evaluate_basis = new_instancemethod(_fem.FiniteElement_evaluate_basis,None,FiniteElement)
FiniteElement.evaluate_basis_all = new_instancemethod(_fem.FiniteElement_evaluate_basis_all,None,FiniteElement)
FiniteElement.evaluate_basis_derivatives = new_instancemethod(_fem.FiniteElement_evaluate_basis_derivatives,None,FiniteElement)
FiniteElement.evaluate_basis_derivatives_all = new_instancemethod(_fem.FiniteElement_evaluate_basis_derivatives_all,None,FiniteElement)
FiniteElement.evaluate_dof = new_instancemethod(_fem.FiniteElement_evaluate_dof,None,FiniteElement)
FiniteElement.evaluate_dofs = new_instancemethod(_fem.FiniteElement_evaluate_dofs,None,FiniteElement)
FiniteElement.interpolate_vertex_values = new_instancemethod(_fem.FiniteElement_interpolate_vertex_values,None,FiniteElement)
FiniteElement.map_from_reference_cell = new_instancemethod(_fem.FiniteElement_map_from_reference_cell,None,FiniteElement)
FiniteElement.map_to_reference_cell = new_instancemethod(_fem.FiniteElement_map_to_reference_cell,None,FiniteElement)
FiniteElement.num_sub_elements = new_instancemethod(_fem.FiniteElement_num_sub_elements,None,FiniteElement)
FiniteElement.hash = new_instancemethod(_fem.FiniteElement_hash,None,FiniteElement)
FiniteElement.create_sub_element = new_instancemethod(_fem.FiniteElement_create_sub_element,None,FiniteElement)
FiniteElement.create = new_instancemethod(_fem.FiniteElement_create,None,FiniteElement)
FiniteElement.extract_sub_element = new_instancemethod(_fem.FiniteElement_extract_sub_element,None,FiniteElement)
FiniteElement_swigregister = _fem.FiniteElement_swigregister
FiniteElement_swigregister(FiniteElement)
class BasisFunction(ufc.function):
"""
This class represents a finite element basis function. It can be
used for computation of basis function values and derivatives.
Evaluation of basis functions is also possible through the use
of the functions ``evaluate_basis`` and ``evaluate_basis_derivatives``
available in the :py:class:`FiniteElement` class. The BasisFunction class
relies on these functions for evaluation but also implements the
ufc::function interface which allows evaluate_dof to be
evaluated for a basis function (on a possibly different
element).
"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""
Create basis function with given index on element on given cell
*Arguments*
index (int)
The index of the basis function.
element (:py:class:`FiniteElement`)
The element to create basis function on.
cell (ufc::cell)
The cell.
"""
_fem.BasisFunction_swiginit(self,_fem.new_BasisFunction(*args))
__swig_destroy__ = _fem.delete_BasisFunction
def eval(self, *args):
"""
Evaluate basis function at given point
*Arguments*
values (float)
The values of the function at the point.
x (float)
The coordinates of the point.
"""
return _fem.BasisFunction_eval(self, *args)
def eval_derivatives(self, *args):
"""
Evaluate all order n derivatives at given point
*Arguments*
values (float)
The values of derivatives at the point.
x (float)
The coordinates of the point.
n (int)
The order of derivation.
"""
return _fem.BasisFunction_eval_derivatives(self, *args)
BasisFunction.eval = new_instancemethod(_fem.BasisFunction_eval,None,BasisFunction)
BasisFunction.eval_derivatives = new_instancemethod(_fem.BasisFunction_eval_derivatives,None,BasisFunction)
BasisFunction_swigregister = _fem.BasisFunction_swigregister
BasisFunction_swigregister(BasisFunction)
class DirichletBC(HierarchicalDirichletBC,common.Variable):
"""
This class specifies the interface for setting (strong)
Dirichlet boundary conditions for partial differential
equations,
.. math::
u = g \hbox{ on } G,
where :math:`u` is the solution to be computed, :math:`g` is a function
and :math:`G` is a sub domain of the mesh.
A DirichletBC is specified by the function g, the function space
(trial space) and boundary indicators on (a subset of) the mesh
boundary.
The boundary indicators may be specified in a number of
different ways.
The simplest approach is to specify the boundary by a :py:class:`SubDomain`
object, using the inside() function to specify on which facets
the boundary conditions should be applied.
Alternatively, the boundary may be specified by a :py:class:`MeshFunction`
labeling all mesh facets together with a number that specifies
which facets should be included in the boundary.
The third option is to attach the boundary information to the
mesh. This is handled automatically when exporting a mesh from
for example VMTK.
The 'method' variable may be used to specify the type of method
used to identify degrees of freedom on the boundary. Available
methods are: topological approach (default), geometric approach,
and pointwise approach. The topological approach is faster, but
will only identify degrees of freedom that are located on a
facet that is entirely on the boundary. In particular, the
topological approach will not identify degrees of freedom for
discontinuous elements (which are all internal to the cell). A
remedy for this is to use the geometric approach. In the
geometric approach, each dof on each facet that matches the
boundary condition will be checked. To apply pointwise boundary
conditions e.g. pointloads, one will have to use the pointwise
approach which in turn is the slowest of the three possible
methods. The three possibilties are "topological", "geometric"
and "pointwise".
The 'check_midpoint' variable can be used to decide whether or
not the midpoint of each facet should be checked when a
user-defined :py:class:`SubDomain` is used to define the domain of the
boundary condition. By default, midpoints are always checked.
Note that this variable may be of importance close to corners,
in which case it is sometimes important to check the midpoint to
avoid including facets "on the diagonal close" to a corner. This
variable is also of importance for curved boundaries (like on a
sphere or cylinder), in which case it is important *not* to
check the midpoint which will be located in the interior of a
domain defined relative to a radius.
"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""
**Overloaded versions**
* DirichletBC\ (V, g, sub_domain, method="topological", check_midpoint=true)
Create boundary condition for subdomain
*Arguments*
V (:py:class:`FunctionSpace`)
The function space.
g (:py:class:`GenericFunction`)
The value.
sub_domain (:py:class:`SubDomain`)
The subdomain.
method (str)
Optional argument: A string specifying
the method to identify dofs.
* DirichletBC\ (V, g, sub_domain, method="topological", check_midpoint=true)
Create boundary condition for subdomain
*Arguments*
V (:py:class:`FunctionSpace`)
The function space
g (:py:class:`GenericFunction`)
The value
sub_domain (:py:class:`SubDomain`)
The subdomain
method (str)
Optional argument: A string specifying
the method to identify dofs
* DirichletBC\ (V, g, sub_domains, sub_domain, method="topological")
Create boundary condition for subdomain specified by index
*Arguments*
V (:py:class:`FunctionSpace`)
The function space.
g (:py:class:`GenericFunction`)
The value.
sub_domains (:py:class:`MeshFunction`)
Subdomain markers
sub_domain (int)
The subdomain index (number)
method (str)
Optional argument: A string specifying the
method to identify dofs.
* DirichletBC\ (V, g, sub_domains, sub_domain, method="topological")
Create boundary condition for subdomain specified by index
*Arguments*
V (:py:class:`FunctionSpace`)
The function space.
g (:py:class:`GenericFunction`)
The value.
sub_domains (:py:class:`MeshFunction`)
Subdomain markers
sub_domain (int)
The subdomain index (number)
method (str)
Optional argument: A string specifying the
method to identify dofs.
* DirichletBC\ (V, g, sub_domain, method="topological")
Create boundary condition for boundary data included in the mesh
*Arguments*
V (:py:class:`FunctionSpace`)
The function space.
g (:py:class:`GenericFunction`)
The value.
sub_domain (int)
The subdomain index (number)
method (str)
Optional argument: A string specifying the
method to identify dofs.
* DirichletBC\ (V, g, sub_domain, method="topological")
Create boundary condition for boundary data included in the mesh
*Arguments*
V (:py:class:`FunctionSpace`)
The function space.
g (:py:class:`GenericFunction`)
The value.
sub_domain (int)
The subdomain index (number)
method (str)
Optional argument: A string specifying the
method to identify dofs.
* DirichletBC\ (V, g, markers, method="topological")
Create boundary condition for subdomain by boundary markers
(cells, local facet numbers)
*Arguments*
V (:py:class:`FunctionSpace`)
The function space.
g (:py:class:`GenericFunction`)
The value.
markers (numpy.array((int, int)))
Subdomain markers (cells, local facet number)
method (str)
Optional argument: A string specifying the
method to identify dofs.
* DirichletBC\ (bc)
Copy constructor
*Arguments*
bc (:py:class:`DirichletBC`)
The object to be copied.
"""
_fem.DirichletBC_swiginit(self,_fem.new_DirichletBC(*args))
__swig_destroy__ = _fem.delete_DirichletBC
def apply(self, *args):
"""
**Overloaded versions**
* apply\ (A)
Apply boundary condition to a matrix
*Arguments*
A (:py:class:`GenericMatrix`)
The matrix to apply boundary condition to.
* apply\ (b)
Apply boundary condition to a vector
*Arguments*
b (:py:class:`GenericVector`)
The vector to apply boundary condition to.
* apply\ (A, b)
Apply boundary condition to a linear system
*Arguments*
A (:py:class:`GenericMatrix`)
The matrix to apply boundary condition to.
b (:py:class:`GenericVector`)
The vector to apply boundary condition to.
* apply\ (b, x)
Apply boundary condition to vectors for a nonlinear problem
*Arguments*
b (:py:class:`GenericVector`)
The vector to apply boundary conditions to.
x (:py:class:`GenericVector`)
Another vector (nonlinear problem).
* apply\ (A, b, x)
Apply boundary condition to a linear system for a nonlinear problem
*Arguments*
A (:py:class:`GenericMatrix`)
The matrix to apply boundary conditions to.
b (:py:class:`GenericVector`)
The vector to apply boundary conditions to.
x (:py:class:`GenericVector`)
Another vector (nonlinear problem).
"""
return _fem.DirichletBC_apply(self, *args)
def get_boundary_values(self, *args):
"""
Get Dirichlet dofs and values. If a method other than 'pointwise' is
used in parallel, the map may not be complete for local vertices since
a vertex can have a bc applied, but the partition might not have a
facet on the boundary. To ensure all local boundary dofs are marked,
it is necessary to call gather() on the returned boundary values.
*Arguments*
boundary_values (boost::unordered_map<std::size_t, double>)
Map from dof to boundary value.
method (str)
Optional argument: A string specifying which
method to use.
"""
return _fem.DirichletBC_get_boundary_values(self, *args)
def gather(self, *args):
"""
Get boundary values from neighbour processes. If a method other than
"pointwise" is used, this is necessary to ensure all boundary dofs are
marked on all processes.
*Arguments*
boundary_values (boost::unordered_map<std::size_t, double>)
Map from dof to boundary value.
"""
return _fem.DirichletBC_gather(self, *args)
def zero(self, *args):
"""
Make rows of matrix associated with boundary condition zero,
useful for non-diagonal matrices in a block matrix.
*Arguments*
A (:py:class:`GenericMatrix`)
The matrix
"""
return _fem.DirichletBC_zero(self, *args)
def zero_columns(self, *args):
"""
Make columns of matrix associated with boundary condition
zero, and update a (right-hand side) vector to reflect the
changes. Useful for non-diagonals.
*Arguments*
A (:py:class:`GenericMatrix`)
The matrix
b (:py:class:`GenericVector`)
The vector
diag_val (float)
This parameter would normally be -1, 0 or 1.
"""
return _fem.DirichletBC_zero_columns(self, *args)
def markers(self, *args):
"""
Return boundary markers
*Returns*
numpy.array((int, int))
Boundary markers (facets stored as pairs of cells and
local facet numbers).
"""
return _fem.DirichletBC_markers(self, *args)
def _function_space(self, *args):
"""
Return function space V
*Returns*
_FunctionSPace_
The function space to which boundary conditions are applied.
"""
return _fem.DirichletBC__function_space(self, *args)
def value(self, *args):
"""
Return boundary value g
*Returns*
:py:class:`GenericFunction`
The boundary values.
"""
return _fem.DirichletBC_value(self, *args)
def user_sub_domain(self, *args):
"""
Return shared pointer to subdomain
*Returns*
:py:class:`SubDomain`
Shared pointer to subdomain.
"""
return _fem.DirichletBC_user_sub_domain(self, *args)
def is_compatible(self, *args):
"""
Check if given function is compatible with boundary condition
(checking only vertex values)
*Arguments*
v (:py:class:`GenericFunction`)
The function to check for compability
with boundary condition.
*Returns*
bool
True if compatible.
"""
return _fem.DirichletBC_is_compatible(self, *args)
def set_value(self, *args):
"""
**Overloaded versions**
* set_value\ (g)
Set value g for boundary condition, domain remains unchanged
*Arguments*
g (:py:class:`GenericFunction`)
The value.
* set_value\ (g)
Set value g for boundary condition, domain remains unchanged
*Arguments*
g (:py:class:`GenericFunction`)
The value.
"""
return _fem.DirichletBC_set_value(self, *args)
def homogenize(self, *args):
"""
Set value to 0.0
"""
return _fem.DirichletBC_homogenize(self, *args)
def method(self, *args):
"""
Return method used for computing Dirichet dofs
*Returns*
str
Method used for computing Dirichet dofs ("topological",
"geometric" or "pointwise").
"""
return _fem.DirichletBC_method(self, *args)
def default_parameters(*args):
"""
Default parameter values
"""
return _fem.DirichletBC_default_parameters(*args)
default_parameters = staticmethod(default_parameters)
_user_sub_domain = _swig_property(_fem.DirichletBC__user_sub_domain_get, _fem.DirichletBC__user_sub_domain_set)
def function_space(self):
"Return the FunctionSpace"
from dolfin.functions.functionspace import FunctionSpaceFromCpp
return FunctionSpaceFromCpp(self._function_space())
DirichletBC.apply = new_instancemethod(_fem.DirichletBC_apply,None,DirichletBC)
DirichletBC.get_boundary_values = new_instancemethod(_fem.DirichletBC_get_boundary_values,None,DirichletBC)
DirichletBC.gather = new_instancemethod(_fem.DirichletBC_gather,None,DirichletBC)
DirichletBC.zero = new_instancemethod(_fem.DirichletBC_zero,None,DirichletBC)
DirichletBC.zero_columns = new_instancemethod(_fem.DirichletBC_zero_columns,None,DirichletBC)
DirichletBC.markers = new_instancemethod(_fem.DirichletBC_markers,None,DirichletBC)
DirichletBC._function_space = new_instancemethod(_fem.DirichletBC__function_space,None,DirichletBC)
DirichletBC.value = new_instancemethod(_fem.DirichletBC_value,None,DirichletBC)
DirichletBC.user_sub_domain = new_instancemethod(_fem.DirichletBC_user_sub_domain,None,DirichletBC)
DirichletBC.is_compatible = new_instancemethod(_fem.DirichletBC_is_compatible,None,DirichletBC)
DirichletBC.set_value = new_instancemethod(_fem.DirichletBC_set_value,None,DirichletBC)
DirichletBC.homogenize = new_instancemethod(_fem.DirichletBC_homogenize,None,DirichletBC)
DirichletBC.method = new_instancemethod(_fem.DirichletBC_method,None,DirichletBC)
DirichletBC_swigregister = _fem.DirichletBC_swigregister
DirichletBC_swigregister(DirichletBC)
def DirichletBC_default_parameters(*args):
"""
Default parameter values
"""
return _fem.DirichletBC_default_parameters(*args)
class PointSource(object):
"""
This class provides an easy mechanism for adding a point source
(Dirac delta function) to the right-hand side vector in a
variational problem. The associated function space must be
scalar in order for the inner product with the (scalar) Dirac
delta function to be well defined.
"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""
**Overloaded versions**
* PointSource\ (V, p, magnitude=1.0)
Create point source at given point of given magnitude
* PointSource\ (V, p, magnitude=1.0)
Create point source at given point of given magnitude
"""
_fem.PointSource_swiginit(self,_fem.new_PointSource(*args))
__swig_destroy__ = _fem.delete_PointSource
def apply(self, *args):
"""
Apply (add) point source to right-hand side vector
"""
return _fem.PointSource_apply(self, *args)
PointSource.apply = new_instancemethod(_fem.PointSource_apply,None,PointSource)
PointSource_swigregister = _fem.PointSource_swigregister
PointSource_swigregister(PointSource)
def assemble_system(*args):
"""
**Overloaded versions**
* assemble_system\ (A, b, a, L)
Assemble system (A, b)
* assemble_system\ (A, b, a, L, bc)
Assemble system (A, b) and apply Dirichlet boundary condition
* assemble_system\ (A, b, a, L, bcs)
Assemble system (A, b) and apply Dirichlet boundary conditions
* assemble_system\ (A, b, a, L, bcs, x0)
Assemble system (A, b) on sub domains and apply Dirichlet boundary
conditions
"""
return _fem.assemble_system(*args)
def assemble(*args):
"""
**Overloaded versions**
* assemble\ (A, a)
Assemble tensor
* assemble\ (a)
Assemble scalar
"""
return _fem.assemble(*args)
class LocalSolver(object):
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def solve(self, *args):
"""
Solve local (cell-wise) problem and copy result into global
vector x.
"""
return _fem.LocalSolver_solve(self, *args)
def __init__(self, *args):
_fem.LocalSolver_swiginit(self,_fem.new_LocalSolver(*args))
__swig_destroy__ = _fem.delete_LocalSolver
LocalSolver.solve = new_instancemethod(_fem.LocalSolver_solve,None,LocalSolver)
LocalSolver_swigregister = _fem.LocalSolver_swigregister
LocalSolver_swigregister(LocalSolver)
class Form(HierarchicalForm):
"""
Base class for UFC code generated by FFC for DOLFIN with option -l.
A note on the order of trial and test spaces: FEniCS numbers
argument spaces starting with the leading dimension of the
corresponding tensor (matrix). In other words, the test space is
numbered 0 and the trial space is numbered 1. However, in order
to have a notation that agrees with most existing finite element
literature, in particular
a = a(u, v)
the spaces are numbered from right to
a: V_1 x V_0 -> R
.. note::
Figure out how to write this in math mode without it getting
messed up in the Python version.
This is reflected in the ordering of the spaces that should be
supplied to generated subclasses. In particular, when a bilinear
form is initialized, it should be initialized as
.. code-block:: c++
a(V_1, V_0) = ...
where ``V_1`` is the trial space and ``V_0`` is the test space.
However, when a form is initialized by a list of argument spaces
(the variable ``function_spaces`` in the constructors below, the
list of spaces should start with space number 0 (the test space)
and then space number 1 (the trial space).
"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""
**Overloaded versions**
* Form\ (rank, num_coefficients)
Create form of given rank with given number of coefficients
*Arguments*
rank (int)
The rank.
num_coefficients (int)
The number of coefficients.
* Form\ (ufc_form, function_spaces, coefficients)
Create form (shared data)
*Arguments*
ufc_form (ufc::form)
The UFC form.
function_spaces (list of :py:class:`FunctionSpace`)
Vector of function spaces.
coefficients (list of :py:class:`GenericFunction`)
Vector of coefficients.
"""
_fem.Form_swiginit(self,_fem.new_Form(*args))
__swig_destroy__ = _fem.delete_Form
def rank(self, *args):
"""
Return rank of form (bilinear form = 2, linear form = 1,
functional = 0, etc)
*Returns*
int
The rank of the form.
"""
return _fem.Form_rank(self, *args)
def num_coefficients(self, *args):
"""
Return number of coefficients
*Returns*
int
The number of coefficients.
"""
return _fem.Form_num_coefficients(self, *args)
def coloring(self, *args):
"""
Return coloring type for colored (multi-threaded) assembly of form
over a mesh entity of a given dimension
*Arguments*
entity_dim (int)
Dimension.
*Returns*
numpy.array(int)
Coloring type.
"""
return _fem.Form_coloring(self, *args)
def set_mesh(self, *args):
"""
Set mesh, necessary for functionals when there are no function spaces
*Arguments*
mesh (:py:class:`Mesh`)
The mesh.
"""
return _fem.Form_set_mesh(self, *args)
def mesh(self, *args):
"""
Extract common mesh from form
*Returns*
:py:class:`Mesh`
The mesh.
"""
return _fem.Form_mesh(self, *args)
def mesh_shared_ptr(self, *args):
"""
Return mesh shared pointer (if any)
*Returns*
:py:class:`Mesh`
The mesh shared pointer.
"""
return _fem.Form_mesh_shared_ptr(self, *args)
def _function_space(self, *args):
"""
Return function space for given argument
*Arguments*
i (int)
Index
*Returns*
:py:class:`FunctionSpace`
Function space shared pointer.
"""
return _fem.Form__function_space(self, *args)
def function_spaces(self, *args):
"""
Return function spaces for arguments
*Returns*
list of :py:class:`FunctionSpace`
Vector of function space shared pointers.
"""
return _fem.Form_function_spaces(self, *args)
def set_coefficient(self, *args):
"""
**Overloaded versions**
* set_coefficient\ (i, coefficient)
Set coefficient with given number (shared pointer version)
*Arguments*
i (int)
The given number.
coefficient (:py:class:`GenericFunction`)
The coefficient.
* set_coefficient\ (name, coefficient)
Set coefficient with given name (shared pointer version)
*Arguments*
name (str)
The name.
coefficient (:py:class:`GenericFunction`)
The coefficient.
"""
return _fem.Form_set_coefficient(self, *args)
def set_coefficients(self, *args):
"""
Set all coefficients in given map, possibly a subset (shared
pointer version)
*Arguments*
coefficients (:py:class:`GenericFunction`)
The map of coefficients.
"""
return _fem.Form_set_coefficients(self, *args)
def coefficient(self, *args):
"""
**Overloaded versions**
* coefficient\ (i)
Return coefficient with given number
*Arguments*
i (int)
Index
*Returns*
:py:class:`GenericFunction`
The coefficient.
* coefficient\ (name)
Return coefficient with given name
*Arguments*
name (str)
The name.
*Returns*
:py:class:`GenericFunction`
The coefficient.
"""
return _fem.Form_coefficient(self, *args)
def coefficients(self, *args):
"""
Return all coefficients
*Returns*
list of :py:class:`GenericFunction`
All coefficients.
"""
return _fem.Form_coefficients(self, *args)
def coefficient_number(self, *args):
"""
Return the number of the coefficient with this name
*Arguments*
name (str)
The name.
*Returns*
int
The number of the coefficient with the given name.
"""
return _fem.Form_coefficient_number(self, *args)
def coefficient_name(self, *args):
"""
Return the name of the coefficient with this number
*Arguments*
i (int)
The number
*Returns*
str
The name of the coefficient with the given number.
"""
return _fem.Form_coefficient_name(self, *args)
def cell_domains(self, *args):
"""
Return cell domains (zero pointer if no domains have been
specified)
*Returns*
:py:class:`MeshFunction`
The cell domains.
"""
return _fem.Form_cell_domains(self, *args)
def exterior_facet_domains(self, *args):
"""
Return exterior facet domains (zero pointer if no domains have
been specified)
*Returns*
:py:class:`MeshFunction`
The exterior facet domains.
"""
return _fem.Form_exterior_facet_domains(self, *args)
def interior_facet_domains(self, *args):
"""
Return interior facet domains (zero pointer if no domains have
been specified)
*Returns*
:py:class:`MeshFunction`
The interior facet domains.
"""
return _fem.Form_interior_facet_domains(self, *args)
def set_cell_domains(self, *args):
"""
Set cell domains
*Arguments*
cell_domains (:py:class:`MeshFunction`)
The cell domains.
"""
return _fem.Form_set_cell_domains(self, *args)
def set_exterior_facet_domains(self, *args):
"""
Set exterior facet domains
*Arguments*
exterior_facet_domains (:py:class:`MeshFunction`)
The exterior facet domains.
"""
return _fem.Form_set_exterior_facet_domains(self, *args)
def set_interior_facet_domains(self, *args):
"""
Set interior facet domains
*Arguments*
interior_facet_domains (:py:class:`MeshFunction`)
The interior facet domains.
"""
return _fem.Form_set_interior_facet_domains(self, *args)
def ufc_form(self, *args):
"""
Return UFC form shared pointer
*Returns*
ufc::form
The UFC form.
"""
return _fem.Form_ufc_form(self, *args)
def check(self, *args):
"""
Check function spaces and coefficients
"""
return _fem.Form_check(self, *args)
def function_space(self, i):
"""
Return function space for given argument
*Arguments*
i (std::size_t)
Index
*Returns*
_FunctionSpace_
Function space shared pointer.
"""
from dolfin.functions.functionspace import FunctionSpaceFromCpp
return FunctionSpaceFromCpp(self._function_space(i))
Form.rank = new_instancemethod(_fem.Form_rank,None,Form)
Form.num_coefficients = new_instancemethod(_fem.Form_num_coefficients,None,Form)
Form.coloring = new_instancemethod(_fem.Form_coloring,None,Form)
Form.set_mesh = new_instancemethod(_fem.Form_set_mesh,None,Form)
Form.mesh = new_instancemethod(_fem.Form_mesh,None,Form)
Form.mesh_shared_ptr = new_instancemethod(_fem.Form_mesh_shared_ptr,None,Form)
Form._function_space = new_instancemethod(_fem.Form__function_space,None,Form)
Form.function_spaces = new_instancemethod(_fem.Form_function_spaces,None,Form)
Form.set_coefficient = new_instancemethod(_fem.Form_set_coefficient,None,Form)
Form.set_coefficients = new_instancemethod(_fem.Form_set_coefficients,None,Form)
Form.coefficient = new_instancemethod(_fem.Form_coefficient,None,Form)
Form.coefficients = new_instancemethod(_fem.Form_coefficients,None,Form)
Form.coefficient_number = new_instancemethod(_fem.Form_coefficient_number,None,Form)
Form.coefficient_name = new_instancemethod(_fem.Form_coefficient_name,None,Form)
Form.cell_domains = new_instancemethod(_fem.Form_cell_domains,None,Form)
Form.exterior_facet_domains = new_instancemethod(_fem.Form_exterior_facet_domains,None,Form)
Form.interior_facet_domains = new_instancemethod(_fem.Form_interior_facet_domains,None,Form)
Form.set_cell_domains = new_instancemethod(_fem.Form_set_cell_domains,None,Form)
Form.set_exterior_facet_domains = new_instancemethod(_fem.Form_set_exterior_facet_domains,None,Form)
Form.set_interior_facet_domains = new_instancemethod(_fem.Form_set_interior_facet_domains,None,Form)
Form.ufc_form = new_instancemethod(_fem.Form_ufc_form,None,Form)
Form.check = new_instancemethod(_fem.Form_check,None,Form)
Form_swigregister = _fem.Form_swigregister
Form_swigregister(Form)
class AssemblerBase(object):
"""
This class provides some common functions used in
assembler classes.
"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
_fem.AssemblerBase_swiginit(self,_fem.new_AssemblerBase(*args))
reset_sparsity = _swig_property(_fem.AssemblerBase_reset_sparsity_get, _fem.AssemblerBase_reset_sparsity_set)
add_values = _swig_property(_fem.AssemblerBase_add_values_get, _fem.AssemblerBase_add_values_set)
finalize_tensor = _swig_property(_fem.AssemblerBase_finalize_tensor_get, _fem.AssemblerBase_finalize_tensor_set)
keep_diagonal = _swig_property(_fem.AssemblerBase_keep_diagonal_get, _fem.AssemblerBase_keep_diagonal_set)
__swig_destroy__ = _fem.delete_AssemblerBase
AssemblerBase.init_global_tensor = new_instancemethod(_fem.AssemblerBase_init_global_tensor,None,AssemblerBase)
AssemblerBase_swigregister = _fem.AssemblerBase_swigregister
AssemblerBase_swigregister(AssemblerBase)
class Assembler(AssemblerBase):
"""
This class provides automated assembly of linear systems, or
more generally, assembly of a sparse tensor from a given
variational form.
Subdomains for cells and facets may be specified by assigning
subdomain indicators specified by :py:class:`MeshFunction` to the :py:class:`Form`
being assembled:
.. code-block:: c++
form.dx = cell_domains
form.ds = exterior_facet_domains
form.dS = interior_facet_domains
"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""
Constructor
"""
_fem.Assembler_swiginit(self,_fem.new_Assembler(*args))
def assemble(self, *args):
"""
Assemble tensor from given form
*Arguments*
A (:py:class:`GenericTensor`)
The tensor to assemble.
a (:py:class:`Form`)
The form to assemble the tensor from.
"""
return _fem.Assembler_assemble(self, *args)
def assemble_cells(self, *args):
"""
Assemble tensor from given form over cells. This function is
provided for users who wish to build a customized assembler.
"""
return _fem.Assembler_assemble_cells(self, *args)
def assemble_exterior_facets(self, *args):
"""
Assemble tensor from given form over exterior facets. This
function is provided for users who wish to build a customized
assembler.
"""
return _fem.Assembler_assemble_exterior_facets(self, *args)
def assemble_interior_facets(self, *args):
"""
Assemble tensor from given form over interior facets. This
function is provided for users who wish to build a customized
assembler.
"""
return _fem.Assembler_assemble_interior_facets(self, *args)
__swig_destroy__ = _fem.delete_Assembler
Assembler.assemble = new_instancemethod(_fem.Assembler_assemble,None,Assembler)
Assembler.assemble_cells = new_instancemethod(_fem.Assembler_assemble_cells,None,Assembler)
Assembler.assemble_exterior_facets = new_instancemethod(_fem.Assembler_assemble_exterior_facets,None,Assembler)
Assembler.assemble_interior_facets = new_instancemethod(_fem.Assembler_assemble_interior_facets,None,Assembler)
Assembler_swigregister = _fem.Assembler_swigregister
Assembler_swigregister(Assembler)
class SparsityPatternBuilder(object):
"""
This class provides functions to compute the sparsity pattern.
"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def build(*args):
"""
Build sparsity pattern for assembly of given form
"""
return _fem.SparsityPatternBuilder_build(*args)
build = staticmethod(build)
def build_ccfem(*args):
"""
Build sparsity pattern for assembly of given CCFEM form
"""
return _fem.SparsityPatternBuilder_build_ccfem(*args)
build_ccfem = staticmethod(build_ccfem)
def __init__(self, *args):
_fem.SparsityPatternBuilder_swiginit(self,_fem.new_SparsityPatternBuilder(*args))
__swig_destroy__ = _fem.delete_SparsityPatternBuilder
SparsityPatternBuilder_swigregister = _fem.SparsityPatternBuilder_swigregister
SparsityPatternBuilder_swigregister(SparsityPatternBuilder)
def SparsityPatternBuilder_build(*args):
"""
Build sparsity pattern for assembly of given form
"""
return _fem.SparsityPatternBuilder_build(*args)
def SparsityPatternBuilder_build_ccfem(*args):
"""
Build sparsity pattern for assembly of given CCFEM form
"""
return _fem.SparsityPatternBuilder_build_ccfem(*args)
class SystemAssembler(AssemblerBase):
"""
This class provides an assembler for systems of the form
Ax = b. It differs from the default DOLFIN assembler in that it
applies boundary conditions at the time of assembly, which
preserves any symmetries in A.
"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""
**Overloaded versions**
* SystemAssembler\ (a, L)
Constructor
* SystemAssembler\ (a, L, bc)
Constructor
* SystemAssembler\ (a, L, bcs)
Constructor
* SystemAssembler\ (a, L)
Constructor
* SystemAssembler\ (a, L, bc)
Constructor
* SystemAssembler\ (a, L, bcs)
Constructor
"""
_fem.SystemAssembler_swiginit(self,_fem.new_SystemAssembler(*args))
def assemble(self, *args):
"""
**Overloaded versions**
* assemble\ (A, b)
Assemble system (A, b)
* assemble\ (A)
Assemble matrix A
* assemble\ (b)
Assemble vector b
* assemble\ (A, b, x0)
Assemble system (A, b) for (negative) increment dx, where
x = x0 - dx is solution to system a == -L subject to bcs.
Suitable for use inside a (quasi-)Newton solver.
* assemble\ (b, x0)
Assemble rhs vector b for (negative) increment dx, where
x = x0 - dx is solution to system a == -L subject to bcs.
Suitable for use inside a (quasi-)Newton solver.
"""
return _fem.SystemAssembler_assemble(self, *args)
__swig_destroy__ = _fem.delete_SystemAssembler
SystemAssembler.assemble = new_instancemethod(_fem.SystemAssembler_assemble,None,SystemAssembler)
SystemAssembler_swigregister = _fem.SystemAssembler_swigregister
SystemAssembler_swigregister(SystemAssembler)
class LinearVariationalProblem(HierarchicalLinearVariationalProblem):
"""
This class represents a linear variational problem:
Find u in V such that
a(u, v) = L(v) for all v in V^,
where V is the trial space and V^ is the test space.
"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""
**Overloaded versions**
* LinearVariationalProblem\ (a, L, u)
Create linear variational problem without boundary conditions
* LinearVariationalProblem\ (a, L, u, bc)
Create linear variational problem with a single boundary condition
* LinearVariationalProblem\ (a, L, u, bcs)
Create linear variational problem with a list of boundary conditions
* LinearVariationalProblem\ (a, L, u, bcs)
Create linear variational problem with a list of boundary conditions
(shared pointer version)
"""
_fem.LinearVariationalProblem_swiginit(self,_fem.new_LinearVariationalProblem(*args))
def bilinear_form(self, *args):
"""
Return bilinear form
"""
return _fem.LinearVariationalProblem_bilinear_form(self, *args)
def linear_form(self, *args):
"""
Return linear form
"""
return _fem.LinearVariationalProblem_linear_form(self, *args)
def _solution(self, *args):
"""
**Overloaded versions**
* solution\ ()
Return solution variable
* solution\ ()
Return solution variable (const version)
"""
return _fem.LinearVariationalProblem__solution(self, *args)
def bcs(self, *args):
"""
Return boundary conditions
"""
return _fem.LinearVariationalProblem_bcs(self, *args)
def _trial_space(self, *args):
"""
Return trial space
"""
return _fem.LinearVariationalProblem__trial_space(self, *args)
def _test_space(self, *args):
"""
Return test space
"""
return _fem.LinearVariationalProblem__test_space(self, *args)
def solution(self):
"""
Return the solution
"""
from dolfin.functions.function import Function
return Function(self._solution())
def trial_space(self):
"""
Return the trial space
"""
from dolfin.functions.functionspace import FunctionSpaceFromCpp
return FunctionSpaceFromCpp(self._trial_space())
def test_space(self):
"""
Return the test space
"""
from dolfin.functions.functionspace import FunctionSpaceFromCpp
return FunctionSpaceFromCpp(self._test_space())
__swig_destroy__ = _fem.delete_LinearVariationalProblem
LinearVariationalProblem.bilinear_form = new_instancemethod(_fem.LinearVariationalProblem_bilinear_form,None,LinearVariationalProblem)
LinearVariationalProblem.linear_form = new_instancemethod(_fem.LinearVariationalProblem_linear_form,None,LinearVariationalProblem)
LinearVariationalProblem._solution = new_instancemethod(_fem.LinearVariationalProblem__solution,None,LinearVariationalProblem)
LinearVariationalProblem.bcs = new_instancemethod(_fem.LinearVariationalProblem_bcs,None,LinearVariationalProblem)
LinearVariationalProblem._trial_space = new_instancemethod(_fem.LinearVariationalProblem__trial_space,None,LinearVariationalProblem)
LinearVariationalProblem._test_space = new_instancemethod(_fem.LinearVariationalProblem__test_space,None,LinearVariationalProblem)
LinearVariationalProblem_swigregister = _fem.LinearVariationalProblem_swigregister
LinearVariationalProblem_swigregister(LinearVariationalProblem)
class LinearVariationalSolver(common.Variable):
"""
This class implements a solver for linear variational problems.
"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""
**Overloaded versions**
* LinearVariationalSolver\ (problem)
Create linear variational solver for given problem
* LinearVariationalSolver\ (problem)
Create linear variational solver for given problem (shared pointer version)
"""
_fem.LinearVariationalSolver_swiginit(self,_fem.new_LinearVariationalSolver(*args))
def solve(self, *args):
"""
Solve variational problem
"""
return _fem.LinearVariationalSolver_solve(self, *args)
def default_parameters(*args):
"""
Default parameter values
"""
return _fem.LinearVariationalSolver_default_parameters(*args)
default_parameters = staticmethod(default_parameters)
__swig_destroy__ = _fem.delete_LinearVariationalSolver
LinearVariationalSolver.solve = new_instancemethod(_fem.LinearVariationalSolver_solve,None,LinearVariationalSolver)
LinearVariationalSolver_swigregister = _fem.LinearVariationalSolver_swigregister
LinearVariationalSolver_swigregister(LinearVariationalSolver)
def LinearVariationalSolver_default_parameters(*args):
"""
Default parameter values
"""
return _fem.LinearVariationalSolver_default_parameters(*args)
class NonlinearVariationalProblem(HierarchicalNonlinearVariationalProblem):
"""
This class represents a nonlinear variational problem:
Find u in V such that
F(u; v) = 0 for all v in V^,
where V is the trial space and V^ is the test space.
"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""
**Overloaded versions**
* NonlinearVariationalProblem\ (F, u)
Create nonlinear variational problem without boundary conditions.
The Jacobian form is not specified which requires the use of a
nonlinear solver that does not rely on the Jacobian.
* NonlinearVariationalProblem\ (F, u, J)
Create nonlinear variational problem without boundary conditions.
The Jacobian form is specified which allows the use of a nonlinear
solver that relies on the Jacobian (using Newton's method).
* NonlinearVariationalProblem\ (F, u, bc)
Create nonlinear variational problem with a single boundary condition.
The Jacobian form is not specified which requires the use of a
nonlinear solver that does not rely on the Jacobian.
* NonlinearVariationalProblem\ (F, u, bc, J)
Create nonlinear variational problem with a single boundary condition.
The Jacobian form is specified which allows the use of a nonlinear
solver that relies on the Jacobian (using Newton's method).
* NonlinearVariationalProblem\ (F, u, bcs)
Create nonlinear variational problem with a list of boundary conditions.
The Jacobian form is not specified which requires the use of a
nonlinear solver that does not rely on the Jacobian.
* NonlinearVariationalProblem\ (F, u, bcs, J)
Create nonlinear variational problem with a list of boundary conditions.
The Jacobian form is specified which allows the use of a nonlinear
solver that relies on the Jacobian (using Newton's method).
* NonlinearVariationalProblem\ (F, u, bcs)
Create nonlinear variational problem, shared pointer version.
The Jacobian form is not specified which requires the use of a
nonlinear solver that does not rely on the Jacobian.
* NonlinearVariationalProblem\ (F, u, bcs, J)
Create nonlinear variational problem, shared pointer version.
The Jacobian form is specified which allows the use of a nonlinear
solver that relies on the Jacobian (using Newton's method).
"""
_fem.NonlinearVariationalProblem_swiginit(self,_fem.new_NonlinearVariationalProblem(*args))
def set_bounds(self, *args):
"""
**Overloaded versions**
* set_bounds\ (lb, ub)
Set the bounds for bound constrained solver
* set_bounds\ (lb, ub)
Set the bounds for bound constrained solver
* set_bounds\ (lb_func, ub_func)
Set the bounds for bound constrained solver
* set_bounds\ (lb_func, ub_func)
Set the bounds for bound constrained solver
"""
return _fem.NonlinearVariationalProblem_set_bounds(self, *args)
def residual_form(self, *args):
"""
Return residual form
"""
return _fem.NonlinearVariationalProblem_residual_form(self, *args)
def jacobian_form(self, *args):
"""
Return Jacobian form
"""
return _fem.NonlinearVariationalProblem_jacobian_form(self, *args)
def _solution(self, *args):
"""
**Overloaded versions**
* solution\ ()
Return solution variable
* solution\ ()
Return solution variable (const version)
"""
return _fem.NonlinearVariationalProblem__solution(self, *args)
def bcs(self, *args):
"""
Return boundary conditions
"""
return _fem.NonlinearVariationalProblem_bcs(self, *args)
def _trial_space(self, *args):
"""
Return trial space
"""
return _fem.NonlinearVariationalProblem__trial_space(self, *args)
def _test_space(self, *args):
"""
Return test space
"""
return _fem.NonlinearVariationalProblem__test_space(self, *args)
def lower_bound(self, *args):
"""
Return lower bound
"""
return _fem.NonlinearVariationalProblem_lower_bound(self, *args)
def upper_bound(self, *args):
"""
Return upper bound
"""
return _fem.NonlinearVariationalProblem_upper_bound(self, *args)
def has_jacobian(self, *args):
"""
Check whether Jacobian has been defined
"""
return _fem.NonlinearVariationalProblem_has_jacobian(self, *args)
def has_lower_bound(self, *args):
"""
Check whether lower bound has been defined
"""
return _fem.NonlinearVariationalProblem_has_lower_bound(self, *args)
def has_upper_bound(self, *args):
"""
Check whether upper bound have has defined
"""
return _fem.NonlinearVariationalProblem_has_upper_bound(self, *args)
def solution(self):
"""
Return the solution
"""
from dolfin.functions.function import Function
return Function(self._solution())
def trial_space(self):
"""
Return the trial space
"""
from dolfin.functions.functionspace import FunctionSpaceFromCpp
return FunctionSpaceFromCpp(self._trial_space())
def test_space(self):
"""
Return the test space
"""
from dolfin.functions.functionspace import FunctionSpaceFromCpp
return FunctionSpaceFromCpp(self._test_space())
__swig_destroy__ = _fem.delete_NonlinearVariationalProblem
NonlinearVariationalProblem.set_bounds = new_instancemethod(_fem.NonlinearVariationalProblem_set_bounds,None,NonlinearVariationalProblem)
NonlinearVariationalProblem.residual_form = new_instancemethod(_fem.NonlinearVariationalProblem_residual_form,None,NonlinearVariationalProblem)
NonlinearVariationalProblem.jacobian_form = new_instancemethod(_fem.NonlinearVariationalProblem_jacobian_form,None,NonlinearVariationalProblem)
NonlinearVariationalProblem._solution = new_instancemethod(_fem.NonlinearVariationalProblem__solution,None,NonlinearVariationalProblem)
NonlinearVariationalProblem.bcs = new_instancemethod(_fem.NonlinearVariationalProblem_bcs,None,NonlinearVariationalProblem)
NonlinearVariationalProblem._trial_space = new_instancemethod(_fem.NonlinearVariationalProblem__trial_space,None,NonlinearVariationalProblem)
NonlinearVariationalProblem._test_space = new_instancemethod(_fem.NonlinearVariationalProblem__test_space,None,NonlinearVariationalProblem)
NonlinearVariationalProblem.lower_bound = new_instancemethod(_fem.NonlinearVariationalProblem_lower_bound,None,NonlinearVariationalProblem)
NonlinearVariationalProblem.upper_bound = new_instancemethod(_fem.NonlinearVariationalProblem_upper_bound,None,NonlinearVariationalProblem)
NonlinearVariationalProblem.has_jacobian = new_instancemethod(_fem.NonlinearVariationalProblem_has_jacobian,None,NonlinearVariationalProblem)
NonlinearVariationalProblem.has_lower_bound = new_instancemethod(_fem.NonlinearVariationalProblem_has_lower_bound,None,NonlinearVariationalProblem)
NonlinearVariationalProblem.has_upper_bound = new_instancemethod(_fem.NonlinearVariationalProblem_has_upper_bound,None,NonlinearVariationalProblem)
NonlinearVariationalProblem_swigregister = _fem.NonlinearVariationalProblem_swigregister
NonlinearVariationalProblem_swigregister(NonlinearVariationalProblem)
class NonlinearVariationalSolver(common.Variable):
"""
This class implements a solver for nonlinear variational problems.
"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""
**Overloaded versions**
* NonlinearVariationalSolver\ (problem)
Create nonlinear variational solver for given problem
* NonlinearVariationalSolver\ (problem)
Create nonlinear variational solver for given problem (shared pointer version)
"""
_fem.NonlinearVariationalSolver_swiginit(self,_fem.new_NonlinearVariationalSolver(*args))
def solve(self, *args):
"""
**Overloaded versions**
* solve\ (lb, ub)
Solve variational problem with bound constraints defined by GenericVectors
*Arguments*
lb (:py:class:`GenericVector`)
The linear solver.
ub (:py:class:`GenericVector`)
The factory.
*Returns*
(int, bool)
Pair of number of Newton iterations, and whether
iteration converged)
* solve\ (lb, ub)
Solve variational problem with bound constraints defined by GenericVectors (shared pointer version)
*Arguments*
lb (_boost::shared_ptr<const GenericVector>_)
The linear solver.
ub (_boost::shared_ptr<const GenericVector>_)
The factory.
*Returns*
(int, bool)
Pair of number of Newton iterations, and whether
iteration converged)
* solve\ (lb, ub)
Solve variational problem with bound constraints defined by Functions
*Arguments*
lb (:py:class:`Function`)
The linear solver.
ub (:py:class:`Function`)
The factory.
*Returns*
(int, bool)
Pair of number of Newton iterations, and whether
iteration converged)
* solve\ (lb, ub)
Solve variational problem with bound constraints defined by Functions (shared pointer version)
*Arguments*
lb (_boost::shared_ptr<const Function>_)
The linear solver.
ub (_boost::shared_ptr<const Function>_)
The factory.
*Returns*
(int, bool)
Pair of number of Newton iterations, and whether
iteration converged)
* solve\ ()
Solve variational problem
*Returns*
(int, bool)
Pair of number of Newton iterations, and whether
iteration converged)
"""
return _fem.NonlinearVariationalSolver_solve(self, *args)
def default_parameters(*args):
"""
Default parameter values
"""
return _fem.NonlinearVariationalSolver_default_parameters(*args)
default_parameters = staticmethod(default_parameters)
__swig_destroy__ = _fem.delete_NonlinearVariationalSolver
NonlinearVariationalSolver.solve = new_instancemethod(_fem.NonlinearVariationalSolver_solve,None,NonlinearVariationalSolver)
NonlinearVariationalSolver_swigregister = _fem.NonlinearVariationalSolver_swigregister
NonlinearVariationalSolver_swigregister(NonlinearVariationalSolver)
def NonlinearVariationalSolver_default_parameters(*args):
"""
Default parameter values
"""
return _fem.NonlinearVariationalSolver_default_parameters(*args)
class CCFEMForm(object):
"""
This class represents a variational form on a cut and composite
finite element function space (CCFEM) defined on one or more
possibly intersecting meshes.
FIXME: Document usage of class with add() followed by build()
"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""
**Overloaded versions**
* CCFEMForm\ (function_space)
Create empty linear CCFEM variational form (shared pointer version)
* CCFEMForm\ (function_space)
Create empty linear CCFEM variational form (reference version)
* CCFEMForm\ (function_space_0, function_space_1)
Create empty bilinear CCFEM variational form (shared pointer version)
* CCFEMForm\ (function_space_0, function_space_1)
Create empty bilinear CCFEM variational form (reference version)
"""
_fem.CCFEMForm_swiginit(self,_fem.new_CCFEMForm(*args))
__swig_destroy__ = _fem.delete_CCFEMForm
def rank(self, *args):
"""
Return rank of form (bilinear form = 2, linear form = 1,
functional = 0, etc)
*Returns*
int
The rank of the form.
"""
return _fem.CCFEMForm_rank(self, *args)
def num_parts(self, *args):
"""
Return the number of forms (parts) of the CCFEM form
*Returns*
int
The number of forms (parts) of the CCFEM form.
"""
return _fem.CCFEMForm_num_parts(self, *args)
def part(self, *args):
"""
Return form (part) number i
*Returns*
:py:class:`Form`
Form (part) number i.
"""
return _fem.CCFEMForm_part(self, *args)
def function_space(self, *args):
"""
Return function space for given argument
*Arguments*
i (int)
Index
*Returns*
:py:class:`CCFEMFunctionSpace`
Function space shared pointer.
"""
return _fem.CCFEMForm_function_space(self, *args)
def add(self, *args):
"""
**Overloaded versions**
* add\ (form)
Add form (shared pointer version)
*Arguments*
form (:py:class:`Form`)
The form.
* add\ (form)
Add form (reference version)
*Arguments*
form (:py:class:`Form`)
The form.
"""
return _fem.CCFEMForm_add(self, *args)
def build(self, *args):
"""
Build CCFEM form
"""
return _fem.CCFEMForm_build(self, *args)
def clear(self, *args):
"""
Clear CCFEM form
"""
return _fem.CCFEMForm_clear(self, *args)
CCFEMForm.rank = new_instancemethod(_fem.CCFEMForm_rank,None,CCFEMForm)
CCFEMForm.num_parts = new_instancemethod(_fem.CCFEMForm_num_parts,None,CCFEMForm)
CCFEMForm.part = new_instancemethod(_fem.CCFEMForm_part,None,CCFEMForm)
CCFEMForm.function_space = new_instancemethod(_fem.CCFEMForm_function_space,None,CCFEMForm)
CCFEMForm.add = new_instancemethod(_fem.CCFEMForm_add,None,CCFEMForm)
CCFEMForm.build = new_instancemethod(_fem.CCFEMForm_build,None,CCFEMForm)
CCFEMForm.clear = new_instancemethod(_fem.CCFEMForm_clear,None,CCFEMForm)
CCFEMForm_swigregister = _fem.CCFEMForm_swigregister
CCFEMForm_swigregister(CCFEMForm)
class CCFEMDofMap(GenericDofMap):
"""
This class handles the mapping of degrees of freedom for CCFEM
function spaces.
"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""
Constructor
"""
_fem.CCFEMDofMap_swiginit(self,_fem.new_CCFEMDofMap(*args))
__swig_destroy__ = _fem.delete_CCFEMDofMap
def num_parts(self, *args):
"""
Return the number dofmaps (parts) of the CCFEM dofmap
*Returns*
int
The number of dofmaps (parts) of the CCFEM dofmap
"""
return _fem.CCFEMDofMap_num_parts(self, *args)
def part(self, *args):
"""
Return dofmap (part) number i
*Returns*
:py:class:`GenericDofMap`
Dofmap (part) number i
"""
return _fem.CCFEMDofMap_part(self, *args)
def set_current_part(self, *args):
"""
Set current part. This will make the CCFEM dofmap act as a
dofmap for the part of the CCFEM function space defined on the
current part (mesh).
*Arguments*
part (int)
The number of the part.
"""
return _fem.CCFEMDofMap_set_current_part(self, *args)
def add(self, *args):
"""
**Overloaded versions**
* add\ (dofmap)
Add dofmap (shared pointer version)
*Arguments*
dofmap (:py:class:`GenericDofMap`)
The dofmap.
* add\ (dofmap)
Add dofmap (reference version)
*Arguments*
dofmap (:py:class:`DofMap`)
The dofmap.
"""
return _fem.CCFEMDofMap_add(self, *args)
def build(self, *args):
"""
Build CCFEM dofmap
"""
return _fem.CCFEMDofMap_build(self, *args)
def clear(self, *args):
"""
Clear CCFEM dofmap
"""
return _fem.CCFEMDofMap_clear(self, *args)
CCFEMDofMap.num_parts = new_instancemethod(_fem.CCFEMDofMap_num_parts,None,CCFEMDofMap)
CCFEMDofMap.part = new_instancemethod(_fem.CCFEMDofMap_part,None,CCFEMDofMap)
CCFEMDofMap.set_current_part = new_instancemethod(_fem.CCFEMDofMap_set_current_part,None,CCFEMDofMap)
CCFEMDofMap.add = new_instancemethod(_fem.CCFEMDofMap_add,None,CCFEMDofMap)
CCFEMDofMap.build = new_instancemethod(_fem.CCFEMDofMap_build,None,CCFEMDofMap)
CCFEMDofMap.clear = new_instancemethod(_fem.CCFEMDofMap_clear,None,CCFEMDofMap)
CCFEMDofMap_swigregister = _fem.CCFEMDofMap_swigregister
CCFEMDofMap_swigregister(CCFEMDofMap)
class CCFEMAssembler(object):
"""
This class implements functionality for finite element assembly
over cut and composite finite element (CCFEM) function spaces.
"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""
Constructor
"""
_fem.CCFEMAssembler_swiginit(self,_fem.new_CCFEMAssembler(*args))
def assemble(self, *args):
"""
Assemble tensor from given form
*Arguments*
A (:py:class:`GenericTensor`)
The tensor to assemble.
a (:py:class:`Form`)
The form to assemble the tensor from.
"""
return _fem.CCFEMAssembler_assemble(self, *args)
__swig_destroy__ = _fem.delete_CCFEMAssembler
CCFEMAssembler.assemble = new_instancemethod(_fem.CCFEMAssembler_assemble,None,CCFEMAssembler)
CCFEMAssembler_swigregister = _fem.CCFEMAssembler_swigregister
CCFEMAssembler_swigregister(CCFEMAssembler)
class OpenMpAssembler(AssemblerBase):
"""
This class provides automated assembly of linear systems, or
more generally, assembly of a sparse tensor from a given
variational form.
The MeshFunction arguments can be used to specify assembly over
subdomains of the mesh cells, exterior facets or interior
facets. Either a null pointer or an empty MeshFunction may be
used to specify that the tensor should be assembled over the
entire set of cells or facets.
"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""
Constructor
"""
_fem.OpenMpAssembler_swiginit(self,_fem.new_OpenMpAssembler(*args))
def assemble(self, *args):
"""
Assemble tensor from given form
"""
return _fem.OpenMpAssembler_assemble(self, *args)
__swig_destroy__ = _fem.delete_OpenMpAssembler
OpenMpAssembler.assemble = new_instancemethod(_fem.OpenMpAssembler_assemble,None,OpenMpAssembler)
OpenMpAssembler_swigregister = _fem.OpenMpAssembler_swigregister
OpenMpAssembler_swigregister(OpenMpAssembler)
class VariationalProblem(object):
"""
This class is deprecated and is only here to give an informative error
message to users about the new interface.
"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""
**Overloaded versions**
* VariationalProblem\ (form_0, form_1)
Deprecated
* VariationalProblem\ (form_0, form_1, bc)
Deprecated
* VariationalProblem\ (form_0, form_1, bcs)
Deprecated
* VariationalProblem\ (form_0, form_1, bcs)
Deprecated
"""
_fem.VariationalProblem_swiginit(self,_fem.new_VariationalProblem(*args))
__swig_destroy__ = _fem.delete_VariationalProblem
def solve(self, *args):
"""
**Overloaded versions**
* solve\ (u)
Deprecated
* solve\ (u0, u1)
Deprecated
* solve\ (u0, u1, u2)
Deprecated
* solve\ (u, tol, M)
Deprecated
* solve\ (u, tol, M, ec)
Deprecated
"""
return _fem.VariationalProblem_solve(self, *args)
VariationalProblem.solve = new_instancemethod(_fem.VariationalProblem_solve,None,VariationalProblem)
VariationalProblem_swigregister = _fem.VariationalProblem_swigregister
VariationalProblem_swigregister(VariationalProblem)
HierarchicalLinearVariationalProblem.leaf_node = HierarchicalLinearVariationalProblem._leaf_node
HierarchicalLinearVariationalProblem.root_node = HierarchicalLinearVariationalProblem._root_node
HierarchicalLinearVariationalProblem.child = HierarchicalLinearVariationalProblem._child
HierarchicalLinearVariationalProblem.parent = HierarchicalLinearVariationalProblem._parent
HierarchicalNonlinearVariationalProblem.leaf_node = HierarchicalNonlinearVariationalProblem._leaf_node
HierarchicalNonlinearVariationalProblem.root_node = HierarchicalNonlinearVariationalProblem._root_node
HierarchicalNonlinearVariationalProblem.child = HierarchicalNonlinearVariationalProblem._child
HierarchicalNonlinearVariationalProblem.parent = HierarchicalNonlinearVariationalProblem._parent
HierarchicalForm.leaf_node = HierarchicalForm._leaf_node
HierarchicalForm.root_node = HierarchicalForm._root_node
HierarchicalForm.child = HierarchicalForm._child
HierarchicalForm.parent = HierarchicalForm._parent
HierarchicalDirichletBC.leaf_node = HierarchicalDirichletBC._leaf_node
HierarchicalDirichletBC.root_node = HierarchicalDirichletBC._root_node
HierarchicalDirichletBC.child = HierarchicalDirichletBC._child
HierarchicalDirichletBC.parent = HierarchicalDirichletBC._parent
class MultiStageScheme(common.Variable):
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""
**Overloaded versions**
* MultiStageScheme\ (stage_forms, last_stage, stage_solutions, u, t, dt, dt_stage_offset, order, name, human_form)
Constructor
FIXME: This constructor is a MESS. Needs clean up...
* MultiStageScheme\ (stage_forms, last_stage, stage_solutions, u, t, dt, dt_stage_offset, order, name, human_form, bcs)
Constructor with Boundary conditions
"""
_fem.MultiStageScheme_swiginit(self,_fem.new_MultiStageScheme(*args))
def dt_stage_offset(self, *args):
"""
Return local timestep
"""
return _fem.MultiStageScheme_dt_stage_offset(self, *args)
def order(self, *args):
"""
Return the order of the scheme
"""
return _fem.MultiStageScheme_order(self, *args)
def bcs(self, *args):
"""
Return boundary conditions
"""
return _fem.MultiStageScheme_bcs(self, *args)
def implicit(self, *args):
"""
**Overloaded versions**
* implicit\ (stage)
Return true if stage is implicit
* implicit\ ()
Return true if the whole scheme is implicit
"""
return _fem.MultiStageScheme_implicit(self, *args)
__swig_destroy__ = _fem.delete_MultiStageScheme
MultiStageScheme.dt_stage_offset = new_instancemethod(_fem.MultiStageScheme_dt_stage_offset,None,MultiStageScheme)
MultiStageScheme.order = new_instancemethod(_fem.MultiStageScheme_order,None,MultiStageScheme)
MultiStageScheme.bcs = new_instancemethod(_fem.MultiStageScheme_bcs,None,MultiStageScheme)
MultiStageScheme.implicit = new_instancemethod(_fem.MultiStageScheme_implicit,None,MultiStageScheme)
MultiStageScheme_swigregister = _fem.MultiStageScheme_swigregister
MultiStageScheme_swigregister(MultiStageScheme)
class RKSolver(object):
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""
Constructor
FIXME: Include version where one can pass a Solver and/or Parameters
"""
_fem.RKSolver_swiginit(self,_fem.new_RKSolver(*args))
def step(self, *args):
"""
Step solver with time step dt
"""
return _fem.RKSolver_step(self, *args)
def step_interval(self, *args):
"""
Step solver an interval using dt as time step
"""
return _fem.RKSolver_step_interval(self, *args)
__swig_destroy__ = _fem.delete_RKSolver
RKSolver.step = new_instancemethod(_fem.RKSolver_step,None,RKSolver)
RKSolver.step_interval = new_instancemethod(_fem.RKSolver_step_interval,None,RKSolver)
RKSolver_swigregister = _fem.RKSolver_swigregister
RKSolver_swigregister(RKSolver)
class PointIntegralSolver(common.Variable):
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""
Constructor
FIXME: Include version where one can pass a Solver and/or Parameters
"""
_fem.PointIntegralSolver_swiginit(self,_fem.new_PointIntegralSolver(*args))
def step(self, *args):
"""
Step solver with time step dt
"""
return _fem.PointIntegralSolver_step(self, *args)
def step_interval(self, *args):
"""
Step solver an interval using dt as time step
"""
return _fem.PointIntegralSolver_step_interval(self, *args)
def default_parameters(*args):
"""
Default parameter values
"""
return _fem.PointIntegralSolver_default_parameters(*args)
default_parameters = staticmethod(default_parameters)
__swig_destroy__ = _fem.delete_PointIntegralSolver
PointIntegralSolver.step = new_instancemethod(_fem.PointIntegralSolver_step,None,PointIntegralSolver)
PointIntegralSolver.step_interval = new_instancemethod(_fem.PointIntegralSolver_step_interval,None,PointIntegralSolver)
PointIntegralSolver_swigregister = _fem.PointIntegralSolver_swigregister
PointIntegralSolver_swigregister(PointIntegralSolver)
def PointIntegralSolver_default_parameters(*args):
"""
Default parameter values
"""
return _fem.PointIntegralSolver_default_parameters(*args)
class HierarchicalErrorControl(object):
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
_fem.HierarchicalErrorControl_swiginit(self,_fem.new_HierarchicalErrorControl(*args))
__swig_destroy__ = _fem.delete_HierarchicalErrorControl
HierarchicalErrorControl.depth = new_instancemethod(_fem.HierarchicalErrorControl_depth,None,HierarchicalErrorControl)
HierarchicalErrorControl.has_parent = new_instancemethod(_fem.HierarchicalErrorControl_has_parent,None,HierarchicalErrorControl)
HierarchicalErrorControl.has_child = new_instancemethod(_fem.HierarchicalErrorControl_has_child,None,HierarchicalErrorControl)
HierarchicalErrorControl._parent = new_instancemethod(_fem.HierarchicalErrorControl__parent,None,HierarchicalErrorControl)
HierarchicalErrorControl._child = new_instancemethod(_fem.HierarchicalErrorControl__child,None,HierarchicalErrorControl)
HierarchicalErrorControl._root_node = new_instancemethod(_fem.HierarchicalErrorControl__root_node,None,HierarchicalErrorControl)
HierarchicalErrorControl._leaf_node = new_instancemethod(_fem.HierarchicalErrorControl__leaf_node,None,HierarchicalErrorControl)
HierarchicalErrorControl.set_parent = new_instancemethod(_fem.HierarchicalErrorControl_set_parent,None,HierarchicalErrorControl)
HierarchicalErrorControl.clear_child = new_instancemethod(_fem.HierarchicalErrorControl_clear_child,None,HierarchicalErrorControl)
HierarchicalErrorControl.set_child = new_instancemethod(_fem.HierarchicalErrorControl_set_child,None,HierarchicalErrorControl)
HierarchicalErrorControl._debug = new_instancemethod(_fem.HierarchicalErrorControl__debug,None,HierarchicalErrorControl)
HierarchicalErrorControl_swigregister = _fem.HierarchicalErrorControl_swigregister
HierarchicalErrorControl_swigregister(HierarchicalErrorControl)
class GenericAdaptiveVariationalSolver(common.Variable):
"""
An abstract class for goal-oriented adaptive solution of
variational problems.
"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract")
__repr__ = _swig_repr
__swig_destroy__ = _fem.delete_GenericAdaptiveVariationalSolver
def solve(self, *args):
"""
Solve such that the functional error is less than the given
tolerance. Note that each call to solve is based on the
leaf-node of the variational problem
*Arguments*
tol (float)
The error tolerance
"""
return _fem.GenericAdaptiveVariationalSolver_solve(self, *args)
def solve_primal(self, *args):
"""
Solve the primal problem. Must be overloaded in subclass.
*Returns*
:py:class:`Function`
The solution to the primal problem
"""
return _fem.GenericAdaptiveVariationalSolver_solve_primal(self, *args)
def extract_bcs(self, *args):
"""
Extract the boundary conditions for the primal problem. Must
be overloaded in subclass.
*Returns*
list of :py:class:`DirichletBC`
The primal boundary conditions
"""
return _fem.GenericAdaptiveVariationalSolver_extract_bcs(self, *args)
def evaluate_goal(self, *args):
"""
Evaluate the goal functional. Must be overloaded in subclass.
*Arguments*
M (:py:class:`Form`)
The functional to be evaluated
u (:py:class:`Function`)
The function of which to evaluate the functional
*Returns*
float
The value of M evaluated at u
"""
return _fem.GenericAdaptiveVariationalSolver_evaluate_goal(self, *args)
def adapt_problem(self, *args):
"""
Adapt the problem to other mesh. Must be overloaded in subclass.
*Arguments*
mesh (:py:class:`Mesh`)
The other mesh
"""
return _fem.GenericAdaptiveVariationalSolver_adapt_problem(self, *args)
def adaptive_data(self, *args):
"""
Return stored adaptive data
*Returns*
list of :py:class:`Parameters`
The data stored in the adaptive loop
"""
return _fem.GenericAdaptiveVariationalSolver_adaptive_data(self, *args)
def default_parameters(*args):
"""
Default parameter values:
"max_iterations" (int)
"max_dimension" (int)
"plot_mesh" (bool)
"save_data" (bool)
"data_label" (std::string)
"reference" (double)
"marking_strategy" (std::string)
"marking_fraction" (double)
"""
return _fem.GenericAdaptiveVariationalSolver_default_parameters(*args)
default_parameters = staticmethod(default_parameters)
def summary(self, *args):
"""
Present summary of all adaptive data and parameters
"""
return _fem.GenericAdaptiveVariationalSolver_summary(self, *args)
GenericAdaptiveVariationalSolver.solve = new_instancemethod(_fem.GenericAdaptiveVariationalSolver_solve,None,GenericAdaptiveVariationalSolver)
GenericAdaptiveVariationalSolver.solve_primal = new_instancemethod(_fem.GenericAdaptiveVariationalSolver_solve_primal,None,GenericAdaptiveVariationalSolver)
GenericAdaptiveVariationalSolver.extract_bcs = new_instancemethod(_fem.GenericAdaptiveVariationalSolver_extract_bcs,None,GenericAdaptiveVariationalSolver)
GenericAdaptiveVariationalSolver.evaluate_goal = new_instancemethod(_fem.GenericAdaptiveVariationalSolver_evaluate_goal,None,GenericAdaptiveVariationalSolver)
GenericAdaptiveVariationalSolver.adapt_problem = new_instancemethod(_fem.GenericAdaptiveVariationalSolver_adapt_problem,None,GenericAdaptiveVariationalSolver)
GenericAdaptiveVariationalSolver.adaptive_data = new_instancemethod(_fem.GenericAdaptiveVariationalSolver_adaptive_data,None,GenericAdaptiveVariationalSolver)
GenericAdaptiveVariationalSolver.summary = new_instancemethod(_fem.GenericAdaptiveVariationalSolver_summary,None,GenericAdaptiveVariationalSolver)
GenericAdaptiveVariationalSolver_swigregister = _fem.GenericAdaptiveVariationalSolver_swigregister
GenericAdaptiveVariationalSolver_swigregister(GenericAdaptiveVariationalSolver)
def GenericAdaptiveVariationalSolver_default_parameters(*args):
"""
Default parameter values:
"max_iterations" (int)
"max_dimension" (int)
"plot_mesh" (bool)
"save_data" (bool)
"data_label" (std::string)
"reference" (double)
"marking_strategy" (std::string)
"marking_fraction" (double)
"""
return _fem.GenericAdaptiveVariationalSolver_default_parameters(*args)
class AdaptiveLinearVariationalSolver(GenericAdaptiveVariationalSolver):
"""
A class for goal-oriented adaptive solution of linear
variational problems.
For a linear variational problem of the form: find u in V
satisfying
a(u, v) = L(v) for all v in :math:`\hat V`
and a corresponding conforming discrete problem: find u_h in V_h
satisfying
a(u_h, v) = L(v) for all v in :math:`\hat V_h`
and a given goal functional M and tolerance tol, the aim is to
find a V_H and a u_H in V_H satisfying the discrete problem such
that
\|M(u) - M(u_H)\| < tol
This strategy is based on dual-weighted residual error
estimators designed and automatically generated for the primal
problem and subsequent h-adaptivity.
"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""
**Overloaded versions**
* AdaptiveLinearVariationalSolver\ (problem, goal)
Create AdaptiveLinearVariationalSolver
*Arguments*
problem (:py:class:`LinearVariationalProblem`)
The primal problem
goal (:py:class:`GoalFunctional`)
The goal functional
* AdaptiveLinearVariationalSolver\ (problem, goal)
Create AdaptiveLinearVariationalSolver (shared ptr version)
*Arguments*
problem (:py:class:`LinearVariationalProblem`)
The primal problem
goal (:py:class:`GoalFunctional`)
The goal functional
* AdaptiveLinearVariationalSolver\ (problem, goal, control)
Create AdaptiveLinearVariationalSolver from variational
problem, goal form and error control instance
*Arguments*
problem (:py:class:`LinearVariationalProblem`)
The primal problem
goal (:py:class:`Form`)
The goal functional
control (:py:class:`ErrorControl`)
An error controller object
"""
_fem.AdaptiveLinearVariationalSolver_swiginit(self,_fem.new_AdaptiveLinearVariationalSolver(*args))
__swig_destroy__ = _fem.delete_AdaptiveLinearVariationalSolver
AdaptiveLinearVariationalSolver_swigregister = _fem.AdaptiveLinearVariationalSolver_swigregister
AdaptiveLinearVariationalSolver_swigregister(AdaptiveLinearVariationalSolver)
class AdaptiveNonlinearVariationalSolver(GenericAdaptiveVariationalSolver):
"""
A class for goal-oriented adaptive solution of nonlinear
variational problems.
For a nonlinear variational problem of the form: find u in V
satisfying
F(u; v) = 0 for all v in :math:`\hat V`
and a corresponding conforming discrete problem: find u_h in V_h
satisfying (at least approximately)
F(u_h; v) = 0 for all v in :math:`\hat V_h`
and a given goal functional M and tolerance tol, the aim is to
find a V_H and a u_H in V_H satisfying the discrete problem such
that
\|M(u) - M(u_H)\| < tol
This strategy is based on dual-weighted residual error
estimators designed and automatically generated for the primal
problem and subsequent h-adaptivity.
"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""
**Overloaded versions**
* AdaptiveNonlinearVariationalSolver\ (problem, goal)
Create AdaptiveNonlinearVariationalSolver
*Arguments*
problem (:py:class:`NonlinearVariationalProblem`)
The primal problem
goal (:py:class:`GoalFunctional`)
The goal functional
* AdaptiveNonlinearVariationalSolver\ (problem, goal)
Create AdaptiveNonlinearVariationalSolver (shared ptr version)
*Arguments*
problem (:py:class:`NonlinearVariationalProblem`)
The primal problem
goal (:py:class:`GoalFunctional`)
The goal functional
* AdaptiveNonlinearVariationalSolver\ (problem, goal, control)
Create AdaptiveLinearVariationalSolver from variational
problem, goal form and error control instance
*Arguments*
problem (:py:class:`NonlinearVariationalProblem`)
The primal problem
goal (:py:class:`Form`)
The goal functional
control (:py:class:`ErrorControl`)
An error controller object
"""
_fem.AdaptiveNonlinearVariationalSolver_swiginit(self,_fem.new_AdaptiveNonlinearVariationalSolver(*args))
__swig_destroy__ = _fem.delete_AdaptiveNonlinearVariationalSolver
AdaptiveNonlinearVariationalSolver_swigregister = _fem.AdaptiveNonlinearVariationalSolver_swigregister
AdaptiveNonlinearVariationalSolver_swigregister(AdaptiveNonlinearVariationalSolver)
class ErrorControl(HierarchicalErrorControl,common.Variable):
"""
(Goal-oriented) Error Control class.
The notation used here follows the notation in "Automated
goal-oriented error control I: stationary variational problems",
ME Rognes and A Logg, 2010-2011.
"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""
Create error control object
*Arguments*
a_star (:py:class:`Form`)
the bilinear form for the dual problem
L_star (:py:class:`Form`)
the linear form for the dual problem
residual (:py:class:`Form`)
a functional for the residual (error estimate)
a_R_T (:py:class:`Form`)
the bilinear form for the strong cell residual problem
L_R_T (:py:class:`Form`)
the linear form for the strong cell residual problem
a_R_dT (:py:class:`Form`)
the bilinear form for the strong facet residual problem
L_R_dT (:py:class:`Form`)
the linear form for the strong facet residual problem
eta_T (:py:class:`Form`)
a linear form over DG_0 for error indicators
is_linear (bool)
true iff primal problem is linear
"""
_fem.ErrorControl_swiginit(self,_fem.new_ErrorControl(*args))
__swig_destroy__ = _fem.delete_ErrorControl
def default_parameters(*args):
"""
Default parameter values:
"""
return _fem.ErrorControl_default_parameters(*args)
default_parameters = staticmethod(default_parameters)
def estimate_error(self, *args):
"""
Estimate the error relative to the goal M of the discrete
approximation 'u' relative to the variational formulation by
evaluating the weak residual at an approximation to the dual
solution.
*Arguments*
u (:py:class:`Function`)
the primal approximation
bcs (list of :py:class:`DirichletBC`)
the primal boundary conditions
*Returns*
float
error estimate
"""
return _fem.ErrorControl_estimate_error(self, *args)
def compute_indicators(self, *args):
"""
Compute error indicators
*Arguments*
indicators (:py:class:`MeshFunction`)
the error indicators (to be computed)
u (:py:class:`Function`)
the primal approximation
"""
return _fem.ErrorControl_compute_indicators(self, *args)
def residual_representation(self, *args):
"""
Compute strong representation (strong cell and facet
residuals) of the weak residual.
*Arguments*
R_T (:py:class:`Function`)
the strong cell residual (to be computed)
R_dT (:py:class:`SpecialFacetFunction`)
the strong facet residual (to be computed)
u (:py:class:`Function`)
the primal approximation
"""
return _fem.ErrorControl_residual_representation(self, *args)
def compute_cell_residual(self, *args):
"""
Compute representation for the strong cell residual
from the weak residual
*Arguments*
R_T (:py:class:`Function`)
the strong cell residual (to be computed)
u (:py:class:`Function`)
the primal approximation
"""
return _fem.ErrorControl_compute_cell_residual(self, *args)
def compute_facet_residual(self, *args):
"""
Compute representation for the strong facet residual from the
weak residual and the strong cell residual
*Arguments*
R_dT (:py:class:`SpecialFacetFunction`)
the strong facet residual (to be computed)
u (:py:class:`Function`)
the primal approximation
R_T (:py:class:`Function`)
the strong cell residual
"""
return _fem.ErrorControl_compute_facet_residual(self, *args)
def compute_dual(self, *args):
"""
Compute dual approximation defined by dual variational
problem and dual boundary conditions given by homogenized primal
boundary conditions.
*Arguments*
z (:py:class:`Function`)
the dual approximation (to be computed)
bcs (list of :py:class:`DirichletBC`)
the primal boundary conditions
"""
return _fem.ErrorControl_compute_dual(self, *args)
def compute_extrapolation(self, *args):
"""
Compute extrapolation with boundary conditions
*Arguments*
z (:py:class:`Function`)
the extrapolated function (to be computed)
bcs (list of :py:class:`DirichletBC`)
the dual boundary conditions
"""
return _fem.ErrorControl_compute_extrapolation(self, *args)
ErrorControl.estimate_error = new_instancemethod(_fem.ErrorControl_estimate_error,None,ErrorControl)
ErrorControl.compute_indicators = new_instancemethod(_fem.ErrorControl_compute_indicators,None,ErrorControl)
ErrorControl.residual_representation = new_instancemethod(_fem.ErrorControl_residual_representation,None,ErrorControl)
ErrorControl.compute_cell_residual = new_instancemethod(_fem.ErrorControl_compute_cell_residual,None,ErrorControl)
ErrorControl.compute_facet_residual = new_instancemethod(_fem.ErrorControl_compute_facet_residual,None,ErrorControl)
ErrorControl.compute_dual = new_instancemethod(_fem.ErrorControl_compute_dual,None,ErrorControl)
ErrorControl.compute_extrapolation = new_instancemethod(_fem.ErrorControl_compute_extrapolation,None,ErrorControl)
ErrorControl_swigregister = _fem.ErrorControl_swigregister
ErrorControl_swigregister(ErrorControl)
def ErrorControl_default_parameters(*args):
"""
Default parameter values:
"""
return _fem.ErrorControl_default_parameters(*args)
class Extrapolation(object):
"""
This class implements an algorithm for extrapolating a function
on a given function space from an approximation of that function
on a possibly lower-order function space.
This can be used to obtain a higher-order approximation of a
computed dual solution, which is necessary when the computed
dual approximation is in the test space of the primal problem,
thereby being orthogonal to the residual.
It is assumed that the extrapolation is computed on the same
mesh as the original function.
"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def extrapolate(*args):
"""
Compute extrapolation w from v
"""
return _fem.Extrapolation_extrapolate(*args)
extrapolate = staticmethod(extrapolate)
def __init__(self, *args):
_fem.Extrapolation_swiginit(self,_fem.new_Extrapolation(*args))
__swig_destroy__ = _fem.delete_Extrapolation
Extrapolation_swigregister = _fem.Extrapolation_swigregister
Extrapolation_swigregister(Extrapolation)
def Extrapolation_extrapolate(*args):
"""
Compute extrapolation w from v
"""
return _fem.Extrapolation_extrapolate(*args)
class LocalAssembler(object):
"""
"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def assemble(*args):
"""
"""
return _fem.LocalAssembler_assemble(*args)
assemble = staticmethod(assemble)
def assemble_cell(*args):
"""
"""
return _fem.LocalAssembler_assemble_cell(*args)
assemble_cell = staticmethod(assemble_cell)
def assemble_exterior_facet(*args):
"""
"""
return _fem.LocalAssembler_assemble_exterior_facet(*args)
assemble_exterior_facet = staticmethod(assemble_exterior_facet)
def assemble_interior_facet(*args):
"""
"""
return _fem.LocalAssembler_assemble_interior_facet(*args)
assemble_interior_facet = staticmethod(assemble_interior_facet)
def __init__(self, *args):
_fem.LocalAssembler_swiginit(self,_fem.new_LocalAssembler(*args))
__swig_destroy__ = _fem.delete_LocalAssembler
LocalAssembler_swigregister = _fem.LocalAssembler_swigregister
LocalAssembler_swigregister(LocalAssembler)
def LocalAssembler_assemble(*args):
"""
"""
return _fem.LocalAssembler_assemble(*args)
def LocalAssembler_assemble_cell(*args):
"""
"""
return _fem.LocalAssembler_assemble_cell(*args)
def LocalAssembler_assemble_exterior_facet(*args):
"""
"""
return _fem.LocalAssembler_assemble_exterior_facet(*args)
def LocalAssembler_assemble_interior_facet(*args):
"""
"""
return _fem.LocalAssembler_assemble_interior_facet(*args)
class TimeSeries(common.Variable):
"""
This class stores a time series of objects to file(s) in a
binary format which is efficient for reading and writing.
When objects are retrieved, the object stored at the time
closest to the given time will be used.
A new time series will check if values have been stored to
file before (for a series with the same name) and in that
case reuse those values. If new values are stored, old
values will be cleared.
"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""
Create empty time series
*Arguments*
name (str)
The time series name
compressed (bool)
Use compressed file format (default false)
store_connectivity (bool)
Store all computed connectivity (default false)
"""
_fem.TimeSeries_swiginit(self,_fem.new_TimeSeries(*args))
__swig_destroy__ = _fem.delete_TimeSeries
def store(self, *args):
"""
**Overloaded versions**
* store\ (vector, t)
Store vector at given time
*Arguments*
vector (:py:class:`GenericVector`)
The vector to be stored.
t (float)
The time.
* store\ (mesh, t)
Store mesh at given time
*Arguments*
mesh (:py:class:`Mesh`)
The mesh to be stored.
t (float)
The time.
"""
return _fem.TimeSeries_store(self, *args)
def retrieve(self, *args):
"""
**Overloaded versions**
* retrieve\ (vector, t, interpolate=true)
Retrieve vector at given time
*Arguments*
vector (:py:class:`GenericVector`)
The vector (values to be retrieved).
t (float)
The time.
interpolate (bool)
Optional argument: If true (default), interpolate
time samples closest to t if t is not present.
* retrieve\ (mesh, t)
Retrieve mesh at given time
*Arguments*
mesh (:py:class:`Mesh`)
The mesh (values to be retrieved).
t (float)
The time.
"""
return _fem.TimeSeries_retrieve(self, *args)
def vector_times(self, *args):
"""
Return array of sample times for vectors
*Returns*
numpy.array(float)
The times.
"""
return _fem.TimeSeries_vector_times(self, *args)
def mesh_times(self, *args):
"""
Return array of sample times for meshes
*Returns*
numpy.array(float)
The times.
"""
return _fem.TimeSeries_mesh_times(self, *args)
def clear(self, *args):
"""
Clear time series
"""
return _fem.TimeSeries_clear(self, *args)
def filename_data(*args):
"""
Return filename for data
*Arguments*
series_name (str)
The time series name
type_name (str)
The type of data
index (int)
The index
compressed (bool)
True if compressed file format
*Returns*
str
The filename
"""
return _fem.TimeSeries_filename_data(*args)
filename_data = staticmethod(filename_data)
def filename_times(*args):
"""
Return filename for times
*Arguments*
series_name (str)
The time series name
type_name (str)
The type of data
compressed (bool)
True if compressed file format
*Returns*
str
The filename
"""
return _fem.TimeSeries_filename_times(*args)
filename_times = staticmethod(filename_times)
def default_parameters(*args):
"""
Default parameter values
"""
return _fem.TimeSeries_default_parameters(*args)
default_parameters = staticmethod(default_parameters)
TimeSeries.store = new_instancemethod(_fem.TimeSeries_store,None,TimeSeries)
TimeSeries.retrieve = new_instancemethod(_fem.TimeSeries_retrieve,None,TimeSeries)
TimeSeries.vector_times = new_instancemethod(_fem.TimeSeries_vector_times,None,TimeSeries)
TimeSeries.mesh_times = new_instancemethod(_fem.TimeSeries_mesh_times,None,TimeSeries)
TimeSeries.clear = new_instancemethod(_fem.TimeSeries_clear,None,TimeSeries)
TimeSeries_swigregister = _fem.TimeSeries_swigregister
TimeSeries_swigregister(TimeSeries)
def TimeSeries_filename_data(*args):
"""
Return filename for data
*Arguments*
series_name (str)
The time series name
type_name (str)
The type of data
index (int)
The index
compressed (bool)
True if compressed file format
*Returns*
str
The filename
"""
return _fem.TimeSeries_filename_data(*args)
def TimeSeries_filename_times(*args):
"""
Return filename for times
*Arguments*
series_name (str)
The time series name
type_name (str)
The type of data
compressed (bool)
True if compressed file format
*Returns*
str
The filename
"""
return _fem.TimeSeries_filename_times(*args)
def TimeSeries_default_parameters(*args):
"""
Default parameter values
"""
return _fem.TimeSeries_default_parameters(*args)
class TimeSeriesHDF5(common.Variable):
"""
This class stores a time series of objects to file(s) in a
binary format which is efficient for reading and writing.
When objects are retrieved, the object stored at the time
closest to the given time will be used.
A new time series will check if values have been stored to
file before (for a series with the same name) and in that
case reuse those values. If new values are stored, old
values will be cleared.
"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""
Create empty time series
*Arguments*
name (str)
The time series name
"""
_fem.TimeSeriesHDF5_swiginit(self,_fem.new_TimeSeriesHDF5(*args))
__swig_destroy__ = _fem.delete_TimeSeriesHDF5
def store(self, *args):
"""
**Overloaded versions**
* store\ (vector, t)
Store vector at given time
*Arguments*
vector (:py:class:`GenericVector`)
The vector to be stored.
t (float)
The time.
* store\ (mesh, t)
Store mesh at given time
*Arguments*
mesh (:py:class:`Mesh`)
The mesh to be stored.
t (float)
The time.
"""
return _fem.TimeSeriesHDF5_store(self, *args)
def retrieve(self, *args):
"""
**Overloaded versions**
* retrieve\ (vector, t, interpolate=true)
Retrieve vector at given time
*Arguments*
vector (:py:class:`GenericVector`)
The vector (values to be retrieved).
t (float)
The time.
interpolate (bool)
Optional argument: If true (default), interpolate
time samples closest to t if t is not present.
* retrieve\ (mesh, t)
Retrieve mesh at given time
*Arguments*
mesh (:py:class:`Mesh`)
The mesh (values to be retrieved).
t (float)
The time.
"""
return _fem.TimeSeriesHDF5_retrieve(self, *args)
def vector_times(self, *args):
"""
Return array of sample times for vectors
*Returns*
numpy.array(float)
The times.
"""
return _fem.TimeSeriesHDF5_vector_times(self, *args)
def mesh_times(self, *args):
"""
Return array of sample times for meshes
*Returns*
numpy.array(float)
The times.
"""
return _fem.TimeSeriesHDF5_mesh_times(self, *args)
def clear(self, *args):
"""
Clear time series
"""
return _fem.TimeSeriesHDF5_clear(self, *args)
def default_parameters(*args):
"""
Default parameter values
"""
return _fem.TimeSeriesHDF5_default_parameters(*args)
default_parameters = staticmethod(default_parameters)
TimeSeriesHDF5.store = new_instancemethod(_fem.TimeSeriesHDF5_store,None,TimeSeriesHDF5)
TimeSeriesHDF5.retrieve = new_instancemethod(_fem.TimeSeriesHDF5_retrieve,None,TimeSeriesHDF5)
TimeSeriesHDF5.vector_times = new_instancemethod(_fem.TimeSeriesHDF5_vector_times,None,TimeSeriesHDF5)
TimeSeriesHDF5.mesh_times = new_instancemethod(_fem.TimeSeriesHDF5_mesh_times,None,TimeSeriesHDF5)
TimeSeriesHDF5.clear = new_instancemethod(_fem.TimeSeriesHDF5_clear,None,TimeSeriesHDF5)
TimeSeriesHDF5_swigregister = _fem.TimeSeriesHDF5_swigregister
TimeSeriesHDF5_swigregister(TimeSeriesHDF5)
def TimeSeriesHDF5_default_parameters(*args):
"""
Default parameter values
"""
return _fem.TimeSeriesHDF5_default_parameters(*args)
def adapt_markers(*args):
"""
Helper function for refinement of boundary conditions
"""
return _fem.adapt_markers(*args)
def adapt(*args):
"""
**Overloaded versions**
* adapt\ (mesh)
Refine mesh uniformly
* adapt\ (mesh, cell_markers)
Refine mesh based on cell markers
* adapt\ (space)
Refine function space uniformly
* adapt\ (space, cell_markers)
Refine function space based on cell markers
* adapt\ (space, adapted_mesh)
Refine function space based on refined mesh
* adapt\ (function, adapted_mesh, interpolate=true)
Adapt Function based on adapted mesh
*Arguments*
function (:py:class:`Function`)
The function that should be adapted
adapted_mesh (:py:class:`Mesh`)
The new mesh
interpolate (bool)
Optional argument, default is true. If false, the
function's function space is adapted, but the values are
not interpolated.
*Returns*
:py:class:`Function`
The adapted function
* adapt\ (function, adapted_mesh)
Refine GenericFunction based on refined mesh
* adapt\ (mesh_function, adapted_mesh)
Refine mesh function<std::size_t> based on mesh
* adapt\ (bc, adapted_mesh, S)
Refine Dirichlet bc based on refined mesh
* adapt\ (form, adapted_mesh, adapt_coefficients=true)
Adapt form based on adapted mesh
*Arguments*
form (:py:class:`Form`)
The form that should be adapted
adapted_mesh (:py:class:`Mesh`)
The new mesh
adapt_coefficients (bool)
Optional argument, default is true. If false, the form
coefficients are not explictly adapted, but pre-adapted
coefficients will be transferred.
*Returns*
:py:class:`Form`
The adapted form
* adapt\ (problem, adapted_mesh)
Refine linear variational problem based on mesh
* adapt\ (problem, adapted_mesh)
Refine nonlinear variational problem based on mesh
* adapt\ (ec, adapted_mesh, adapt_coefficients=true)
Adapt error control object based on adapted mesh
*Arguments*
ec (:py:class:`ErrorControl`)
The error control object to be adapted
adapted_mesh (:py:class:`Mesh`)
The new mesh
adapt_coefficients (bool)
Optional argument, default is true. If false, any form
coefficients are not explictly adapted, but pre-adapted
coefficients will be transferred.
*Returns*
:py:class:`ErrorControl`
The adapted error control object
"""
return _fem.adapt(*args)
def mark(*args):
"""
Mark cells based on indicators and given marking strategy
*Arguments*
markers (:py:class:`MeshFunction`)
the cell markers (to be computed)
indicators (:py:class:`MeshFunction`)
error indicators (one per cell)
strategy (str)
the marking strategy
fraction (float)
the marking fraction
"""
return _fem.mark(*args)
def dorfler_mark(*args):
"""
Mark cells using Dorfler marking
*Arguments*
markers (:py:class:`MeshFunction`)
the cell markers (to be computed)
indicators (:py:class:`MeshFunction`)
error indicators (one per cell)
fraction (float)
the marking fraction
"""
return _fem.dorfler_mark(*args)
def fem_solve(*args):
"""
**Overloaded versions**
* solve\ (equation, u, tol, M)
Solve linear variational problem a(u, v) == L(v) without
essential boundary conditions
* solve\ (equation, u, bc, tol, M)
Solve linear variational problem a(u, v) == L(v) with single
boundary condition
* solve\ (equation, u, bcs, tol, M)
Solve linear variational problem a(u, v) == L(v) with list of
boundary conditions
* solve\ (equation, u, J, tol, M)
Solve nonlinear variational problem F(u; v) = 0 without
essential boundary conditions
* solve\ (equation, u, bc, J, tol, M)
Solve linear variational problem F(u; v) = 0 with single
boundary condition
* solve\ (equation, u, bcs, J, tol, M)
Solve linear variational problem F(u; v) = 0 with list of
boundary conditions
"""
return _fem.fem_solve(*args)
HierarchicalErrorControl.leaf_node = HierarchicalErrorControl._leaf_node
HierarchicalErrorControl.root_node = HierarchicalErrorControl._root_node
HierarchicalErrorControl.child = HierarchicalErrorControl._child
HierarchicalErrorControl.parent = HierarchicalErrorControl._parent
|