-
Notifications
You must be signed in to change notification settings - Fork 3
/
ansys_to_vtk.inp
355 lines (308 loc) · 15.7 KB
/
ansys_to_vtk.inp
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
! EXPORT NODAL/ELEMENT RESULTS FROM ANSYS APDL TO UNSTRUCTURED VTK FILE
! FOR USE IN PARAVIEW
! CODE IS BASED ON https://pastebin.com/gyJHKTeJ
! FROM
! https://stackoverflow.com/questions/41722822/how-to-read-ansys-data-files-in-paraview
! IMPORTANT!!!!
! YOU HABE TO RUN:
! "sed -i -e 's/ \{2,\}/ /g' -e 's/^ //g' -e 's/\r$//g' -e 's/ $//g' ansys_res_out.vtk"
! ON UNIX SYSTEMS TO MAKE THE VTK FILE READABLE BY PARAVIEW
! SOLUTION FOR WINDOWS SYSTEMS NOT GIVEN HERE
! THE PARTS WHICH SHOULD BE MODIFIED ARE MARKED INSIDE THE SCRIPT
! TESTED WITH ANSYS MECHANICAL APDL19.2 AND PARAVIEW 5.6.*
! MODIFED @2019 Christian Schubert
! USE AT YOUR OWN RISK
/POST1
SET,LAST ! NEEDED TO LOAD NODE-AND-ELEMENT MODEL IN ANSYS WORKBENCH.
! SELECT REPORTED ELEMENTS AND NODES
ESEL,ALL
NSLE,S,CORNER
*GET,E_COU,ELEM,,COUNT
*GET,N_COU,NODE,,COUNT
*GET,E_MIN,ELEM,,NUM,MIN
*GET,E_MAX,ELEM,,NUM,MAX
*GET,N_MIN,NODE,,NUM,MIN
*GET,N_MAX,NODE,,NUM,MAX
*DIM,E_NODES,,E_COU,20
*DIM,E_NODES_MAT,CHAR,E_COU,21
*DIM,E_NODES_COUNT,,E_COU
*DIM,E_TYPES,,E_COU
*DIM,E_TYPES_NAME,,E_COU
*DIM,E_TYPES_VTK,,E_COU
*DIM,NODE_ID,,N_MAX
*DIM,N_X,,N_COU
*DIM,N_Y,,N_COU
*DIM,N_Z,,N_COU
*DIM,E_TYPES_ANSYS_TO_VTK,,300
! ---------------- MODIFY -----------------------
! MODIF IF YOU WANT MORE RESULTS ....
*DIM,MY_NODE_RESULT,,N_COU
*DIM,MY_ELEM_RESULT,,E_COU
! ---------------- END MODIFY -------------------
E_TYPES_ANSYS_TO_VTK(5)=12 ! SOLID5 (3-D COUPLED-FIELD SOLID)
E_TYPES_ANSYS_TO_VTK(11)=3 ! LINK11 (LINEAR ACTUATOR)
E_TYPES_ANSYS_TO_VTK(13)=9 ! PLANE13 (2-D COUPLED-FIELD SOLID)
E_TYPES_ANSYS_TO_VTK(14)=3 ! COMBIN14 (SPRING-DAMPER)
E_TYPES_ANSYS_TO_VTK(21)=1 ! MASS21 (STRUCTURAL MASS)
E_TYPES_ANSYS_TO_VTK(25)=9 ! PLANE25 (AXISYMMETRIC-HARMONIC 4-NODE STRUCTURAL SOLID)
E_TYPES_ANSYS_TO_VTK(27)=3 ! MATRIX27 (STIFFNESS, DAMPING, OR MASS MATRIX)
E_TYPES_ANSYS_TO_VTK(29)=9 ! FLUID29 (2-D AXISYMMETRIC HARMONIC ACOUSTIC FLUID)
E_TYPES_ANSYS_TO_VTK(30)=12 ! FLUID30 (3-D ACOUSTIC FLUID)
E_TYPES_ANSYS_TO_VTK(31)=3 ! LINK31 (RADIATION LINK)
E_TYPES_ANSYS_TO_VTK(33)=3 ! LINK33 (3-D CONDUCTION BAR)
E_TYPES_ANSYS_TO_VTK(34)=3 ! LINK34 (CONVECTION LINK)
E_TYPES_ANSYS_TO_VTK(35)=5 ! PLANE35 (2-D 6-NODE TRIANGULAR THERMAL SOLID)
E_TYPES_ANSYS_TO_VTK(36)=5 ! SOURC36 (CURRENT SOURCE)
E_TYPES_ANSYS_TO_VTK(37)=4 ! COMBIN37 (CONTROL)
E_TYPES_ANSYS_TO_VTK(38)=3 ! FLUID38 (DYNAMIC FLUID COUPLING)
E_TYPES_ANSYS_TO_VTK(39)=3 ! COMBIN39 (NONLINEAR SPRING)
E_TYPES_ANSYS_TO_VTK(40)=3 ! COMBIN40 (COMBINATION)
E_TYPES_ANSYS_TO_VTK(47)=9 ! INFIN47 (3-D INFINITE BOUNDARY)
E_TYPES_ANSYS_TO_VTK(50)=-1000 ! MATRIX50 (SUPERELEMENT (OR SUBSTRUCTURE))
E_TYPES_ANSYS_TO_VTK(55)=9 ! PLANE55 (2-D THERMAL SOLID)
E_TYPES_ANSYS_TO_VTK(61)=3 ! SHELL61 (AXISYMMETRIC-HARMONIC STRUCTURAL SHELL)
E_TYPES_ANSYS_TO_VTK(65)=12 ! SOLID65 (3-D REINFORCED CONCRETE SOLID)
E_TYPES_ANSYS_TO_VTK(68)=3 ! LINK68 (COUPLED THERMAL-ELECTRIC LINE)
E_TYPES_ANSYS_TO_VTK(70)=12 ! SOLID70 (3-D THERMAL SOLID)
E_TYPES_ANSYS_TO_VTK(71)=1 ! MASS71 (THERMAL MASS)
E_TYPES_ANSYS_TO_VTK(75)=9 ! PLANE75 (AXISYMMETRIC-HARMONIC 4-NODE THERMAL SOLID)
E_TYPES_ANSYS_TO_VTK(77)=9 ! PLANE77 (2-D 8-NODE THERMAL SOLID)
E_TYPES_ANSYS_TO_VTK(78)=9 ! PLANE78 (AXISYMMETRIC-HARMONIC 8-NODE THERMAL SOLID)
E_TYPES_ANSYS_TO_VTK(83)=9 ! PLANE83 (AXISYMMETRIC-HARMONIC 8-NODE STRUCTURAL SOLID)
E_TYPES_ANSYS_TO_VTK(87)=10 ! SOLID87 (3-D 10-NODE TETRAHEDRAL THERMAL SOLID)
E_TYPES_ANSYS_TO_VTK(90)=12 ! SOLID90 (3-D 20-NODE THERMAL SOLID)
E_TYPES_ANSYS_TO_VTK(94)=4 ! CIRCU94 (PIEZOELECTRIC CIRCUIT)
E_TYPES_ANSYS_TO_VTK(96)=12 ! SOLID96 (3-D MAGNETIC SCALAR SOLID)
E_TYPES_ANSYS_TO_VTK(98)=10 ! SOLID98 (TETRAHEDRAL COUPLED-FIELD SOLID)
E_TYPES_ANSYS_TO_VTK(110)=9 ! INFIN110 (2-D INFINITE SOLID)
E_TYPES_ANSYS_TO_VTK(111)=12 ! INFIN111 (3-D INFINITE SOLID)
E_TYPES_ANSYS_TO_VTK(116)=3 ! FLUID116 (COUPLED THERMAL-FLUID PIPE)
E_TYPES_ANSYS_TO_VTK(121)=9 ! PLANE121 (2-D 8-NODE ELECTROSTATIC SOLID)
E_TYPES_ANSYS_TO_VTK(122)=12 ! SOLID122 (3-D 20-NODE ELECTROSTATIC SOLID)
E_TYPES_ANSYS_TO_VTK(123)=10 ! SOLID123 (3-D 10-NODE TETRAHEDRAL ELECTROSTATIC SOLID)
E_TYPES_ANSYS_TO_VTK(124)=4 ! CIRCU124 (ELECTRIC CIRCUIT)
E_TYPES_ANSYS_TO_VTK(125)=4 ! CIRCU125 (DIODE)
E_TYPES_ANSYS_TO_VTK(126)=3 ! TRANS126 (ELECTROMECHANICAL TRANSDUCER)
E_TYPES_ANSYS_TO_VTK(129)=3 ! FLUID129 (2-D INFINITE ACOUSTIC)
E_TYPES_ANSYS_TO_VTK(130)=9 ! FLUID130 (3-D INFINITE ACOUSTIC)
E_TYPES_ANSYS_TO_VTK(131)=9 ! SHELL131 (4-NODE THERMAL SHELL)
E_TYPES_ANSYS_TO_VTK(132)=9 ! SHELL132 (8-NODE THERMAL SHELL)
E_TYPES_ANSYS_TO_VTK(136)=9 ! FLUID136 (3-D SQUEEZE FILM FLUID ELEMENT)
E_TYPES_ANSYS_TO_VTK(138)=3 ! FLUID138 (3-D VISCOUS FLUID LINK ELEMENT)
E_TYPES_ANSYS_TO_VTK(139)=4 ! FLUID139 (3-D SLIDE FILM FLUID ELEMENT)
E_TYPES_ANSYS_TO_VTK(144)=4 ! ROM144 (REDUCED ORDER ELECTROSTATIC-STRUCTURAL)
E_TYPES_ANSYS_TO_VTK(151)=3 ! SURF151 (2-D THERMAL SURFACE EFFECT)
E_TYPES_ANSYS_TO_VTK(152)=9 ! SURF152 (3-D THERMAL SURFACE EFFECT)
E_TYPES_ANSYS_TO_VTK(153)=3 ! SURF153 (2-D STRUCTURAL SURFACE EFFECT)
E_TYPES_ANSYS_TO_VTK(154)=9 ! SURF154 (3-D STRUCTURAL SURFACE EFFECT)
E_TYPES_ANSYS_TO_VTK(155)=3 ! SURF155 (3-D THERMAL SURFACE EFFECT)
E_TYPES_ANSYS_TO_VTK(156)=3 ! SURF156 (3-D STRUCTURAL SURFACE LINE LOAD EFFECT)
E_TYPES_ANSYS_TO_VTK(157)=9 ! SHELL157 (THERMAL-ELECTRIC SHELL)
E_TYPES_ANSYS_TO_VTK(159)=-1000! SURF159 (GENERAL AXISYMMETRIC SURFACE)
E_TYPES_ANSYS_TO_VTK(160)=5 ! LINK160 (EXPLICIT 3-D SPAR (OR TRUSS))
E_TYPES_ANSYS_TO_VTK(161)=5 ! BEAM161 (EXPLICIT 3-D BEAM)
E_TYPES_ANSYS_TO_VTK(162)=9 ! PLANE162 (EXPLICIT 2-D STRUCTURAL SOLID)
E_TYPES_ANSYS_TO_VTK(163)=9 ! SHELL163 (EXPLICIT THIN STRUCTURAL SHELL)
E_TYPES_ANSYS_TO_VTK(164)=12 ! SOLID164 (EXPLICIT 3-D STRUCTURAL SOLID)
E_TYPES_ANSYS_TO_VTK(165)=3 ! COMBI165 (EXPLICIT SPRING-DAMPER)
E_TYPES_ANSYS_TO_VTK(166)=1 ! MASS166 (EXPLICIT 3-D STRUCTURAL MASS)
E_TYPES_ANSYS_TO_VTK(167)=5 ! LINK167 (EXPLICIT TENSION-ONLY SPAR)
E_TYPES_ANSYS_TO_VTK(168)=10 ! SOLID168 (EXPLICIT 3-D 10-NODE TETRAHEDRAL STRUCTURAL SOLID)
E_TYPES_ANSYS_TO_VTK(169)=3 ! TARGE169 (2-D TARGET SEGMENT)
E_TYPES_ANSYS_TO_VTK(170)=9 ! TARGE170 (3-D TARGET SEGMENT)
E_TYPES_ANSYS_TO_VTK(171)=3 ! CONTA171 (2-D 2-NODE SURFACE-TO-SURFACE CONTACT)
E_TYPES_ANSYS_TO_VTK(172)=3 ! CONTA172 (2-D 3-NODE SURFACE-TO-SURFACE CONTACT )
E_TYPES_ANSYS_TO_VTK(173)=9 ! CONTA173 (3-D 4-NODE SURFACE-TO-SURFACE CONTACT)
E_TYPES_ANSYS_TO_VTK(174)=9 ! CONTA174 (3-D 8-NODE SURFACE-TO-SURFACE CONTACT)
E_TYPES_ANSYS_TO_VTK(175)=1 ! CONTA175 (2-D/3-D NODE-TO-SURFACE CONTACT)
E_TYPES_ANSYS_TO_VTK(176)=3 ! CONTA176 (3-D LINE-TO-LINE CONTACT)
E_TYPES_ANSYS_TO_VTK(177)=3 ! CONTA177 (3-D LINE-TO-SURFACE CONTACT)
E_TYPES_ANSYS_TO_VTK(178)=3 ! CONTA178 (3-D NODE-TO-NODE CONTACT)
E_TYPES_ANSYS_TO_VTK(179)=5 ! PRETS179 (PRETENSION)
E_TYPES_ANSYS_TO_VTK(180)=3 ! LINK180 (3-D SPAR (OR TRUSS))
E_TYPES_ANSYS_TO_VTK(181)=9 ! SHELL181 (4-NODE STRUCTURAL SHELL)
E_TYPES_ANSYS_TO_VTK(182)=9 ! PLANE182 (2-D 4-NODE STRUCTURAL SOLID)
E_TYPES_ANSYS_TO_VTK(183)=9 ! PLANE183 (2-D 8-NODE OR 6-NODE STRUCTURAL SOLID)
E_TYPES_ANSYS_TO_VTK(184)=4 ! MPC184 (MULTIPOINT CONSTRAINT ELEMENT)
E_TYPES_ANSYS_TO_VTK(184)=4 ! MPC184-LINK/BEAM (MULTIPOINT CONSTRAINT ELEMENT: RIGID LINK OR RIGID BEAM)
E_TYPES_ANSYS_TO_VTK(184)=4 ! MPC184-SLIDER (MULTIPOINT CONSTRAINT ELEMENT: SLIDER)
E_TYPES_ANSYS_TO_VTK(184)=4 ! MPC184-REVOLUTE (MULTIPOINT CONSTRAINT ELEMENT: REVOLUTE JOINT)
E_TYPES_ANSYS_TO_VTK(184)=4 ! MPC184-UNIVERSAL (MULTIPOINT CONSTRAINT ELEMENT: UNIVERSAL JOINT)
E_TYPES_ANSYS_TO_VTK(184)=4 ! MPC184-SLOT (MULTIPOINT CONSTRAINT ELEMENT: SLOT JOINT)
E_TYPES_ANSYS_TO_VTK(184)=4 ! MPC184-POINT (MULTIPOINT CONSTRAINT ELEMENT: POINT-IN-PLANE JOINT)
E_TYPES_ANSYS_TO_VTK(184)=4 ! MPC184-TRANSLATIONAL (MULTIPOINT CONSTRAINT ELEMENT: TRANSLATIONAL JOINT)
E_TYPES_ANSYS_TO_VTK(184)=4 ! MPC184-CYLINDRICAL (MULTIPOINT CONSTRAINT ELEMENT: CYLINDRICAL JOINT)
E_TYPES_ANSYS_TO_VTK(184)=4 ! MPC184-PLANAR (MULTIPOINT CONSTRAINT ELEMENT: PLANAR JOINT)
E_TYPES_ANSYS_TO_VTK(184)=4 ! MPC184-WELD (MULTIPOINT CONSTRAINT ELEMENT: WELD JOINT)
E_TYPES_ANSYS_TO_VTK(184)=4 ! MPC184-ORIENT (MULTIPOINT CONSTRAINT ELEMENT: ORIENT JOINT)
E_TYPES_ANSYS_TO_VTK(184)=4 ! MPC184-SPHERICAL (MULTIPOINT CONSTRAINT ELEMENT: SPHERICAL JOINT)
E_TYPES_ANSYS_TO_VTK(184)=4 ! MPC184-GENERAL (MULTIPOINT CONSTRAINT ELEMENT: GENERAL JOINT)
E_TYPES_ANSYS_TO_VTK(184)=4 ! MPC184-SCREW (MULTIPOINT CONSTRAINT ELEMENT: SCREW JOINT)
E_TYPES_ANSYS_TO_VTK(185)=12 ! SOLID185 (3-D 8-NODE STRUCTURAL SOLID)
E_TYPES_ANSYS_TO_VTK(186)=12 ! SOLID186 (3-D 20-NODE STRUCTURAL SOLID)
E_TYPES_ANSYS_TO_VTK(187)=10 ! SOLID187 (3-D 10-NODE TETRAHEDRAL STRUCTURAL SOLID)
E_TYPES_ANSYS_TO_VTK(188)=5 ! BEAM188 (3-D 2-NODE BEAM)
E_TYPES_ANSYS_TO_VTK(189)=9 ! BEAM189 (3-D 3-NODE BEAM)
E_TYPES_ANSYS_TO_VTK(190)=12 ! SOLSH190 (3-D 8-NODE STRUCTURAL SOLID SHELL)
E_TYPES_ANSYS_TO_VTK(192)=9 ! INTER192 (2-D 4-NODE GASKET)
E_TYPES_ANSYS_TO_VTK(193)=9 ! INTER193 (2-D 6-NODE GASKET)
E_TYPES_ANSYS_TO_VTK(194)=12 ! INTER194 (3-D 16-NODE GASKET)
E_TYPES_ANSYS_TO_VTK(195)=12 ! INTER195 (3-D 8-NODE GASKET)
E_TYPES_ANSYS_TO_VTK(200)=-1000! MESH200 (MESHING FACET)
E_TYPES_ANSYS_TO_VTK(201)=1 ! FOLLW201 (FOLLOWER LOAD)
E_TYPES_ANSYS_TO_VTK(202)=9 ! INTER202 (2-D 4-NODE COHESIVE)
E_TYPES_ANSYS_TO_VTK(203)=7 ! INTER203 (2-D 6-NODE COHESIVE)
E_TYPES_ANSYS_TO_VTK(204)=-1000! INTER204 (3-D 16-NODE COHESIVE)
E_TYPES_ANSYS_TO_VTK(205)=12 ! INTER205 (3-D 8-NODE COHESIVE)
E_TYPES_ANSYS_TO_VTK(208)=3 ! SHELL208 (2-NODE AXISYMMETRIC SHELL)
E_TYPES_ANSYS_TO_VTK(209)=3 ! SHELL209 (3-NODE AXISYMMETRIC SHELL)
E_TYPES_ANSYS_TO_VTK(212)=9 ! CPT212 (2-D 4-NODE COUPLED PORE-PRESSURE MECHANICAL SOLID)
E_TYPES_ANSYS_TO_VTK(213)=9 ! CPT213 (2-D 8-NODE COUPLED PORE-PRESSURE MECHANICAL SOLID)
E_TYPES_ANSYS_TO_VTK(214)=3 ! COMBI214 (2-D SPRING-DAMPER BEARING)
E_TYPES_ANSYS_TO_VTK(215)=12 ! CPT215 (3-D 8-NODE COUPLED PORE-PRESSURE MECHANICAL SOLID)
E_TYPES_ANSYS_TO_VTK(216)=12 ! CPT216 (3-D 20-NODE COUPLED PORE-PRESSURE MECHANICAL SOLID )
E_TYPES_ANSYS_TO_VTK(217)=10 ! CPT217 (3-D 10-NODE COUPLED PORE-PRESSURE MECHANICAL SOLID)
E_TYPES_ANSYS_TO_VTK(218)=9 ! FLUID218 (3-D HYDRODYNAMIC BEARING ELEMENT)
E_TYPES_ANSYS_TO_VTK(220)=12 ! FLUID220 (3-D ACOUSTIC FLUID 20-NODE SOLID ELEMENT)
E_TYPES_ANSYS_TO_VTK(221)=10 ! FLUID221 (3-D ACOUSTIC FLUID 10-NODE SOLID ELEMENT)
E_TYPES_ANSYS_TO_VTK(223)=9 ! PLANE223 (2-D 8-NODE COUPLED-FIELD SOLID)
E_TYPES_ANSYS_TO_VTK(226)=12 ! SOLID226 (3-D 20-NODE COUPLED-FIELD SOLID)
E_TYPES_ANSYS_TO_VTK(227)=10 ! SOLID227 (3-D 10-NODE COUPLED-FIELD SOLID)
E_TYPES_ANSYS_TO_VTK(230)=9 ! PLANE230 (2-D 8-NODE ELECTRIC SOLID)
E_TYPES_ANSYS_TO_VTK(231)=12 ! SOLID231 (3-D 20-NODE ELECTRIC SOLID)
E_TYPES_ANSYS_TO_VTK(232)=10 ! SOLID232 (3-D 10-NODE TETRAHEDRAL ELECTRIC SOLID)
E_TYPES_ANSYS_TO_VTK(233)=9 ! PLANE233 (2-D 8-NODE ELECTROMAGNETIC SOLID )
E_TYPES_ANSYS_TO_VTK(236)=12 ! SOLID236 (3-D 20-NODE ELECTROMAGNETIC SOLID)
E_TYPES_ANSYS_TO_VTK(237)=10 ! SOLID237 (3-D 10-NODE ELECTROMAGNETIC SOLID)
E_TYPES_ANSYS_TO_VTK(238)=9 ! PLANE238 (2-D 8-NODE DIFFUSION SOLID)
E_TYPES_ANSYS_TO_VTK(239)=12 ! SOLID239 (3-D 20-NODE DIFFUSION SOLID)
E_TYPES_ANSYS_TO_VTK(240)=10 ! SOLID240 (3-D 10-NODE TETRAHEDRAL DIFFUSION SOLID)
E_TYPES_ANSYS_TO_VTK(241)=9 ! HSFLD241 (2-D HYDROSTATIC FLUID)
E_TYPES_ANSYS_TO_VTK(242)=-1000! HSFLD242 (3-D HYDROSTATIC FLUID)
E_TYPES_ANSYS_TO_VTK(251)=3 ! SURF251 (2-D RADIOSITY SURFACE)
E_TYPES_ANSYS_TO_VTK(252)=9 ! SURF252 (3-D RADIOSITY SURFACE)
E_TYPES_ANSYS_TO_VTK(257)=12 ! INFIN257 (STRUCTURAL INFINITE SOLID)
E_TYPES_ANSYS_TO_VTK(263)=9 ! REINF263 (2-D SMEARED REINFORCING)
E_TYPES_ANSYS_TO_VTK(264)=12 ! REINF264 (3-D DISCRETE REINFORCING)
E_TYPES_ANSYS_TO_VTK(265)=-1000! REINF265 (3-D SMEARED REINFORCING)
E_TYPES_ANSYS_TO_VTK(272)=-1000! SOLID272 (GENERAL AXISYMMETRIC SOLID WITH 4 BASE NODES)
E_TYPES_ANSYS_TO_VTK(273)=-1000! SOLID273 (GENERAL AXISYMMETRIC SOLID WITH 8 BASE NODES)
E_TYPES_ANSYS_TO_VTK(278)=12 ! SOLID278 (3-D 8-NODE THERMAL SOLID)
E_TYPES_ANSYS_TO_VTK(279)=12 ! SOLID279 (3-D 20-NODE THERMAL SOLID)
E_TYPES_ANSYS_TO_VTK(281)=9 ! SHELL281 (8-NODE STRUCTURAL SHELL)
E_TYPES_ANSYS_TO_VTK(285)=10 ! SOLID285 (3-D 4-NODE TETRAHEDRAL STRUCTURAL SOLID WITH NODAL PRESSURES)
E_TYPES_ANSYS_TO_VTK(288)=3 ! PIPE288 (3-D 2-NODE PIPE)
E_TYPES_ANSYS_TO_VTK(289)=3 ! PIPE289 (3-D 3-NODE PIPE )
E_TYPES_ANSYS_TO_VTK(290)=3 ! ELBOW290 (3-D 3-NODE ELBOW)
E_TYPES_ANSYS_TO_VTK(300)=-1000! USER300 (USER-DEFINED ELEMENT)
! GET NODE RESULTS
N_J=N_MIN
*DO,J,1,N_COU
! ---------------- MODIFY -----------------------
! GET NODE RESULTS
*GET,MY_NODE_RESULT(J),NODE,N_J,CURR ! MODIFY!!!
! ---------------- END MODIFY -------------------
N_J=NDNEXT(N_J)
*ENDDO
! GET ELEMENT RESULTS
E_I=E_MIN
*DO,I,1,E_COU
! ---------------- MODIFY -----------------------
! GET ELEMENT RESULTS
*GET,MY_ELEM_RESULT(I),ELEM,E_I,ETAB,JOULE,, ! MODIFY!!!
! ---------------- END MODIFY -------------------
E_I=ELNEXT(E_I)
*ENDDO
! GET NODE COORDINATES
N_J=N_MIN
*DO,J,1,N_COU
NODE_ID(N_J)=J-1
*GET,N_X(J),NODE,N_J,LOC,X !NX(N_J) - SHORT undocumented?
*GET,N_Y(J),NODE,N_J,LOC,Y !NY(N_J) - SHORT undocumented?
*GET,N_Z(J),NODE,N_J,LOC,Z !NZ(N_J) - SHORT undocumented?
N_J=NDNEXT(N_J)
*ENDDO
! GET ELEMENT TYPE FOR VTK
CELLS_SIZE=0
E_I=E_MIN
*DO,I,1,E_COU
CELLS_SIZE=CELLS_SIZE+1
E_NODES_COUNT(I)=0
*DO,J,1,20
N_J=NELEM(E_I,J) !undocumented -*GET,NJ,ELEM,E_I,NODE,J
*IF,NSEL(N_J),NE,-1,THEN
E_NODES_COUNT(I)=E_NODES_COUNT(I)+1
E_NODES(I,J)=NODE_ID(N_J)
E_NODES_MAT(I,J+1)=CHRVAL(NODE_ID(N_J))
CELLS_SIZE=CELLS_SIZE+1
*ELSE
*EXIT
*ENDIF
*ENDDO
E_NODES_MAT(I,1)=CHRVAL(E_NODES_COUNT(I))
*GET,E_TYPES(I),ELEM,E_I,ATTR,TYPE
*GET,E_TYPES_NAME(I),ETYP,E_TYPES(I),ATTR,ENAM
E_TYPES_VTK(I)=E_TYPES_ANSYS_TO_VTK(E_TYPES_NAME(I))
E_I=ELNEXT(E_I)
*ENDDO
*CFOPEN,'ansys_res_out','vtk'
*VWRITE,
('# vtk DataFile Version 3.0')
*VWRITE,
('ANSYS Results')
*VWRITE,
('ASCII')
*VWRITE,
('DATASET UNSTRUCTURED_GRID')
*VWRITE,N_COU
('POINTS ',F0.0,TL1,' float')
*VWRITE,N_X(1),N_Y(1),N_Z(1)
(1PE12.5,' ',1PE12.5,' '1PE12.5)
*VWRITE,E_COU,CELLS_SIZE
('CELLS ',F0.0,TL1,' ',F0.0,TL1,' ')
*CFCLOSE
/NOPR !SUPPRESS PRINTOUT TO CONSOLE
/OUTPUT,'ansys_res_out','vtk',,APPEND
*MWRITE,E_NODES_MAT(1,1)
(21(A8,','))
/OUTPUT
*CFCLOSE
/GOPR !REACTIVATE PRINTOUT TO CONSOLE
*CFOPEN,'ansys_res_out','vtk',,APPEND
*VWRITE,E_COU
('CELL_TYPES ',F0.0,TL1,' ')
*VWRITE,E_TYPES_VTK(1)
(F0.0,TL1,' ')
*CFCLOSE
WRITE NODE DATA
*CFOPEN,'ansys_res_out','vtk',,APPEND
*VWRITE,N_COU
('POINT_DATA ',F0.0,TL1,' ')
! ---------------- MODIFY -----------------------
! WRITE NODE DATA. COPY NODE RES BLOCK AND MODIFY FOR MORE THAN 1 VARIABLE
! NODE RES BLOCK --------
*VWRITE,'NODE_RES' ! NAME OF NODE RES DATA
('SCALARS ',A8,' FLOAT 1')
*VWRITE
('LOOKUP_TABLE default')
*VWRITE,MY_NODE_RESULT(1) ! NODE RESULT TO WRITE
(1PE12.5)
! END NODE RES BLOCK -----
! ---------------- END MODIFY -------------------
*CFCLOSE
! WRITE ELEMENT DATA
*CFOPEN,'ansys_res_out','vtk',,APPEND
*VWRITE,E_COU
('CELL_DATA ',F0.0,TL1,' ')
! ---------------- MODIFY -----------------------
! WRITE ELEMT DATA. COPY ELEM RES BLOCK AND MODIFY FOR MORE THAN 1 VARIABLE
! NODE RES BLOCK --------
*VWRITE,'ELEM_RES' ! NAME OF ELEM RES DATA
('SCALARS ',A8,' float 1')
*VWRITE
('LOOKUP_TABLE default')
*VWRITE,MY_ELEM_RESULT(1) ! ELEMENT RESULT TO WRITE
(1PE12.5)
! END NODE RES BLOCK -----
! ---------------- END MODIFY -------------------
*CFCLOSE