Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: ce8e8b0222
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 1719 lines (1674 sloc) 54.407 kb
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
;;; ansys-template.el -- APDL code templates for Ansys mode

;; Copyright (C) 2006 - 20010 H. Dieter Wilhelm

(defun ansys-display-skeleton () ;NEW
  "Display code templates in another buffer."
  (interactive)
  (let* (
(old-buffer (buffer-name))
(new-buffer-name "*Ansys-skeleton*")
(skeleton-buffer
(get-buffer-create new-buffer-name))
s
(skel (completing-read
"Template: " obarray 'commandp
t "ansys-skeleton-" nil))
;; (skel "ansys-skeleton-numbering-controls")
)
    (switch-to-buffer-other-window skeleton-buffer)
    (remove-overlays)
    ;;(make-local-variable 'ansys-skeleton-overlay)
    (setq ansys-skeleton-overlay (make-overlay 1 1))
    (kill-region (point-min) (point-max))
    (funcall (intern-soft skel))
; (ansys-skeleton-numbering-controls)
; (insert "bla\n")
    (goto-char (point-min))
    (unless (eq major-mode 'ansys-mode)
      (ansys-mode))
    (setq ansys-last-skeleton skel)
    (setq s (propertize
     (concat "-*- Ansys template: " skel " -*-\n") 'face 'match))
    (overlay-put ansys-skeleton-overlay 'before-string s)
    (set-buffer-modified-p nil)
; (toggle-read-only t)
    (switch-to-buffer-other-window old-buffer)
    ;; (display-buffer new-buffer-name 'other-window)
    ))

(define-skeleton ansys_do ;NEW
  ""
  "Which *do counter [i]: "
  > "*do," str | "i" ",1," (skeleton-read "End condition: " "10") ",1\n"
  > _ \n
  "*cycle !bypass below commands in *do loop" > \n
  "*enddo" > \n
  )

(define-skeleton ansys_if ;NEW
  ""
  "First operant [i]: "
  "*if," str | "i" ","
  (skeleton-read "Operator (EQ,NE,GT,LE,GE,ABLT,ABGT): " "LT") ","
  (skeleton-read "Second operant: " "j") ","
  (skeleton-read "Action (:label,STOP,EXIT,CYCLE): " "THEN") > \n
  > _ \n
  "!! *elseif,i,GT,j" > \n
  "!! *else" > \n
  "*endif" >
  )

(define-skeleton ansys-skeleton-looping
  "Control constructs"
  nil
  "\n!@@@ - branching, looping and control structures -"\n
  \n
  "! if controls" \n
  "*if,I,eq,1,then" \n
  "*elseif,I,le,10" > \n
  "*else" > \n
  "*endif" > \n
  \n
  "! *if,val1,oper1,val2,base1,val3,oper2,val4,base2" \n
  " ! oper: eq,ne,lt,gt,le,ge,ablt,abgt," \n
  " ! base: stop,exit,cycle,and,or,xor" \n
  \n
  "! implicit looping" \n
  "lfillt,(1:2),(3:4),5" \n
  \n
  "! command repetition" \n
  "e,1,2" \n
  "*repeat,5,0,1"\n
  \n
  "! do loops" \n
  "*do,I,1,6,2" \n
  "*cycle" > \n
  "*exit" > \n
  "*enddo" > \n
  \n
  "*dowhile,PAR" \n
  "*cycle" > \n
  "*exit" > \n
  "*enddo" > \n
  \n
  "! goto branching" \n
  "*go,:BRANCH" \n
  ":BRANCH" \n
  )

(define-skeleton ansys-skeleton-header ;NEW
  "Insert a file header for an APDL script.
Together with an Emacs Time-stamp string. You might update the
time stamp with the Emacs command M-x `time-stamp'."
  "Brief description of the file: "
  "!! ------------------------------" \n
  "!" ansys-outline-string " --- file header ---" \n
  "!! ------------------------------" \n
  ;; "!! FILENAME: " (file-name-nondirectory (if (buffer-file-name)
  ;; (buffer-file-name)
  ;; (buffer-name))) \n
  "!! Time-stamp: <" (current-time-string) ">"\n
  "!! ANSYS VERSION: " ansys-current-ansys-version \n
  "!! UNITS: mm-t-s" \n
  "!! NOTE: " str \n
  "!! ------------------------------" \n
  "/units,mpa !indicate mm-t-s unit system" \n
  \n
  )

(define-skeleton ansys-skeleton-information
  ""
  nil
  "\n!! ------------------------------" \n
  "!@@ -- informations --" \n
  "/inquire,Job_name,jobname!get string array jobname|directory|user|psearch" \n
  "*stat,Job_name(1,1,1)" \n
  "/inquire,param,date,file,ext !get date(size,lines) of file.ext"\n
  "!@@@ - stati -" \n
  "/status ![all], title,units,mem,db,config,global,solu,prod" \n
  "*list,file,ext ! list file content" \n
  "/runst ! enter run statistics processor" \n
  "/pstatus ! display window stats specifications" \n
  "list: k-,l-,a-,v-,n-,e-,ce-,cp-,mp-,f-,bf-,d-,da-,dk-,dl-,fk-,af-,sf-,sfl-,bfa-,bfe-,bfk-,bfl-,bfv-,ic-,r-,tb-,s-,m-,sw-" \n
  \n
  "*status ! parameters, arrays and abbreviations" \n
  "*status,_STATUS !return value: 0:no error, 1:note, 2:warning, 3:error" \n
  "*stat,argx !list all local ARGx values" \n
  "*status,_RETURN !some solid modelling commands return this parameter" \n
  "(see the _return value list below)"\n
  "*vstat !status on arry operations"\n
  \n
  "!@@@ - material info" \n
  "mplist,all" \n
  "tblist" \n
  "tbplot,biso,1" \n
  "!@@@ - solution info -" \n
  \n
  "set,list ! list a summary of each load step" \n
  "wpstyl,stat !working plane status" \n
  "status,solu" \n
  \n
  "!@@@ - \"stat\" database settings - "\n
  "/prep7" \n
  "etype" \n
  "stat" \n
  "rcon$stat"\n
  "!! prep7 stat topics" \n
  "ETYPE $ stat ! - Element types" \n
  "RCON $ stat ! - Real constants" \n
  "MATER $ stat ! - Material properties" \n
  "TBLE $ stat ! - Data table properties" \n
  "PRIM $ stat ! - Solid model primitives" \n
  "KEYPTS $ stat ! - Keypoints" \n
  "LINE $ stat ! - Lines" \n
  "AREAS $ stat ! - Areas" \n
  "VOLUMES $ stat ! - Volumes" \n
  "GEOMETRY $ stat ! - Solid model information" \n
  "MESHING $ stat ! - Meshing" \n
  "BOOL $ stat ! - Booleans" \n
  "NODES $ stat ! - Nodes" \n
  "ELEM $ stat ! - Elements" \n
  "SELM $ stat ! - Superelements" \n
  "PIPE $ stat ! - Pipe modeling" \n
  "DIGIT $ stat ! - Node digitizing" \n
  "COUPLE $ stat ! - Node coupling" \n
  "CEQN $ stat ! - Constraint equations" \n
  "REORDER $ stat ! - Model reordering" \n
  \n
  "!! solution stat topics" \n
  "ATYPE $ stat ! - Analysis types" \n
  "MASTER $ stat ! - Master DOF" \n
  "GAP $ stat ! - Reduced transient gap conditions" \n
  "DEACT $ stat ! - Element birth and death (deactivation)" \n
  "LSOPER $ stat ! - Load step operations" \n
  "FECONS $ stat ! - Constraints on nodes" \n
  "FEFOR $ stat ! - Forces on nodes" \n
  "FESURF $ stat ! - Surface loads on elements" \n
  "FEBODY $ stat ! - Body loads on elements" \n
  "SMCONS $ stat ! - Constraints on the solid model" \n
  "SMFOR $ stat ! - Forces on the solid model" \n
  "SMSURF $ stat ! - Surface loads on the solid model" \n
  "SMBODY $ stat ! - Body loads on the solid model" \n
  "INRTIA $ stat ! - Inertial loads" \n
  "GENOPT $ stat ! - General options" \n
  "DYNOPT $ stat ! - Dynamic analysis options" \n
  "NLOPT $ stat ! - Nonlinear analysis options" \n
  "OUTOPT $ stat ! - Output options" \n
  "BIOOPT $ stat ! - Biot-Savart options" \n
  "SPTOPT $ stat ! - Spectrum analysis options" \n
  "SOLUOPT $ stat ! - Solution options" \n
  "FLOTRAN $ stat ! - FLOTRAN data settings" \n
  \n
  "!! post1 stat topics" \n
  "DEFINE $ stat ! - Data definition settings" \n
  "SORT $ stat ! - Sort settings" \n
  "PRINT $ stat ! - Print settings" \n
  "DISPLAY $ stat ! - Display settings" \n
  "CALC $ stat ! - Calculation settings" \n
  "PATH $ stat ! - Path data settings" \n
  "LCCALC $ stat ! - Load case settings" \n
  "DATADEF $ stat ! - Directly defined data status" \n
  "FATIGUE $ stat ! - Fatigue data status" \n
  "POINT $ stat ! - Point flow tracing settings" \n
  "SPEC $ stat ! - Miscellaneous specifications" \n
  \n
  "!! post26 stat topics" \n
  "DEFINE $ stat ! - Data definition settings" \n
  "OPERATE $ stat ! - Operation data" \n
  "PRINT $ stat ! - Print settings" \n
  "PLOTTING $ stat ! - Plotting settings" \n
  \n
  "!@@@ - aux3 result file edit routine -" \n
  "/aux3" \n
  "list !result statistics" \n
  "!@@@ - *get -" \n
  "*get,bla,active,,mat![|csys|type|real|esys]" \n
  \n
  "*status,_RETURN ! command, documenation, _return value" \n
  "!Keypoints -" \n
  "K ! Defines a keypoint - keypoint number"\n
  "KL ! Keypoint on a line - Keypoint number"\n
  "KNODE ! Keypoint at node - Keypoint number"\n
  "KBETW ! Keypoint between two keypoints - KP number"\n
  "KCENTER ! Keypoint at center - KP number"\n
  "!Lines -" \n
  "BSPLIN ! Generate spline - Line number"\n
  "CIRCLE ! Generate circular arc lines - First line number"\n
  "L ! Line between two keypoints - Line number"\n
  "L2ANG ! Line at angle with two lines - Line number"\n
  "LANG ! Line tangent to two lines - Line number"\n
  "LARC ! Defines a circular arc - Line number"\n
  "LAREA ! Line between two keypoints - Line number"\n
  "LCOMB ! Combine two lines into one - Line number"\n
  "LDIV ! Divide line into two or more lines - First keypoint number"\n
  "LDRAG ! Line by keypoint sweep - First line number"\n
  "LFILLT ! Fillet line between two liens - Fillet line number"\n
  "LROTAT ! Arc by keypoint rotation - First line number"\n
  "LSTR ! Straight line - Line number"\n
  "LTAN ! Line at end and tangent - Line number"\n
  "SPLINE ! Segmented spline - First line number"\n
  "!Areas -" \n
  "A ! Area connecting keypoints - Area number"\n
  "ACCAT ! Concatenate two or more areas - Area number"\n
  "ADRAG ! Drag lines along path - First area number"\n
  "AFILLT ! Fillet at intersection of two areas - Fillet area number"\n
  "AL ! Area bounded by lines - Area number"\n
  "ALPFILL ! All loops - Area number"\n
  "AOFFST ! Area offset from given area - Area number"\n
  "AROTAT ! Rotate lines around axis - First area number"\n
  "ASKIN ! Skin surface through guiding lines - First area number"\n
  "ASUB ! Area using shape of existing area - Area number"\n
  "!Volumes - "\n
  "V ! Volume through keypoints - Volume number"\n
  "VA ! Volume bounded through areas - Volume number"\n
  "VDRAG ! Drag area pattern to create volume - First volume number"\n
  "VEXT ! Volume by extruding areas - First volume number"\n
  "VOFFST ! Volume offset from given area - Volume number"\n
  "VROTAT ! Volume by rotating areas - First volume number"\n
)

(define-skeleton ansys-skeleton-configuration
  ""
  nil
  "\n!! ------------------------------" \n
  "!@@ -- configurations --" \n
  \n
  "! *afun,deg ! trig. functions accept angle arguments" \n
  "*afun,rad !rad: default" \n
  "True = 1" \n
  "False = 0" \n
  \n
  "/title," _ \n
  "/plopts,wp ! switch off working plane" \n
  "/plopts,wp,1 !display working plane" \n
  "/plopts,minm,0 !0: switch off min max" \n
  "/triad,rbot !off, orig, ltop, ..." \n
  "/cwd,DIR !changes working directory" \n
  \n
  "/cwd !changes working dir" \n
  "/filname !changes jobname" \n
  "resume! resume the database" \n
  "file !result file" \n
  )

(define-skeleton ansys-skeleton-view-settings
  ""
  nil
  "\n!! ------------------------------" \n
  "!@@ -- view settings --" \n
  \n
  "/view !viewing direction"_ \n
  "/angle,1,10,xs,1!rotation {x,y,z}m global {x,y,z}s screen 1:cumulative 0: absolut" \n
  "/dist,1,1/2.,1 $ /repl !distance (zoom) to object " \n
  "/focus,1 $ /repl !focus to csys,0" \n
  "/plopts,wp,1 !display working plane" \n
  "/plopts,minm ! switch off min max" \n
  "!/focus,1,,.5,,1 $ /repl !focus with screen coordinate multiplier" \n
  "/auto ! automatic fit mode" \n
  "/user ! keep last display scaling"\n
  "/pstatus ! display window stats specifications" \n
  "/dscale,all,10 !set displacment multiplier" \n
  )

(define-skeleton ansys-skeleton-import ;NEW
  "Import commands."
  nil
  "\n!! ------------------------------" \n
  "!" ansys-outline-string ansys-outline-string " -- cad import -- " \n
  \n
  "/aux15" \n
  "ioptn,iges,nodefeat" \n
  "ioptn,merge,yes" \n
  "ioptn,solid,yes" \n
  "ioptn,small,yes" \n
  "ioptn,gtoler,defa" \n
  "igesin,'test','iges'"\n
  \n
  "/input,filename,anf ! for APDL based input" \n
  "/facet,norm" \n
  )

(define-skeleton ansys-skeleton-expand ;NEW
  "Symmetry expansion."
  nil
  "\n!@@@ - symmetry expansion -" \n
  \n
  "!/EXPAND, Nrepeat1, Type1, Method1, DX1, DY1, DZ1, Nrepeat2, Type2, Method2, DX2, DY2, DZ2, Nrepeat3, Type3, Method3, DX3, DY3, DZ3"\n
  "!DX1,DY1,DZ1,... 1.) normal vector of reflection plane 2.) increments between patterns"\n
  "! full: no tranlation<-small nonzero value, half: mirroring, increment is doubled" \n
  "/expand,2,(l)rect,half,,-1e-6,,2,rect,half,-1e-6 !(local) cartesian, half:mirror" \n
  "/expand,8,(l)polar,half,,45 !(local) polar expansion, full:normal exp." \n
  "/expand,18,axis,,,10 !axisymmetric (360 ° rot. around y-axis)" \n
  "/expand !switch off expansion" \n
  "!! -- cyclic expansion --" \n
  "cyclic,status" \n
  "/cycexpand ! expand graphics rep." \n
  )

(define-skeleton ansys-skeleton-contact-definition
  ""
  nil
  "\n!! ------------------------------" \n
  "!@@ -- contact pair defintion --" \n
  \n
  "Contact="_ \n
  "Target=Contact+1" \n
  "r,Contact !define a real set" \n
  "et,Contact,conta174 !3d, 8 node" \n
  "et,Contact,conta173 !3d, 4 node" \n
  "et,Contact,conta172 !2d, 3 node" \n
  "et,Contact,conta171 !2d, 2 node" \n
  "et,Contact,conta175 !2/3d node to surf" \n
  "et,Contact,conta176 !3d line to line, 3 node" \n
  "et,Contact,conta177 !3d line to surf, 3 node" \n
  \n
  "et,Target,targe170 !3d area,line,(pilot-)node" \n
  "et,Target,targe169 !2d" \n
  \n
  "!! --- contact options --"\n
  "keyo,Contact,2,1 !ALGORITHM [0]:augm. Lagrange,1:penalty,2:MPC,4:pure Lagrange" \n
  "!! " \n
  "Fkn = .1 !contact stiffness (default 1, divided by 100 if plastic mat. ONLY Ansys version < 12.0!)" \n
  "rmod,Contact,3,Fkn !FKN:normal penalty stiffness factor (default:1) smaller: bigger penetration, easier convergence" \n
  "rmod,Contact,12,0. !FKT:tangent stiffness factor,0:means 1 for Ansys!!!" \n
  \n
  "Ftoln = .1 !penetration tolerance [.1] for lagr. mult. & chattering control" \n
  "rmod,Contact,4,Ftoln !FTOLN penetration tolerance (augm. Lagrance! default:0.1) bigger: less chattering" \n
  \n
  "Pinb = -1 !search radius, neg: absolut value ( > CNOF!)" \n
  "rmod,Contact,6,Pinb !PINB:pinball radius (negative: no scaling:absolute distance)" \n
  \n
  "ICONT = -0.05 !initial contact closure [0] band size (neg. absolut)" \n
  "rmod,Contact,5,Icont !ICONT:amount of initial contact closure (positiv:penetration)" \n
  \n
  "CNOF = 0 !contact surface offset ([0], neg.: penetr.)" \n
  "rmod,Contact,10,Cnof !CNOF (thickness effects):contact normal offset (e.g. beams)" \n
  \n
  "keyo,Contact,5,4 !EFFEKT of CNOF (surface offset) or ICONT (node movement in a band)" \n
  " !! 0: no adjustm." \n
  " !! 1: close gap with auto CNOF" \n
  " !! 2: reduce penetr. w. auto CNOF" \n
  " !! 3: close gap/red. pene. w. auto CNOF" \n
  " !! 4: auto ICONT" \n
  "keyo,Contact,9,4 !HANDLING of initial penetration/gap and CNOF" \n
  " !! 0: include everything" \n
  " !! 1: remove everything" \n
  " !! 2: include everyth. ramped" \n
  " !! 3: include offset only" \n
  " !! 4: incl. offset only, ramped" \n
  "keyo,Contact,10,2 !Stiffness UPDATE,[0]:each LS,2:each NR iteration,1:each substep" \n
  "keyo,Contact,11,1 !SHELL thickness effect" \n
  "keyo,Contact,12,0 !BEHAVIOUR,[0]:frictional/-less,1:rough,2:no separation,3:bonded" \n
  "real,Contact" \n
  \n
  "rmod,Contact,11,-1 !FKOP contact opening stiffness & contact damping, must be neg." \n
  \n
  "mp,mu,Contact,Mu !friction factor" \n
  "mat,Contact" \n
  \n
  "!@@ -- contact generation --" \n
  \n
  "type,Contact" \n
  "real,Contact" \n
  "esurf !,,top ![default] beam element's top direction" \n
  "esurf !,,bottom ! for beam elements top direction" \n
  "esurf !,,reverse ! reverse dir. on existing elem." \n
  "!! -- Target generation --" \n
  "type,Target" \n
  \n
  "!! check of contact normals" \n
  "esel,s,type,,Contact" \n
  "esel,a,type,,Target" \n
  "/psymb,esys,1" \n
  "eplot" \n
  \n
  "enorm ! change the underlying elem." \n
  \n
  "!@@@ - check contact status -" \n
  \n
  "cncheck !list contact pari properties" \n
  "cncheck,summary !list only open/closed status" \n
  "cncheck,adjust !adjust physically the elements!" \n
  "/solu" \n
  "cncheck,post !write contact config to jobname.rcn" \n
  \n
  "/post1" \n
  "/inquire,Job_name,jobname!get string array jobname|directory|user|psearch" \n
  "/inquire,param,date,file,ext !get date(size,lines) of file.ext"\n
  "save"\n
  "file,Job_name(1),rcn ! set result file to file.rcn" \n
  "set,first" \n
  "plnsol,cont,gap,0,1" \n
  "esel,s,type,,Contact" \n
  "etable,Stat,cont,stat !3-closed sticking" \n
  " !2-closed sliding" \n
  " !1-open near" \n
  " !0-open far" \n
  "!/efacet,2" \n
  "plls,stat,stat" \n
  "etable,Pene,cont,pene !pres|sfric|stot|slide|gap|flux|cnos|fprs" \n
  "plls,Pene,Pene !line element results" \n
  "resume,Job_name,db" \n
  )

(define-skeleton ansys-skeleton-rigid-target ;NEW
  ""
  nil
  "\n!! ------------------------------" \n
  "!@@ -- rigid target creation -- " \n
  \n
  "Contact="_ \n
  "Target=Contact+1" \n
  "real,Contact" \n
  "type,Target" \n
  "!!tshap,arc !clockwise arc" \n
  "!!tshap,cone" \n
  "!!tshap,quad" \n
  "!!tshap,sphere" \n
  "!!tshap,qua8" \n
  "tshap,line" \n
  "*get,Nmax,node,,num,max" \n
  "n,Nmax+1,1,1,0" \n
  " ,Nmax+2,1,2,0" \n
  "e,Nmax+1,Nmax+2" \n
  "tshap,pilo" \n
  "e,Nmax+1" \n
  )

(define-skeleton ansys-skeleton-coordinates
  ""
  nil
  "\n!@@@ - coordinate system display -" \n
  \n
  "!csys ![0]:cartesian, 1:cylindrical, 2:spherical, 3:toroidal, 4:wp" \n
  "!clocal,11,0 !define local coord. sys. from active" \n
  "!psymb,cs,1 ! display local coord."
  "/plopts,wp,1 !display working plane" \n
  "/plopts,wp,off !switch off wp" \n
  "/plopts,frame,off !switch off graphics frame" \n
  "/plopts,logo,off !switch off Ansys logo" \n
  "/triad,rbot"_ \n
  "/triad,off"
  )

(define-skeleton ansys-skeleton-working-plane
  ""
  nil
  "\n!@@@ - working plane setup -" \n
  \n
  "/plopts,wp,1 !display working plane" \n
  "/repl" \n
  "wpcsys,1,0 !align wp in WIN with specified c-sys" \n
  "wpoffs,,-100 !x,y,z offset" \n
  "wprota,0,90,0 !z,x,y axis of rotation" \n
  "/plopts,wp,off !switch off wp" \n
  "/plopts,frame,off !switch off graphics frame" \n
  "/plopts,logo,off !switch off Ansys logo" \n
  "wpstyl,,,,,,1 !type spec 0,1,2 cartesian,cylindrical,spherical" \n
  "wpstyl,,,,,,,0 !grid spec: 0 grid+triad,1 grid,2 [triad]" \n
  "!wpstyl,stat" \n
  "csys,wp !change co to wp" \n
  )

;; PlotCtrls ->Multi-plot-Ctrls???
(define-skeleton ansys-skeleton-multi-plot
  ""
  nil
  "\n!@@@ - multiplot controls -" \n
  \n
  "/gcmd,1,u,sum" \n
  "/gtype,all,node,0 !turn off nodes (elem,keyp,line,area)" \n
  "/gtype,,volu,1 !turn on volumens" \n
  "gplot" \n
  )

;; PlotCtrls ->Numbering Controls
(define-skeleton ansys-skeleton-numbering-controls
  ""
  nil
  "\n!@@@ - numbering controls -" \n
  \n
  "/pnum,kp,1 !line;area;volu;node;elem;mat;type;tabn;sval,on" \n
  "/number,1 ![0]: colour & number, 1:colour only, 2 number only" \n
  "/replot"
  )

;; PlotCtrls -> Symbols
(define-skeleton ansys-skeleton-symbols
  ""
  nil
  "\n!@@@ - symbol display -" \n
  \n
  "/pbc,all,,1 !bc symbols"\n
  "/psf,pres,,2 !2 arrows, surface loads" \n
  "/pbf !body loads" \n
  "/pice !element initial condition symbols" \n
  "/psymb,esys,1 ![0],1: display of element co-ordinate sys." \n
  "/psymb,ndir,1 !only for rotated nodal co-ordinate systems!" \n
  "/psymb,stat" \n
  "/repl" \n
  )

(define-skeleton ansys-skeleton-element-table
  ""
  nil
  "\n!! ------------------------------" \n
  "!@@ -- etables --" \n
  \n
  "!! etables don't take into account higher element order!"
  "!! ---- Mohr-Coulomb failure criterion" \n
  "Z1 = 60 !tensile strength" \n
  "Z3 = 160 !compressive strength" \n
  "etable,S1,s,1" \n
  "etable,S3,s,3" \n
  "sadd,R,S1,S3,1/Z1,-1/Z3" \n
  "sexp,X,S1,,-1 !warning: sexp uses modulus of S!!!!!" \n
  "pletab,R,avg !avg: average over nodes" \n
  "esel,s,type,,2" \n
  "etable,Pene,cont,pene" \n
  "!etable,chat,cont,cnos !chattering levels" \n
  "!etable,cpre,cont,pres"\n
  "!plls,Pene,Pene !line elem. results" \n
  "esort,etab,R" \n
  "etable,refl !refill all element tables for latest load set" \n
  "*get,Mc,etab,sort,,max" \n
  "*msg,,Mc" \n
  "Mohr-Coulomb criterion (< 1): %G" \n
  )

(define-skeleton ansys-skeleton-element-def
 ""
 nil
 "\n!! ------------------------------" \n
 "!@@ -- element definition --" \n
 \n
 "Steel = 1" \n
 "ID=Steel" \n
 "real=Steel" \n
 "et,ID,solid186 !3d, 20 node" \n
 "etlist !list defined elements" \n
 "et,ID,solid185 !3d, 8 node" \n
 "et,ID,plane183,,,3 !2d, 8 node (3)0:plane stress, 1:axissymmetric, 2:plane strain, 3:plane stress with thickness real constant" \n
 "r,ID,13 ! thickness" \n
 "et,ID,plane182 !2d, 4 node"\n
 "keyopt,ID,3,1 !(3)=0:plane stress,1:axissym,2:plain strain." \n
 "keyopt,ID,1,0 !(1)=0:reduced integr.2:enhanced strain for bending" \n
 "!!for most elements the radial direction is the x-axis" \n
 \n
 "!! --- shells and planes ---" \n
 "et,ID,shell181 !4 node structural shell" \n
 "et,ID,plane182 !2d 4 node structural solid" \n
 "et,ID,plane183 !2d 6 node structural solid" \n
 \n
 "!! --- thermal ---" \n
 "et,ID,solid90 !3D 20 nodes thermal solid" \n
 \n
 "!! --- magnetics ---" \n
 "et,ID,plane13 !2d, legacy coupled-field ->plane53" \n
 "keyopt,ID,3,1 !(3)=1:axissym." \n
 "keyopt,ID,5,2 !(5)=2:nodal magnetic field printout" \n
 "et,ID,infin110 !2d semi infinit electromagnetic elem." \n
 "!only 1 element layer, sized in the order of the problem domain" \n
 "keyopt,ID,3,1 !(3)=1:axissym." \n
 "keyopt,ID,2,1 !(2)=0:4-node,1:8-n" \n
 \n
 "!! --- assign attributes ---" \n
 "aatt,MAT,REAL,TYPE ! associate prop. with selected areas" \n
 \n
 "!! /pnum,type,1 $ eplot ! display materials" \n
)

(define-skeleton ansys-skeleton-meshing
  ""
  nil
  "\n!! ------------------------------" \n
  "!@@ -- meshing --" \n
  \n
  "!! mat,Steel" \n
  "mshkey,1 !1: mapped meshing,2: mapped if possible" \n
  "mshape,0,3d !0: quads/hex 1:tri/tets, dimensions: 2d/3d" \n
  "esize,1 ! element edge length" \n
  "aesize,ANUM,SIZE ! element SIZE on area ANUM (or ALL)" \n
  "lesize,all,,,3 ! SPACE neg: center to end division" \n
  "lcomb,all !combine adjacent lines" \n
  "ldiv,all,1 !divide a single line" \n
  "lccat,all !concatenate lines for meshing" \n
  \n
  "esys,12 !set element coordinates for a and v elements to 12" \n
  "vmesh,all" \n
  "amesh,all" \n
  "shrink,.8 !shrink elements,l,a,v"\n
  "lsel,s,lcca !select all concatenated lines" \n
  "ldele,all" \n
  "!! -- cyclic symmetric meshing --" \n
  "cyclic ! check sectors in case of cyclic sym." \n
  "*status ! look for CYCLIC_XREF" \n
  "cyclic,status" \n
  "/cycexpand ! expand graphics rep." \n
  \n
  "/pnum,mat,1 $ eplot" \n
  )

(define-skeleton ansys-skeleton-function
  "Standard FORTRAN functions"
  nil
  "A = ABS()" \n
  "A = SIGN() !sign(absolute_value,sign)" \n
  "A = EXP()" \n
  "A = LOG()" \n
  "A = LOG10()" \n
  "A = SQRT()" \n
  "A = NINT() !nearest integer" \n
  "A = abs(nint()) !round" \n
  "A = MOD() !mod(x,y): modulo x/y" \n
  "A = RAND() !rand(lower_bound,upper_bound)" \n
  "A = GDIS() !gdis(mean,stdd): gaussian distribution" \n
  "A = SIN()" \n
  "A = COS()" \n
  "A = TAN()" \n
  "A = SINH()" \n
  "A = COSH()" \n
  "A = TANH()" \n
  "A = ASIN()" \n
  "A = ACOS()" \n
  "A = ATAN()" \n
  "A = ATAN2()!gdis(mean,stdd): gaussian distribution"\n
  )

(define-skeleton ansys-skeleton-geometry
  ""
  nil
  "\n!! ------------------------------" \n
  "!@@ -- geometry --"\n
  \n
  "/prep7" \n
  "rectng,X1,X2,Y1,Y2 ! 2d rectangle" \n
  "block,X1,X2,Y1,Y2,Z1,Z2 !3d hexahedron (wp)" \n
  "!!arsym,y,all ! reflection of areas "
  "Xc = 0" \n
  "Yc = 0" \n
  "R1=4" \n
  "R2=20" \n
  "N = 14." \n
  "Alpha1=-360./(2*N)" \n
  "Alpha2=+360./(2*N)" \n
  "Depth=30" \n
  "pcirc,R1,R2,Th1,Th2 ! circular area" \n
  "cyl4,Xc,Yc,R1,Alpha1,R2,Alpha2,Depth ! circular area or cylinder" \n
  "shpere,Rad1,Rad2,Th1,Th2 !spherical volume" \n
  "cylind,R1,R2,Z1,Z2,Th1,Th2 !cylinder V>0! " \n
  \n
  "!@@@ - operations -" \n
  "vdele,all,,,1 ! delete everything below" \n
  \n
  "!@@@ - booleans -" \n
  \n
  "aovlap,all ! overlap areas" \n
  "asba,A1,A2,SEPO,KEEP1,KEEP2 ! SEPO: seperate entities" \n
  "asbw, !substract by wp" \n
  "/pnum,area,1 $ aplot" \n
  "vglue,all" \n
  "vsbw,all,,delete !v substracted by wp" \n
  "vdele,all,,,1 !skwp 1:delete kp,l,a as well" \n
  )

(define-skeleton ansys-skeleton-material-def
  ""
  nil
  "\n!@@ -- material definitions --" \n
  \n
  "Steel=1" \n
  "mp,nuxy,Steel,0.3 ! Poisson No" \n
  "mp,ex,Steel,200000 ! Elastic modulus" \n
  "AlphaSteel = 12e-6 ! thermal expansion in 1/K" \n
  "mp,alpx,Steel,AlphaSteel !secant modulus of therm. exp.!" \n
  "!mp,ctex,Steel,12e-6 ! instantaneous coofficient of therm. exp." \n
  "KSteel = 60.5 !conductivity in W/(mK)" \n
  "mp,kxx,Steel,KSteel" \n
  "mplist,all" \n
  "mpplot,ex,Steel,100,500 !plots mat. vs temp." \n
  "tb,biso,Steel,1 ! bilinear isotropic plasticity" \n
  "Yield_stress = 160" \n
  "Tensile_strain = 0.3" \n
  "True_tensile_strain = log( 1+Tensile_strain)" \n
  "Tensile_stress = 260" \n
  "True_tensile_stress = Tensile_stress*(1+Tensile_strain)" \n
  "Tangent_modulus = (True_tensile_stress-Yield_stress) / True_tensile_strain" \n
  "tbdata,,Yield_stress,Tangent_modulus" \n
  "tblist !list data tables" \n
  "tbplot,biso,Steel" \n
  "/com, === Material %Steel% is steel. ===" \n
  "Alu=2" \n
  "mp,nuxy,Alu,0.3" \n
  "mp,ex,Alu,70000" \n
  "tb,biso,Alu,1" \n
  "tbdata,,Yield_stress,Tangent_modulus" \n
  "mptemp !erase temperature table" \n
  "mptemp,,-100,0,100,200 !4 temperatures" \n
  "mpdata,kxx,Alu,,114,144,165,175 !conductivities in W/(mK)" \n
  "mptemp" \n
  "/com, === Material %Alu% is Aluminium. ===" \n
  "Air=3" \n
  "mptemp,,-150,0,100,200,300,500,1000" \n
  "mpdata,kxx,Air,,.012,.0243,.0314,.0386,.0454,.057,.0662" \n
  "mptemp" \n
  \n
  "!! -- orthotropic linear material --" \n
  "esel,s,mat,,bla" \n
  "emodif,all,esys,12 !modify esys" \n
  "mp, e{x,y,z}, Steel, VAL" \n
  "mp, alp{x,y,z}, Steel, VAL !in element co-ordinate system" \n
  \n
  "!! --- Elastomers (hyperelasticity) ---" \n
  \n
  "!! --- Neo Hook ---" \n
  "!! for 30 % strain" \n
  "Shore = 60" \n
  "ShearModule = 0.086*1.045**Shore !guestimate" \n
  "NeoHook = 1" \n
  "tb,hyper,NeoHook,,,neo" \n
  "BulkModulus = 2000" \n
  "tbdata,1,ShearModulus,1/(2*BulkModulus)" \n
  \n
  "!! --- Mooney-Rivlin ---" \n
  "!! for 30 % compression 100 % tension strain" \n
  "Mooney = 2" \n
  "tb,hyper,Mooney,,,MOONEY" \n
  "tbdata,1,3*ShearModule/6.6" \n
  "tbdata,2,.3*ShearModule/6.6" \n
  "!! -- check whether to drop elem. midside nodes and use u-p formulation" \n
  "!! -- u-p is not needed in plane stress configurations!" \n
  "keyopt,Mooney,6,1 !(6)1: mixed u-p formulation" \n
  "!! --- Ogden for high strain applic. (700 % strain) ---" \n
  "Ogden = 3" \n
  "tb,hyper,Ogden,1,2,OGDEN !2nd order Ogden model" \n
  "tbdata,1,3.5809,1.05e-9,3.8485e5" \n
  "tbdata,4,-2.2e6,-.8778,0" \n
  \n
  "!! --- Magnetic materials ---" \n
  "Air = 4" \n
  "mp,murx,Air,1 ! murx permeability" \n
  "Magnet = 5" \n
  "Hc = 2.8e5 ! ferrit magnet coercive force in A/m" \n
  "mp,mgxx,Magnet,Hc " \n
  "Pi = acos(-1)" \n
  "Mu0 = .4*Pi*1e-6 ! field constant in Vs/(Am)" \n
  "Br = .4 ! residual induction in Tesla" \n
  "mp,murx,Magnet,Br/(Mu0*Hc)" \n
  \n
  "/pnum,mat,1 $ eplot"\n
  )

(define-skeleton ansys-skeleton-bc
  ""
  nil
  "\n!@@ -- boundary conditions --"\n
  \n
  "/prep7" \n
  \n
  "kbc,1 ![0](antype,static):ramped, 1:stepped loading" \n
  \n
  "!@@@ - DOF constraints -" \n
  \n
  "nsel,s,loc,y,0" \n
  ",a,loc,y,1" > \n
  ",r,loc,x,0" > \n
  "d,all,all!dk,dl,da" \n
  "dlist,all" \n
  \n
  "!@@@ - concentrated loads -" \n
  "f,all,fx,1 !fk" \n
  "flist,all !fklist" \n
  \n
  "!@@@ - surface loads -" \n
  "sf,all,pres,1 !surface loads on nodes" \n
  "sflist,all" \n
  "sfe,all" \n
  "sfl,all" \n
  "sfa,all,,pres," \n
  "sfalist,all" \n
  \n
  "!@@@ -body loads-" \n
  "tref,23 ![0] degree reference temperature" \n
  "tunif,30 !uniform temperature (default step applied!)" \n
  "bf,all,temp,30 !bfe,bfk,bfl,bfa,bfv" \n
  "bflist,all !list body loads" \n
  \n
  "!@@@ - inertia relief -" \n
  \n
  "!! LOADS: nonlinearities aren't supported, fix all DOFs!" \n
  "irlf,1 !0: none,1:ir on,-1:printout masses" \n
  "nsel,s,loc,x,1" \n
  \n
  "!@@@ - corriolis effects -" \n
  \n
  "cgmga,x,y,z, ! rotational velocity about globla coord. sys." \n
  "dcgomg,x,y,z ! rotational acceleration about global coord. sys." \n
  \n
  "!@@@ - coupling -" \n
  "nsel,s,loc,x,1" \n
  "cp,next,uy,all !couple dofs" \n
  \n
  "allsel" \n
  "/pbc,all,on" \n
  "gplot" \n
  \n
  "!@@@ - magnetics -" \n
  \n
  "!! fmagbc,'Component' ! flag force calculation" \n
  "bfa,all,js, ! js current density" \n
  "bflist,all" \n
  "dl,all,,asym ! flux parallel to lines" \n
  "nsel,s,ext ! select exterior nodes" \n
  "dsym,asym ! flux parallel to lines" \n
  )

(define-skeleton ansys-skeleton-buckling
  ""
  nil
  "\n!! ------------------------------" \n
  "!@@ - buckling -" \n
  \n
  "!! -- static --"
  "/solu" \n
  "allsel" \n
  "outres,all,all" \n
  "pstres,on" \n
  "solve" \n
  "" \n
  "!! -- buckling --" \n
  "" \n
  "fini $ /solu" \n
  "antype,buckle" \n
  "bucopt,lanb,3" \n
  "outres,all,all" \n
  "solve" \n
  "fini $ /solu !switch to another loadstep?" \n
  "expass,on" \n
  "mxpand,3" \n
  )

(define-skeleton ansys-skeleton-solve
  ""
  nil
  "\n!! ------------------------------" \n
  "!@ --- solution --- " \n
  "!! ------------------------------" \n
  \n
  "/solu" \n
  "allsel" \n
  \n
  "solcontrol,on! optimised nonlinear solution defaults" \n
  "!! implies /kbc,0: ramped loading" \n
  "n1=20" \n
  "n2=n1*100" \n
  "n3=n1/4" \n
  "nsubst,n1,n2,n3"\n
  "outres,all,all"\n
  "antype!,,rest, !rest: perform restart operation" \n
  "nlgeom,on" \n
  "autots,on" \n
  \n
  "solve" \n
  \n
  "cnvtol,u,,0.1! convergence [0.5 % solcontrol, on: 5 %] manipulation" \n
  "cnvtol,f,,0.05 !solcontol,on: [0.5% F,M; 5% U]" \n
  "neqit,30! No of equilibr. iterations"
  "nldiag,nrre,on! store residual file" \n
  "nldiag,maxf,2! maximum files written" \n
  "rescontrol,,1,last !create restart file(s)" \n
  ",status" > \n
  "/config,nres,2000 !No of substeps in result file [1000]" \n
  "/solu" \n
  \n
  "nlhist,on !nonlinear tracking in .nlh" \n
  "eqslv,pcg,1e-4" \n
  "nropt,unsym !frictional contacts not converging?" \n
  "coupling of sliding and normal stiffness" \n
  "stabilize,constant,energy,1e-4 !constant over LS" \n
  "stabilize,reduce,energy,1e-4 !reduce to the end of LS" \n
  "stabilize !decactivate stabilisation" \n
  "arclen,on ! arclen stabilisation" \n
  \n
  "/runst !enter the run statistics processor" \n
  "rall !run statistics estimator" \n
  \n
  "rescontrol,file_summary !check restart files" \n
  "antyp,,rest,1,last"\n
  "time,1.2 !time at the end of load step" \n
  \n
  "!@@ -- magnetics --" \n
  \n
  "magsolv" \n
  \n
  "!@@ -- cyclic symmetry --" \n
  \n
  "cycopt,status" \n
  )

(define-skeleton ansys-skeleton-post1
  ""
  nil
  "\n!! ------------------------------" \n
  "!@ --- post 1 ---" \n
  "!! ------------------------------" \n
  \n
  "/post1" \n
  "/inquire,job_name,jobname" \n
  "!resume,job_name,db" \n
  "set,last" \n
  "plnsol,u,sum,2 !0:deformed only, 1:with undef model 2:with undeformed edges" \n
  "plnsol,s,eqv ! von Mises" \n
  "plnsol,s,1 ! maximum principle: Lamé" \n
  "plnsol,s,int ! stress intensity: Tresca" \n
  "plnsol,s,xy ! shear in xy-dir." \n
  "plnsol,epto,1!principal total mechanical strain (excluding thermal) (EPEL + EPPL + EPCR)," \n
  "!! reactions"\n
  "fsum !force sum from all selected nodes"\n
  "*get,Fy,fsum,,item,fy" \n
  "*get,T,active,,set,time" \n
  "nforce !list of all nodal forces" \n
  "/gcolumn,1,'Reaction'" \n
  "/axlab,x,Substep" \n
  "/axlab,y,Force in N" \n
  "/gropt,fill,1 ! fill curves" \n
  "*vplot,,Reaction" \n
  \n
  "/dscale,,1 !do not scale (for nlgeom)" \n
  "/dscale,,auto !or 0:scale automatically" \n
  "*get,Ds,graph,WN,dscale,dmult" \n
  "/contour,,ncont,min,inc,max" \n
  "/contour,,auto !switch off user contours" \n
  "/edge,,1 !1:display elements in contour plots" \n
  "/edge,,0 !0:switch off display of elements in contour plots" \n
  "/plopts,minm,off !switch off min-max symbols" \n
  "/plopts,minm,on" \n
  "/pbc,rfor,,1 !1:show reaction f. symbols" \n
  "/pbc,rfor,,0" \n
  "/dist,,1/2,1 !enlarge twice" \n
  "/noerase ! don't erase screen between plots" \n
  "erase"
  "/triad,rbot ! coordinate system to right bot" \n
  "/plopts,wp ! switch off working plane" \n
  "/plopts,minm ! switch off min max" \n
  \n
  "/image,save,test !save XWindow Dump xwd (or bmp on Windows)" \n
  "/sys,convert test test.png" \n
  "!! -- graphics output & invert background colour --" \n
  "/RGB,index,100,100,100,0" \n
  "/RGB,index,0,0,0,15" \n
  "/show,png !creates jobnameXXX.png files" \n
  "pngr,stat !additional png options (orientation,compression,...)" \n
  "plvect,B" \n
  "noerase" \n
  "lplot" \n
  "/show,close" \n
  "erase" \n
  \n
  "/efacet,2" \n
; "psdisp,0" \n
  "/graphics,full ! results averaging also from interior" \n
  "pletab,Pene" \n
  "plls,Pene,Pene !line element results" \n
  "!@@@ --- magnetics ---" \n
  "plf2d,27 ! flux lines, equipotentials" \n
  "plvect,b,! induction vector plot" \n
  "fmagsum,'component_name'" \n
  \n
  "nldpost,nrre,stat !element information nonlinear" \n
  "plnsol,nrre,,,,001 !plot residual file .nr001 " \n
  "etable,Pene,cont,pene" \n
  "etable,chat,cont,cnos" \n
  "etable,cpre,cont,pres" \n
  "etable,Slid,cont,slide" \n
  "etable,St,cont,stat !3-closed sticking" \n
  "!! !2-closed sliding" \n
  "!! !1-open but near" \n
  "!! !0-open and far, outside pinball" \n
  "set,list" \n
  "set,last!first,next,previous" \n
  "set,2,last ! set,last,last does not work!" \n
  "plnsol,s,1" \n
  "antime" \n
  "andata" \n
  "anmres !multiple result files" \n
  \n
  "!! cycexpand,on ! graphical expansion" \n
  )

(define-skeleton ansys-skeleton-output-to-file
  ""
  nil
  "\n!! ------------------------------" \n
  "!@@ -- output to file --" \n
  \n
  "! redirect ansys text output to file" \n
  "/output,test,txt,,append !append solver output to file" \n
  "/com,# dist from center | axial mag. induction" \n
  "*vwrite,B(1,1),B(1,2)" > \n
  "%G %G" \n
  "/output ! redirect to screen" \n
  \n
  "! macro file" \n
  "*create,test.txt ! macro file, no parameter substitution!" \n
  "*end !up to this command" > \n
  "!! can be used with the *use command to pass params into it" \n
  "!! /input does not allow parameters" \n
  \n
  "! create data file" \n
  "*cfopen,test,txt,,append ! appending to file" \n
  "*cfwrite,A=5 ! interpreted output" \n
  "*set strings are limited to 32 characters!!!" \n
  "Strg1='# cylindrical magnet: radius = %Rad%'" \n
  "Strg2=', lenght = %Len%'" \n
  "Strg3='# distance, magnetic induction'" \n
  "*vwrite,Strg1, Strg2, Strg3" \n
  "%S %S% %S" \n
  "*vwrite,B(1,1),B(1,2)" > \n
  "%E %E" > \n
  "*cfclos ! close file" \n
  "/input,test,txt,,:label ! read from label onwards"\n
  \n
  "!! graphical output" \n
  "/RGB,index,100,100,100,0" \n
  "/RGB,index,0,0,0,15" \n
  "/show,png !creates jobnameXXX.png files" \n
  "pngr !additional options" \n
  "plvect,B" \n
  "noerase" \n
  "lplot" \n
  "/show,close" \n
  )

;TODO: explain what's it for
(define-skeleton ansys-skeleton-select
  ""
  nil
  "\n!@@@ - select stuff -" \n
  \n
  "!! lowest face No of element E from selected nodes"
  "a=nmface(E) !plane elements:faces =^= el. sides" \n
  "node in POS of element E" \n
  "bla=nelem(E,POS) !pos. ijklmnop =^= [1:8]" \n
  "!unsel midnodes of 8-node 2d elem" \n
  "*get,En,elem,,count" \n
  "*get,E,elem,,num,min" \n
  "*do,I,1,En,1" \n
  " Face = nmface(E)" \n
  " Ntmp = ndface(E,Face,3)" \n
  " nsel,u,,,Ntmp" \n
  " *get,E,elem,E,nxth" \n
  "*enddo " \n
  )

(define-skeleton ansys-skeleton-path-plot
  ""
  nil
  "\n!! ------------------------------" \n
  "!@@ -- path plot --" \n
  "!! avoid element borders for inaccuracies of the rounding algorithm." \n
  \n
  "path,Name,nPts[2],nSets[30],nDiv[20] ! define active path \"Name\"" \n
  "!ppath,P,N,x,y,z,CS coord. in global cartesian csys, but use CS for path" \n
  "ppath,1" \n
  "ppath,2,,,Rair" \n
  "psel,s,axis,... !select multiple paths" \n
  "pdef,By,b,y" \n
  "pcalc,add,By2,By,,2 !multiply By by 2" \n
  "/axlab,x,distance !axis label" \n
  "plpath,By !plot in graph" \n
  "plpagm,By,5 !plot on geom." \n
  "!write into table variable content: x,y,z,path length?,v1,v2,..." \n
  "paget,Path,table" \n
  "!path $ stat" \n
  )

(define-skeleton ansys-skeleton-post26
  ""
  nil
  "\n!! ------------------------------" \n
  "!@ --- time-history postprocessing ---" \n
  "!! ------------------------------" \n
  \n
  "/post26" \n
  "numvar,200 !maximum No of variables"
  "esol,2,1,,u,z,'displ z'" \n
  "nsol,2,1,u,z" \n
  "filldata,7,1,10,,20 !fills a variable by a ramp or constant"\n
  "rforce,3,1,f,z" \n
  "add,4,2,,,displ,,,-1" \n
  "/grid,1" \n
  "/gmarker,1,1 !curve marking: 1: triangles,2: squares" \n
  "/xrange,0,1" \n
  "/xrange,default" \n
  "/yrange,0,1" \n
  "/axlab,x,x" \n
  "/axlab,y,y" \n
  "/gthk,curve,3!set line thickness" \n
  "timerange,0,1" \n
  "/title,bla" \n
  "/stitle,,blabla !subtitle line 1 (not shown in plot)" \n
  "/stitle,2,blabla !subtitle line 2" \n
  "/tlable,x,y,bla !annotation at (x,y)" \n
  "xvar,2" \n
  "!! invert background colour" \n
  "/RGB,index,100,100,100,0" \n
  "/RGB,index,0,0,0,15" \n
  "/show,png !creates jobnameXXX.png files" \n
  "plvar,3" \n
  "/show,close" \n
  "!!prvar,3" \n
  )

;; TODO: complete
(define-skeleton ansys-skeleton-array
  "arrays"
  nil
  "\n!! ------------------------------" \n
  "!@@ -- table arrays --" \n
  "!! table arrays are *set with integers" \n
  "!! and accessed with real indices" \n
  "NSS=100" \n
  "*dim,F_y,table,NSS,3! three columns" \n
  "F_y(0,1) = 1,2,3 ! column 'index'" \n
  "*do,I,1,NSS" \n
  " set,1,I" \n
  " fsum" \n
  " *get,Tim,active,,set,time" \n
  " Strain = Tim*100*Displ/Leng" \n
  " F_y(I,0) = Strain ! row 'index'" \n
  " *get,Forc,fsum,,item,fy" \n
  " F_y(I,1) = Forc/(Width*Thick)" \n
  "*enddo" \n
  "!@@ -- arrays --" \n
  \n
  "*dim,A,,10,1 ! type array is default, No of rows, No of columns" \n
  "B = !deleting before redimensioning necessary" \n
  "*dim,B,table,10,1,1,TIME !table type interpolating" \n
  "B(1,0,1) = 0." \n
  "B(2,0,1) = 1." \n
  "*get,A,x,,item,fx" \n
  \n
  "*get,Nn,node,,count" \n
  "*vget,PAR,node,,nlist! array of nodenumbers" \n
  "A = 1,2,3,4,5" \n
  \n
  "!! -- check dimensions --" \n
  "*get,Dim,parm,A,dim,x" \n
  "*if,Dim,le,1,then" \n
  "*dim,A,array,10,1" > \n
  "*endif" > \n
  "*do,I,1,Ns" \n
  "set,Ls,I" > \n
  "fsum" \n
  "Reaction(I)=Fx" \n
  "*enddo" > \n
  "!! -- plotting --" \n
  "! arrays are plotted as histograms,tables are plotted as curves"
  "/gcol,1,'curve1'"\n
  "/gropt,fill,1 !fill lines"
  "/axlab,x,'x-variable in mm'" \n
  "/xrange,0,10 !xrange of plot"\n
  "*vplot,time(1,1),A(1,2)!plot column 2 of A " \n
  "/gmarker,1,3,10" \n
  "/gcolumn,1,'Neo-Hook'" \n
  "/gcolumn,2,'Mooney-R'" \n
  "/gcolumn,3,'Ogden'" \n
  "/gthk,curve,4 !curve thickness" \n
  "*vplot,F_y(1,0),F_y(1,1),2.0"
  )

(defun ansys-skeleton-compilation ()
  "Collection of important code templates for an APDL file."
  (interactive)
  (ansys-skeleton-header)
  (goto-char (point-max))
  (ansys-skeleton-import)
  (goto-char (point-max))
  (ansys-skeleton-configuration)
  (goto-char (point-max))
  (ansys-skeleton-geometry)
  (goto-char (point-max))
  (ansys-skeleton-material-def)
  (goto-char (point-max))
  (ansys-skeleton-element-def)
  (goto-char (point-max))
  (ansys-skeleton-meshing)
  (goto-char (point-max))
  (ansys-skeleton-bc)
  (goto-char (point-max))
  (ansys-skeleton-solve)
  (goto-char (point-max))
  (ansys-skeleton-post1))

;; TODO: warning dated
(define-skeleton ansys-skeleton ;NEW
  "Insert full framework of an Ansys APDL file."
  "Insert brief purpose of file: "
  "!" ansys-outline-string " ********* first line ***************\n"
  "!! FILENAME: " (buffer-file-name) \n
  "!! CREATION DATE: " (current-time-string) \n
  "!! ANSYS VERSION: " ansys-current-ansys-version \n
  "!! DESCRIPTION: " str \n
  "!! ------------------------------" \n
  "!! COMMENTARY: User parameters start in upper case." \n
  "!! Ansys command names may be ommitted (defaulting to the" \n
  "!! previous command, except slash and asterisk commands)." \n
  "!! WARNING: Variables starting with an underscore are reserved" \n
  "!! (for components and Ansys furnished macros, like" \n
  "!! the %_FIX% table name for current displacement values or" \n
  "!! the _RETURN and _STATUS variable (_STATUS: 0 no error, 1" \n
  "!! note, 2 warning, 3 error)!" \n \n
  "!! ==============================" \n
  "!" ansys-outline-string " --- Setup ---" \n
  "!! ==============================" \n
  \n
  "finish "\n
  "/clear" \n
  "y !necessary for /clear" \n
  \n
  "*get,Wallstrt,active,,time,wall" \n
  "c*** Configuring for 2 processors does not harm when only 1 is present" \n
  "/config,nproc,2" \n
  "/uis,msgpop,3 !3: No warning popup boxes" \n
  "*afun,deg !trig: funs accept degree args" \n
  "*afun,rad" \n
  "/title," _ \n
  "/plopts,wp,1 !display working plane" \n
  "/triad,rbot" \n
  "!! /output, !change solver output file" \n
  "!! /input," \n
  "/filname," (setq ansys-job (skeleton-read "Ansys jobname: " "file")) \n
  \n
  "!! ==============================" \n
  "!" ansys-outline-string " --- Preprocessing --- " \n
  "!! ==============================" \n
  \n
  "!! ------------------------------" \n
  "!" ansys-outline-string ansys-outline-string " --- Cad Import --- " \n
  "!! ------------------------------" \n
  \n
  "!! /aux15" \n
  "!! ioptn,iges,nodefeat" \n
  "!! ioptn,merge,yes" \n
  "!! ioptn,solid,yes" \n
  "!! ioptn,small,yes" \n
  "!! ioptn,gtoler,defa" \n
  "!! igesin,'test','iges'"\n
  \n
  "!! /input,fname,anf" \n
  "!! /facet,norm" \n
  \n
  "!! ------------------------------" \n
  "!" ansys-outline-string ansys-outline-string " --- General Preprocessing --- " \n
  "!! ------------------------------" \n
  \n
  "/prep7" \n
  "Pi=3.14159265359" \n
  \n
  "!! /pnum,area,1"\n
  \n
  "!! --- Materials and element types ---" \n
  "Steel=1" \n
  "Alu=2" \n
  "!! Contact = 3" \n
  "!! Target = 4" \n
  "mp,nuxy,Steel,0.3" \n
  "mp,ex,Steel,200000" \n
  "!! tb,biso,Steel,1" \n
  "!! yield_stress=140" \n
  "!! tangent_modulus=1400" \n
  "!! tbdata,,yield_stress,tangent_modulus !biso" \n
  "/com, === Material %Steel% is steel. ===" \n
  "et,Steel,solid186 !3d, 20 node" \n
  "!! et,Steel,solid185 !3d, 8 node" \n
  "!! et,Steel,plane183,,,0 !2d, 8 node (3)0:plane stress, 1:axissymmetric" \n
  "!! et,Steel,plane182 !2d, 4 node"\n
  "!! keyopt,Steel,3,1 !keyopt(3)=1:axissym." \n
  "!! for most elements the radial direction is the x-axis" \n
  \n
  "!! mp,nuxy,Alu,0.3" \n
  "!! mp,ex,Alu,70000" \n
  "!! tb,biso,Alu,1" \n
  "!! !! tbdata,,yield_stress,tangent_modulus !biso" \n
  "!! /com, === Material %Alu% is Aluminium. ===" \n
  "!! et,Alu,solid186 !3d" \n
  "!! !! et,Alu,plane183 !2d" \n
  "!! !! et,Alu,plane182 !2d 4 node" \n
  "!! !! keyopt,Alu,3,1 !0:plane stress, 1:axissym." \n
  \n
  "!! !! --- Contacts ---" \n
  "!! r,Contact" \n
  "!! et,Contact,conta174 !3d, 8 node" \n
  "!! !! et,Contact,conta173, !3d, 4 node" \n
  "!! !! et,Contact,conta172 !2d, 3 node" \n
  "!! !! et,Contact,conta171 !2d, 2 node" \n
  "!! et,Target,targe170 !3d" \n
  "!! !! et,Target,targe169 !2d, 2/3 node" \n
  "!! keyo,Contact,2,1 !algorithm 0:augm. Lagrange (default),1:penalty,2:MPC,4:pure Lagrange" \n
  "!! keyo,Contact,5,1 !initial contact closure,1:auto CNOF adjustment to close geometric gap only" \n
  "!! keyo,Contact,9,2 !initial penetration,1:ignore initial gaps/penetr 2:ramp" \n
  "!! keyo,Contact,10,2 !contact stiffness update,2:each NR iteration,1:each substep" \n
  "!! keyo,Contact,12,0 !contact behaviour,0:frictional/-less (default),1:rough" \n
  "!! real,Contact" \n
  "!! rmod,Contact,3,1. !FKN:normal penalty stiffness factor (default:1)" \n
  "!! rmod,Contact,5,0.0 !ICONT:amount of initial contact closure (positiv:penetration)" \n
  "!! rmod,Contact,6,-0.1 !PINB:pinball radius (negativ means no scaling:absolute distance)" \n
  "!! rmod,Contact,10,0. !CNOF:contact surface offset" \n
  "!! mp,mu,Contact,0.4 !friction factor" \n
  "!! rmod,Contact,12,0. ! FKT:tangent stiffness factor (corresp. to FKN),0:means 1 for Ansys!!!" \n
  \n
  "!" ansys-outline-string ansys-outline-string ansys-outline-string " --- Geometry ---" \n
  \n
  "bloc,0,1,0,1,0,1" \n
  "*get,A1,area,,num,max" \n
  "!! rectng,0,1,0,1 !x1,x2,y1,y2" \n
  "!! k,,1,0,0 & KN = _return !keypoint number" \n
  \n
  "!! /number,1 !0: colour and number,1: colour" \n
  "!! /pnum,line,1 !1: turn on numbering" \n
  "!! lplot" \n
  "!! lesize,1,,,3" \n
  \n
  "!! --- Meshing ---" \n
  \n
  "!! mat,Steel" \n
  "!! mshkey,1 !1: mapped meshing,2: mapped if possible" \n
  "!! mshape,0 !0: quadrilaterals" \n
  "esize,1" \n
  "vmesh,all" \n
  \n
  "!! amesh,all" \n
  \n
  "!! !! --- Rigid targets ---" \n
  \n
  "!! type,Target" \n
  "!! real,Contact" \n
  "!! tshap,line" \n
  "!! *get,Nmax,node,,num,max" \n
  "!! n,Nmax+1,1,1,0" \n
  "!! ,Nmax+2,1,2,0" \n
  "!! e,Nmax+1,Nmax+2" \n
  "!! tshap,pilo" \n
  "!! e,Nmax+1" \n
  \n
  "!! !! --- Contacts --- " \n
  \n
  "!! type,Contact" \n
  "!! real,Contact" \n
  "!! esurf !,,reverse !also 2d" \n
  \n
  "!! /pcb !bc symbols"\n
  "!! /psf !surface loads" \n
  "!! /pbf !body loads"
  "!! /psymb,esys,on !check element esys" \n
  "!! /psymb,ndir !only for rotated nodal co-ordinate systems!" \n
  "!! cncheck !initial contact status" \n
  \n
  "!" ansys-outline-string ansys-outline-string ansys-outline-string " --- boundary conditions --- " \n
  \n
  "nsel,s,loc,y,0" \n
  " ,a,loc,y,1" \n
  " ,r,loc,x,0" \n
  "d,all,all" \n
  "nsel,s,loc,x,1" \n
  "cp,next,uy,all !couple dofs" \n
  "f,1,fx,1" \n
  "allsel" \n
  "/pbc,all,on" \n
  \n
  "!! ==============================" \n
  "!" ansys-outline-string " --- solution --- " \n
  "!! ==============================" \n
  \n
  "/solu" \n
  \n
  "!! solcontrol,,on, ! ,,check contact state,pressure load stiffness"
  \n
  "!! n1=20" \n
  "!! n2=n1*100" \n
  "!! n3=n1/4" \n
  "!! nsubst,n1,n2,n3"\n
  "!! outres,all,all"\n
  "!! nlgeom,on" \n
  "!! autots,on" \n
  \n
  "!! rescontrol,,all,1 !restart files" \n
  "!! eqslv,pcg,1e-4" \n
  "!! cnvtol,f,,0.05 !solcontol,on: [0.5% F,M; 5% U]" \n
  "!! nropt,unsym !frictional contacts not converging?" \n
  "!! coupling of sliding and normal stiffness"
  \n
  "/eof ------------------------------" \n
  \n
  "/runst !enter the run statistics processor" \n
  "rall !run statistics estimator" \n
  "/solu" \n
  "*get,Wallasol,active,,time,wall" \n
  \n
  "solve" \n
  "y" \n
  "save $ finish" \n
  \n
  "*get,Wallbsol,active,,time,wall" \n
  \n
  "!! ==============================" \n
  "!" ansys-outline-string " --- Postprocessing ---" \n
  "!! ==============================" \n
  \n
  "!! ------------------------------" \n
  "!" ansys-outline-string ansys-outline-string
  " --- General Postprocessing --- " \n
  "!! ------------------------------" \n
  \n
  "/post1" \n
  \n
  "!! /dscale,,1 !do not scale (for nlgeom)" \n
  "!! /dscale,,auto !or 0:scale automatically" \n
  "!! !*get,Ds,graph,WN,dscale,dmult" \n
  "!! /contour,,ncont,min,inc,max" \n
  "!! /contour,,auto !switch off user contours" \n
  "!! /edge,,1 !1:display elements in contour plots" \n
  "!! /edge,,0 !0:switch off display of elements in contour plots" \n
  "!! /plopts,minm,off !switch off min-max symbols" \n
  "!! /plopts,minm,on" \n
  "!! /pbc,rfor,,1 !1:show reaction f. symbols" \n
  "!! /pbc,rfor,,0" \n
  "!! /expand,8,lpolar,half,,45 !polar symmetry expansion" \n
  "!! /expand,8,lpolar,half,,45 !polar symmetry expansion" \n
  "!! !half symmetry(mirrored) and then 8 x 45° offset!" \n
  "!! /expand,18,axis,,,10 !axis symmetry 180° expansion" \n
  "!! /expand !switch off expansion" \n
  "!! /dist,,1/2,1 !enlarge twice" \n
  "!! " \n
  \n
  "set,last" \n
  "/efacet,2" \n
  "plnsol,u,sum !,2 !2:overlay undeformed edges" \n
  \n
  "!! --- Birth & Death --- " \n
  "!! etable,strain,epto,1" \n
  "!! esel,s,etab,strain,0.02" \n
  "!! /solu" \n
  "!! antype,,rest"\n
  "!! ekill,all"\n
  "!! esel,all" \n
  \n
  "!! --- Reactions" \n
  "Ls=1" \n
  "set,Ls" \n
  "*get,Ns,active,,solu,ncmss !number of substeps" \n
  "*get,Dim,parm,Reaction,dim,x" \n
  "*if,Dim,le,1,then" \n
  "*dim,Reaction,array,Ns,1" \n
  "*endif" > \n
  "*do,I,1,Ns" \n
  "set,Ls,I" > \n
  "fsum" \n
  "*get,Fx,fsum,,item,fx" \n
  "Reaction(I)=Fx" \n
  "*enddo" > \n
  "/gcolumn,1,'Reaction'" \n
  "/axlab,x,Substep" \n
  "/axlab,y,Force in N" \n
  "/gropt,fill,1 ! fill curves" \n
  "*vplot,,Reaction" \n
  \n
  "!! --- Animations ---" \n
  "/seg,multi,process,0.15 !process.avi, delay .15" \n
  "Ls=1 !Loadstep 1" \n
  "!antime," \n
  "!andata," \n
  "set,LS" \n
  "*get,Ns,active,,solu,ncmss !number of substeps" \n
  "*do,I,1,Ns" \n
  "set,Ls,I" > \n
  "plnsol,s,eqv" \n
  "*enddo" > \n
  "/seg,off,process,.15" \n
  \n
  "!! --------- etables ----------" \n
  "!! etables don't take into account higher element order!"
  "!! ---- Mohr-Coulomb failure criterion" \n
  "Z1 = 60 !tensile strength" \n
  "Z3 = 160 !compressive strength" \n
  "etable,S1,s,1" \n
  "etable,S3,s,3" \n
  "sadd,R,S1,S3,1/Z1,-1/Z3" \n
  "pletab,R,avg !avg: average over nodes" \n
  "esort,etab,R" \n
  "*get,Mc,etab,sort,,max" \n
  "*msg,,Mc" \n
  "Mohr-Coulomb criterion (< 1): %G" \n
  \n
  "!! --- multiple graphics windows" \n
  "/window,1,rtop" \n
  "/window,2,ltop" > \n
  "/window,3,lbot" > \n
  "/window,4,rbot" > \n
  "/gtype,all,node,0 !switch off node display" > \n
  "/gcmd,1,pletab,s1" \n
  "/gcmd,2,pletab,s3" > \n
  "/gcmd,3,pletab,r,avg" > \n
  "/gcmd,4,plvect,s" > \n
  "gplot" > \n
  \n
  "/window,1,full" \n
  \n
  "!! --- cross section by working plane ---" \n
  "/cplane,1 !1:cutting plane is x-y-wp" \n
  "wpcsys,1,11 !align wp with specified c-sys" \n
  "wpoffs,,-100" \n
  "wprota,0,90,0 !z,x,y axis rotation" \n
  \n
  "/type,1,zcap ! z-buffered capping" \n
  "!! /type,1,zqsl ! z-bufferd capping with outlines" \n
  "!! /type,1,basic !switch off cross sections" \n
  \n
  "!! ------------------------------" \n
  "!" ansys-outline-string
  ansys-outline-string " --- Time-History Postprocessing ---" \n
  "!! ------------------------------" \n
  \n
  "/post26" \n
  "!! esol,2,1,,u,z,'displ z'" \n
  "nsol,2,1,u,z" \n
  "rforce,3,1,f,z" \n
  "!! add,4,2,,,displ,,,-1" \n
  "/grid,1" \n
  "/gmarker,1,1 !curve marking: 1: triangles,2: squares" \n
  "!! /xrange,0,1" \n
  "!! /xrange,default" \n
  "!! /yrange,0,1" \n
  "!! /axlab,x,x" \n
  "!! /axlab,y,y" \n
  "!! timerange,0,1" \n
  "!! /title,bla" \n
  "!! /stitle,,blabla !subtitle line 1" \n
  "!! /stitle,2,blabla !subtitle line 2" \n
  "!! /tlable,x,y,bla !annotation at (x,y)" \n
  "xvar,2" \n
  "!! invert background colour" \n
  "!/RGB,index,100,100,100,0" \n
  "!/RGB,index,0,0,0,15" \n
  "!/show,png !creates jobnameXXX.png files" \n
  "plvar,3" \n
  "!/show,close" \n
  "!!prvar,3" \n
  \n
  "!! ------------------------------" \n
  "!" ansys-outline-string
  ansys-outline-string " --- Time Stat Processing ---" \n
  "!! ------------------------------" \n
  \n
  "*get,Walldone,active,,time,wall" \n
  "Preptime=(Wallasol-Wallstrt)*60" \n
  "Solvtime=(Wallbsol-Wallasol)*60" \n
  "Totaltim=(Walldone-Wallstrt)" \n
  "*msg,ui,Preptime,Solvtime,Totaltim" \n
  "Time in min for preprocessing: %G %/ &" \n
  "Time in min for Solving: %G %/ &" \n
  "Total time in h: %G %/ &" \n
  "=== End of timing messages ===" \n
  \n)


(defmacro define-ansys-skeleton (command documentation &rest definitions) ;FIXME: documentation
  "Define COMMAND with an optional docstring DOCUMENTATION.
to insert statements as in DEFINITION ... Prior
DEFINITIONS (e.g. from ~/.emacs) are maintained. Each definition
is built up as (format PROMPT ELEMENT ...). Alternately a
synonym definition can be (format . PREVIOUSLY-DEFINED-FORMAT).

For the meaning of (PROMPT ELEMENT ...) see `skeleton-insert'.
Each DEFINITION is actually stored as
(put COMMAND format (PROMPT ELEMENT ...)), which you can
also do yourself."
  (unless (stringp documentation)
    (setq definitions (cons documentation definitions)
documentation ""))
  ;; The compiled version doesn't. FIXME: Doesn't what?
  (require 'backquote)
  (`(progn
      (let ((definitions '(, definitions)))
(while definitions
;; skeleton need not be loaded to define these
(or (get '(, command) (car (car definitions)))
(put '(, command) (car (car definitions))
(if (symbolp (cdr (car definitions)))
(get '(, command) (cdr (car definitions)))
(cdr (car definitions)))))
(setq definitions (cdr definitions))))
      (defun (, command) ()
(, documentation)
(interactive)
(skeleton-insert
(or (get '(, command) ansys-format)
(error "%s statement syntax not defined for ansys format %s"
'(, command) ansys-format)))))))

(define-ansys-skeleton ansys-if
  "Insert an if statement in the current format's syntax."
  (format "Value/Parameter 1: "
"*IF," str ","
(read-string "Operation: (EQ,NE,LT,GT,LE,GE,ABLT,ABGT) ")
","
(read-string "Value/Parameter 2: ")
","
(read-string "Action: (:label,STOP,EXIT,CYCLE,THEN,otto) ") ;FIXME: remove otto!
\n >_
"*ENDIF"
\n)
  (mac . format))


(define-ansys-skeleton ansys-if-then
  "Insert an if statement in the current format's syntax."
  (format "Value/Parameter 1: "
"*IF," str ","
(read-string "Operation: (EQ,NE,LT,GT,LE,GE,ABLT,ABGT) ")
","
(read-string "Value/Parameter 2: ")
",THEN" \n
> _ \n
("*ELSEIF? %s: " ;FIXME: here subskeleton!
> "*ELSEIF," str ","
(read-string "Operation: (EQ,NE,LT,GT,LE,GE,ABLT,ABGT) ")
","
(read-string "Next Value/Parameter: ")
",THEN" \n
> \n)
"*ELSE" > \n
> \n
"*ENDIF" > \n)
  (mac . format))

(define-ansys-skeleton ansys-do
  "Insert an if statement in the current format's syntax."
  (format "Parameter: "
"*DO," str ","
(read-string "Start Value/Parameter: ")
","
(read-string "Finish Value/Parameter: ")
","
(read-string "Increment Value/Parameter: ") \n
> _ \n
"*ENDDO" > \n)
  (mac . format))

(define-ansys-skeleton ansys-mp ;FIXME: skeleton a bit over the top
  "Insert an if statement in the current format's syntax."
  (format "Material Property: (EX,ALPX,PRXY,NUXY,GXY,DAMP,MU,DENS,KXX) "
"MP," str ","
(read-string "Material Number: ")
","
(read-string "Constant Value: ")
","
(read-string "Linear Coefficient? : ")
","
(read-string "Quadratic Coefficient? : ")
","
(read-string "Cubic Coefficient? : ")
","
(read-string "Quartic Coefficient? : ")
\n)
  (mac . format))

;;; ansys-template.el ends here
Something went wrong with that request. Please try again.