-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathapdl-template.el
3327 lines (3252 loc) · 117 KB
/
apdl-template.el
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
;;; apdl-template.el --- APDL code templates for the APDL-Mode -*- lexical-binding: t; -*-
;; Time-stamp: <2021-10-01 22:58:02 dieter>
;; Copyright (C) 2006 - 2021 H. Dieter Wilhelm GPL V3
;; Author: H. Dieter Wilhelm <[email protected]>
;; Maintainer: H. Dieter Wilhelm
;; Version: 20.7.0
;; Package-Requires: ((emacs "25.1"))
;; Keywords: languages, convenience, Ansys, tools, APDL
;; URL: https://github.com/dieter-wilhelm/apdl-mode
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; This code is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published
;; by the Free Software Foundation; either version 3, or (at your
;; option) any later version.
;;
;; This lisp script is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
;;
;; Permission is granted to distribute copies of this lisp script
;; provided the copyright notice and this permission are preserved in
;; all copies.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, you can either send email to this
;; program's maintainer or write to: The Free Software Foundation,
;; Inc.; 675 Massachusetts Avenue; Cambridge, MA 02139, USA.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Comment:
;; Convention used for outlining
;; !@ is surrounded by 30 equal signs !! ==============================
;; !@ === Title
;; !@@ by 30 dashes !! ------------------------------
;; !@@ --- Subtitle
;; !@@@ by 30 dots !! ..............................
;; !@@@ ... Subsubtitle
;; Separator lines with `s [SPACE]
;; !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Commentary:
;; Collection of APDL templates
;;; Code:
(require 'apdl-initialise)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; --- variables ---
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defcustom apdl-custom-template-directory
apdl-mode-install-directory
"Directory where your APDL template macros reside.
Collect your APDL macro files into this directory and define your
own templates with these in apdl-templates.el:
(define-skeleton apdl-skeleton-your-example-template
\"Your documentation for your example template.\"
nil
(insert-file
(concat apdl-custom-template-directory
\"your-example-template.mac\")))
Then you can preview or include it with C-c C-s, as the others.
"
:type '(directory)
:group 'APDL-template)
(defvar apdl-skeleton-overlay)
(make-local-variable 'apdl-skeleton-overlay)
(defvar apdl-last-skeleton nil
"Variable containing the last previewed skeleton.")
(defconst apdl-default-template-directory
(concat apdl-mode-install-directory "template/")
"Directory where the APDL-Mode template macro files reside.")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; --- functions ---
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(declare-function apdl-mode "apdl-mode")
(defun apdl-display-skeleton (&optional arg)
"Display or insert code templates.
With an argument ARG not equal to 1 insert the template into the
current buffer instead of previewing it in a separate window.
You might trigger a completion of templates with the <TAB> or <?>
key and choose with the mouse 2 button."
(interactive "p")
(let* (
(old-buffer (buffer-name))
(new-buffer-name "*APDL-skeleton*")
(skeleton-buffer
(get-buffer-create new-buffer-name))
s ; yellow indicator line in the preview buffer above content
;; if skeleton window is visible in selected frame
(visible (get-buffer-window new-buffer-name nil))
(skel-string
;; we might want to insert it while previewing...
(if (and (not (= arg 1)) apdl-last-skeleton visible)
apdl-last-skeleton
"apdl-skeleton-"))
(skel
(if (= arg 1)
(completing-read "Preview template [TAB to complete]: "
obarray 'commandp t skel-string nil)
(completing-read "Insert template [TAB to complete]: "
obarray 'commandp t skel-string nil))))
(setq apdl-last-skeleton skel)
(cond ((= arg 1)
(switch-to-buffer-other-window skeleton-buffer)
(setq buffer-read-only nil)
(remove-overlays) ; from beginnin and end of buffer
(setq apdl-skeleton-overlay (make-overlay 1 1))
(kill-region (point-min) (point-max))
(funcall (intern-soft skel))
;; (apdl-skeleton-numbering-controls)
;; (insert "bla\n")
(goto-char (point-min))
(unless (eq major-mode 'apdl-mode)
(apdl-mode))
(setq s (propertize
(concat "-*- APDL template: "
skel " -*-\n") 'face 'match))
(overlay-put apdl-skeleton-overlay 'before-string s)
(set-buffer-modified-p nil)
(setq buffer-read-only t)
(switch-to-buffer-other-window old-buffer))
(t
(funcall (intern-soft skel))))))
;; for abbrevs
(define-skeleton apdl_do
"Insert a *do .. *enddo loop."
nil
"*do,I,1,10,1" > \n
- \n
"*cycle ! continue loop but bypass below commands" > \n
"nplot ! this command is not executed *cycle" \n
"*enddo" > \n)
;; for abbrevs
(define-skeleton apdl_if
"Insert an *if .. *endif construct."
nil
"*if,I,eq,J,then" > \n
> _ \n
"!! *elseif,K,gt,L" > \n
"!! *else" > \n
"*endif" >)
;; switched strategy to include APDL files into template
;; definitions. This is way easier for users to setup their own
;; example templates!
(define-skeleton apdl-skeleton-2d-structural
"Short but complete plane stress structural APDL template."
nil
"/com,==============================================================\n"
"/com, Inserted: "(current-time-string)", APDL-Mode: "apdl-mode-version"\n"
"/com,==============================================================\n"
(insert-file
(concat apdl-wb-default-template-directory
"plane-stress_structural_example.mac")))
;; ------------- "old" skeleton descriptions -------
(define-skeleton apdl-skeleton-looping
"Control constructs"
nil
"!! .............................." \n
"!@@@ ... Branching, looping and control structures ..." \n
"!! .............................." \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
"!! do loops" \n
"*do,I,1,6,2" \n
"!!*exit ! exit loop" > \n
"*cycle" > \n
"nplot ! this command is not executed *cycle" \n
"*enddo" > \n
\n
"*dowhile,PAR ! do until PAR == 0" \n
"PAR = 0" \n
"!!*exit ! stop do loop" > \n
"*cycle" > \n
"nplot ! this command is not executed <- *cycle" \n
"*enddo" > \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
"!! goto branching, not in interactive sessions possible!" \n
"*go,:BRANCH ! or with label STOP like /eof" \n
":BRANCH" \n)
;; str must occur before it can be used internally (setq str
;; read-skeleton...)
(define-skeleton apdl-skeleton-section-separator
"Insert comment section strings to distinguish topics."
"Which section type? section type 1, subsect.: 2, or subsubsect.: [3] "
"!!" str
(cond ((string= str "1")
(insert "=============================="))
((string= str "2")
(insert "------------------------------"))
((string= str "3")
(insert ".............................."))
(t
(insert "3..............................")))
\n
(cond ((string= str "1")
(insert (concat "!" apdl-outline-string " === ")))
((string= str "2")
(insert (concat "!" apdl-outline-string apdl-outline-string " --- ")))
(t
(insert (concat "!" apdl-outline-string apdl-outline-string
apdl-outline-string " ... "))))
(skeleton-read "Brief description of the section: ")
(cond ((string= str "1")
(insert " ====="))
((string= str "2")
(insert " ----"))
(t
(insert " ...")))
\n
(cond ((string= str "1")
(insert "!! =============================="))
((string= str "2")
(insert "!! ------------------------------"))
(t
(insert "!! ..............................")))
\n
\n)
;; str must occur somewhere outside cond otherwise an error!!
(define-skeleton apdl-skeleton-separator-line
"Insert one comment line to separate topics."
nil
"!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" \n
\n)
(define-skeleton apdl-skeleton-header
"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
"!" apdl-outline-string " === 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: " apdl-current-ansys-version \n
;; "!! UNITS: mm-t-s" \n
"!! Note: " str \n
"!! ------------------------------" \n
\n
"!! fini" \n
"!! /clear" \n
"!! y" \n
"/units,mpa ! indicate mm-t-s unit system" \n
\n)
(define-skeleton apdl-skeleton-information
"Information gathering with APDL commands."
nil
;; "!! ------------------------------" \n
;; "!@@ -- informations --" \n
;; "!! ------------------------------" \n
"!! .............................." \n
"!@@@ ... Measurements ..." \n
"!! .............................." \n
\n
"nx(NodeNo)|y|z ! x|y|z-coordinate of node NodeNo " \n
"kx(KPoint)|y|z ! x|y|z-coordinate of KP KeyPoint " \n
"distnd(N1,N2) ! distance between nodes" \n
"distkp(k1,k2) ! distance between keypoints" \n
"disten(e,n) ! distance between element centroid and node" \n
\n
"!! .............................." \n
"!@@@ ... Center of mass, mass, and mass moments of inertia ..." \n
"!! .............................." \n
\n
"!! --- partial solution for mass calculation ---" \n
"/solu ! for psolve" \n
"outpr,basic,all" \n
"irlf,-1 ! inertia relief option" \n
"/output,mass_output,txt" \n
"psolve,elform ! only partial solution" \n
"psolve,elprep" \n
"/output" \n
"*list,mass_output,txt"\n
"irlist ! print inertia relief summary" \n
\n
"/prep7 ! for gsum" \n
"gsum ! for selected entities: combination of ksum, lsum, asum and vsum" \n
"!! mass, centroids, moments of inertia, length, area, volumen, ..." \n
"*get,bla,area,0,imc,y ! moment of inertia about y w.r.t. mass centroid" \n
\n
"!! .............................." \n
"!@@@ ... Job items ..." \n
"!! .............................." \n
\n
"/inquire,Job_name,jobname ! get string array jobname|directory|user|psearch" \n
"*stat,Job_name(1)" \n
"/com,This is the jobname: \"%Job_name(1)%\"" \n
"/inquire,Dirname,directory" \n
"*stat,Dirname(1)" \n
"/inquire,param,date,file,ext ! get date(size,lines) of file.ext" \n
\n
"!! .............................." \n
"!@@@ ... Stati ..." \n
"!! .............................." \n
\n
"/status ! [all],capabilities: 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
"!! .............................." \n
"!@@@ ... Material info ..." \n
"!! .............................." \n
\n
"*get,Density,dens,ID,temperature ! get the properties of material ID" \n
"mplist,all" \n
"tblist" \n
"tbplot,biso,1" \n
\n
"!! .............................." \n
"!@@@ ... Geom info ..." \n
"!! .............................." \n
\n
"/prep7" \n
"lsum ! or gsum" \n
"*get,LLen,line,,leng ! combined length of all selected lines" \n
"asum ! or gsum" \n
"*get,Area,area,,area ! combined area of all selected areas" \n
"vsum ! or gsum" \n
"*get,Volume,volu,,volu ! combined volume of all selected volumes" \n
\n
"!! .............................." \n
"!@@@ ... Solution info ..." \n
"!! .............................." \n
\n
"set,list ! list a summary of each load step" \n
"wpstyl,stat ! working plane status" \n
"status,solu" \n
\n
"!! .............................." \n
"!@@@ ... Postproc info ..." \n
"!! .............................." \n
\n
"*get,NS,active,,set,nset ! No of load steps" \n
"*get,T,active,,set,time ! Time of current set" \n
\n
"!! .............................." \n
"!@@@ ... \"stat\" database settings ... " \n
"!! .............................." \n
\n
"/prep7" \n
"etype" \n
"stat ! load step options" \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 is not supported any longer in v130 "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" \n
"extrem,2 ! post26 variable extrema listing" \n
"*get,Extr,vari,2,extrem,vmax ! get max extreme value" \n
"*get,Extr,vari,2,extrem,vmin ! get min extreme value" \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
"!! .............................." \n
"!@@@ ... aux3 result file edit routine ..." \n
"!! .............................." \n
\n
"/aux3" \n
"list ! result statistics" \n
"!! .............................." \n
"!@@@ ... *get ..." \n
"!! .............................." \n
\n
"*get,bla,active,,mat ! [|csys|type|real|esys]" \n
\n
"*status,_RETURN ! command, documentation, _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 apdl-skeleton-configuration
"Configuration skeleton."
nil
"!! ------------------------------" \n
"!@@ --- Configurations ----" \n
"!! ------------------------------" \n
\n
"*afun,deg ! [rad],deg" \n
"Pi = acos(-1)" \n
"*afun,deg ! deg: trig. functions accept and return angle arguments" \n
"True = 1" \n
"False = 0" \n
"/mplib,read,YourLibraryPath ! define material library path" \n
"/mplib,stat ! stat defined material library paths" \n
"/units,MPA ! I'm using mostly MPA (Tmms) \
(important only for material libs)" \n
"mpread,steel_elastic,,,lib" \n
\n
"!! --- Directory and file names -- " \n
"*dim,Dir,string,248 ! string array with maximum of 248 characters!" \n
"Dir(1) = '/very/very/very/long/path/to/heaven/'" \n
"/cwd,/tmp ! change the current working dir" \n
"filnam,bla ! change the jobname" \n
"resume ! resume the database" \n
"file ! result file" \n
"/title," _ \n
"!! --- display options ---" \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
"!! --- graphics ---" \n
"/gfile,1200 ! set height resolution [800] to 1200, width=1.33*height" \n
"/graphics,power" \n
"/efacet,4" \n
"/type,4 ! better hidden line removal" \n
\n)
(define-skeleton apdl-skeleton-view-settings
"View settings skeleton."
nil
"!! ------------------------------" \n
"!@@ --- View settings ----" \n
"!! ------------------------------" \n
\n
"/color,wbak,whit ! white background on plot window" \n
"/RGB,index,100,100,100,0" \n
"/RGB,index,0,0,0,15" \n
"immed,1 ! immediate display of generated geom. in /prep7" \n
"/graphics,power" \n
"/uis,replot,0 ! suppress automatic replot" \n
\n
"!! -- views --" \n
"/view,,1,1,1 ! viewing direction vector [0,0,1]"_ \n
"/view,,wp ! view normal to working plane" \n
"/focus,1 $ /repl ! focus wn 1 to csys,0" \n
"!! /focus,1,,.5,,1 $ /repl !focus with screen coordinate multiplier" \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 ! 1/2:distance (zoom) to object <1 nearer/larger, \
1:use multiplier" \n
"/dscale,all,10 ! set displacment multiplier" \n
"/zoom,1,off ! refit image to window" \n
"/zoom,1,rect,0,0,1,1 ! fit image to rectangel X1,Y1 & X2,Y2" \n
"/auto ! automatic fit mode" \n
"/angle,,5,xm,1 ! turn view about x " \n
"/angle,,-20,ym,1 ! turn view about y"\n
"/user ! keep last display scaling" \n
\n
"!! -- style options ---" \n
"/device,text,1,140 ! enlarge 140 % the text size" \n
"/plopts,minm ! switch off[on] (both!) min & max" \n
"/plopts,info,off ! switch off all descriptive text" \n
"/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
"/plopts,date,1 ! show only date and not time" \n
"/plopts,title,off ! switch of title display" \n
"!! --- WB like legend display --- " \n
"/plopt,leg3,on ! contour section of legend" \n
"/plopt,leg1,on ! legend header" \n
"/plopt,info,3 ! show legend info on the left side" \n
"/udoc,,cntr,bottom ! show legend on bottom" \n
"/pstatus ! display window stats specifications" \n
\n
"!! -- wp & coordinate systems display"
"/psymb,cs,1 ! display local coord." \n
"/psymb,ndir,1 ! display (only) rotated nodal coordinates" \n
"/plopts,wp,1 ! display working plane" \n
"/plopts,wp,off ! switch off wp" \n
"/triad,off ! orig,lbot,rbot,ltop,rtop" \n
"/triad,rbot" \n
"/triad,off" \n
\n
"!! .............................." \n
"!@@@ ... Translucency / transparency ..." \n
"!! .............................." \n
\n
"/trlcy,elem,.5,all ! make all selected elements translucent" \n
\n
"!! .............................." \n
"!@@@ ... material display ..." \n
"!! .............................." \n
\n
"/number,1 ! 0:colours & numbers,1:colours,2:numbers" \n
"/pnum,mat,1 ! 1: turn on numbering" \n
"!! NODE ELEM MAT TYPE REAL LOC SVAL ESYS KP LINE AREA VOLU STAT TABN \
SEC DOMA DEFA" \n
"/pnum,defa ! 1: turn off any numbering" \n
\n
"!! .............................." \n
"!@@@ ... Element shape display ..." \n
"!! .............................." \n
\n
"/efacet,2 ! display 2 element facets (curvature) with power graphics" \n
"/eshape,1 ! 1:use real constant def. for element shapes" \n
"/graphics,power ! for post1 results" \n
\n
"!! .............................." \n
"!@@@ ... Shrink display ..." \n
"!! .............................." \n
\n
"/graphics,full ! /shrink doesn't work with power graphics" \n
"/shrink,0.5 ! for geom and elements " \n
"eplot" \n
"vplot" \n
\n
"!! .............................." \n
"!@@@ ... Multi window plots ..." \n
"!! .............................." \n
"/window,2,dele" \n
"/window,1,dele" \n
"/erase" \n
"/window,2,-1,-.5,.5,1 ! from -1 to 1 is the full screen" \n
"aplot" \n
"/window,2,off" \n
"/noerase" \n
"!/window,1,rbot ! from -1 to 1 is the full screen" \n
"/window,1,full ! from -1 to 1 is the full screen" \n
"!/window,3,rbot ! full,righ,top,bot,ltop,lbot,rtop,rbot" \n
"eplot" \n
"/window,2,on" \n
"/erase" \n
\n
"!! .............................." \n
"!@@@ ... Legend range and contours ..." \n
"!! .............................." \n
"!! 9 X11 or WIN32 and up to 128 for X11c or WIN32C " \n
"/contour,,10,0,,2000 ! wn,ncont[9],vmin,vinc,vmax" \n
"!! 3-D device" \n
"/dv3d,contr,off ! [on]" \n
"/contour,, ! wn,ncont[128],vmin,vinc,vmax" \n
\n
"!! .............................." \n
"!@@@ ... Cutting planes and power graphics ..." \n
"!! .............................." \n
\n
"/graphics,power ! power (surface) graphics" \n
"/shade,,0 ! bug in 14.5, shouldn't be necessary" \n
"/type,,zcap ! capped z-buffered" \n
"/type,,zqsl ! sliced z-buffered" \n
"/gline,,1 ! elem outlines [0] solid, 1 dashed, -1 no outl." \n
\n
"!! .............................." \n
"!@@@ ... Mesh line display ..." \n
"!! .............................." \n
\n
"/edge,,1 ! 1:display elements in contour plots" \n
"/edge,,0 ! 0:switch off display of elements in contour plots" \n
\n
"!! .............................." \n
"!@@@ ... Coordinate system display ..." \n
"!! .............................." \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." \n
"/psymb,ndir,1 ! display (only) rotated nodal coord." \n
"/plopts,wp,off ! switch off wp" \n
"/triad,rbot"_ \n
"/triad,off" \n
\n)
(define-skeleton apdl-skeleton-import-export
"Import commands."
nil
"!! ------------------------------" \n
"!" apdl-outline-string apdl-outline-string " --- cad import ---- " \n
"!! ------------------------------" \n
\n
"~cat5in" \n
"~catiain" \n
"~parain" \n
"~proein" \n
"~satin" \n
"~ugin" \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
"!! IGES Export" \n
"igesout,bla,iges" \n
"finish" \n
\n
"/input,filename,anf ! for APDL based input" \n
"/facet,fine" \n
"/title,new title" \n
\n
"!! read array from file: Variable of *vread must be dimensioned!" \n
"/inquire,Numlines,LINES,'%Dir(1)%ground_plate_temperature',csv" \n
"*dim,bla,Numlines,1" \n
"!! lines might be skipped with the SKIP parameter" \n
"*vread,Bla,file,ext,,ijk,Numlines,2,,skip" \n
"(E10.3)" \n
"*vplot,Bla(1,1),Bla(1,2) "
"! works only with FORTRAN not C specifiers!" \n
\n
"!!read table from file: Variable of *tread must be dimensioned!" \n
"!!*tread: tab-delimited, blank-delimited, or comma-delimited file format" \n
"/inquire,Numlines,LINES,'%Dir(1)%ground_plate_temperature',csv" \n
"*dim,Hans,table,Numlines,4 !column and row 0 must not be dimensioned!" \n
"!! lines might be skipped with the SKIP parameter" \n
"*tread,Hans,tmp,out,,skip !the value Hans(0,0) must be smaller then \
Hans(0,1) and Hans(1,0)!" \n
"*vplot,Hans(1,0),Hans(1,1),2,3" \n
\n)
(define-skeleton apdl-skeleton-symmetry-expansion
"Graphical expansion of models utilising symmetry conditions."
nil
"!! .............................." \n
"!@@@ ... Symmetry expansion ..." \n
"!! .............................." \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,rect,half,,-1e-6,,2,rect,half,-1e-6 ! cartesian,\
half:mirror" \n
"/repl" \n
"!! /expand,2,lrect,half,,-1e-6,,2,rect,half,-1e-6 !local cartesian,\
half:mirror" \n
"!! -- polar expansion --" \n
"/expand,8,polar,half,,45 ! polar expansion, full:normal exp." \n
"!! /expand,8,lpolar,half,,45 ! local polar expansion, full:normal exp." \n
"!! -- axissymmtric expansion --" \n
"/expand,18,axis,,,10 !axisymmetric (180 ° rot. around y-axis)" \n
"/expand !switch off expansion" \n
"!! -- cyclic expansion --" \n
"/prep7" \n
"cyclic,status ! status of cyclic analysis (/prep7)" \n
"/post1" \n
"/cycexpand,,amount,nrepeat,6 ! expand graphics rep." \n
"!!/cycexpand,,off ! deactivate cyclic expansion" \n
"/cycexpand ! deactivate cyclic expansion" \n
\n)
(define-skeleton apdl-skeleton-contact-definition
"Contact definitons skeleton."
nil
"!! -------------------------------" \n
"!@@ --- General contact definitions (since Ansys 16) ----" \n
"!! -------------------------------" \n
\n
"!! 2D and 3D elements are automatically selected!" \n
"gcgen ! contacts on all exterior element faces" \n
"gcgen,,,,,select! only contacts for selected elements!" \n
"gcgen,,,,part! sectionIDs only for parts!" \n
"gcdef, Option, SECT1, SECT2, MATID, REALID" \n
"tb,inter,MatID,,,bonded !contact interaction" \n
"mp,mu,MatID,.1 !friction " \n
"!! rigid targets without real constants are allowed with general \
contact definitons!" \n
"ET,100,170,,1" \n
"TYPE,100" \n
"SECNUM,101" \n
"REAL,0" \n
"MAT,0" \n
"keyopt,gcn,2,3! keyopt for ALL general contacts" \n
"gcgen,select !select all general contacts and deselect others!" \n
"elist !get sectionID and typeID" \n
"/pnum,sect,on !display section type" \n
\n
"!! -------------------------------" \n
"!@@ --- Contact pair definitions ----" \n
"!! -------------------------------" \n
\n
"Contact=10"_ \n
"Target=Contact+1" \n
"Mu = 0.1 !friction factor" \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
"!! --- targets ---" \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
"rmodif,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 = -0.1 !search radius, neg: absolut value ( > CNOF!!!!)" \n
"!rmod,Contact,6,Pinb !PINB:pinball radius (negative: no scaling:absolute \
distance)" \n
\n
"!move open contact points to onto target surface" \n
"!ICONT = -0.05 !initial contact closure [0] relative band size \
(neg. absolut)" \n
"!rmod,Contact,5,Icont !ICONT:amount of initial contact closure \
(positiv:penetration)" \n
\n
"!shift complete open contact surface to target surf. " \n
"!CNOF = 0 !contact surface offset (complete shift) ([0], neg.: penetr.)" \n
"!rmod,Contact,10,Cnof !CNOF (thickness effects):contact normal offset \
(e.g. beams)" \n
\n
"!keyo,Contact,4,0 !keyo(4): location of contact detection" \n
" !! [0]:Gauss points, 3(V13):surface projection method" \n
"!keyo,Contact,5,4 !EFFEKT of CNOF (surface offset) or ICON \
(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,1 ! corresponds to Adjust To Touch in WB" \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
"Mu = 0.1 !Mu is the friction factor" \n
"!Mu = 0 ! frictionless" \n
"mp,mu,Contact,Mu" \n
"mat,Contact" \n
\n
"!! ------------------------------" \n
"!@@ -- Contact generation --" \n
"!! ------------------------------" \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
"!! .............................." \n
"!@@@ ... Check contact status ..." \n
"!! .............................." \n
\n
"!!cncheck !list contact pair 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
"ssum !sum of element table items" \n
\n)
(define-skeleton apdl-skeleton-contact-rigid
"Rigid contacts skeleton."
nil
"!! ------------------------------" \n
"!@@ --- Rigid target creation ----" \n
"!! ------------------------------" \n
\n
"Contact="_ \n
"Target=Contact+1" \n
"real,Contact" \n
"type,Target" \n
"tshap,line ! 2d/3d, automatically fixed" \n
"cncheck,summary" \n
"!! tshap,para !parabola 2d/3d" \n
"!! tshap,arc !clockwise arc 2d (targe169)" \n
"!! tshap,carc !counterclockwise arc 2d (targe169)" \n
"!! tshap,circ !2d (targe169)" \n
"!! tshap,tria !3d" \n
"!! tshap,tri6 !6 node triangle 3d" \n
"!! tshap,quad !3d" \n
"!! tshap,quad8 !8-node quadrilateral 3D" \n
"!! tshap,cyli !3d" \n
"!! tshap,cone" \n
"!! tshap,sphe !sphere 3d" \n
"!! tshap,pilo !2d/3d" \n
"!! tshap,point !2d/3d" \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 ! 2d/3d" \n
"e,Nmax+1" \n
"!! .............................." \n
"!@@@ .... 3D line to line beams ... " \n
"!! .............................." \n
"Contact = 10" \n
"ID = Contact" \n
"real = ID" \n
"et,ID, conta177 ! 177 3D line to line, 175 node to surface contact element" \n
"r,ID,R1,R2 !R1, R2 of line elements" \n
"Target = 20" \n
"ID = Target" \n
"real = Contact ! must be the same as for the contact elements" \n
"et,ID,targe170 !170 3D line segments" \n
"keyopt,ID,9,0 !external contact should, be default!" \n
"!! targets tshap,line !staight line" \n
"tshap,para !parabola not circle" \n
"type,Target" \n
"real,Contact" \n
"!!lsel,s,,,LNo" \n
"e,1,2,3" \n
";; contacts" \n
"esel,s,type,,Steel" \n
"lsel,u,,,1,LNo" \n
"nsll,s" \n