/usr/lib/python2.7/dist-packages/dolfin/cpp/function.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 | # 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: _function.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('_function', [dirname(__file__)])
except ImportError:
import _function
return _function
if fp is not None:
try:
_mod = imp.load_module('_function', fp, pathname, description)
finally:
fp.close()
return _mod
_function = swig_import_helper()
del swig_import_helper
else:
import _function
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 = _function.SHARED_PTR_DISOWN
import ufc
def _attach_base_to_numpy_array(*args):
return _function._attach_base_to_numpy_array(*args)
_attach_base_to_numpy_array = _function._attach_base_to_numpy_array
def dolfin_swigversion(*args):
return _function.dolfin_swigversion(*args)
dolfin_swigversion = _function.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 _function.has_petsc4py(*args)
has_petsc4py = _function.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):
_function.HierarchicalMeshFunctionUInt_swiginit(self,_function.new_HierarchicalMeshFunctionUInt(*args))
__swig_destroy__ = _function.delete_HierarchicalMeshFunctionUInt
HierarchicalMeshFunctionUInt.depth = new_instancemethod(_function.HierarchicalMeshFunctionUInt_depth,None,HierarchicalMeshFunctionUInt)
HierarchicalMeshFunctionUInt.has_parent = new_instancemethod(_function.HierarchicalMeshFunctionUInt_has_parent,None,HierarchicalMeshFunctionUInt)
HierarchicalMeshFunctionUInt.has_child = new_instancemethod(_function.HierarchicalMeshFunctionUInt_has_child,None,HierarchicalMeshFunctionUInt)
HierarchicalMeshFunctionUInt._parent = new_instancemethod(_function.HierarchicalMeshFunctionUInt__parent,None,HierarchicalMeshFunctionUInt)
HierarchicalMeshFunctionUInt._child = new_instancemethod(_function.HierarchicalMeshFunctionUInt__child,None,HierarchicalMeshFunctionUInt)
HierarchicalMeshFunctionUInt._root_node = new_instancemethod(_function.HierarchicalMeshFunctionUInt__root_node,None,HierarchicalMeshFunctionUInt)
HierarchicalMeshFunctionUInt._leaf_node = new_instancemethod(_function.HierarchicalMeshFunctionUInt__leaf_node,None,HierarchicalMeshFunctionUInt)
HierarchicalMeshFunctionUInt.set_parent = new_instancemethod(_function.HierarchicalMeshFunctionUInt_set_parent,None,HierarchicalMeshFunctionUInt)
HierarchicalMeshFunctionUInt.clear_child = new_instancemethod(_function.HierarchicalMeshFunctionUInt_clear_child,None,HierarchicalMeshFunctionUInt)
HierarchicalMeshFunctionUInt.set_child = new_instancemethod(_function.HierarchicalMeshFunctionUInt_set_child,None,HierarchicalMeshFunctionUInt)
HierarchicalMeshFunctionUInt._debug = new_instancemethod(_function.HierarchicalMeshFunctionUInt__debug,None,HierarchicalMeshFunctionUInt)
HierarchicalMeshFunctionUInt_swigregister = _function.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):
_function.HierarchicalMeshFunctionInt_swiginit(self,_function.new_HierarchicalMeshFunctionInt(*args))
__swig_destroy__ = _function.delete_HierarchicalMeshFunctionInt
HierarchicalMeshFunctionInt.depth = new_instancemethod(_function.HierarchicalMeshFunctionInt_depth,None,HierarchicalMeshFunctionInt)
HierarchicalMeshFunctionInt.has_parent = new_instancemethod(_function.HierarchicalMeshFunctionInt_has_parent,None,HierarchicalMeshFunctionInt)
HierarchicalMeshFunctionInt.has_child = new_instancemethod(_function.HierarchicalMeshFunctionInt_has_child,None,HierarchicalMeshFunctionInt)
HierarchicalMeshFunctionInt._parent = new_instancemethod(_function.HierarchicalMeshFunctionInt__parent,None,HierarchicalMeshFunctionInt)
HierarchicalMeshFunctionInt._child = new_instancemethod(_function.HierarchicalMeshFunctionInt__child,None,HierarchicalMeshFunctionInt)
HierarchicalMeshFunctionInt._root_node = new_instancemethod(_function.HierarchicalMeshFunctionInt__root_node,None,HierarchicalMeshFunctionInt)
HierarchicalMeshFunctionInt._leaf_node = new_instancemethod(_function.HierarchicalMeshFunctionInt__leaf_node,None,HierarchicalMeshFunctionInt)
HierarchicalMeshFunctionInt.set_parent = new_instancemethod(_function.HierarchicalMeshFunctionInt_set_parent,None,HierarchicalMeshFunctionInt)
HierarchicalMeshFunctionInt.clear_child = new_instancemethod(_function.HierarchicalMeshFunctionInt_clear_child,None,HierarchicalMeshFunctionInt)
HierarchicalMeshFunctionInt.set_child = new_instancemethod(_function.HierarchicalMeshFunctionInt_set_child,None,HierarchicalMeshFunctionInt)
HierarchicalMeshFunctionInt._debug = new_instancemethod(_function.HierarchicalMeshFunctionInt__debug,None,HierarchicalMeshFunctionInt)
HierarchicalMeshFunctionInt_swigregister = _function.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):
_function.HierarchicalMeshFunctionDouble_swiginit(self,_function.new_HierarchicalMeshFunctionDouble(*args))
__swig_destroy__ = _function.delete_HierarchicalMeshFunctionDouble
HierarchicalMeshFunctionDouble.depth = new_instancemethod(_function.HierarchicalMeshFunctionDouble_depth,None,HierarchicalMeshFunctionDouble)
HierarchicalMeshFunctionDouble.has_parent = new_instancemethod(_function.HierarchicalMeshFunctionDouble_has_parent,None,HierarchicalMeshFunctionDouble)
HierarchicalMeshFunctionDouble.has_child = new_instancemethod(_function.HierarchicalMeshFunctionDouble_has_child,None,HierarchicalMeshFunctionDouble)
HierarchicalMeshFunctionDouble._parent = new_instancemethod(_function.HierarchicalMeshFunctionDouble__parent,None,HierarchicalMeshFunctionDouble)
HierarchicalMeshFunctionDouble._child = new_instancemethod(_function.HierarchicalMeshFunctionDouble__child,None,HierarchicalMeshFunctionDouble)
HierarchicalMeshFunctionDouble._root_node = new_instancemethod(_function.HierarchicalMeshFunctionDouble__root_node,None,HierarchicalMeshFunctionDouble)
HierarchicalMeshFunctionDouble._leaf_node = new_instancemethod(_function.HierarchicalMeshFunctionDouble__leaf_node,None,HierarchicalMeshFunctionDouble)
HierarchicalMeshFunctionDouble.set_parent = new_instancemethod(_function.HierarchicalMeshFunctionDouble_set_parent,None,HierarchicalMeshFunctionDouble)
HierarchicalMeshFunctionDouble.clear_child = new_instancemethod(_function.HierarchicalMeshFunctionDouble_clear_child,None,HierarchicalMeshFunctionDouble)
HierarchicalMeshFunctionDouble.set_child = new_instancemethod(_function.HierarchicalMeshFunctionDouble_set_child,None,HierarchicalMeshFunctionDouble)
HierarchicalMeshFunctionDouble._debug = new_instancemethod(_function.HierarchicalMeshFunctionDouble__debug,None,HierarchicalMeshFunctionDouble)
HierarchicalMeshFunctionDouble_swigregister = _function.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):
_function.HierarchicalMeshFunctionBool_swiginit(self,_function.new_HierarchicalMeshFunctionBool(*args))
__swig_destroy__ = _function.delete_HierarchicalMeshFunctionBool
HierarchicalMeshFunctionBool.depth = new_instancemethod(_function.HierarchicalMeshFunctionBool_depth,None,HierarchicalMeshFunctionBool)
HierarchicalMeshFunctionBool.has_parent = new_instancemethod(_function.HierarchicalMeshFunctionBool_has_parent,None,HierarchicalMeshFunctionBool)
HierarchicalMeshFunctionBool.has_child = new_instancemethod(_function.HierarchicalMeshFunctionBool_has_child,None,HierarchicalMeshFunctionBool)
HierarchicalMeshFunctionBool._parent = new_instancemethod(_function.HierarchicalMeshFunctionBool__parent,None,HierarchicalMeshFunctionBool)
HierarchicalMeshFunctionBool._child = new_instancemethod(_function.HierarchicalMeshFunctionBool__child,None,HierarchicalMeshFunctionBool)
HierarchicalMeshFunctionBool._root_node = new_instancemethod(_function.HierarchicalMeshFunctionBool__root_node,None,HierarchicalMeshFunctionBool)
HierarchicalMeshFunctionBool._leaf_node = new_instancemethod(_function.HierarchicalMeshFunctionBool__leaf_node,None,HierarchicalMeshFunctionBool)
HierarchicalMeshFunctionBool.set_parent = new_instancemethod(_function.HierarchicalMeshFunctionBool_set_parent,None,HierarchicalMeshFunctionBool)
HierarchicalMeshFunctionBool.clear_child = new_instancemethod(_function.HierarchicalMeshFunctionBool_clear_child,None,HierarchicalMeshFunctionBool)
HierarchicalMeshFunctionBool.set_child = new_instancemethod(_function.HierarchicalMeshFunctionBool_set_child,None,HierarchicalMeshFunctionBool)
HierarchicalMeshFunctionBool._debug = new_instancemethod(_function.HierarchicalMeshFunctionBool__debug,None,HierarchicalMeshFunctionBool)
HierarchicalMeshFunctionBool_swigregister = _function.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):
_function.HierarchicalMeshFunctionSizet_swiginit(self,_function.new_HierarchicalMeshFunctionSizet(*args))
__swig_destroy__ = _function.delete_HierarchicalMeshFunctionSizet
HierarchicalMeshFunctionSizet.depth = new_instancemethod(_function.HierarchicalMeshFunctionSizet_depth,None,HierarchicalMeshFunctionSizet)
HierarchicalMeshFunctionSizet.has_parent = new_instancemethod(_function.HierarchicalMeshFunctionSizet_has_parent,None,HierarchicalMeshFunctionSizet)
HierarchicalMeshFunctionSizet.has_child = new_instancemethod(_function.HierarchicalMeshFunctionSizet_has_child,None,HierarchicalMeshFunctionSizet)
HierarchicalMeshFunctionSizet._parent = new_instancemethod(_function.HierarchicalMeshFunctionSizet__parent,None,HierarchicalMeshFunctionSizet)
HierarchicalMeshFunctionSizet._child = new_instancemethod(_function.HierarchicalMeshFunctionSizet__child,None,HierarchicalMeshFunctionSizet)
HierarchicalMeshFunctionSizet._root_node = new_instancemethod(_function.HierarchicalMeshFunctionSizet__root_node,None,HierarchicalMeshFunctionSizet)
HierarchicalMeshFunctionSizet._leaf_node = new_instancemethod(_function.HierarchicalMeshFunctionSizet__leaf_node,None,HierarchicalMeshFunctionSizet)
HierarchicalMeshFunctionSizet.set_parent = new_instancemethod(_function.HierarchicalMeshFunctionSizet_set_parent,None,HierarchicalMeshFunctionSizet)
HierarchicalMeshFunctionSizet.clear_child = new_instancemethod(_function.HierarchicalMeshFunctionSizet_clear_child,None,HierarchicalMeshFunctionSizet)
HierarchicalMeshFunctionSizet.set_child = new_instancemethod(_function.HierarchicalMeshFunctionSizet_set_child,None,HierarchicalMeshFunctionSizet)
HierarchicalMeshFunctionSizet._debug = new_instancemethod(_function.HierarchicalMeshFunctionSizet__debug,None,HierarchicalMeshFunctionSizet)
HierarchicalMeshFunctionSizet_swigregister = _function.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):
_function.HierarchicalMesh_swiginit(self,_function.new_HierarchicalMesh(*args))
__swig_destroy__ = _function.delete_HierarchicalMesh
HierarchicalMesh.depth = new_instancemethod(_function.HierarchicalMesh_depth,None,HierarchicalMesh)
HierarchicalMesh.has_parent = new_instancemethod(_function.HierarchicalMesh_has_parent,None,HierarchicalMesh)
HierarchicalMesh.has_child = new_instancemethod(_function.HierarchicalMesh_has_child,None,HierarchicalMesh)
HierarchicalMesh._parent = new_instancemethod(_function.HierarchicalMesh__parent,None,HierarchicalMesh)
HierarchicalMesh._child = new_instancemethod(_function.HierarchicalMesh__child,None,HierarchicalMesh)
HierarchicalMesh._root_node = new_instancemethod(_function.HierarchicalMesh__root_node,None,HierarchicalMesh)
HierarchicalMesh._leaf_node = new_instancemethod(_function.HierarchicalMesh__leaf_node,None,HierarchicalMesh)
HierarchicalMesh.set_parent = new_instancemethod(_function.HierarchicalMesh_set_parent,None,HierarchicalMesh)
HierarchicalMesh.clear_child = new_instancemethod(_function.HierarchicalMesh_clear_child,None,HierarchicalMesh)
HierarchicalMesh.set_child = new_instancemethod(_function.HierarchicalMesh_set_child,None,HierarchicalMesh)
HierarchicalMesh._debug = new_instancemethod(_function.HierarchicalMesh__debug,None,HierarchicalMesh)
HierarchicalMesh_swigregister = _function.HierarchicalMesh_swigregister
HierarchicalMesh_swigregister(HierarchicalMesh)
import mesh
import fem
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):
_function.HierarchicalFunctionSpace_swiginit(self,_function.new_HierarchicalFunctionSpace(*args))
__swig_destroy__ = _function.delete_HierarchicalFunctionSpace
HierarchicalFunctionSpace.depth = new_instancemethod(_function.HierarchicalFunctionSpace_depth,None,HierarchicalFunctionSpace)
HierarchicalFunctionSpace.has_parent = new_instancemethod(_function.HierarchicalFunctionSpace_has_parent,None,HierarchicalFunctionSpace)
HierarchicalFunctionSpace.has_child = new_instancemethod(_function.HierarchicalFunctionSpace_has_child,None,HierarchicalFunctionSpace)
HierarchicalFunctionSpace._parent = new_instancemethod(_function.HierarchicalFunctionSpace__parent,None,HierarchicalFunctionSpace)
HierarchicalFunctionSpace._child = new_instancemethod(_function.HierarchicalFunctionSpace__child,None,HierarchicalFunctionSpace)
HierarchicalFunctionSpace._root_node = new_instancemethod(_function.HierarchicalFunctionSpace__root_node,None,HierarchicalFunctionSpace)
HierarchicalFunctionSpace._leaf_node = new_instancemethod(_function.HierarchicalFunctionSpace__leaf_node,None,HierarchicalFunctionSpace)
HierarchicalFunctionSpace.set_parent = new_instancemethod(_function.HierarchicalFunctionSpace_set_parent,None,HierarchicalFunctionSpace)
HierarchicalFunctionSpace.clear_child = new_instancemethod(_function.HierarchicalFunctionSpace_clear_child,None,HierarchicalFunctionSpace)
HierarchicalFunctionSpace.set_child = new_instancemethod(_function.HierarchicalFunctionSpace_set_child,None,HierarchicalFunctionSpace)
HierarchicalFunctionSpace._debug = new_instancemethod(_function.HierarchicalFunctionSpace__debug,None,HierarchicalFunctionSpace)
HierarchicalFunctionSpace_swigregister = _function.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):
_function.HierarchicalFunction_swiginit(self,_function.new_HierarchicalFunction(*args))
__swig_destroy__ = _function.delete_HierarchicalFunction
HierarchicalFunction.depth = new_instancemethod(_function.HierarchicalFunction_depth,None,HierarchicalFunction)
HierarchicalFunction.has_parent = new_instancemethod(_function.HierarchicalFunction_has_parent,None,HierarchicalFunction)
HierarchicalFunction.has_child = new_instancemethod(_function.HierarchicalFunction_has_child,None,HierarchicalFunction)
HierarchicalFunction._parent = new_instancemethod(_function.HierarchicalFunction__parent,None,HierarchicalFunction)
HierarchicalFunction._child = new_instancemethod(_function.HierarchicalFunction__child,None,HierarchicalFunction)
HierarchicalFunction._root_node = new_instancemethod(_function.HierarchicalFunction__root_node,None,HierarchicalFunction)
HierarchicalFunction._leaf_node = new_instancemethod(_function.HierarchicalFunction__leaf_node,None,HierarchicalFunction)
HierarchicalFunction.set_parent = new_instancemethod(_function.HierarchicalFunction_set_parent,None,HierarchicalFunction)
HierarchicalFunction.clear_child = new_instancemethod(_function.HierarchicalFunction_clear_child,None,HierarchicalFunction)
HierarchicalFunction.set_child = new_instancemethod(_function.HierarchicalFunction_set_child,None,HierarchicalFunction)
HierarchicalFunction._debug = new_instancemethod(_function.HierarchicalFunction__debug,None,HierarchicalFunction)
HierarchicalFunction_swigregister = _function.HierarchicalFunction_swigregister
HierarchicalFunction_swigregister(HierarchicalFunction)
class GenericFunction(ufc.function,common.Variable):
"""
This is a common base class for functions. Functions can be
evaluated at a given point and they can be restricted to a given
cell in a finite element mesh. This functionality is implemented
by sub-classes that implement the eval() and restrict() functions.
DOLFIN provides two implementations of the GenericFunction
interface in the form of the classes Function and Expression.
Sub-classes may optionally implement the update() function that
will be called prior to restriction when running in parallel.
"""
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__ = _function.delete_GenericFunction
def value_rank(self, *args):
"""
Return value rank
"""
return _function.GenericFunction_value_rank(self, *args)
def value_dimension(self, *args):
"""
Return value dimension for given axis
"""
return _function.GenericFunction_value_dimension(self, *args)
def eval_cell(self, *args):
"""
**Overloaded versions**
* eval\ (values, x, cell)
Evaluate at given point in given cell
* eval\ (values, x)
Evaluate at given point
"""
return _function.GenericFunction_eval_cell(self, *args)
def eval(self, *args):
"""
**Overloaded versions**
* eval\ (values, x, cell)
Evaluate at given point in given cell
* eval\ (values, x)
Evaluate at given point
"""
return _function.GenericFunction_eval(self, *args)
def restrict(self, *args):
"""
Restrict function to local cell (compute expansion coefficients w)
"""
return _function.GenericFunction_restrict(self, *args)
def compute_vertex_values(self, *args):
"""
Compute values at all mesh vertices
"""
return _function.GenericFunction_compute_vertex_values(self, *args)
def update(self, *args):
"""
Update off-process ghost coefficients
"""
return _function.GenericFunction_update(self, *args)
def value_size(self, *args):
"""
Evaluation at given point
Return value size (product of value dimensions)
"""
return _function.GenericFunction_value_size(self, *args)
GenericFunction.value_rank = new_instancemethod(_function.GenericFunction_value_rank,None,GenericFunction)
GenericFunction.value_dimension = new_instancemethod(_function.GenericFunction_value_dimension,None,GenericFunction)
GenericFunction.eval_cell = new_instancemethod(_function.GenericFunction_eval_cell,None,GenericFunction)
GenericFunction.eval = new_instancemethod(_function.GenericFunction_eval,None,GenericFunction)
GenericFunction.restrict = new_instancemethod(_function.GenericFunction_restrict,None,GenericFunction)
GenericFunction.compute_vertex_values = new_instancemethod(_function.GenericFunction_compute_vertex_values,None,GenericFunction)
GenericFunction.update = new_instancemethod(_function.GenericFunction_update,None,GenericFunction)
GenericFunction.value_size = new_instancemethod(_function.GenericFunction_value_size,None,GenericFunction)
GenericFunction_swigregister = _function.GenericFunction_swigregister
GenericFunction_swigregister(GenericFunction)
class Expression(GenericFunction):
"""
This class represents a user-defined expression. Expressions can
be used as coefficients in variational forms or interpolated
into finite element spaces.
An expression is defined by overloading the eval() method. Users
may choose to overload either a simple version of eval(), in the
case of expressions only depending on the coordinate x, or an
optional version for expressions depending on x and mesh data
like cell indices or facet normals.
The geometric dimension (the size of x) and the value rank and
dimensions of an expression must supplied as arguments to the
constructor.
"""
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**
* Expression\ ()
Create scalar expression.
* Expression\ (dim)
Create vector-valued expression with given dimension.
*Arguments*
dim (int)
Dimension of the vector-valued expression.
* Expression\ (dim0, dim1)
Create matrix-valued expression with given dimensions.
*Arguments*
dim0 (int)
Dimension (rows).
dim1 (int)
Dimension (columns).
* Expression\ (value_shape)
Create tensor-valued expression with given shape.
*Arguments*
value_shape (numpy.array(int))
Shape of expression.
* Expression\ (expression)
Copy constructor
*Arguments*
expression (:py:class:`Expression`)
Object to be copied.
"""
if self.__class__ == Expression:
_self = None
else:
_self = self
_function.Expression_swiginit(self,_function.new_Expression(_self, *args))
__swig_destroy__ = _function.delete_Expression
def eval_cell(self, *args):
"""
**Overloaded versions**
* eval\ (values, x, cell)
Note: The reimplementation of eval is needed for the Python interface.
Evaluate at given point in given cell.
*Arguments*
values (numpy.array(float))
The values at the point.
x (numpy.array(float))
The coordinates of the point.
cell (ufc::cell)
The cell which contains the given point.
* eval\ (values, x)
Evaluate at given point.
*Arguments*
values (numpy.array(float))
The values at the point.
x (numpy.array(float))
The coordinates of the point.
"""
return _function.Expression_eval_cell(self, *args)
def eval(self, *args):
"""
**Overloaded versions**
* eval\ (values, x, cell)
Note: The reimplementation of eval is needed for the Python interface.
Evaluate at given point in given cell.
*Arguments*
values (numpy.array(float))
The values at the point.
x (numpy.array(float))
The coordinates of the point.
cell (ufc::cell)
The cell which contains the given point.
* eval\ (values, x)
Evaluate at given point.
*Arguments*
values (numpy.array(float))
The values at the point.
x (numpy.array(float))
The coordinates of the point.
"""
return _function.Expression_eval(self, *args)
def __disown__(self):
self.this.disown()
_function.disown_Expression(self)
return weakref_proxy(self)
Expression.eval_cell = new_instancemethod(_function.Expression_eval_cell,None,Expression)
Expression.eval = new_instancemethod(_function.Expression_eval,None,Expression)
Expression_swigregister = _function.Expression_swigregister
Expression_swigregister(Expression)
class FunctionAXPY(object):
"""
This class represents a linear combination of functions. It is
mostly used as an intermediate class for operations such as u =
3*u0 + 4*u1; where the rhs generates an FunctionAXPY.
"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
ADD_ADD = _function.FunctionAXPY_ADD_ADD
SUB_ADD = _function.FunctionAXPY_SUB_ADD
ADD_SUB = _function.FunctionAXPY_ADD_SUB
SUB_SUB = _function.FunctionAXPY_SUB_SUB
def __init__(self, *args):
"""
**Overloaded versions**
* FunctionAXPY\ (func, scalar)
Constructor
* FunctionAXPY\ (axpy, scalar)
Constructor
* FunctionAXPY\ (func0, func1, direction)
Constructor
* FunctionAXPY\ (axpy, func, direction)
Constructor
* FunctionAXPY\ (axpy0, axpy1, direction)
Constructor
* FunctionAXPY\ (pairs)
Constructor
* FunctionAXPY\ (axpy)
Copy constructor
"""
_function.FunctionAXPY_swiginit(self,_function.new_FunctionAXPY(*args))
def __add__(self, *args):
"""
**Overloaded versions**
* operator+\ (func)
Addition operator
* operator+\ (axpy)
Addition operator
"""
return _function.FunctionAXPY___add__(self, *args)
def __sub__(self, *args):
"""
**Overloaded versions**
* operator-\ (func)
Substraction operator
* operator-\ (axpy)
Substraction operator
"""
return _function.FunctionAXPY___sub__(self, *args)
def __mul__(self, *args):
"""
Scale operator
"""
return _function.FunctionAXPY___mul__(self, *args)
def __div__(self, *args):
"""
Scale operator
"""
return _function.FunctionAXPY___div__(self, *args)
def pairs(self, *args):
"""
Return the scalar and Function pairs
"""
return _function.FunctionAXPY_pairs(self, *args)
__swig_destroy__ = _function.delete_FunctionAXPY
FunctionAXPY.__add__ = new_instancemethod(_function.FunctionAXPY___add__,None,FunctionAXPY)
FunctionAXPY.__sub__ = new_instancemethod(_function.FunctionAXPY___sub__,None,FunctionAXPY)
FunctionAXPY.__mul__ = new_instancemethod(_function.FunctionAXPY___mul__,None,FunctionAXPY)
FunctionAXPY.__div__ = new_instancemethod(_function.FunctionAXPY___div__,None,FunctionAXPY)
FunctionAXPY.pairs = new_instancemethod(_function.FunctionAXPY_pairs,None,FunctionAXPY)
FunctionAXPY_swigregister = _function.FunctionAXPY_swigregister
FunctionAXPY_swigregister(FunctionAXPY)
class Function(GenericFunction,HierarchicalFunction):
"""
This class represents a function :math:`u_h` in a finite
element function space :math:`V_h`, given by
.. math::
u_h = \sum_{i=1}^{n} U_i \phi_i
where :math:`\{\phi_i\}_{i=1}^{n}` is a basis for :math:`V_h`,
and :math:`U` is a vector of expansion coefficients for :math:`u_h`.
"""
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**
* Function\ (V)
Create function on given function space
*Arguments*
V (:py:class:`FunctionSpace`)
The function space.
*Example*
.. note::
No example code available for this function.
* Function\ (V)
Create function on given function space (shared data)
*Arguments*
V (:py:class:`FunctionSpace`)
The function space.
* Function\ (V, x)
Create function on given function space with a given vector
(shared data)
*Warning: This constructor is intended for internal library use only*
*Arguments*
V (:py:class:`FunctionSpace`)
The function space.
x (:py:class:`GenericVector`)
The vector.
* Function\ (V, filename)
Create function from vector of dofs stored to file
*Arguments*
V (:py:class:`FunctionSpace`)
The function space.
filename_vector (str)
The name of the file containing the vector.
filename_dofdata (str)
The name of the file containing the dofmap data.
* Function\ (V, filename)
Create function from vector of dofs stored to file (shared data)
*Arguments*
V (:py:class:`FunctionSpace`)
The function space.
filename_dofdata (str)
The name of the file containing the dofmap data.
* Function\ (v)
Copy constructor
*Arguments*
v (:py:class:`Function`)
The object to be copied.
* Function\ (v, i)
Sub-function constructor with shallow copy of vector (used in Python
interface)
*Arguments*
v (:py:class:`Function`)
The function to be copied.
i (int)
Index of subfunction.
"""
_function.Function_swiginit(self,_function.new_Function(*args))
__swig_destroy__ = _function.delete_Function
def _assign(self, *args):
"""
**Overloaded versions**
* operator=\ (v)
Assignment from function
*Arguments*
v (:py:class:`Function`)
Another function.
* operator=\ (v)
Assignment from expression using interpolation
*Arguments*
v (:py:class:`Expression`)
The expression.
* operator=\ (axpy)
Assignment from linear combination of function
*Arguments*
v (:py:class:`FunctionAXPY`)
A linear combination of other Functions
"""
return _function.Function__assign(self, *args)
def sub(self, *args):
"""
Extract subfunction
*Arguments*
i (int)
Index of subfunction.
*Returns*
:py:class:`Function`
The subfunction.
"""
return _function.Function_sub(self, *args)
def __add__(self, *args):
"""
**Overloaded versions**
* operator+\ (other)
Add operator with other function
*Returns*
:py:class:`FunctionAXPY`
Return a linear combination of Functions
* operator+\ (axpy)
Add operator with other linear combination of functions
*Returns*
:py:class:`FunctionAXPY`
Return a linear combination of Functions
"""
return _function.Function___add__(self, *args)
def __sub__(self, *args):
"""
**Overloaded versions**
* operator-\ (other)
Substraction operator with other function
*Returns*
:py:class:`FunctionAXPY`
Return a linear combination of Functions
* operator-\ (axpy)
Substraction operator with other linear combination of functions
*Returns*
:py:class:`FunctionAXPY`
Return a linear combination of Functions
"""
return _function.Function___sub__(self, *args)
def __mul__(self, *args):
"""
Scale operator
*Returns*
:py:class:`FunctionAXPY`
Return a linear combination of Functions
"""
return _function.Function___mul__(self, *args)
def __div__(self, *args):
"""
Scale operator
*Returns*
:py:class:`FunctionAXPY`
Return a linear combination of Functions
"""
return _function.Function___div__(self, *args)
def _function_space(self, *args):
"""
Return shared pointer to function space
*Returns*
:py:class:`FunctionSpace`
Return the shared pointer.
"""
return _function.Function__function_space(self, *args)
def vector(self, *args):
"""
**Overloaded versions**
* vector\ ()
Return vector of expansion coefficients (non-const version)
*Returns*
:py:class:`GenericVector`
The vector of expansion coefficients.
* vector\ ()
Return vector of expansion coefficients (const version)
*Returns*
:py:class:`GenericVector`
The vector of expansion coefficients (const).
"""
return _function.Function_vector(self, *args)
def _in(self, *args):
"""
Check if function is a member of the given function space
*Arguments*
V (:py:class:`FunctionSpace`)
The function space.
*Returns*
bool
True if the function is in the function space.
"""
return _function.Function__in(self, *args)
def geometric_dimension(self, *args):
"""
Return geometric dimension
*Returns*
int
The geometric dimension.
"""
return _function.Function_geometric_dimension(self, *args)
def eval(self, *args):
"""
**Overloaded versions**
* eval\ (values, x)
Evaluate function at given coordinates
*Arguments*
values (numpy.array(float))
The values.
x (numpy.array(float))
The coordinates.
* eval\ (values, x, dolfin_cell, ufc_cell)
Evaluate function at given coordinates in given cell
*Arguments*
values (numpy.array(float))
The values.
x (numpy.array(float))
The coordinates.
dolfin_cell (:py:class:`Cell`)
The cell.
ufc_cell (ufc::cell)
The ufc::cell.
* eval\ (values, x, cell)
Evaluate at given point in given cell
*Arguments*
values (numpy.array(float))
The values at the point.
x (numpy.array(float))
The coordinates of the point.
cell (ufc::cell)
The cell which contains the given point.
"""
return _function.Function_eval(self, *args)
def interpolate(self, *args):
"""
Interpolate function (on possibly non-matching meshes)
*Arguments*
v (:py:class:`GenericFunction`)
The function to be interpolated.
"""
return _function.Function_interpolate(self, *args)
def extrapolate(self, *args):
"""
Extrapolate function (from a possibly lower-degree function space)
*Arguments*
v (:py:class:`Function`)
The function to be extrapolated.
"""
return _function.Function_extrapolate(self, *args)
def non_matching_eval(self, *args):
"""
Evaluate function for given data (non-matching meshes)
*Arguments*
values (numpy.array(float))
The values at the point.
x (numpy.array(float))
The coordinates of the point.
cell (ufc::cell)
The cell.
"""
return _function.Function_non_matching_eval(self, *args)
def compute_vertex_values(self, *args):
"""
**Overloaded versions**
* compute_vertex_values\ (vertex_values, mesh)
Compute values at all mesh vertices
*Arguments*
vertex_values (numpy.array(float))
The values at all vertices.
mesh (:py:class:`Mesh`)
The mesh.
* compute_vertex_values\ (vertex_values)
Compute values at all mesh vertices
*Arguments*
vertex_values (numpy.array(float))
The values at all vertices.
"""
return _function.Function_compute_vertex_values(self, *args)
def function_space(self):
"Return the FunctionSpace"
from dolfin.functions.functionspace import FunctionSpaceFromCpp
return FunctionSpaceFromCpp(self._function_space())
def copy(self, deepcopy=False):
"""
Return a copy of itself
*Arguments*
deepcopy (bool)
If false (default) the dof vector is shared.
*Returns*
_Function_
The Function
"""
from dolfin.functions.function import Function
if deepcopy:
return Function(self.function_space(), self.vector().copy())
return Function(self.function_space(), self.vector())
def leaf_node(self):
"Return the finest Function in hierarchy"
from dolfin.functions.function import Function
return Function(HierarchicalFunction._leaf_node(self))
def root_node(self):
"Return the coarsest Function in hierarchy"
from dolfin.functions.function import Function
return Function(HierarchicalFunction._root_node(self))
def child(self):
"Return the child Function in the hierarchy"
from dolfin.functions.function import Function
return Function(HierarchicalFunction._child(self))
def parent(self):
"Return the parent Function in the hierarchy"
from dolfin.functions.function import Function
return Function(HierarchicalFunction._parent(self))
Function._assign = new_instancemethod(_function.Function__assign,None,Function)
Function.sub = new_instancemethod(_function.Function_sub,None,Function)
Function.__add__ = new_instancemethod(_function.Function___add__,None,Function)
Function.__sub__ = new_instancemethod(_function.Function___sub__,None,Function)
Function.__mul__ = new_instancemethod(_function.Function___mul__,None,Function)
Function.__div__ = new_instancemethod(_function.Function___div__,None,Function)
Function._function_space = new_instancemethod(_function.Function__function_space,None,Function)
Function.vector = new_instancemethod(_function.Function_vector,None,Function)
Function._in = new_instancemethod(_function.Function__in,None,Function)
Function.geometric_dimension = new_instancemethod(_function.Function_geometric_dimension,None,Function)
Function.eval = new_instancemethod(_function.Function_eval,None,Function)
Function.interpolate = new_instancemethod(_function.Function_interpolate,None,Function)
Function.extrapolate = new_instancemethod(_function.Function_extrapolate,None,Function)
Function.non_matching_eval = new_instancemethod(_function.Function_non_matching_eval,None,Function)
Function.compute_vertex_values = new_instancemethod(_function.Function_compute_vertex_values,None,Function)
Function_swigregister = _function.Function_swigregister
Function_swigregister(Function)
class FunctionSpace(common.Variable,HierarchicalFunctionSpace):
"""
This class represents a finite element function space defined by
a mesh, a finite element, and a local-to-global mapping of the
degrees of freedom (dofmap).
"""
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**
* FunctionSpace\ (mesh, element, dofmap)
Create function space for given mesh, element and dofmap
(shared data)
*Arguments*
mesh (:py:class:`Mesh`)
The mesh.
element (:py:class:`FiniteElement`)
The element.
dofmap (:py:class:`GenericDofMap`)
The dofmap.
* FunctionSpace\ (mesh)
Create empty function space for later initialization. This
constructor is intended for use by any sub-classes which need
to construct objects before the initialisation of the base
class. Data can be attached to the base class using
FunctionSpace::attach(...).
*Arguments*
mesh (:py:class:`Mesh`)
The mesh.
* FunctionSpace\ (V)
Copy constructor
*Arguments*
V (:py:class:`FunctionSpace`)
The object to be copied.
"""
_function.FunctionSpace_swiginit(self,_function.new_FunctionSpace(*args))
__swig_destroy__ = _function.delete_FunctionSpace
def assign(self, *args):
"""
Assignment operator
*Arguments*
V (:py:class:`FunctionSpace`)
Another function space.
"""
return _function.FunctionSpace_assign(self, *args)
def __eq__(self, *args):
"""
Equality operator
*Arguments*
V (:py:class:`FunctionSpace`)
Another function space.
"""
return _function.FunctionSpace___eq__(self, *args)
def __ne__(self, *args):
"""
Unequality operator
*Arguments*
V (:py:class:`FunctionSpace`)
Another function space.
"""
return _function.FunctionSpace___ne__(self, *args)
def mesh(self, *args):
"""
Return mesh
*Returns*
:py:class:`Mesh`
The mesh.
"""
return _function.FunctionSpace_mesh(self, *args)
def element(self, *args):
"""
Return finite element
*Returns*
:py:class:`FiniteElement`
The finite element.
"""
return _function.FunctionSpace_element(self, *args)
def dofmap(self, *args):
"""
Return dofmap
*Returns*
:py:class:`GenericDofMap`
The dofmap.
"""
return _function.FunctionSpace_dofmap(self, *args)
def dim(self, *args):
"""
Return dimension of function space
*Returns*
int
The dimension of the function space.
"""
return _function.FunctionSpace_dim(self, *args)
def interpolate(self, *args):
"""
Interpolate function v into function space, returning the
vector of expansion coefficients
*Arguments*
expansion_coefficients (:py:class:`GenericVector`)
The expansion coefficients.
v (:py:class:`GenericFunction`)
The function to be interpolated.
"""
return _function.FunctionSpace_interpolate(self, *args)
def sub(self, *args):
"""
Extract subspace for component
*Arguments*
i (int)
Index of the subspace.
*Returns*
:py:class:`FunctionSpace`
The subspace.
"""
return _function.FunctionSpace_sub(self, *args)
def extract_sub_space(self, *args):
"""
Extract subspace for component
*Arguments*
component (numpy.array(int))
The component.
*Returns*
:py:class:`FunctionSpace`
The subspace.
"""
return _function.FunctionSpace_extract_sub_space(self, *args)
def collapse(self, *args):
"""
**Overloaded versions**
* collapse\ ()
Collapse a subspace and return a new function space
*Returns*
:py:class:`FunctionSpace`
The new function space.
* collapse\ (collapsed_dofs)
Collapse a subspace and return a new function space and a map
from new to old dofs
*Arguments*
collapsed_dofs (boost::unordered_map<std::size_t, std::size_t>)
The map from new to old dofs.
*Returns*
:py:class:`FunctionSpace`
The new function space.
"""
return _function.FunctionSpace_collapse(self, *args)
def has_cell(self, *args):
"""
Check if function space has given cell
*Arguments*
cell (:py:class:`Cell`)
The cell.
*Returns*
bool
True if the function space has the given cell.
"""
return _function.FunctionSpace_has_cell(self, *args)
def has_element(self, *args):
"""
Check if function space has given element
*Arguments*
element (:py:class:`FiniteElement`)
The finite element.
*Returns*
bool
True if the function space has the given element.
"""
return _function.FunctionSpace_has_element(self, *args)
def component(self, *args):
"""
Return component
*Returns*
numpy.array(int)
The component (relative to superspace).
"""
return _function.FunctionSpace_component(self, *args)
def print_dofmap(self, *args):
"""
Print dofmap (useful for debugging)
"""
return _function.FunctionSpace_print_dofmap(self, *args)
def __contains__(self,u):
"Check whether a function is in the FunctionSpace"
assert(isinstance(u,Function))
return u._in(self)
def leaf_node(self):
"Return the finest FunctionSpace in hierarchy"
from dolfin.functions.functionspace import FunctionSpaceFromCpp
return FunctionSpaceFromCpp(HierarchicalFunctionSpace._leaf_node(self))
def root_node(self):
"Return the coarsest FunctionSpace in hierarchy"
from dolfin.functions.functionspace import FunctionSpaceFromCpp
return FunctionSpaceFromCpp(HierarchicalFunctionSpace._root_node(self))
def child(self):
"Return the child FunctionSpace in the hierarchy"
from dolfin.functions.functionspace import FunctionSpaceFromCpp
return FunctionSpaceFromCpp(HierarchicalFunctionSpace._child(self))
def parent(self):
"Return the parent FunctionSpace in the hierarchy"
from dolfin.functions.functionspace import FunctionSpaceFromCpp
return FunctionSpaceFromCpp(HierarchicalFunctionSpace._parent(self))
FunctionSpace.assign = new_instancemethod(_function.FunctionSpace_assign,None,FunctionSpace)
FunctionSpace.__eq__ = new_instancemethod(_function.FunctionSpace___eq__,None,FunctionSpace)
FunctionSpace.__ne__ = new_instancemethod(_function.FunctionSpace___ne__,None,FunctionSpace)
FunctionSpace.mesh = new_instancemethod(_function.FunctionSpace_mesh,None,FunctionSpace)
FunctionSpace.element = new_instancemethod(_function.FunctionSpace_element,None,FunctionSpace)
FunctionSpace.dofmap = new_instancemethod(_function.FunctionSpace_dofmap,None,FunctionSpace)
FunctionSpace.dim = new_instancemethod(_function.FunctionSpace_dim,None,FunctionSpace)
FunctionSpace.interpolate = new_instancemethod(_function.FunctionSpace_interpolate,None,FunctionSpace)
FunctionSpace.sub = new_instancemethod(_function.FunctionSpace_sub,None,FunctionSpace)
FunctionSpace.extract_sub_space = new_instancemethod(_function.FunctionSpace_extract_sub_space,None,FunctionSpace)
FunctionSpace.collapse = new_instancemethod(_function.FunctionSpace_collapse,None,FunctionSpace)
FunctionSpace.has_cell = new_instancemethod(_function.FunctionSpace_has_cell,None,FunctionSpace)
FunctionSpace.has_element = new_instancemethod(_function.FunctionSpace_has_element,None,FunctionSpace)
FunctionSpace.component = new_instancemethod(_function.FunctionSpace_component,None,FunctionSpace)
FunctionSpace.print_dofmap = new_instancemethod(_function.FunctionSpace_print_dofmap,None,FunctionSpace)
FunctionSpace_swigregister = _function.FunctionSpace_swigregister
FunctionSpace_swigregister(FunctionSpace)
class SubSpace(FunctionSpace):
"""
This class represents a subspace (component) of a function space.
The subspace is specified by an array of indices. For example,
the array [3, 0, 2] specifies subspace 2 of subspace 0 of
subspace 3.
A typical example is the function space W = V x P for Stokes.
Here, V = W[0] is the subspace for the velocity component and
P = W[1] is the subspace for the pressure component. Furthermore,
W[0][0] = V[0] is the first component of the velocity space etc.
"""
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**
* SubSpace\ (V, component)
Create subspace for given component (one level)
* SubSpace\ (V, component, sub_component)
Create subspace for given component (two levels)
* SubSpace\ (V, component)
Create subspace for given component (n levels)
"""
_function.SubSpace_swiginit(self,_function.new_SubSpace(*args))
__swig_destroy__ = _function.delete_SubSpace
SubSpace_swigregister = _function.SubSpace_swigregister
SubSpace_swigregister(SubSpace)
class Constant(Expression):
"""
This class represents a constant-valued expression.
"""
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**
* Constant\ (value)
Create scalar constant
*Arguments*
value (float)
The scalar to create a Constant object from.
*Example*
.. note::
No example code available for this function.
* Constant\ (value0, value1)
Create vector constant (dim = 2)
*Arguments*
value0 (float)
The first vector element.
value1 (float)
The second vector element.
*Example*
.. note::
No example code available for this function.
* Constant\ (value0, value1, value2)
Create vector constant (dim = 3)
*Arguments*
value0 (float)
The first vector element.
value1 (float)
The second vector element.
value2 (float)
The third vector element.
*Example*
.. note::
No example code available for this function.
* Constant\ (values)
Create vector-valued constant
*Arguments*
values (numpy.array(float))
Values to create a vector-valued constant from.
* Constant\ (value_shape, values)
Create tensor-valued constant for flattened array of values
*Arguments*
value_shape (numpy.array(int))
Shape of tensor.
values (numpy.array(float))
Values to create tensor-valued constant from.
* Constant\ (constant)
Copy constructor
*Arguments*
constant (:py:class:`Constant`)
Object to be copied.
"""
_function.Constant_swiginit(self,_function.new_Constant(*args))
__swig_destroy__ = _function.delete_Constant
def assign(self, *args):
"""
**Overloaded versions**
* operator=\ (constant)
Assignment operator
*Arguments*
constant (:py:class:`Constant`)
Another constant.
* operator=\ (constant)
Assignment operator
*Arguments*
constant (float)
Another constant.
"""
return _function.Constant_assign(self, *args)
def __float__(self, *args):
"""
Cast to double (for scalar constants)
*Returns*
float
The scalar value.
"""
return _function.Constant___float__(self, *args)
Constant.assign = new_instancemethod(_function.Constant_assign,None,Constant)
Constant.__float__ = new_instancemethod(_function.Constant___float__,None,Constant)
Constant_swigregister = _function.Constant_swigregister
Constant_swigregister(Constant)
class MeshCoordinates(Expression):
"""
This Function represents the mesh coordinates on a given mesh.
"""
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
"""
_function.MeshCoordinates_swiginit(self,_function.new_MeshCoordinates(*args))
__swig_destroy__ = _function.delete_MeshCoordinates
MeshCoordinates_swigregister = _function.MeshCoordinates_swigregister
MeshCoordinates_swigregister(MeshCoordinates)
class FacetArea(Expression):
"""
This function represents the area/length of a cell facet on a given mesh.
"""
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
"""
_function.FacetArea_swiginit(self,_function.new_FacetArea(*args))
__swig_destroy__ = _function.delete_FacetArea
FacetArea_swigregister = _function.FacetArea_swigregister
FacetArea_swigregister(FacetArea)
class SpecialFacetFunction(Expression):
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**
* SpecialFacetFunction\ (f_e)
Create (scalar-valued) SpecialFacetFunction
*Arguments*
f_e (list of :py:class:`Function`)
Separate _Function_s for each facet
* SpecialFacetFunction\ (f_e, dim)
Create (vector-valued) SpecialFacetFunction
*Arguments*
f_e (list of :py:class:`Function`)
Separate _Function_s for each facet
dim (int)
The value-dimension of the Functions
"""
_function.SpecialFacetFunction_swiginit(self,_function.new_SpecialFacetFunction(*args))
def _sub(self, *args):
"""
Extract sub-function i
*Arguments*
i (int)
component
*Returns*
:py:class:`Function`
"""
return _function.SpecialFacetFunction__sub(self, *args)
__swig_destroy__ = _function.delete_SpecialFacetFunction
SpecialFacetFunction._sub = new_instancemethod(_function.SpecialFacetFunction__sub,None,SpecialFacetFunction)
SpecialFacetFunction_swigregister = _function.SpecialFacetFunction_swigregister
SpecialFacetFunction_swigregister(SpecialFacetFunction)
class CCFEMFunctionSpace(object):
"""
This class represents 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):
"""
Create empty CCFEM function space
"""
_function.CCFEMFunctionSpace_swiginit(self,_function.new_CCFEMFunctionSpace(*args))
__swig_destroy__ = _function.delete_CCFEMFunctionSpace
def dim(self, *args):
"""
Return dimension of the CCFEM function space
*Returns*
int
The dimension of the CCFEM function space.
"""
return _function.CCFEMFunctionSpace_dim(self, *args)
def dofmap(self, *args):
"""
Return CCFEM dofmap
*Returns*
:py:class:`CCFEMDofMap`
The dofmap.
"""
return _function.CCFEMFunctionSpace_dofmap(self, *args)
def num_parts(self, *args):
"""
Return the number function spaces (parts) of the CCFEM function space
*Returns*
int
The number of function spaces (parts) of the CCFEM function space.
"""
return _function.CCFEMFunctionSpace_num_parts(self, *args)
def part(self, *args):
"""
Return function space (part) number i
*Returns*
:py:class:`FunctionSpace`
Function space (part) number i
"""
return _function.CCFEMFunctionSpace_part(self, *args)
def add(self, *args):
"""
**Overloaded versions**
* add\ (function_space)
Add function space (shared pointer version)
*Arguments*
function_space (:py:class:`FunctionSpace`)
The function space.
* add\ (function_space)
Add function space (reference version)
*Arguments*
function_space (:py:class:`FunctionSpace`)
The function space.
"""
return _function.CCFEMFunctionSpace_add(self, *args)
def build(self, *args):
"""
Build CCFEM function space
"""
return _function.CCFEMFunctionSpace_build(self, *args)
def clear(self, *args):
"""
Clear CCFEM function space
"""
return _function.CCFEMFunctionSpace_clear(self, *args)
CCFEMFunctionSpace.dim = new_instancemethod(_function.CCFEMFunctionSpace_dim,None,CCFEMFunctionSpace)
CCFEMFunctionSpace.dofmap = new_instancemethod(_function.CCFEMFunctionSpace_dofmap,None,CCFEMFunctionSpace)
CCFEMFunctionSpace.num_parts = new_instancemethod(_function.CCFEMFunctionSpace_num_parts,None,CCFEMFunctionSpace)
CCFEMFunctionSpace.part = new_instancemethod(_function.CCFEMFunctionSpace_part,None,CCFEMFunctionSpace)
CCFEMFunctionSpace.add = new_instancemethod(_function.CCFEMFunctionSpace_add,None,CCFEMFunctionSpace)
CCFEMFunctionSpace.build = new_instancemethod(_function.CCFEMFunctionSpace_build,None,CCFEMFunctionSpace)
CCFEMFunctionSpace.clear = new_instancemethod(_function.CCFEMFunctionSpace_clear,None,CCFEMFunctionSpace)
CCFEMFunctionSpace_swigregister = _function.CCFEMFunctionSpace_swigregister
CCFEMFunctionSpace_swigregister(CCFEMFunctionSpace)
class FunctionAssigner(object):
"""
This class facilitate assignments between Function and sub
Functions. It builds and caches maps between compatible
dofs. These maps are used in the assignment methods which
perform the actual assignment. Optionally can a MeshFunction be
passed together with a label, facilitating FunctionAssignment
over sub 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):
"""
**Overloaded versions**
* FunctionAssigner\ (receiving_space, assigning_space)
Create a FunctionAssigner between functions residing in the
same type of FunctionSpace. One or both functions can be sub
functions.
*Arguments*
receiving_space (:py:class:`FunctionSpace`)
The function space of the receiving function
assigning_space (:py:class:`FunctionSpace`)
The function space of the assigning function
* FunctionAssigner\ (receiving_spaces, assigning_space)
Create a FunctionAssigner between one mixed function
(assigning) and several functions (receiving). The number of
receiving functions must sum up to the number of sub functions
in the assigning mixed function. The sub spaces of the
assigning mixed space must be of the same type ans size as the
receiving spaces.
*Arguments*
receiving_spaces (list of :py:class:`FunctionSpace`)
The recieving function spaces
assigning_space (:py:class:`FunctionSpace`)
The assigning function space
* FunctionAssigner\ (receiving_space, assigning_spaces)
Create a FunctionAssigner between several functions
(assigning) and one mixed function (receiving). The number of
sub functions in the assigning mixed function must sum up to
the number of receiving functions. The sub spaces of the
receiving mixed space must be of the same type ans size as the
assigning spaces.
*Arguments*
receiving_space (:py:class:`FunctionSpace`)
The recieving function space
assigning_spaces (std::vector<boost::shared_ptr<:py:class:`FunctionSpace`> >)
The assigning function spaces
"""
_function.FunctionAssigner_swiginit(self,_function.new_FunctionAssigner(*args))
def assign(self, *args):
"""
**Overloaded versions**
* assign\ (receiving_func, assigning_func)
Assign one function to another
*Arguments*
receiving_func (:py:class:`Function`)
The recieving function
assigning_func (:py:class:`Function`)
The assigning function
* assign\ (receiving_func, assigning_funcs)
Assign several functions to sub functions of a mixed receiving
function
*Arguments*
receiving_func (:py:class:`Function`)
The recieving mixed function
assigning_funcs (std::vector<boost::shared_ptr<:py:class:`Function`> >)
The assigning functions
* assign\ (receiving_funcs, assigning_func)
Assign sub functions of a single mixed function to single
receiving functions
*Arguments*
receiving_funcs (std::vector<boost::shared_ptr<:py:class:`Function`> >)
The recieving functions
assigning_func (:py:class:`Function`)
The assigning mixed function
"""
return _function.FunctionAssigner_assign(self, *args)
__swig_destroy__ = _function.delete_FunctionAssigner
def num_assigning_functions(self, *args):
"""
Return the number of assiging functions
"""
return _function.FunctionAssigner_num_assigning_functions(self, *args)
def num_receiving_functions(self, *args):
"""
Return the number of receiving functions
"""
return _function.FunctionAssigner_num_receiving_functions(self, *args)
FunctionAssigner.assign = new_instancemethod(_function.FunctionAssigner_assign,None,FunctionAssigner)
FunctionAssigner.num_assigning_functions = new_instancemethod(_function.FunctionAssigner_num_assigning_functions,None,FunctionAssigner)
FunctionAssigner.num_receiving_functions = new_instancemethod(_function.FunctionAssigner_num_receiving_functions,None,FunctionAssigner)
FunctionAssigner_swigregister = _function.FunctionAssigner_swigregister
FunctionAssigner_swigregister(FunctionAssigner)
def assign(*args):
"""
**Overloaded versions**
* assign\ (receiving_func, assigning_func)
Assign one function to another. The functions must reside in the
same type of FunctionSpace. One or both functions can be sub
functions.
*Arguments*
receiving_func (:py:class:`Function`)
The recieving function
assigning_func (:py:class:`Function`)
The assigning function
* assign\ (receiving_func, assigning_funcs)
Assign several functions to sub functions of a mixed receiving
function. The number of receiving functions must sum up to the
number of sub functions in the assigning mixed function. The sub
spaces of the assigning mixed space must be of the same type ans
size as the receiving spaces.
* assign\ (receiving_funcs, assigning_func)
Assign sub functions of a single mixed function to single
receiving functions. The number of sub functions in the
assigning mixed function must sum up to the number of receiving
functions. The sub spaces of the receiving mixed space must be
of the same type ans size as the assigning spaces.
"""
return _function.assign(*args)
class CCFEMFunction(object):
"""
This class represents a function on a cut and composite finite
element function space (CCFEM) defined on one or more possibly
intersecting meshes.
"""
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**
* CCFEMFunction\ (V)
Create CCFEM function on given CCFEM function space
*Arguments*
V (:py:class:`CCFEMFunctionSpace`)
The CCFEM function space.
*Example*
.. note::
No example code available for this function.
* CCFEMFunction\ (V)
Create CCFEM function on given CCFEM function space (shared
pointer version)
*Arguments*
V (:py:class:`CCFEMFunctionSpace`)
The CCFEM function space.
"""
_function.CCFEMFunction_swiginit(self,_function.new_CCFEMFunction(*args))
__swig_destroy__ = _function.delete_CCFEMFunction
def part(self, *args):
"""
Return function (part) number i
*Returns*
:py:class:`Function`
Function (part) number i
"""
return _function.CCFEMFunction_part(self, *args)
def vector(self, *args):
"""
**Overloaded versions**
* vector\ ()
Return vector of expansion coefficients (non-const version)
*Returns*
:py:class:`GenericVector`
The vector of expansion coefficients.
* vector\ ()
Return vector of expansion coefficients (const version)
*Returns*
:py:class:`GenericVector`
The vector of expansion coefficients (const).
"""
return _function.CCFEMFunction_vector(self, *args)
CCFEMFunction.part = new_instancemethod(_function.CCFEMFunction_part,None,CCFEMFunction)
CCFEMFunction.vector = new_instancemethod(_function.CCFEMFunction_vector,None,CCFEMFunction)
CCFEMFunction_swigregister = _function.CCFEMFunction_swigregister
CCFEMFunction_swigregister(CCFEMFunction)
def ipow(*args):
"""
Return a to the power n
"""
return _function.ipow(*args)
def rand(*args):
"""
Return a random number, uniformly distributed between [0.0, 1.0)
"""
return _function.rand(*args)
def seed(*args):
"""
Seed random number generator
"""
return _function.seed(*args)
def near(*args):
"""
Check whether x is close to x0 (to within DOLFIN_EPS)
"""
return _function.near(*args)
def between(*args):
"""
Check whether x is between x0 and x1 (inclusive, to within DOLFIN_EPS)
"""
return _function.between(*args)
class Lagrange(common.Variable):
"""
Lagrange polynomial (basis) with given degree q determined by
n = q + 1 nodal points.
Example: q = 1 (n = 2)
Lagrange p(1);
p.set(0, 0.0);
p.set(1, 1.0);
It is the callers reponsibility that the points are distinct.
This creates a Lagrange polynomial (actually two Lagrange
polynomials):
p(0,x) = 1 - x (one at x = 0, zero at x = 1)
p(1,x) = x (zero at x = 0, one at x = 1)
"""
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**
* Lagrange\ (q)
Constructor
* Lagrange\ (p)
Copy constructor
"""
_function.Lagrange_swiginit(self,_function.new_Lagrange(*args))
def set(self, *args):
"""
Specify point
"""
return _function.Lagrange_set(self, *args)
def size(self, *args):
"""
Return number of points
"""
return _function.Lagrange_size(self, *args)
def degree(self, *args):
"""
Return degree
"""
return _function.Lagrange_degree(self, *args)
def point(self, *args):
"""
Return point
"""
return _function.Lagrange_point(self, *args)
def eval(self, *args):
"""
Return value of polynomial i at given point x
"""
return _function.Lagrange_eval(self, *args)
def ddx(self, *args):
"""
Return derivate of polynomial i at given point x
"""
return _function.Lagrange_ddx(self, *args)
def dqdx(self, *args):
"""
Return derivative q (a constant) of polynomial
"""
return _function.Lagrange_dqdx(self, *args)
__swig_destroy__ = _function.delete_Lagrange
Lagrange.set = new_instancemethod(_function.Lagrange_set,None,Lagrange)
Lagrange.size = new_instancemethod(_function.Lagrange_size,None,Lagrange)
Lagrange.degree = new_instancemethod(_function.Lagrange_degree,None,Lagrange)
Lagrange.point = new_instancemethod(_function.Lagrange_point,None,Lagrange)
Lagrange.__call__ = new_instancemethod(_function.Lagrange___call__,None,Lagrange)
Lagrange.eval = new_instancemethod(_function.Lagrange_eval,None,Lagrange)
Lagrange.ddx = new_instancemethod(_function.Lagrange_ddx,None,Lagrange)
Lagrange.dqdx = new_instancemethod(_function.Lagrange_dqdx,None,Lagrange)
Lagrange_swigregister = _function.Lagrange_swigregister
Lagrange_swigregister(Lagrange)
class Legendre(object):
"""
Interface for computing Legendre polynomials via Boost.
"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def eval(*args):
"""
Evaluate polynomial of order n at point x
"""
return _function.Legendre_eval(*args)
eval = staticmethod(eval)
def ddx(*args):
"""
Evaluate first derivative of polynomial of order n at point x
"""
return _function.Legendre_ddx(*args)
ddx = staticmethod(ddx)
def d2dx(*args):
"""
Evaluate second derivative of polynomial of order n at point x
"""
return _function.Legendre_d2dx(*args)
d2dx = staticmethod(d2dx)
def __init__(self, *args):
_function.Legendre_swiginit(self,_function.new_Legendre(*args))
__swig_destroy__ = _function.delete_Legendre
Legendre_swigregister = _function.Legendre_swigregister
Legendre_swigregister(Legendre)
def Legendre_eval(*args):
"""
Evaluate polynomial of order n at point x
"""
return _function.Legendre_eval(*args)
def Legendre_ddx(*args):
"""
Evaluate first derivative of polynomial of order n at point x
"""
return _function.Legendre_ddx(*args)
def Legendre_d2dx(*args):
"""
Evaluate second derivative of polynomial of order n at point x
"""
return _function.Legendre_d2dx(*args)
|