/usr/share/pyshared/PyTrilinos/ML.py is in python-pytrilinos 10.4.0.dfsg-1ubuntu2.
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 | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.4
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
"""
PyTrilinos.ML is the python interface to the Trilinos multi-level
preconditioner package ML/MLAPI:
http://trilinos.sandia.gov/packages/ml
The purpose of ML is to provide multilevel preconditioners to
Trilinos.
ML provides the following user-level classes:
* BaseObject - Base class for MLAPI objects
* CompObject - FLOP counting base class
* TimeObject - Timing base class
* MultiLevelPreconditioner - Black-box multilevel preconditioner
* EpetraBaseOperator - Base class for interface to Epetra
* BaseOperator - Base class for all MLAPI operators
* Space - Defines number of elements and their distribution
* MultiVector - MLAPI multivector class
* Operator - MLAPI operator class
* InverseOperator - MLAPI inverse operator class
* PyMatrix - Python interface to MLAPI operators
For examples of usage, please consult the following scripts in the
example subdirectory of the PyTrilinos package:
* exMLAPI.py
* exMLAPI_Simple.py
* exMLAPI_AztecOO.py
* exMLAPI_Iterate.py
* exMLAPI_PyMatrix.py
* exMLAPI_Smoother.py
"""
from sys import version_info
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('_ML', [dirname(__file__)])
except ImportError:
import _ML
return _ML
if fp is not None:
try:
_mod = imp.load_module('_ML', fp, pathname, description)
finally:
fp.close()
return _mod
_ML = swig_import_helper()
del swig_import_helper
else:
import _ML
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
try:
import weakref
weakref_proxy = weakref.proxy
except:
weakref_proxy = lambda x: x
import Teuchos
import Epetra
HAVE_INTTYPES_H = _ML.HAVE_INTTYPES_H
HAVE_STDINT_H = _ML.HAVE_STDINT_H
def GetML_Comm(*args):
"""
GetML_Comm() -> ML_Comm
ML_Comm*
MLAPI::GetML_Comm()
Returns a pointer to the ML_Comm object defined on MPI_COMM_WORLD.
"""
return _ML.GetML_Comm(*args)
def GetEpetra_Comm(*args):
"""
GetEpetra_Comm() -> Comm
Epetra_Comm&
MLAPI::GetEpetra_Comm()
Returns a reference to the Epetra_Comm object defined on
MPI_COMM_WORLD.
"""
return _ML.GetEpetra_Comm(*args)
def Barrier(*args):
"""
Barrier()
void MLAPI::Barrier()
Calls Mpi_Barrier() if MPI is enabled.
"""
return _ML.Barrier(*args)
def GetMyPID(*args):
"""
GetMyPID() -> int
int MLAPI::GetMyPID()
Returns the ID of the calling process.
"""
return _ML.GetMyPID(*args)
def GetNumProcs(*args):
"""
GetNumProcs() -> int
int MLAPI::GetNumProcs()
Returns the total number of processes in the computation.
"""
return _ML.GetNumProcs(*args)
def GetPrintLevel(*args):
"""
GetPrintLevel() -> int
int
MLAPI::GetPrintLevel()
Retutns the level of output (always 0 if MyPID() != 0).
"""
return _ML.GetPrintLevel(*args)
def SetPrintLevel(*args):
"""
SetPrintLevel(int Level)
void
MLAPI::SetPrintLevel(int Level)
Sets the level of output (from 0 to 10, 0 being verbose).
"""
return _ML.SetPrintLevel(*args)
def Init(*args):
"""
Init()
void MLAPI::Init()
Initialize the MLAPI workspace.
"""
return _ML.Init(*args)
def Finalize(*args):
"""
Finalize()
void MLAPI::Finalize()
Destroys the MLAPI workspace.
"""
return _ML.Finalize(*args)
def GetMatrixType(*args):
"""
GetMatrixType() -> int
int
MLAPI::GetMatrixType()
"""
return _ML.GetMatrixType(*args)
class BaseObject(_object):
"""
Basic class for MLAPI objects.
BaseObject is the basic class for all MLAPI objects. Currently, it
contains the label of the object and method Print().
Marzio Sala, SNL 9214
C++ includes: MLAPI_BaseObject.h
"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, BaseObject, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, BaseObject, name)
def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract")
__repr__ = _swig_repr
__swig_destroy__ = _ML.delete_BaseObject
__del__ = lambda self : None;
def SetLabel(self, *args):
"""
SetLabel(self, string Label)
void
MLAPI::BaseObject::SetLabel(const string &Label)
Sets the Label of this object to Label.
"""
return _ML.BaseObject_SetLabel(self, *args)
def GetLabel(self, *args):
"""
GetLabel(self) -> string
const string&
MLAPI::BaseObject::GetLabel() const
Returns the Label of this object.
"""
return _ML.BaseObject_GetLabel(self, *args)
def Print(self, *args):
"""
Print(self, file=None)
Print a description of the object to the given file object. If no
file object is provided, output is to stdout.
"""
return _ML.BaseObject_Print(self, *args)
def __str__(self, *args):
"""
__str__(self) -> str
Return the description of the object as a string.
"""
return _ML.BaseObject___str__(self, *args)
BaseObject_swigregister = _ML.BaseObject_swigregister
BaseObject_swigregister(BaseObject)
def GetString(*args):
"""
GetString(int x) -> string
GetString(double x) -> string
string
MLAPI::GetString(const double &x)
"""
return _ML.GetString(*args)
def __lshift__(*args):
"""__lshift__( os, BaseObject obj)"""
return _ML.__lshift__(*args)
class Space(BaseObject):
"""
Specifies the number and distribution among processes of elements.
Marzio Sala, SNL 9214
C++ includes: MLAPI_Space.h
"""
__swig_setmethods__ = {}
for _s in [BaseObject]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
__setattr__ = lambda self, name, value: _swig_setattr(self, Space, name, value)
__swig_getmethods__ = {}
for _s in [BaseObject]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))
__getattr__ = lambda self, name: _swig_getattr(self, Space, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(self) -> Space
__init__(self, int NumGlobalElements, int NumMyElements = -1) -> Space
__init__(self, Map Map) -> Space
__init__(self, int numGlobalElements, sequence myGlobalElements) -> Space
__init__(self, Space RHS) -> Space
MLAPI::Space::Space(const
Space &RHS)
Copy constructor.
"""
this = _ML.new_Space(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _ML.delete_Space
__del__ = lambda self : None;
def Reshape(self, *args):
"""
Reshape(self)
Reshape(self, int NumGlobalElements, int NumMyElements = -1)
Reshape(self, int NumGlobalElements, int NumMyElements)
void
MLAPI::Space::Reshape(const int NumGlobalElements, const int
NumMyElements, const int *MyGlobalElements)
Reset the dimension of the space by specifying the local number of
elements and their global numbering (starting from 0).
"""
return _ML.Space_Reshape(self, *args)
def __eq__(self, *args):
"""__eq__(self, Space RHS) -> bool"""
return _ML.Space___eq__(self, *args)
def __ne__(self, *args):
"""__ne__(self, Space RHS) -> bool"""
return _ML.Space___ne__(self, *args)
def __call__(self, *args):
"""__call__(self, int i) -> int"""
return _ML.Space___call__(self, *args)
def GetNumMyElements(self, *args):
"""
GetNumMyElements(self) -> int
int
MLAPI::Space::GetNumMyElements() const
Returns the local number of elements on the calling process.
"""
return _ML.Space_GetNumMyElements(self, *args)
def GetNumGlobalElements(self, *args):
"""
GetNumGlobalElements(self) -> int
int
MLAPI::Space::GetNumGlobalElements() const
Returns the global number of elements.
"""
return _ML.Space_GetNumGlobalElements(self, *args)
def GetOffset(self, *args):
"""
GetOffset(self) -> int
int
MLAPI::Space::GetOffset() const
Returns the global ID of the first element on the calling process (for
linear distributions only).
"""
return _ML.Space_GetOffset(self, *args)
def IsLinear(self, *args):
"""
IsLinear(self) -> bool
bool
MLAPI::Space::IsLinear() const
Returns true if the decomposition among processors is linear.
"""
return _ML.Space_IsLinear(self, *args)
def GetMyGlobalElements(self, *args):
"""
GetMyGlobalElements(self) -> Epetra.SerialDenseVector
Return an Epetra.SerialDenseVector of global indexes representing the
elements on this processor. If the Space is distributed linearly,
this method returns None.
"""
return _ML.Space_GetMyGlobalElements(self, *args)
Space_swigregister = _ML.Space_swigregister
Space_swigregister(Space)
def Space_GetMyGlobalElements(*args):
"""
GetMyGlobalElements(self) -> Epetra.SerialDenseVector
Return an Epetra.SerialDenseVector of global indexes representing the
elements on this processor.
"""
result = _ML.Space_GetMyGlobalElements(*args)
if result is None:
offset = args[0].GetOffset()
data = range(offset, offset+args[0].GetNumMyElements())
result = Epetra.IntSerialDenseVector(data)
return result
Space.GetMyGlobalElements = Space_GetMyGlobalElements
class CompObject(_object):
"""
Class to count flops.
Marzio Sala, SNL 9214
C++ includes: MLAPI_CompObject.h
"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, CompObject, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, CompObject, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(self) -> CompObject
MLAPI::CompObject::CompObject()
Constructor, set counter to 0.0.
"""
this = _ML.new_CompObject(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _ML.delete_CompObject
__del__ = lambda self : None;
def GetFlops(self, *args):
"""
GetFlops(self) -> double
double
MLAPI::CompObject::GetFlops() const
Returns the internal counter of flops.
"""
return _ML.CompObject_GetFlops(self, *args)
def SetFlops(self, *args):
"""
SetFlops(self, double Flops)
void
MLAPI::CompObject::SetFlops(double Flops) const
Sets internal counter to Flops.
"""
return _ML.CompObject_SetFlops(self, *args)
def UpdateFlops(self, *args):
"""
UpdateFlops(self, double Flops)
void
MLAPI::CompObject::UpdateFlops(double Flops) const
Updates internal counter by summing Flops.
"""
return _ML.CompObject_UpdateFlops(self, *args)
CompObject_swigregister = _ML.CompObject_swigregister
CompObject_swigregister(CompObject)
class TimeObject(_object):
"""
Class to track time spent in an object.
Marzio Sala, SNL 9214
C++ includes: MLAPI_TimeObject.h
"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, TimeObject, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, TimeObject, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(self) -> TimeObject
MLAPI::TimeObject::TimeObject()
Constructor, set counter to 0.0.
"""
this = _ML.new_TimeObject(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _ML.delete_TimeObject
__del__ = lambda self : None;
def ResetTimer(self, *args):
"""
ResetTimer(self)
void
MLAPI::TimeObject::ResetTimer() const
Resets the internal timer.
"""
return _ML.TimeObject_ResetTimer(self, *args)
def UpdateTime(self, *args):
"""
UpdateTime(self)
UpdateTime(self, double t)
void
MLAPI::TimeObject::UpdateTime(double t) const
Updates the internal timer with input value t.
"""
return _ML.TimeObject_UpdateTime(self, *args)
def GetTime(self, *args):
"""
GetTime(self) -> double
double
MLAPI::TimeObject::GetTime() const
Returns the internally stored counter.
"""
return _ML.TimeObject_GetTime(self, *args)
TimeObject_swigregister = _ML.TimeObject_swigregister
TimeObject_swigregister(TimeObject)
class BaseOperator(BaseObject):
"""
Base class for all MLAPI objects.
Marzio Sala, SNL 9214.
C++ includes: MLAPI_BaseOperator.h
"""
__swig_setmethods__ = {}
for _s in [BaseObject]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
__setattr__ = lambda self, name, value: _swig_setattr(self, BaseOperator, name, value)
__swig_getmethods__ = {}
for _s in [BaseObject]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))
__getattr__ = lambda self, name: _swig_getattr(self, BaseOperator, name)
__repr__ = _swig_repr
__swig_destroy__ = _ML.delete_BaseOperator
__del__ = lambda self : None;
def Apply(self, *args):
"""
Apply(self, MultiVector LHS, MultiVector RHS) -> int
virtual int
MLAPI::BaseOperator::Apply(const MultiVector &LHS, MultiVector &RHS)
const =0
Applies the operator to X, using Y as starting solution. Returns the
solution in Y.
"""
return _ML.BaseOperator_Apply(self, *args)
def GetOperatorDomainSpace(self, *args):
"""
GetOperatorDomainSpace(self) -> Space
virtual const Space MLAPI::BaseOperator::GetOperatorDomainSpace()
const =0
Returns a copy of the domain space of this object.
"""
return _ML.BaseOperator_GetOperatorDomainSpace(self, *args)
def GetOperatorRangeSpace(self, *args):
"""
GetOperatorRangeSpace(self) -> Space
virtual const Space MLAPI::BaseOperator::GetOperatorRangeSpace() const
=0
Returns a copy of the range space of this object.
"""
return _ML.BaseOperator_GetOperatorRangeSpace(self, *args)
def __init__(self, *args):
"""__init__(self) -> BaseOperator"""
if self.__class__ == BaseOperator:
_self = None
else:
_self = self
this = _ML.new_BaseOperator(_self, *args)
try: self.this.append(this)
except: self.this = this
def __disown__(self):
self.this.disown()
_ML.disown_BaseOperator(self)
return weakref_proxy(self)
BaseOperator_swigregister = _ML.BaseOperator_swigregister
BaseOperator_swigregister(BaseOperator)
class DoubleVector(_object):
"""Proxy of C++ MLAPI::DoubleVector class"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, DoubleVector, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, DoubleVector, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(self, int size) -> DoubleVector
__init__(self, double ptr) -> DoubleVector
MLAPI::DoubleVector::DoubleVector(double *ptr)
"""
this = _ML.new_DoubleVector(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _ML.delete_DoubleVector
__del__ = lambda self : None;
def Values(self, *args):
"""
Values(self) -> double
Values(self) -> double
const double*
MLAPI::DoubleVector::Values() const
"""
return _ML.DoubleVector_Values(self, *args)
DoubleVector_swigregister = _ML.DoubleVector_swigregister
DoubleVector_swigregister(DoubleVector)
class MultiVector(BaseObject,CompObject,TimeObject):
"""
Basic class for distributed double-precision vectors.
Marzio Sala, SNL 9214.
C++ includes: MLAPI_MultiVector.h
"""
__swig_setmethods__ = {}
for _s in [BaseObject,CompObject,TimeObject]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
__setattr__ = lambda self, name, value: _swig_setattr(self, MultiVector, name, value)
__swig_getmethods__ = {}
for _s in [BaseObject,CompObject,TimeObject]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))
__getattr__ = lambda self, name: _swig_getattr(self, MultiVector, name)
__repr__ = _swig_repr
__swig_destroy__ = _ML.delete_MultiVector
__del__ = lambda self : None;
def Reshape(self, *args):
"""
Reshape(self)
Reshape(self, Space S, int NumVectors = 1, bool SetToZero = True)
void
MLAPI::MultiVector::Reshape(const Space &S, const int NumVectors=1,
const bool SetToZero=true)
Sets the space of this vector.
"""
return _ML.MultiVector_Reshape(self, *args)
def Append(self, *args):
"""
Append(self, int NumVectors = 1, bool SetToZero = True)
Append(self, MultiVector rhs)
void
MLAPI::MultiVector::Append(MultiVector rhs)
Appends a new vector.
"""
return _ML.MultiVector_Append(self, *args)
def Delete(self, *args):
"""
Delete(self, int v)
Deletes the v-th vector within the MultiVector.
void
MLAPI::MultiVector::Delete(const int v)
Deletes the last vector.
"""
return _ML.MultiVector_Delete(self, *args)
def GetVectorSpace(self, *args):
"""
GetVectorSpace(self) -> Space
GetVectorSpace(self) -> Space
Space&
MLAPI::MultiVector::GetVectorSpace()
Returns the Space on which this vector is defined (non-const).
"""
return _ML.MultiVector_GetVectorSpace(self, *args)
def GetNumVectors(self, *args):
"""
GetNumVectors(self) -> int
int
MLAPI::MultiVector::GetNumVectors() const
Returns the number of vectors.
"""
return _ML.MultiVector_GetNumVectors(self, *args)
def GetMyLength(self, *args):
"""
GetMyLength(self) -> int
int
MLAPI::MultiVector::GetMyLength() const
Returns the local length of each vector.
"""
return _ML.MultiVector_GetMyLength(self, *args)
def GetGlobalLength(self, *args):
"""
GetGlobalLength(self) -> int
int
MLAPI::MultiVector::GetGlobalLength() const
Returns the global length of each vector.
"""
return _ML.MultiVector_GetGlobalLength(self, *args)
def GetValues(self, *args):
"""
GetValues(self, int v) -> numpy.ndarray
Returns a 1D numpy array representing the v-th vector in the
MultiVector.
const double*
MLAPI::MultiVector::GetValues(const int v) const
Returns a pointer to the double array (const version).
"""
return _ML.MultiVector_GetValues(self, *args)
def Update(self, *args):
"""
Update(self, double alpha, int v = -1)
Update(self, MultiVector rhs)
Update(self, double alpha, MultiVector rhs)
Update(self, double alpha, MultiVector x, double beta, MultiVector y)
Update(self, double alpha, MultiVector rhs, double beta)
void
MLAPI::MultiVector::Update(double alpha, const MultiVector &rhs,
double beta)
Sets this = alpha * rhs + beta * this.
"""
return _ML.MultiVector_Update(self, *args)
def DotProduct(self, *args):
"""
DotProduct(self, MultiVector rhs, int v = -1) -> double
double
MLAPI::MultiVector::DotProduct(const MultiVector &rhs, int v=-1) const
Computes the dot product between this vector and rhs.
"""
return _ML.MultiVector_DotProduct(self, *args)
def Norm2(self, *args):
"""
Norm2(self, int v = -1) -> double
double
MLAPI::MultiVector::Norm2(int v=-1) const
Computes the 2-norm of this vector.
"""
return _ML.MultiVector_Norm2(self, *args)
def NormInf(self, *args):
"""
NormInf(self, int v = -1) -> double
double
MLAPI::MultiVector::NormInf(int v=-1) const
Computes the infinite norm of this vector.
"""
return _ML.MultiVector_NormInf(self, *args)
def NormOne(self, *args):
"""
NormOne(self, int v = -1) -> double
double
MLAPI::MultiVector::NormOne(int v=-1) const
Computes the one norm of this vector.
"""
return _ML.MultiVector_NormOne(self, *args)
def Reciprocal(self, *args):
"""
Reciprocal(self, int v = -1)
void
MLAPI::MultiVector::Reciprocal(int v=-1)
Replaces each element of the vector with its reciprocal.
"""
return _ML.MultiVector_Reciprocal(self, *args)
def Scale(self, *args):
"""
Scale(self, double Factor, int v = -1)
void
MLAPI::MultiVector::Scale(const double Factor, int v=-1)
Scales each element by the specified factor.
"""
return _ML.MultiVector_Scale(self, *args)
def Random(self, *args):
"""
Random(self, int v = -1)
void
MLAPI::MultiVector::Random(int v=-1)
Populates the vector with random elements.
"""
return _ML.MultiVector_Random(self, *args)
def Sort(self, *args):
"""
Sort(self, int v = -1, bool IsIncreasing = False)
void
MLAPI::MultiVector::Sort(int v=-1, const bool IsIncreasing=false)
Sorts the component of the vector.
"""
return _ML.MultiVector_Sort(self, *args)
def IsAlias(self, *args):
"""
IsAlias(self, MultiVector rhs) -> bool
bool
MLAPI::MultiVector::IsAlias(const MultiVector &rhs) const
"""
return _ML.MultiVector_IsAlias(self, *args)
def __init__(self, *args):
"""
__init__(self) -> MultiVector
__init__(self, Space VectorSpace, int NumVectors = 1, bool SetToZero = True) -> MultiVector
__init__(self, MultiVector rhs) -> MultiVector
__init__(self, Space vectorSpace, PyObject pyValues) -> MultiVector
MLAPI::MultiVector::MultiVector(const MultiVector &rhs)
Copy constructor.
"""
this = _ML.new_MultiVector(*args)
try: self.this.append(this)
except: self.this = this
def __add__(self, *args):
"""
__add__(self, MultiVector rhs) -> MultiVector
Element-wise addition operator.
"""
return _ML.MultiVector___add__(self, *args)
def __sub__(self, *args):
"""
__sub__(self, MultiVector rhs) -> MultiVector
Element-wise subtraction operator.
"""
return _ML.MultiVector___sub__(self, *args)
def __mul__(self, *args):
"""
__mul__(self, MultiVector rhs) -> float
Dot-product multiplication operator.
__mul__(self, double rhs) -> MultiVector
__mul__(self, int rhs) -> MultiVector
Scalar multiplication operators.
"""
return _ML.MultiVector___mul__(self, *args)
def __rmul__(self, *args):
"""
__rmul__(self, double lhs) -> MultiVector
__rmul__(self, int lhs) -> MultiVector
Scalar 'reverse' multiplication operators.
"""
return _ML.MultiVector___rmul__(self, *args)
def __setitem__(self, *args):
"""
__setitem__(self, PyObject index, int v, PyObject value)
Argument index can be an integer or slice index into a vector.
Argument v must be an integer specifying the desired vector within the
MultiVector. The value argument must have a shape that matches the
shape of the index.
"""
return _ML.MultiVector___setitem__(self, *args)
def __getitem__(self, *args):
"""
__getitem__(self, PyObject index, int v) -> PyObject
Argument index can be an integer or slice index into a vector.
Argument v must be an integer specifying the desired vector within the
MultiVector. The returned PyObject will be either a scalar or an
array with the same shape as the index.
"""
return _ML.MultiVector___getitem__(self, *args)
def __call__(self, *args):
"""
__call__(self, int i, int v=0) -> float
Returns the i-th element of the v-th vector.
"""
return _ML.MultiVector___call__(self, *args)
MultiVector_swigregister = _ML.MultiVector_swigregister
MultiVector_swigregister(MultiVector)
def Extract(*args):
"""
Extract(MultiVector y, int v) -> MultiVector
MultiVector
MLAPI::Extract(const MultiVector &y, const int v)
Extracts a component from a vector.
"""
return _ML.Extract(*args)
def Redistribute(*args):
"""
Redistribute(MultiVector y, int NumEquations) -> MultiVector
MultiVector
MLAPI::Redistribute(const MultiVector &y, const int NumEquations)
Redistributes the entry of a vector as a multivector.
"""
return _ML.Redistribute(*args)
class Operator(BaseOperator,CompObject,TimeObject):
"""
Operator: basic class to define operators within MLAPI.
Marzio Sala, SNL 9214
C++ includes: MLAPI_Operator.h
"""
__swig_setmethods__ = {}
for _s in [BaseOperator,CompObject,TimeObject]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
__setattr__ = lambda self, name, value: _swig_setattr(self, Operator, name, value)
__swig_getmethods__ = {}
for _s in [BaseOperator,CompObject,TimeObject]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))
__getattr__ = lambda self, name: _swig_getattr(self, Operator, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(self) -> Operator
__init__(self, Space DomainSpace, Space RangeSpace, ML_Operator Op,
bool Ownership = True, Teuchos::RefCountPtr<(ML_Operator_Box)> AuxOp = Teuchos::null) -> Operator
__init__(self, Space DomainSpace, Space RangeSpace, RowMatrix Matrix,
bool Ownership = True, Teuchos::RefCountPtr<(ML_Operator_Box)> AuxOp = Teuchos::null) -> Operator
__init__(self, Operator RHS) -> Operator
MLAPI::Operator::Operator(const Operator &RHS)
Copy constructor.
"""
this = _ML.new_Operator(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _ML.delete_Operator
__del__ = lambda self : None;
def Reshape(self, *args):
"""
Reshape(self)
Reshape(self, Space DomainSpace, Space RangeSpace, ML_Operator Op,
bool Ownership = True, Teuchos::RefCountPtr<(ML_Operator_Box)> AuxOp = Teuchos::null)
Reshape(self, Space DomainSpace, Space RangeSpace, RowMatrix Matrix,
bool Ownership = True, Teuchos::RefCountPtr<(ML_Operator_Box)> AuxOp = Teuchos::null)
void
MLAPI::Operator::Reshape(const Space &DomainSpace, const Space
&RangeSpace, Epetra_RowMatrix *Matrix, bool Ownership=true,
Teuchos::RefCountPtr< ML_Operator_Box > AuxOp=Teuchos::null)
Reshape with given already FillComplete()'d object.
"""
return _ML.Operator_Reshape(self, *args)
def GetOperatorDomainSpace(self, *args):
"""
GetOperatorDomainSpace(self) -> Space
const
Space MLAPI::Operator::GetOperatorDomainSpace() const
Returns a reference to the internally stored domain space.
"""
return _ML.Operator_GetOperatorDomainSpace(self, *args)
def GetOperatorRangeSpace(self, *args):
"""
GetOperatorRangeSpace(self) -> Space
const
Space MLAPI::Operator::GetOperatorRangeSpace() const
Returns a reference to the internally stored range space.
"""
return _ML.Operator_GetOperatorRangeSpace(self, *args)
def GetDomainSpace(self, *args):
"""
GetDomainSpace(self) -> Space
const Space
MLAPI::Operator::GetDomainSpace() const
Returns a reference to the internally stored domain space.
"""
return _ML.Operator_GetDomainSpace(self, *args)
def GetRangeSpace(self, *args):
"""
GetRangeSpace(self) -> Space
const Space
MLAPI::Operator::GetRangeSpace() const
Returns a reference to the internally stored range space.
"""
return _ML.Operator_GetRangeSpace(self, *args)
def GetColumnSpace(self, *args):
"""
GetColumnSpace(self) -> Space
const Space
MLAPI::Operator::GetColumnSpace() const
Returns a reference to the internally stored column space.
"""
return _ML.Operator_GetColumnSpace(self, *args)
def GetNumGlobalRows(self, *args):
"""
GetNumGlobalRows(self) -> int
int
MLAPI::Operator::GetNumGlobalRows() const
Returns the number of global rows.
"""
return _ML.Operator_GetNumGlobalRows(self, *args)
def GetNumMyRows(self, *args):
"""
GetNumMyRows(self) -> int
int
MLAPI::Operator::GetNumMyRows() const
Returns the number of local rows.
"""
return _ML.Operator_GetNumMyRows(self, *args)
def GetNumGlobalCols(self, *args):
"""
GetNumGlobalCols(self) -> int
int
MLAPI::Operator::GetNumGlobalCols() const
Returns the number of global columns.
"""
return _ML.Operator_GetNumGlobalCols(self, *args)
def GetNumMyCols(self, *args):
"""
GetNumMyCols(self) -> int
int
MLAPI::Operator::GetNumMyCols() const
Returns the number of local columns.
"""
return _ML.Operator_GetNumMyCols(self, *args)
def GetNumGlobalNonzeros(self, *args):
"""
GetNumGlobalNonzeros(self) -> int
int
MLAPI::Operator::GetNumGlobalNonzeros() const
Returns the global number of nonzeros.
"""
return _ML.Operator_GetNumGlobalNonzeros(self, *args)
def GetNumMyNonzeros(self, *args):
"""
GetNumMyNonzeros(self) -> int
int
MLAPI::Operator::GetNumMyNonzeros() const
Returns the local number of nonzeros.
"""
return _ML.Operator_GetNumMyNonzeros(self, *args)
def GetRowMatrix(self, *args):
"""
GetRowMatrix(self) -> RowMatrix
const
Epetra_RowMatrix* MLAPI::Operator::GetRowMatrix() const
Returns the RefCountPtr of OperatorBox_.
"""
return _ML.Operator_GetRowMatrix(self, *args)
def GetML_Operator(self, *args):
"""
GetML_Operator(self) -> ML_Operator
ML_Operator*
MLAPI::Operator::GetML_Operator() const
Returns the RefCountPtr of OperatorBox_.
"""
return _ML.Operator_GetML_Operator(self, *args)
def GetRCPOperatorBox(self, *args):
"""
GetRCPOperatorBox(self) -> Teuchos::RefCountPtr<(ML_Operator_Box)>
const
Teuchos::RefCountPtr<ML_Operator_Box>&
MLAPI::Operator::GetRCPOperatorBox() const
Returns the RefCountPtr of OperatorBox_.
"""
return _ML.Operator_GetRCPOperatorBox(self, *args)
def GetRCPAuxOperatorBox(self, *args):
"""
GetRCPAuxOperatorBox(self) -> Teuchos::RefCountPtr<(ML_Operator_Box)>
const
Teuchos::RefCountPtr<ML_Operator_Box>&
MLAPI::Operator::GetRCPAuxOperatorBox() const
Returns the RefCountPtr of AuxOperatorBox_.
"""
return _ML.Operator_GetRCPAuxOperatorBox(self, *args)
def GetRCPRowMatrix(self, *args):
"""
GetRCPRowMatrix(self) -> Teuchos::RefCountPtr<(Epetra_RowMatrix)>
const
Teuchos::RefCountPtr<Epetra_RowMatrix>&
MLAPI::Operator::GetRCPRowMatrix() const
Returns the RefCountPtr of RowMatrix_.
"""
return _ML.Operator_GetRCPRowMatrix(self, *args)
def GetGRID(self, *args):
"""
GetGRID(self, int LRID) -> int
int
MLAPI::Operator::GetGRID(const int LRID) const
Returns the global ID of local row ID LRID.
"""
return _ML.Operator_GetGRID(self, *args)
def GetGCID(self, *args):
"""
GetGCID(self, int LCID) -> int
int
MLAPI::Operator::GetGCID(const int LCID) const
Returns the global ID of local column ID LCID.
"""
return _ML.Operator_GetGCID(self, *args)
def Apply(self, *args):
"""
Apply(self, MultiVector X, MultiVector Y) -> int
int
MLAPI::Operator::Apply(const MultiVector &X, MultiVector &Y) const
Applies this operator to LHS, returns the result in RHS.
"""
return _ML.Operator_Apply(self, *args)
def BuildColumnSpace(self, *args):
"""
BuildColumnSpace(self)
void
MLAPI::Operator::BuildColumnSpace()
Build the column space, by computing the GID of all local columns.
"""
return _ML.Operator_BuildColumnSpace(self, *args)
def __getitem__(self, *args):
"""__getitem__(self, PyObject args) -> PyObject"""
return _ML.Operator___getitem__(self, *args)
def __add__(self, *args):
"""__add__(self, Operator rhs) -> Operator"""
return _ML.Operator___add__(self, *args)
def __sub__(self, *args):
"""__sub__(self, Operator rhs) -> Operator"""
return _ML.Operator___sub__(self, *args)
def __mul__(self, *args):
"""
__mul__(self, MultiVector rhs) -> MultiVector
__mul__(self, Operator rhs) -> Operator
__mul__(self, double rhs) -> Operator
"""
return _ML.Operator___mul__(self, *args)
def __div__(self, *args):
"""__div__(self, double rhs) -> Operator"""
return _ML.Operator___div__(self, *args)
Operator_swigregister = _ML.Operator_swigregister
Operator_swigregister(Operator)
class PyMatrix(Operator):
"""Proxy of C++ PyMatrix class"""
__swig_setmethods__ = {}
for _s in [Operator]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
__setattr__ = lambda self, name, value: _swig_setattr(self, PyMatrix, name, value)
__swig_getmethods__ = {}
for _s in [Operator]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))
__getattr__ = lambda self, name: _swig_getattr(self, PyMatrix, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""__init__(self, Space RowSpace, Space ColSpace) -> PyMatrix"""
this = _ML.new_PyMatrix(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _ML.delete_PyMatrix
__del__ = lambda self : None;
def GetRowSpace(self, *args):
"""GetRowSpace(self) -> Space"""
return _ML.PyMatrix_GetRowSpace(self, *args)
def SetElement(self, *args):
"""SetElement(self, int row, int col, double value)"""
return _ML.PyMatrix_SetElement(self, *args)
def FillComplete(self, *args):
"""FillComplete(self)"""
return _ML.PyMatrix_FillComplete(self, *args)
def GetMatrix(self, *args):
"""GetMatrix(self) -> FECrsMatrix"""
return _ML.PyMatrix_GetMatrix(self, *args)
def __setitem__(self, *args):
"""__setitem__(self, PyObject args, double val) -> PyObject"""
return _ML.PyMatrix___setitem__(self, *args)
def __getitem__(self, *args):
"""__getitem__(self, PyObject args) -> PyObject"""
return _ML.PyMatrix___getitem__(self, *args)
PyMatrix_swigregister = _ML.PyMatrix_swigregister
PyMatrix_swigregister(PyMatrix)
ML_MEM_SIZE = _ML.ML_MEM_SIZE
ML_MEM_INITIAL = _ML.ML_MEM_INITIAL
ML_MEM_FINAL = _ML.ML_MEM_FINAL
ML_MEM_SMOOTHER = _ML.ML_MEM_SMOOTHER
ML_MEM_COARSE = _ML.ML_MEM_COARSE
ML_MEM_HIERARCHY = _ML.ML_MEM_HIERARCHY
ML_MEM_PREC_FIRST = _ML.ML_MEM_PREC_FIRST
ML_MEM_PREC_OTHER = _ML.ML_MEM_PREC_OTHER
ML_MEM_TOT1 = _ML.ML_MEM_TOT1
ML_MEM_TOT2 = _ML.ML_MEM_TOT2
ML_MEM_INITIAL_MALLOC = _ML.ML_MEM_INITIAL_MALLOC
ML_MEM_FINAL_MALLOC = _ML.ML_MEM_FINAL_MALLOC
ML_MEM_SMOOTHER_MALLOC = _ML.ML_MEM_SMOOTHER_MALLOC
ML_MEM_COARSE_MALLOC = _ML.ML_MEM_COARSE_MALLOC
ML_MEM_HIERARCHY_MALLOC = _ML.ML_MEM_HIERARCHY_MALLOC
ML_MEM_PREC_FIRST_MALLOC = _ML.ML_MEM_PREC_FIRST_MALLOC
ML_MEM_PREC_OTHER_MALLOC = _ML.ML_MEM_PREC_OTHER_MALLOC
ML_MEM_TOT1_MALLOC = _ML.ML_MEM_TOT1_MALLOC
ML_MEM_TOT2_MALLOC = _ML.ML_MEM_TOT2_MALLOC
def SetDefaults(*args):
"""
SetDefaults(string ProblemType, ParameterList List, int options = None,
double params = None, bool OverWrite = True) -> int
"""
return _ML.SetDefaults(*args)
def SetDefaultsDD(*args):
"""
SetDefaultsDD(ParameterList List, Teuchos::RCP<(std::vector<(int,std::allocator<(int)>)>)> options,
Teuchos::RCP<(std::vector<(double,std::allocator<(double)>)>)> params,
bool Overwrite = True) -> int
"""
return _ML.SetDefaultsDD(*args)
def SetDefaultsDD_LU(*args):
"""
SetDefaultsDD_LU(ParameterList List, Teuchos::RCP<(std::vector<(int,std::allocator<(int)>)>)> options,
Teuchos::RCP<(std::vector<(double,std::allocator<(double)>)>)> params,
bool Overwrite = True) -> int
"""
return _ML.SetDefaultsDD_LU(*args)
def SetDefaultsDD_3Levels(*args):
"""
SetDefaultsDD_3Levels(ParameterList List, Teuchos::RCP<(std::vector<(int,std::allocator<(int)>)>)> options,
Teuchos::RCP<(std::vector<(double,std::allocator<(double)>)>)> params,
bool Overwrite = True) -> int
"""
return _ML.SetDefaultsDD_3Levels(*args)
def SetDefaultsDD_3Levels_LU(*args):
"""
SetDefaultsDD_3Levels_LU(ParameterList List, Teuchos::RCP<(std::vector<(int,std::allocator<(int)>)>)> options,
Teuchos::RCP<(std::vector<(double,std::allocator<(double)>)>)> params,
bool Overwrite = True) -> int
"""
return _ML.SetDefaultsDD_3Levels_LU(*args)
def SetDefaultsMaxwell(*args):
"""
SetDefaultsMaxwell(ParameterList List, Teuchos::RCP<(std::vector<(int,std::allocator<(int)>)>)> options,
Teuchos::RCP<(std::vector<(double,std::allocator<(double)>)>)> params,
bool Overwrite = True) -> int
"""
return _ML.SetDefaultsMaxwell(*args)
def SetDefaultsSA(*args):
"""
SetDefaultsSA(ParameterList List, Teuchos::RCP<(std::vector<(int,std::allocator<(int)>)>)> options,
Teuchos::RCP<(std::vector<(double,std::allocator<(double)>)>)> params,
bool Overwrite = True) -> int
"""
return _ML.SetDefaultsSA(*args)
def SetDefaultsNSSA(*args):
"""
SetDefaultsNSSA(ParameterList List, Teuchos::RCP<(std::vector<(int,std::allocator<(int)>)>)> options,
Teuchos::RCP<(std::vector<(double,std::allocator<(double)>)>)> params,
bool Overwrite = True) -> int
"""
return _ML.SetDefaultsNSSA(*args)
def ReadXML(*args):
"""ReadXML(string FileName, ParameterList List, Comm Comm) -> int"""
return _ML.ReadXML(*args)
ML_SA_FAMILY = _ML.ML_SA_FAMILY
ML_MAXWELL = _ML.ML_MAXWELL
ML_COMPOSITE = _ML.ML_COMPOSITE
class MultiLevelPreconditioner(Epetra.Operator):
"""
ML black-box preconditioner for Epetra_RowMatrix derived classes.
C++ includes: ml_MultiLevelPreconditioner.h
"""
__swig_setmethods__ = {}
for _s in [Epetra.Operator]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
__setattr__ = lambda self, name, value: _swig_setattr(self, MultiLevelPreconditioner, name, value)
__swig_getmethods__ = {}
for _s in [Epetra.Operator]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))
__getattr__ = lambda self, name: _swig_getattr(self, MultiLevelPreconditioner, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(self, RowMatrix RowMatrix, bool ComputePrec = True) -> MultiLevelPreconditioner
__init__(self, RowMatrix RowMatrix, ParameterList List, bool ComputePrec = True) -> MultiLevelPreconditioner
__init__(self, ML_Operator Operator, ParameterList List, bool ComputePrec = True) -> MultiLevelPreconditioner
__init__(self, ML_Operator Operator, ParameterList List, RowMatrix DiagOperators,
ParameterList DiagLists, int NBlocks = 1,
bool ComputePrec = True) -> MultiLevelPreconditioner
__init__(self, RowMatrix EdgeMatrix, RowMatrix GradMatrix, RowMatrix NodeMatrix,
ParameterList List, bool ComputePrec = True,
bool UseNodeMatrixForSmoother = False) -> MultiLevelPreconditioner
__init__(self, RowMatrix CurlCurlMatrix, RowMatrix MassMatrix, RowMatrix TMatrix,
RowMatrix NodeMatrix, ParameterList List,
bool ComputePrec = True) -> MultiLevelPreconditioner
__init__(self, Epetra_MsrMatrix EdgeMatrix, ML_Operator GradMatrix,
AZ_MATRIX NodeMatrix, int proc_config, ParameterList List,
bool ComputePrec = True) -> MultiLevelPreconditioner
ML black-box preconditioner for Epetra_RowMatrix derived classes.
C++ includes: ml_MultiLevelPreconditioner.h
"""
this = _ML.new_MultiLevelPreconditioner(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _ML.delete_MultiLevelPreconditioner
__del__ = lambda self : None;
def Label(self, *args):
"""
Label(self) -> char
virtual const char*
Epetra_Operator::Label() const =0
Returns a character string describing the operator.
"""
return _ML.MultiLevelPreconditioner_Label(self, *args)
def PrintUnused(self, *args):
"""
PrintUnused(self)
PrintUnused(self, os)
PrintUnused(self, int MyPID)
"""
return _ML.MultiLevelPreconditioner_PrintUnused(self, *args)
def GetList(self, *args):
"""GetList(self) -> ParameterList"""
return _ML.MultiLevelPreconditioner_GetList(self, *args)
def GetOutputList(self, *args):
"""GetOutputList(self) -> ParameterList"""
return _ML.MultiLevelPreconditioner_GetOutputList(self, *args)
def PrintList(self, *args):
"""PrintList(self)"""
return _ML.MultiLevelPreconditioner_PrintList(self, *args)
def SetParameterList(self, *args):
"""SetParameterList(self, ParameterList List) -> int"""
return _ML.MultiLevelPreconditioner_SetParameterList(self, *args)
def Apply(self, *args):
"""
Apply(self, MultiVector x, MultiVector y) -> int
In C++, the Apply() method is pure virtual, thus intended to be
overridden by derived classes. In python, cross-language polymorphism
is supported, and you are expected to derive classes from this base
class and redefine the Apply() method. C++ code (e.g., AztecOO
solvers) can call back to your Apply() method as needed. You must
support two arguments, labeled here MultiVector x and MultiVector y.
These will be converted from Epetra_MultiVector C++ objects to
numpy-hybrid Epetra.MultiVector objects before they are passed to you.
Thus, it is legal to use slice indexing and other numpy features to
compute y from x.
If application of your operator is successful, return 0; else return
some non-zero error code.
It is strongly suggested that you prevent Apply() from raising any
exceptions. Accidental errors can be prevented by wrapping your code
in a try block:
try:
# Your code goes here...
except Exception, e:
print 'A python exception was raised by method Apply:'
print e
return -1
By returning a -1, you inform the calling routine that Apply() was
unsuccessful.
virtual int
Epetra_Operator::Apply(const Epetra_MultiVector &X, Epetra_MultiVector
&Y) const =0
Returns the result of a Epetra_Operator applied to a
Epetra_MultiVector X in Y.
Parameters:
-----------
In: X - A Epetra_MultiVector of dimension NumVectors to multiply with
matrix.
Out: Y -A Epetra_MultiVector of dimension NumVectors containing
result.
Integer error code, set to 0 if successful.
"""
return _ML.MultiLevelPreconditioner_Apply(self, *args)
def ApplyInverse(self, *args):
"""
ApplyInverse(self, MultiVector x, MultiVector y) -> int
In C++, the ApplyInverse() method is pure virtual, thus intended to be
overridden by derived classes. In python, cross-language polymorphism
is supported, and you are expected to derive classes from this base
class and redefine the ApplyInverse() method. C++ code (e.g., AztecOO
solvers) can call back to your ApplyInverse() method as needed. You
must support two arguments, labeled here MultiVector x and MultiVector
y. These will be converted from Epetra_MultiVector C++ objects to
numpy-hybrid Epetra.MultiVector objects before they are passed to you.
Thus, it is legal to use slice indexing and other numpy features to
compute y from x.
If application of your operator is successful, return 0; else return
some non-zero error code.
It is strongly suggested that you prevent ApplyInverse() from raising
any exceptions. Accidental errors can be prevented by wrapping your
code in a try block:
try:
# Your code goes here...
except Exception, e:
print 'A python exception was raised by method ApplyInverse:'
print e
return -1
By returning a -1, you inform the calling routine that ApplyInverse()
was unsuccessful.
virtual int
Epetra_Operator::ApplyInverse(const Epetra_MultiVector &X,
Epetra_MultiVector &Y) const =0
Returns the result of a Epetra_Operator inverse applied to an
Epetra_MultiVector X in Y.
Parameters:
-----------
In: X - A Epetra_MultiVector of dimension NumVectors to solve for.
Out: Y -A Epetra_MultiVector of dimension NumVectors containing
result.
Integer error code, set to 0 if successful.
WARNING: In order to work with AztecOO, any implementation of this
method must support the case where X and Y are the same object.
"""
return _ML.MultiLevelPreconditioner_ApplyInverse(self, *args)
def ComputePreconditioner(self, *args):
"""ComputePreconditioner(self, bool CheckFiltering = False) -> int"""
return _ML.MultiLevelPreconditioner_ComputePreconditioner(self, *args)
def ReComputePreconditioner(self, *args):
"""ReComputePreconditioner(self) -> int"""
return _ML.MultiLevelPreconditioner_ReComputePreconditioner(self, *args)
def ComputeAdaptivePreconditioner(self, *args):
"""ComputeAdaptivePreconditioner(self, int TentativeNullSpaceSize, double TentativeNullSpace) -> int"""
return _ML.MultiLevelPreconditioner_ComputeAdaptivePreconditioner(self, *args)
def IsPreconditionerComputed(self, *args):
"""IsPreconditionerComputed(self) -> int"""
return _ML.MultiLevelPreconditioner_IsPreconditionerComputed(self, *args)
def SetOwnership(self, *args):
"""SetOwnership(self, bool ownership) -> int"""
return _ML.MultiLevelPreconditioner_SetOwnership(self, *args)
def SetUseTranspose(self, *args):
"""
SetUseTranspose(self, bool UseTranspose) -> int
virtual int
Epetra_Operator::SetUseTranspose(bool UseTranspose)=0
If set true, transpose of this operator will be applied.
This flag allows the transpose of the given operator to be used
implicitly. Setting this flag affects only the Apply() and
ApplyInverse() methods. If the implementation of this interface does
not support transpose use, this method should return a value of -1.
Parameters:
-----------
In: UseTranspose -If true, multiply by the transpose of operator,
otherwise just use operator.
Integer error code, set to 0 if successful. Set to -1 if this
implementation does not support transpose.
"""
return _ML.MultiLevelPreconditioner_SetUseTranspose(self, *args)
def NormInf(self, *args):
"""
NormInf(self) -> double
virtual double
Epetra_Operator::NormInf() const =0
Returns the infinity norm of the global matrix.
"""
return _ML.MultiLevelPreconditioner_NormInf(self, *args)
def UseTranspose(self, *args):
"""
UseTranspose(self) -> bool
virtual bool
Epetra_Operator::UseTranspose() const =0
Returns the current UseTranspose setting.
"""
return _ML.MultiLevelPreconditioner_UseTranspose(self, *args)
def HasNormInf(self, *args):
"""
HasNormInf(self) -> bool
virtual bool
Epetra_Operator::HasNormInf() const =0
Returns true if the this object can provide an approximate Inf-norm,
false otherwise.
"""
return _ML.MultiLevelPreconditioner_HasNormInf(self, *args)
def Comm(self, *args):
"""
Comm(self) -> Comm
virtual const
Epetra_Comm& Epetra_Operator::Comm() const =0
Returns a pointer to the Epetra_Comm communicator associated with this
operator.
"""
return _ML.MultiLevelPreconditioner_Comm(self, *args)
def OperatorDomainMap(self, *args):
"""
OperatorDomainMap(self) -> Map
virtual
const Epetra_Map& Epetra_Operator::OperatorDomainMap() const =0
Returns the Epetra_Map object associated with the domain of this
operator.
"""
return _ML.MultiLevelPreconditioner_OperatorDomainMap(self, *args)
def OperatorRangeMap(self, *args):
"""
OperatorRangeMap(self) -> Map
virtual
const Epetra_Map& Epetra_Operator::OperatorRangeMap() const =0
Returns the Epetra_Map object associated with the range of this
operator.
"""
return _ML.MultiLevelPreconditioner_OperatorRangeMap(self, *args)
def DestroyPreconditioner(self, *args):
"""DestroyPreconditioner(self) -> int"""
return _ML.MultiLevelPreconditioner_DestroyPreconditioner(self, *args)
def RowMatrix(self, *args):
"""RowMatrix(self) -> RowMatrix"""
return _ML.MultiLevelPreconditioner_RowMatrix(self, *args)
def Map(self, *args):
"""Map(self) -> BlockMap"""
return _ML.MultiLevelPreconditioner_Map(self, *args)
def NumGlobalRows(self, *args):
"""NumGlobalRows(self) -> int"""
return _ML.MultiLevelPreconditioner_NumGlobalRows(self, *args)
def NumGlobalCols(self, *args):
"""NumGlobalCols(self) -> int"""
return _ML.MultiLevelPreconditioner_NumGlobalCols(self, *args)
def NumMyRows(self, *args):
"""NumMyRows(self) -> int"""
return _ML.MultiLevelPreconditioner_NumMyRows(self, *args)
def NumMyCols(self, *args):
"""NumMyCols(self) -> int"""
return _ML.MultiLevelPreconditioner_NumMyCols(self, *args)
def PrintStencil2D(self, *args):
"""PrintStencil2D(self, int nx, int ny, int NodeID = -1, int EquationID = 0) -> int"""
return _ML.MultiLevelPreconditioner_PrintStencil2D(self, *args)
def AnalyzeHierarchy(self, *args):
"""
AnalyzeHierarchy(self, bool AnalyzeMatrices, int PreCycles, int PostCycles,
int MLCycles) -> int
"""
return _ML.MultiLevelPreconditioner_AnalyzeHierarchy(self, *args)
def AnalyzeSmoothers(self, *args):
"""AnalyzeSmoothers(self, int NumPreCycles = 1, int NumPostCycles = 1) -> int"""
return _ML.MultiLevelPreconditioner_AnalyzeSmoothers(self, *args)
def AnalyzeCoarse(self, *args):
"""AnalyzeCoarse(self) -> int"""
return _ML.MultiLevelPreconditioner_AnalyzeCoarse(self, *args)
def AnalyzeCycle(self, *args):
"""AnalyzeCycle(self, int NumCycles = 1) -> int"""
return _ML.MultiLevelPreconditioner_AnalyzeCycle(self, *args)
def TestSmoothers(self, *args):
"""
TestSmoothers(self, ParameterList InputList, bool IsSymmetric = False) -> int
TestSmoothers(self, bool IsSymmetric = False) -> int
"""
return _ML.MultiLevelPreconditioner_TestSmoothers(self, *args)
def GetML(self, *args):
"""GetML(self, int WhichML = -1) -> ML"""
return _ML.MultiLevelPreconditioner_GetML(self, *args)
def GetML_Aggregate(self, *args):
"""GetML_Aggregate(self) -> ML_Aggregate"""
return _ML.MultiLevelPreconditioner_GetML_Aggregate(self, *args)
def Visualize(self, *args):
"""
Visualize(self, bool VizAggre, bool VizPreSmoother, bool VizPostSmoother,
bool VizCycle, int NumApplPreSmoother,
int NumApplPostSmoother, int NumCycleSmoother) -> int
"""
return _ML.MultiLevelPreconditioner_Visualize(self, *args)
def VisualizeAggregates(self, *args):
"""VisualizeAggregates(self) -> int"""
return _ML.MultiLevelPreconditioner_VisualizeAggregates(self, *args)
def VisualizeSmoothers(self, *args):
"""VisualizeSmoothers(self, int NumPrecCycles = 1, int NumPostCycles = 1) -> int"""
return _ML.MultiLevelPreconditioner_VisualizeSmoothers(self, *args)
def VisualizeCycle(self, *args):
"""VisualizeCycle(self, int NumCycles = 1) -> int"""
return _ML.MultiLevelPreconditioner_VisualizeCycle(self, *args)
def CreateLabel(self, *args):
"""CreateLabel(self) -> int"""
return _ML.MultiLevelPreconditioner_CreateLabel(self, *args)
def ReportTime(self, *args):
"""ReportTime(self)"""
return _ML.MultiLevelPreconditioner_ReportTime(self, *args)
def SetParameterListAndNullSpace(self, *args):
"""SetParameterListAndNullSpace(self, PyObject obj, Epetra_MultiVector NullSpace) -> int"""
return _ML.MultiLevelPreconditioner_SetParameterListAndNullSpace(self, *args)
MultiLevelPreconditioner_swigregister = _ML.MultiLevelPreconditioner_swigregister
MultiLevelPreconditioner_swigregister(MultiLevelPreconditioner)
class InverseOperator(BaseOperator,CompObject,TimeObject):
"""
InverseOperator: basic class to define smoother and coarse solvers.
Marzio Sala, D-INFK/ETHZ.
C++ includes: MLAPI_InverseOperator.h
"""
__swig_setmethods__ = {}
for _s in [BaseOperator,CompObject,TimeObject]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
__setattr__ = lambda self, name, value: _swig_setattr(self, InverseOperator, name, value)
__swig_getmethods__ = {}
for _s in [BaseOperator,CompObject,TimeObject]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))
__getattr__ = lambda self, name: _swig_getattr(self, InverseOperator, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(self) -> InverseOperator
__init__(self, Operator Op, string Type) -> InverseOperator
__init__(self, Operator Op, string Type, ParameterList List) -> InverseOperator
__init__(self, InverseOperator RHS) -> InverseOperator
MLAPI::InverseOperator::InverseOperator(const InverseOperator &RHS)
Copy constructor.
"""
this = _ML.new_InverseOperator(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _ML.delete_InverseOperator
__del__ = lambda self : None;
def GetOperatorRangeSpace(self, *args):
"""
GetOperatorRangeSpace(self) -> Space
const Space MLAPI::InverseOperator::GetOperatorRangeSpace() const
Returns a reference to the range space of this object.
"""
return _ML.InverseOperator_GetOperatorRangeSpace(self, *args)
def GetOperatorDomainSpace(self, *args):
"""
GetOperatorDomainSpace(self) -> Space
const Space MLAPI::InverseOperator::GetOperatorDomainSpace() const
Returns a reference to the domain space of this object.
"""
return _ML.InverseOperator_GetOperatorDomainSpace(self, *args)
def GetRangeSpace(self, *args):
"""
GetRangeSpace(self) -> Space
const
Space MLAPI::InverseOperator::GetRangeSpace() const
Returns a reference to the range space of this object.
"""
return _ML.InverseOperator_GetRangeSpace(self, *args)
def GetDomainSpace(self, *args):
"""
GetDomainSpace(self) -> Space
const
Space MLAPI::InverseOperator::GetDomainSpace() const
Returns a reference to the domain space of this object.
"""
return _ML.InverseOperator_GetDomainSpace(self, *args)
def RCPRowMatrix(self, *args):
"""
RCPRowMatrix(self) -> Teuchos::RefCountPtr<(Epetra_RowMatrix)>
const
Teuchos::RefCountPtr<Epetra_RowMatrix>
MLAPI::InverseOperator::RCPRowMatrix() const
Returns pointer of the internally stored ML_Epetra::RowMatrix object.
"""
return _ML.InverseOperator_RCPRowMatrix(self, *args)
def RowMatrix(self, *args):
"""
RowMatrix(self) -> RowMatrix
Epetra_RowMatrix* MLAPI::InverseOperator::RowMatrix() const
Returns pointer of the internally stored ML_Epetra::RowMatrix object.
"""
return _ML.InverseOperator_RowMatrix(self, *args)
def GetOperator(self, *args):
"""
GetOperator(self) -> Operator
const
Operator& MLAPI::InverseOperator::GetOperator() const
Returns a reference to the Operator of which this object defines the
inverse.
"""
return _ML.InverseOperator_GetOperator(self, *args)
def GetRCPData(self, *args):
"""
GetRCPData(self) -> Teuchos::RefCountPtr<(Ifpack_Preconditioner)>
GetRCPData(self) -> Teuchos::RefCountPtr<(Ifpack_Preconditioner)>
const
Teuchos::RefCountPtr<Ifpack_Preconditioner>&
MLAPI::InverseOperator::GetRCPData() const
Returns a pointer to the internally stored IFPACK preconditioner.
"""
return _ML.InverseOperator_GetRCPData(self, *args)
def GetRCPMLPrec(self, *args):
"""
GetRCPMLPrec(self) -> Teuchos::RefCountPtr<(ML_Epetra::MultiLevelPreconditioner)>
GetRCPMLPrec(self) -> Teuchos::RefCountPtr<(ML_Epetra::MultiLevelPreconditioner)>
const
Teuchos::RefCountPtr<ML_Epetra::MultiLevelPreconditioner>&
MLAPI::InverseOperator::GetRCPMLPrec() const
Returns a pointer to the internally stored ML preconditioner.
"""
return _ML.InverseOperator_GetRCPMLPrec(self, *args)
def Apply(self, *args):
"""
Apply(self, MultiVector x, MultiVector y) -> int
int
MLAPI::InverseOperator::Apply(const MultiVector &x, MultiVector &y)
const
Applies this object to vector lhs, returns values in rhs.
"""
return _ML.InverseOperator_Apply(self, *args)
def __call__(self, *args):
"""
__call__(self, MultiVector LHS) -> MultiVector
__call__(self, MultiVector LHS, MultiVector RHS) -> MultiVector
"""
return _ML.InverseOperator___call__(self, *args)
def __mul__(self, *args):
"""__mul__(self, MultiVector rhs) -> MultiVector"""
return _ML.InverseOperator___mul__(self, *args)
def Reshape(self, *args):
"""
Reshape(self)
Reshape(self, Operator Op, string Type)
Reshape(self, Operator Op, string Type, ParameterList List, ParameterList pushlist = None)
Reshape(self, Ifpack_Preconditioner prec, Operator Op, bool ownership)
Reshape(self, Operator Op, string Type, PyObject obj) -> bool
void
MLAPI::InverseOperator::Reshape(Ifpack_Preconditioner *prec, const
Operator &Op, const bool ownership)
Reshape with preconstructed smoother as Ifpack_Preconditioner.
"""
return _ML.InverseOperator_Reshape(self, *args)
InverseOperator_swigregister = _ML.InverseOperator_swigregister
InverseOperator_swigregister(InverseOperator)
def GetRAP(*args):
"""
GetRAP(Operator R, Operator A, Operator P) -> Operator
Operator MLAPI::GetRAP(const
Operator &R, const Operator &A, const Operator &P)
Performs a triple matrix-matrix product, res = R * A *P.
"""
return _ML.GetRAP(*args)
def GetTranspose(*args):
"""
GetTranspose(Operator A, bool byrow = True) -> Operator
Operator
MLAPI::GetTranspose(const Operator &A, const bool byrow=true)
Returns a newly created transpose of A.
"""
return _ML.GetTranspose(*args)
def GetIdentity(*args):
"""
GetIdentity(Space DomainSpace, Space RangeSpace) -> Operator
Operator
MLAPI::GetIdentity(const Space &DomainSpace, const Space &RangeSpace)
Returns the identity matrix.
"""
return _ML.GetIdentity(*args)
def GetJacobiIterationOperator(*args):
"""
GetJacobiIterationOperator(Operator Amat, double Damping) -> Operator
Operator
MLAPI::GetJacobiIterationOperator(const Operator &Amat, double
Damping)
Returns an operator defined as (I - Damping A).
"""
return _ML.GetJacobiIterationOperator(*args)
def GetPtent1D(*args):
"""
GetPtent1D(MultiVector D, int offset = 0) -> Operator
Operator
MLAPI::GetPtent1D(const MultiVector &D, const int offset=0)
Returns a newly created operator, containing D on the diagonal.
"""
return _ML.GetPtent1D(*args)
def ML_Operator_Add2(*args):
"""
ML_Operator_Add2(ML_Operator A, ML_Operator B, ML_Operator C, int matrix_type,
double scalarA, double scalarB) -> int
int
MLAPI::ML_Operator_Add2(ML_Operator *A, ML_Operator *B, ML_Operator
*C, int matrix_type, double scalarA, double scalarB)
"""
return _ML.ML_Operator_Add2(*args)
def AnalyzeCheap(*args):
"""
AnalyzeCheap(Operator A)
void
MLAPI::AnalyzeCheap(const Operator &A)
Performs a cheap analysis of the properties of the input operator.
"""
return _ML.AnalyzeCheap(*args)
def PrintSparsity(*args):
"""
PrintSparsity(Operator A, int NumPDEEquations = 1)
void
MLAPI::PrintSparsity(const Operator &A, int NumPDEEquations=1)
Prints on file the sparsity structure of input operator.
"""
return _ML.PrintSparsity(*args)
def GetScaledOperator(*args):
"""
GetScaledOperator(Operator A, double alpha) -> Operator
Operator
MLAPI::GetScaledOperator(const Operator &A, const double alpha)
Multiply A by a double value, alpha.
"""
return _ML.GetScaledOperator(*args)
class EpetraBaseOperator(Epetra.Operator):
"""
Basic class to wrap MLAPI::InverseOperator into Epetra_Operator.
Marzio Sala, SNL 9214.
C++ includes: MLAPI_EpetraBaseOperator.h
"""
__swig_setmethods__ = {}
for _s in [Epetra.Operator]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
__setattr__ = lambda self, name, value: _swig_setattr(self, EpetraBaseOperator, name, value)
__swig_getmethods__ = {}
for _s in [Epetra.Operator]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))
__getattr__ = lambda self, name: _swig_getattr(self, EpetraBaseOperator, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(self, Map Map, BaseOperator Op) -> EpetraBaseOperator
MLAPI::EpetraBaseOperator::EpetraBaseOperator(const Epetra_Map &Map,
const BaseOperator &Op)
Constructor.
"""
this = _ML.new_EpetraBaseOperator(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _ML.delete_EpetraBaseOperator
__del__ = lambda self : None;
def ApplyInverse(self, *args):
"""
ApplyInverse(self, Epetra_MultiVector X_Epetra, Epetra_MultiVector Y_Epetra) -> int
int
MLAPI::EpetraBaseOperator::ApplyInverse(const Epetra_MultiVector
&X_Epetra, Epetra_MultiVector &Y_Epetra) const
Applies the operator to X, returns the results in Y.
Apply() and ApplyInverse() are the SAME function!
"""
return _ML.EpetraBaseOperator_ApplyInverse(self, *args)
def SetUseTranspose(self, *args):
"""
SetUseTranspose(self, bool UseTranspose) -> int
virtual int MLAPI::EpetraBaseOperator::SetUseTranspose(bool
UseTranspose)
Sets the use of tranpose (NOT IMPLEMENTED).
"""
return _ML.EpetraBaseOperator_SetUseTranspose(self, *args)
def Apply(self, *args):
"""
Apply(self, Epetra_MultiVector X_Epetra, Epetra_MultiVector Y_Epetra) -> int
virtual int
MLAPI::EpetraBaseOperator::Apply(const Epetra_MultiVector &X_Epetra,
Epetra_MultiVector &Y_Epetra) const
Applies the operator to X, returns the results in Y.
"""
return _ML.EpetraBaseOperator_Apply(self, *args)
def NormInf(self, *args):
"""
NormInf(self) -> double
virtual
double MLAPI::EpetraBaseOperator::NormInf() const
NOT IMPLEMENTED.
"""
return _ML.EpetraBaseOperator_NormInf(self, *args)
def Label(self, *args):
"""
Label(self) -> char
virtual
const char* MLAPI::EpetraBaseOperator::Label() const
Returns the label of this object.
"""
return _ML.EpetraBaseOperator_Label(self, *args)
def UseTranspose(self, *args):
"""
UseTranspose(self) -> bool
virtual bool MLAPI::EpetraBaseOperator::UseTranspose() const
Returns false.
"""
return _ML.EpetraBaseOperator_UseTranspose(self, *args)
def HasNormInf(self, *args):
"""
HasNormInf(self) -> bool
virtual
bool MLAPI::EpetraBaseOperator::HasNormInf() const
NOT IMPLEMENTED.
"""
return _ML.EpetraBaseOperator_HasNormInf(self, *args)
def Comm(self, *args):
"""
Comm(self) -> Comm
virtual const
Epetra_Comm& MLAPI::EpetraBaseOperator::Comm() const
Returns a reference to the communicator object.
"""
return _ML.EpetraBaseOperator_Comm(self, *args)
def OperatorDomainMap(self, *args):
"""
OperatorDomainMap(self) -> Map
virtual const Epetra_Map&
MLAPI::EpetraBaseOperator::OperatorDomainMap() const
Returns a reference to the OperatorDomainMap.
"""
return _ML.EpetraBaseOperator_OperatorDomainMap(self, *args)
def OperatorRangeMap(self, *args):
"""
OperatorRangeMap(self) -> Map
virtual const Epetra_Map&
MLAPI::EpetraBaseOperator::OperatorRangeMap() const
Returns a reference to the OperatorRangeMap.
"""
return _ML.EpetraBaseOperator_OperatorRangeMap(self, *args)
def Map(self, *args):
"""
Map(self) -> Map
virtual const
Epetra_Map& MLAPI::EpetraBaseOperator::Map() const
Returns a reference to the Map of this object.
"""
return _ML.EpetraBaseOperator_Map(self, *args)
def GetBaseOperator(self, *args):
"""
GetBaseOperator(self) -> BaseOperator
const BaseOperator& MLAPI::EpetraBaseOperator::GetBaseOperator() const
"""
return _ML.EpetraBaseOperator_GetBaseOperator(self, *args)
EpetraBaseOperator_swigregister = _ML.EpetraBaseOperator_swigregister
EpetraBaseOperator_swigregister(EpetraBaseOperator)
def GetDiagonal(*args):
"""
GetDiagonal(Operator A) -> MultiVector
GetDiagonal(Operator A, int offset) -> MultiVector
GetDiagonal(MultiVector D) -> Operator
Operator
MLAPI::GetDiagonal(const MultiVector &D)
Returns a newly created operator, containing D on the diagonal.
"""
return _ML.GetDiagonal(*args)
def Duplicate(*args):
"""
Duplicate(MultiVector y) -> MultiVector
Duplicate(MultiVector y, int v) -> MultiVector
Duplicate(Operator A) -> Operator
Operator
MLAPI::Duplicate(const Operator &A)
Duplicates a given operator.
"""
return _ML.Duplicate(*args)
def Krylov(*args):
"""
Krylov(Operator A, MultiVector LHS, MultiVector RHS, BaseOperator Prec,
ParameterList List)
void MLAPI::Krylov(const
Operator &A, const MultiVector &LHS, const MultiVector &RHS, const
BaseOperator &Prec, Teuchos::ParameterList &List)
"""
return _ML.Krylov(*args)
def GetAggregates(*args):
"""
GetAggregates(RowMatrix A, ParameterList List, double thisns, Epetra_IntVector aggrinfo) -> int
int
MLAPI::GetAggregates(Epetra_RowMatrix &A, Teuchos::ParameterList
&List, double *thisns, Epetra_IntVector &aggrinfo)
Call ML aggregation on A according to parameters supplied in List.
Return aggregates in aggrinfo.
On input, map of aggrinfo has to map row map of A. On output,
aggrinfo[i] contains number of aggregate the row belongs to, where
aggregates are numbered starting from 0. Return value is the
processor-local number of aggregates build. If aggrinfo[i] >= return-
value, then i is a processor local row of a row that ML has detected
to be on a Dirichlet BC.
Parameters:
-----------
A: (in): Matrix to be aggregated on
List: (in): ParameterList containing ML options
thisns: (in): nullspace
aggrinfo(out): :: vector containing aggregation information
Map of aggrinfo has to match rowmap of A on input.
returns processor-local number of aggregates
Michael Gee (gee@lnm.mw.tum.de)
"""
return _ML.GetAggregates(*args)
def GetGlobalAggregates(*args):
"""
GetGlobalAggregates(RowMatrix A, ParameterList List, double thisns, Epetra_IntVector aggrinfo) -> int
int
MLAPI::GetGlobalAggregates(Epetra_RowMatrix &A, Teuchos::ParameterList
&List, double *thisns, Epetra_IntVector &aggrinfo)
Call ML aggregation on A according to parameters supplied in List.
Return aggregates in aggrinfo.
On input, map of aggrinfo has to map row map of A. On output,
aggrinfo[i] contains number of global aggregate the row belongs to,
where aggregates are numbered starting from 0 globally. Return value
is the processor-local number of aggregates build. If aggrinfo[i] < 0,
then i is a processor local row that ML has detected to be on a
Dirichlet BC. if aggrinfo[i] >= 0, then i is a processor local row and
aggrinfo[i] is a global aggregate id.
Parameters:
-----------
A: (in): Matrix to be aggregated on
List: (in): ParameterList containing ML options
thisns: (in): nullspace
aggrinfo(out): :: vector containing aggregation information in
global numbering
Map of aggrinfo has to match rowmap of A on input.
returns processor-local number of aggregates
Michael Gee (gee@lnm.mw.tum.de)
"""
return _ML.GetGlobalAggregates(*args)
def MaxEigAnorm(*args):
"""
MaxEigAnorm(Operator Op, bool DiagonalScaling = False) -> double
double
MLAPI::MaxEigAnorm(const Operator &Op, const bool
DiagonalScaling=false)
Computes the maximum eigenvalue of Op using the A-norm of the
operator.
"""
return _ML.MaxEigAnorm(*args)
def MaxEigCG(*args):
"""
MaxEigCG(Operator Op, bool DiagonalScaling = False) -> double
double MLAPI::MaxEigCG(const
Operator &Op, const bool DiagonalScaling=false)
Computes the maximum eigenvalue of Op using the CG method.
"""
return _ML.MaxEigCG(*args)
def MaxEigPowerMethod(*args):
"""
MaxEigPowerMethod(Operator Op, bool DiagonalScaling = False) -> double
double
MLAPI::MaxEigPowerMethod(const Operator &Op, const bool
DiagonalScaling=false)
Computes the maximum eigenvalue of Op using the power method.
"""
return _ML.MaxEigPowerMethod(*args)
def MaxEigAnasazi(*args):
"""
MaxEigAnasazi(Operator Op, bool DiagonalScaling = False) -> double
double
MLAPI::MaxEigAnasazi(const Operator &Op, const bool
DiagonalScaling=false)
Computes the maximum eigenvalue of Op using Anasazi.
"""
return _ML.MaxEigAnasazi(*args)
def Eig(*args):
"""
Eig(Operator Op, MultiVector ER, MultiVector EI)
void MLAPI::Eig(const Operator
&Op, MultiVector &ER, MultiVector &EI)
Computes eigenvalues and eigenvectors using LAPACK (w/ one process
only).
"""
return _ML.Eig(*args)
def Eigs(*args):
"""
Eigs(Operator A, int NumEigenvalues, MultiVector ER, MultiVector EI)
void MLAPI::Eigs(const Operator
&A, int NumEigenvalues, MultiVector &ER, MultiVector &EI)
"""
return _ML.Eigs(*args)
def Gallery(*args):
"""
Gallery(string ProblemType, Space MySpace) -> Operator
Operator MLAPI::Gallery(const
string ProblemType, const Space &MySpace)
Creates a matrix using the TRIUTILS gallery.
"""
return _ML.Gallery(*args)
def GetShiftedLaplacian1D(*args):
"""
GetShiftedLaplacian1D(int NX, double Factor = 0.99) -> Operator
Operator
MLAPI::GetShiftedLaplacian1D(const int NX, const double Factor=0.99)
Creates a 1D shifted Laplacian.
"""
return _ML.GetShiftedLaplacian1D(*args)
def GetShiftedLaplacian2D(*args):
"""
GetShiftedLaplacian2D(int NX, int NY, double Factor = 0.99, bool RandomScale = False) -> Operator
Operator
MLAPI::GetShiftedLaplacian2D(const int NX, const int NY, const double
Factor=0.99, const bool RandomScale=false)
Creates a 2D shifted Laplacian.
"""
return _ML.GetShiftedLaplacian2D(*args)
def ReadMatrix(*args):
"""
ReadMatrix(char FileName) -> Operator
Operator
MLAPI::ReadMatrix(const char *FileName)
Reads a matrix in MATLAB format.
"""
return _ML.ReadMatrix(*args)
def GetRecirc2D(*args):
"""
GetRecirc2D(int NX, int NY, double conv, double diff) -> Operator
Operator
MLAPI::GetRecirc2D(const int NX, const int NY, const double conv,
const double diff)
Creates a recirculation problem in 2D.
"""
return _ML.GetRecirc2D(*args)
def ReadParameterList(*args):
"""
ReadParameterList(char FileName) -> ParameterList
Teuchos::ParameterList MLAPI::ReadParameterList(const char *FileName)
Populates a list from specified file.
"""
return _ML.ReadParameterList(*args)
def GetPNonSmoothed(*args):
"""
GetPNonSmoothed(Operator A, MultiVector ThisNS, MultiVector NextNS,
PyObject obj) -> Operator
"""
return _ML.GetPNonSmoothed(*args)
def Iterate(*args):
"""
Iterate(Operator A, MultiVector LHS, MultiVector RHS, BaseOperator Prec,
PyObject obj) -> bool
"""
return _ML.Iterate(*args)
# This file is compatible with both classic and new-style classes.
def __add__(*args):
"""
__add__(MultiVector x, MultiVector y) -> MultiVector
__add__(MultiVector x, double alpha) -> MultiVector
__add__(double alpha, MultiVector x) -> MultiVector
__add__(Operator A, Operator B) -> Operator
"""
return _ML.__add__(*args)
def __sub__(*args):
"""
__sub__(MultiVector x, MultiVector y) -> MultiVector
__sub__(MultiVector x, double alpha) -> MultiVector
__sub__(double alpha, MultiVector x) -> MultiVector
__sub__(Operator A, Operator B) -> Operator
"""
return _ML.__sub__(*args)
def __div__(*args):
"""
__div__(Operator A, double alpha) -> Operator
__div__(MultiVector x, double alpha) -> MultiVector
"""
return _ML.__div__(*args)
def __mul__(*args):
"""
__mul__(Operator A, MultiVector y) -> MultiVector
__mul__(Operator A, Operator B) -> Operator
__mul__(Operator A, double alpha) -> Operator
__mul__(double alpha, Operator A) -> Operator
__mul__(MultiVector x, double alpha) -> MultiVector
__mul__(double alpha, MultiVector x) -> MultiVector
__mul__(BaseOperator A, MultiVector x) -> MultiVector
__mul__(MultiVector x, MultiVector y) -> double
"""
return _ML.__mul__(*args)
def GetPtent(*args):
"""
GetPtent(Operator A, ParameterList List, MultiVector ThisNS,
Operator Ptent, MultiVector NextNS)
GetPtent(Operator A, ParameterList List, Operator Ptent)
GetPtent(RowMatrix A, ParameterList List, double thisns, Teuchos::RCP<(Epetra_CrsMatrix)> Ptent,
Teuchos::RCP<(Epetra_MultiVector)> NextNS,
int domainoffset = 0)
GetPtent(RowMatrix A, ParameterList List, double thisns, Teuchos::RCP<(Epetra_CrsMatrix)> Ptent,
int domainoffset = 0)
void MLAPI::GetPtent(const
Epetra_RowMatrix &A, Teuchos::ParameterList &List, double *thisns,
Teuchos::RCP< Epetra_CrsMatrix > &Ptent, const int domainoffset=0)
Builds the tentative prolongator using aggregation.
Build Ptent and NextNS as usual but as Epetra objects.
Parameters:
-----------
A: (in): Matrix to be aggregated on
List: (in): ParameterList containing ML options
thisns: (in): nullspace in format ML accepts
Ptent(out): :: Matrix containing tentative prolongator
domainoffset: (in,optional): give an offset such that the domainmap
of Ptent starts global numbering from domainoffset instead from zero.
This is useful to create block matrices.
Michael Gee (gee@lnm.mw.tum.de)
"""
return _ML.GetPtent(*args)
|