1 /***********************************************************************
2 *
3 * ***** *** ***
4 * * * * * *
5 * * *** ***
6 * * * * * *
7 * ***** *** ***
8 *
9 * A FREE Finite Elements Analysis Program in ANSI C for the Windows &
10 * the UNIX OS.
11 *
12 * Composed and edited and copyright by
13 * Professor Dr.-Ing. Frank Rieg, University of Bayreuth, Germany
14 *
15 * eMail:
16 * frank.rieg@uni-bayreuth.de
17 * dr.frank.rieg@t-online.de
18 *
19 * V15.0 November 18, 2015
20 *
21 * This program is free software; you can redistribute it and/or modify
22 * it under the terms of the GNU General Public License as published by
23 * the Free Software Foundation; either version 2, or (at your option)
24 * any later version.
25 *
26 * This program is distributed in the hope that it will be useful,
27 * but WITHOUT ANY WARRANTY; without even the implied warranty of
28 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 * GNU General Public License for more details.
30 *
31 * You should have received a copy of the GNU General Public License
32 * along with this program; see the file COPYING. If not, write to
33 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
34 ***********************************************************************/
35 /***********************************************************************
36 * z88tx.c : von Z88 nach DXF
37 * 14.12.2015 Rieg
38 ***********************************************************************/
39
40 /***********************************************************************
41 * Fuer UNIX
42 ***********************************************************************/
43 #ifdef FR_UNIX
44 #include <z88x.h>
45 #include <stdio.h> /* fopen, fprintf, fclose */
46 #endif
47
48 /***********************************************************************
49 * Fuer Windows
50 ***********************************************************************/
51 #ifdef FR_WIN
52 #include <z88x.h>
53 #include <stdio.h> /* fopen, fprintf, fclose */
54 #endif
55
56 /***********************************************************************
57 * Schreib/Leseformate
58 ***********************************************************************/
59 #define NLB "\n "
60 #define NL "\n"
61
62 #define PC "%c"
63 #define PCB "%c "
64
65 #define PS "%s"
66 #define PSB "%s "
67
68 #ifdef FR_XINT
69 #define PDB "%d "
70 #define PD "%d"
71 #define PD5B "%5d "
72 #define PD5 "%5d"
73 #define PD2B "%2d "
74 #define PD2 "%2d"
75 #endif
76
77 #ifdef FR_XLONG
78 #define PDB "%ld "
79 #define PD "%ld"
80 #define PD5B "%5ld "
81 #define PD5 "%5ld"
82 #define PD2B "%2ld "
83 #define PD2 "%2ld"
84 #endif
85
86 #ifdef FR_XLOLO
87 #define PDB "%lld "
88 #define PD "%lld"
89 #define PD5B "%5lld "
90 #define PD5 "%5lld"
91 #define PD2B "%2lld "
92 #define PD2 "%2lld"
93 #endif
94
95 #ifdef FR_XDOUB
96 #define PFB "%lf "
97 #define PF "%lf"
98 #define PG "%lg"
99 #define PGB "%lg "
100 #define PE13B "%+#13.5lE "
101 #define PE13 "%+#13.5lE"
102 #endif
103
104 #ifdef FR_XQUAD
105 #define PFB "%Lf "
106 #define PF "%Lf"
107 #define PG "%Lg"
108 #define PGB "%Lg "
109 #define PE13B "%+#13.5LE "
110 #define PE13 "%+#13.5LE"
111 #endif
112
113 /***********************************************************************
114 * Functions
115 ***********************************************************************/
116 int wrim88x(FR_INT4,int);
117 int wlog88x(FR_INT4,int);
118
119 /***********************************************************************
120 * hier beginnt Function z88tx
121 ***********************************************************************/
z88tx(void)122 int z88tx(void)
123 {
124 extern FILE *fdxf,*fwlo;
125
126 extern FR_DOUBLEAY x;
127 extern FR_DOUBLEAY y;
128 extern FR_DOUBLEAY z;
129 extern FR_DOUBLEAY wert;
130 extern FR_DOUBLEAY pres;
131 extern FR_DOUBLEAY tr1;
132 extern FR_DOUBLEAY tr2;
133
134 extern FR_INT4AY koi;
135 extern FR_INT4AY koffs;
136 extern FR_INT4AY ityp;
137 extern FR_INT4AY itypfe;
138 extern FR_INT4AY jel;
139 extern FR_INT4AY iel;
140 extern FR_INT4AY kel;
141 extern FR_INT4AY nkn;
142 extern FR_INT4AY ifg;
143 extern FR_INT4AY irflag;
144 extern FR_INT4AY noi;
145 extern FR_INT4AY noffs;
146 extern FR_INT4AY nep;
147
148 extern FR_CHARAY cjmode;
149 extern FR_CHARAY cimode;
150 extern FR_CHARAY ckmode;
151
152 extern FR_DOUBLE epsx,epsy,epsz;
153 extern FR_DOUBLE texts;
154
155 extern FR_INT4 ndim,nkp,ne,nfg,kflagss,kflag,iqflag,niflag;
156 extern FR_INT4 nrb,npr;
157 extern FR_INT4 ICFLAG,ITSFLAG;
158
159 extern char cxx[];
160
161 FR_DOUBLE px[21], py[21], pz[21];
162
163 FR_DOUBLE xmin,xmax,ymin,ymax,zmin,zmax;
164 FR_DOUBLE xlimin,xlimax,ylimin,ylimax;
165 FR_DOUBLE pxele,pyele,pzele;
166 FR_DOUBLE fackno;
167
168 FR_INT4 i1point[] = {0,1,2,3,4,5,6,7,8,1,2,3,4};
169 FR_INT4 j1point[] = {0,2,3,4,1,6,7,8,5,5,6,7,8};
170
171 FR_INT4 i3point[] = {0,1,4,2,5,3,6};
172 FR_INT4 j3point[] = {0,4,2,5,3,6,1};
173
174 FR_INT4 i6point[] = {0,1,2,3};
175 FR_INT4 j6point[] = {0,2,3,1};
176
177 FR_INT4 i7point[] = {0,1,5,2,6,3,7,4,8};
178 FR_INT4 j7point[] = {0,5,2,6,3,7,4,8,1};
179
180 FR_INT4 i10point[]= { 0, 1, 9, 2,10, 3,11, 4,12, 5,13, 6,14, 7,15, 8,16,
181 1,17, 2,18, 3,19, 4,20};
182 FR_INT4 j10point[]= { 0, 9, 2,10, 3,11, 4,12, 1,13, 6,14, 7,15, 8,16, 5,
183 17, 5,18, 6,19, 7,20, 8};
184
185 FR_INT4 i11point[]= {0,1,5,6,2,7,8,3,9 ,10, 4,11,12};
186 FR_INT4 j11point[]= {0,5,6,2,7,8,3,9,10, 4,11,12, 1};
187
188 FR_INT4 i19point[] = {0,1,2,3,4,5,6,7,8,9, 10,11,12,13,14,15,16};
189 FR_INT4 j19point[] = {0,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16, 1};
190
191 FR_INT4 i21point[]= { 0,1,5,2,6,3,7,4,8, 9,13,10,14,11,15,12,16, 1, 2, 3, 4};
192 FR_INT4 j21point[]= { 0,5,2,6,3,7,4,8,1, 13,10,14,11,15,12,16, 9, 9,10,11,12};
193
194 FR_INT4 i22point[]= { 0,1,4,2,5,3,6, 7,10, 8,11, 9,12, 1,2,3};
195 FR_INT4 j22point[]= { 0,4,2,5,3,6,1, 10, 8,11, 9,12, 7, 7,8,9};
196
197 FR_INT4 i17point[]= { 0,1,2,3, 2, 3, 1};
198 FR_INT4 j17point[]= { 0,2,3,1, 4, 4, 4};
199
200 FR_INT4 i16point[]= { 0,1,5,2,6,3,7, 2,8, 3,9, 1,10};
201 FR_INT4 j16point[]= { 0,5,2,6,3,7,1, 8,4, 9,4, 10, 4};
202
203
204 FR_INT4 i,j,k;
205
206 /***********************************************************************
207 * start function
208 ***********************************************************************/
209 wrim88x(0,TX_Z88TX);
210 wlog88x(0,LOG_Z88TX);
211
212 /***********************************************************************
213 * file fdxf = Z88X.DXF oeffnen
214 ***********************************************************************/
215 wlog88x(0,LOG_FX);
216 wrim88x(0,TX_FX);
217 fdxf= fopen(cxx,"w");
218 if(fdxf == NULL)
219 {
220 wlog88x(0,LOG_NOX);
221 fclose(fwlo);
222 return(AL_NOX);
223 }
224 rewind(fdxf);
225
226 /***********************************************************************
227 * faktoren fuer textsize definieren
228 ***********************************************************************/
229 wlog88x(0,LOG_FAC);
230 wrim88x(0,TX_FAC);
231
232 fackno= 0.01;
233
234 /***********************************************************************
235 * wenn 2d, z[i] null setzen
236 ***********************************************************************/
237 if(ndim == 2)
238 for(i= 1; i <= nkp; i++) z[i]= 0.0;
239
240 zmin= 0.0;
241 zmax= 0.0;
242
243 /***********************************************************************
244 * groesstwerte,limits,textsize ermitteln
245 ***********************************************************************/
246 if (ndim == 2)
247 {
248 /*---------------------------------------------------------------------
249 * 2d: kleinste & groesste werte x,y ermitteln
250 *--------------------------------------------------------------------*/
251 xmin= x[1];
252 xmax= x[1];
253 ymin= y[1];
254 ymax= y[1];
255
256 for(i= 1; i <= nkp; i++)
257 {
258 if( x[i] < xmin) xmin= x[i];
259 if( x[i] > xmax) xmax= x[i];
260 if( y[i] < ymin) ymin= y[i];
261 if( y[i] > ymax) ymax= y[i];
262 }
263
264 /*---------------------------------------------------------------------
265 * 2d: textgroessen isele und iskno festlegen
266 *--------------------------------------------------------------------*/
267 if(ITSFLAG == 0)
268 texts= fackno*0.5*((xmax-xmin)+(ymax-ymin));
269
270 /*---------------------------------------------------------------------
271 * 2d: limits ermitteln
272 *--------------------------------------------------------------------*/
273 xlimin= xmin - 0.25*(xmax-xmin);
274 ylimin= ymin - 0.25*(ymax-ymin);
275 xlimax= xmax + 0.25*(xmax-xmin);
276 ylimax= ymax + 0.25*(ymax-ymin);
277 }
278 else
279 {
280 /*---------------------------------------------------------------------
281 * 3d: kleinste & groesste werte x,y,z ermitteln
282 *--------------------------------------------------------------------*/
283 xmin= x[1];
284 xmax= x[1];
285 ymin= y[1];
286 ymax= y[1];
287 zmin= z[1];
288 zmax= z[1];
289
290 for(i= 1; i <= nkp; i++)
291 {
292 if( x[i] < xmin) xmin= x[i];
293 if( x[i] > xmax) xmax= x[i];
294 if( y[i] < ymin) ymin= y[i];
295 if( y[i] > ymax) ymax= y[i];
296 if( z[i] < zmin) zmin= z[i];
297 if( z[i] > zmax) zmax= z[i];
298 }
299
300 /*---------------------------------------------------------------------
301 * 3d: textgroesse texts festlegen
302 *--------------------------------------------------------------------*/
303 if(ITSFLAG == 0)
304 texts= fackno*0.333*((xmax-xmin)+(ymax-ymin)+(zmax-zmin));
305
306 /*---------------------------------------------------------------------
307 * 3d: limits ermitteln
308 *--------------------------------------------------------------------*/
309 xlimin= xmin - 0.5*(xmax-xmin);
310 ylimin= ymin - 0.5*(ymax-ymin);
311 xlimax= xmax + 0.5*(xmax-xmin);
312 ylimax= ymax + 0.5*(ymax-ymin);
313 }
314
315 /***********************************************************************
316 * Z88X.DXF : bis section entities auffuellen
317 ***********************************************************************/
318 wlog88x(0,LOG_SDXF);
319 wrim88x(0,TX_SDXF);
320
321 fprintf(fdxf," 0\nSECTION"); /* start section header */
322 fprintf(fdxf,"\n 2\nHEADER");
323
324 fprintf(fdxf,"\n 9\n$ACADVER\n 1\nAC1009");
325 fprintf(fdxf,"\n 9\n$INSBASE\n 10\n0.0\n 20\n0.0\n 30\n0.0");
326
327 fprintf(fdxf,"\n 9\n$EXTMIN");
328 fprintf(fdxf,"\n 10\n" PG,xmin);
329 fprintf(fdxf,"\n 20\n" PG,ymin);
330 fprintf(fdxf,"\n 30\n" PG,zmin);
331
332 fprintf(fdxf,"\n 9\n$EXTMAX");
333 fprintf(fdxf,"\n 10\n" PG,xmax);
334 fprintf(fdxf,"\n 20\n" PG,ymax);
335 fprintf(fdxf,"\n 30\n" PG,zmax);
336
337 fprintf(fdxf,"\n 9\n$LIMMIN");
338 fprintf(fdxf,"\n 10\n" PG,xlimin);
339 fprintf(fdxf,"\n 20\n" PG,ylimin);
340
341 fprintf(fdxf,"\n 9\n$LIMMAX");
342 fprintf(fdxf,"\n 10\n" PG,xlimax);
343 fprintf(fdxf,"\n 20\n" PG,ylimax);
344
345 fprintf(fdxf,"\n 9\n$CLAYER\n 8\nZ88NET");
346
347 fprintf(fdxf,"\n 9\n$PDMODE\n 70\n 3"); /* schraege kreuze */
348 fprintf(fdxf,"\n 9\n$PDSIZE\n 40\n-3.0"); /* 3 % groesse */
349
350 fprintf(fdxf,"\n 0\nENDSEC"); /* ende section header */
351
352 fprintf(fdxf,"\n 0\nSECTION"); /* start section tables */
353 fprintf(fdxf,"\n 2\nTABLES");
354
355 fprintf(fdxf,"\n 0\nTABLE"); /* start table ltype */
356
357 fprintf(fdxf,"\n 2\nLTYPE\n 70\n 1"); /* 1 linientyp */
358
359 fprintf(fdxf,"\n 0\nLTYPE\n 2\nCONTINUOUS\n 70\n 64\n 3");
360 fprintf(fdxf,"\nSolid line\n 72\n 65\n 73\n 0\n 40\n0.0");
361
362 fprintf(fdxf,"\n 0\nENDTAB"); /* ende table ltype */
363
364 fprintf(fdxf,"\n 0\nTABLE"); /* start table layer */
365
366 fprintf(fdxf,"\n 2\nLAYER\n 70\n 6"); /* 6 layer ausser 0 */
367
368 fprintf(fdxf,"\n 0\nLAYER\n 2\n0\n 70\n 64\n 62\n -7");
369 fprintf(fdxf,"\n 6\nCONTINUOUS"); /* weiss, ausgeschaltet */
370
371 fprintf(fdxf,"\n 0\nLAYER\n 2\nZ88NET\n 70\n 64\n 62\n 5");
372 fprintf(fdxf,"\n 6\nCONTINUOUS"); /* blau, eingeschaltet */
373
374 fprintf(fdxf,"\n 0\nLAYER\n 2\nZ88EIO\n 70\n 64\n 62\n 5");
375 fprintf(fdxf,"\n 6\nCONTINUOUS"); /* blau, eingeschaltet */
376
377 fprintf(fdxf,"\n 0\nLAYER\n 2\nZ88KNR\n 70\n 64\n 62\n 1");
378 fprintf(fdxf,"\n 6\nCONTINUOUS"); /* rot, eingeschaltet */
379
380 fprintf(fdxf,"\n 0\nLAYER\n 2\nZ88RBD\n 70\n 64\n 62\n 6");
381 fprintf(fdxf,"\n 6\nCONTINUOUS"); /* magenta, eingeschaltet */
382
383 fprintf(fdxf,"\n 0\nLAYER\n 2\nZ88FLA\n 70\n 64\n 62\n 6");
384 fprintf(fdxf,"\n 6\nCONTINUOUS"); /* magenta, eingeschaltet */
385
386 fprintf(fdxf,"\n 0\nLAYER\n 2\nZ88GEN\n 70\n 64\n 62\n 6");
387 fprintf(fdxf,"\n 6\nCONTINUOUS"); /* magenta, eingeschaltet */
388
389 fprintf(fdxf,"\n 0\nLAYER\n 2\nZ88PKT\n 70\n 64\n 62\n 1");
390 fprintf(fdxf,"\n 6\nCONTINUOUS"); /* rot, eingeschaltet */
391
392 fprintf(fdxf,"\n 0\nENDTAB"); /* ende table layer */
393
394 fprintf(fdxf,"\n 0\nENDSEC"); /* ende section tables */
395
396 fprintf(fdxf,"\n 0\nSECTION"); /* start section entities */
397 fprintf(fdxf,"\n 2\nENTITIES");
398
399 /***********************************************************************
400 * allgemeine datei-informationen schreiben
401 ***********************************************************************/
402 /*---------------------------------------------------------------------
403 * linke obere ecke
404 *--------------------------------------------------------------------*/
405 pxele= xlimin;
406 pyele= ylimax-1.5*texts;
407
408 /*---------------------------------------------------------------------
409 * grundsatz-infos schreiben
410 *--------------------------------------------------------------------*/
411 fprintf(fdxf,"\n 0\nTEXT\n 8\nZ88GEN");
412 fprintf(fdxf,"\n 10\n" PG,pxele);
413 fprintf(fdxf,"\n 20\n" PG,pyele);
414 fprintf(fdxf,"\n 30\n0.0");
415 fprintf(fdxf,"\n 40\n" PG,texts);
416
417 if (ICFLAG == 1 || ICFLAG == 2)
418 {
419 fprintf(fdxf,"\n 1\nZ88I1.TXT " PDB PDB PDB PDB PD,ndim,nkp,ne,nfg,kflag);
420 }
421 else
422 {
423 fprintf(fdxf,"\n 1\nZ88NI.TXT " PDB PDB PDB PDB PDB PDB PD,ndim,nkp,ne,nfg,kflagss,niflag,kflag);
424 }
425
426 pyele+= -1.5 * texts;
427
428 /*---------------------------------------------------------------------
429 * ggf. neue fangbereiche bei Z88NI.TXT
430 *--------------------------------------------------------------------*/
431 if (ICFLAG == 3 && niflag == 1)
432 {
433 fprintf(fdxf,"\n 0\nTEXT\n 8\nZ88GEN");
434 fprintf(fdxf,"\n 10\n" PG,pxele);
435 fprintf(fdxf,"\n 20\n" PG,pyele);
436 fprintf(fdxf,"\n 30\n0.0");
437 fprintf(fdxf,"\n 40\n" PG,texts);
438 if(ndim == 2)
439 fprintf(fdxf,"\n 1\nD " PGB PG,epsx,epsy);
440 else
441 fprintf(fdxf,"\n 1\nD " PGB PGB PG,epsx,epsy,epsz);
442 pyele+= -1.5 * texts;
443 }
444
445 pyele+= -1.5 * texts;
446
447 /*---------------------------------------------------------------------
448 * randbedingungen z88i2.txt
449 *--------------------------------------------------------------------*/
450 if (ICFLAG == 2)
451 {
452 fprintf(fdxf,"\n 0\nTEXT\n 8\nZ88RBD");
453 fprintf(fdxf,"\n 10\n" PG,pxele);
454 fprintf(fdxf,"\n 20\n" PG,pyele);
455 fprintf(fdxf,"\n 30\n0.0");
456 fprintf(fdxf,"\n 40\n" PG,texts);
457 fprintf(fdxf,"\n 1\nZ88I2.TXT " PD,nrb);
458 pyele+= -1.5 * texts;
459
460 for(i= 1;i <= nrb;i++)
461 {
462 fprintf(fdxf,"\n 0\nTEXT\n 8\nZ88RBD");
463 fprintf(fdxf,"\n 10\n" PG,pxele);
464 fprintf(fdxf,"\n 20\n" PG,pyele);
465 fprintf(fdxf,"\n 30\n0.0");
466 fprintf(fdxf,"\n 40\n" PG,texts);
467 fprintf(fdxf,"\n 1\nRBD " PDB PDB PDB PDB PG,i,nkn[i],ifg[i],irflag[i],wert[i]);
468 pyele+= -1.5 * texts;
469 }
470 }
471
472 pyele+= -3.0 * texts;
473
474 /*---------------------------------------------------------------------
475 * flaechenlasten z88i5.txt
476 *--------------------------------------------------------------------*/
477 if (ICFLAG == 2)
478 {
479 fprintf(fdxf,"\n 0\nTEXT\n 8\nZ88FLA");
480 fprintf(fdxf,"\n 10\n" PG,pxele);
481 fprintf(fdxf,"\n 20\n" PG,pyele);
482 fprintf(fdxf,"\n 30\n0.0");
483 fprintf(fdxf,"\n 40\n" PG,texts);
484 fprintf(fdxf,"\n 1\nZ88I5.TXT " PD,npr);
485 pyele+= -1.5 * texts;
486
487 if(iqflag == 1)
488 {
489 for(j= 1;j <= npr;j++)
490 {
491 fprintf(fdxf,"\n 0\nTEXT\n 8\nZ88FLA");
492 fprintf(fdxf,"\n 10\n" PG,pxele);
493 fprintf(fdxf,"\n 20\n" PG,pyele);
494 fprintf(fdxf,"\n 30\n0.0");
495 fprintf(fdxf,"\n 40\n" PG,texts);
496
497 /*======================================================================
498 * Elementtypen 7, 8, 14, 15
499 *=====================================================================*/
500 if(ityp[nep[j]]== 7 || ityp[nep[j]]== 8 ||
501 ityp[nep[j]]== 14 || ityp[nep[j]]== 15)
502 {
503 fprintf(fdxf,"\n 1\nFLA " PDB PDB PGB PGB PDB PDB PD,
504 j,nep[j],pres[j],tr1[j],
505 noi[noffs[j] ],noi[noffs[j] +1],noi[noffs[j] +2]);
506 }
507
508 /*======================================================================
509 * Elementtyp 10 u. 21
510 *=====================================================================*/
511 if(ityp[nep[j]]== 10 || ityp[nep[j]]== 21)
512 {
513 fprintf(fdxf,"\n 1\nFLA " PDB PDB PGB PGB PGB PDB PDB PDB PDB PDB PDB PDB PD,
514 j,nep[j],pres[j],tr1[j],tr2[j],
515 noi[noffs[j] ], noi[noffs[j] +1],
516 noi[noffs[j] +2], noi[noffs[j] +3],
517 noi[noffs[j] +4], noi[noffs[j] +5],
518 noi[noffs[j] +6], noi[noffs[j] +7]);
519 }
520
521 /*======================================================================
522 * Elementtyp 22
523 *=====================================================================*/
524 if(ityp[nep[j]]== 22)
525 {
526 fprintf(fdxf,"\n 1\nFLA " PDB PDB PGB PGB PGB PDB PDB PDB PDB PDB PD,
527 j,nep[j],pres[j],tr1[j],tr2[j],
528 noi[noffs[j] ], noi[noffs[j] +1],
529 noi[noffs[j] +2], noi[noffs[j] +3],
530 noi[noffs[j] +4], noi[noffs[j] +5]);
531 }
532
533 /*======================================================================
534 * Elementtyp 1
535 *=====================================================================*/
536 if(ityp[nep[j]]== 1)
537 {
538 fprintf(fdxf,"\n 1\nFLA " PDB PDB PGB PGB PGB PDB PDB PDB PD,
539 j,nep[j],pres[j],tr1[j],tr2[j],
540 noi[noffs[j] ], noi[noffs[j] +1],
541 noi[noffs[j] +2], noi[noffs[j] +3]);
542 }
543
544 /*======================================================================
545 * Elementtyp 17
546 *=====================================================================*/
547 if(ityp[nep[j]]== 17)
548 {
549 fprintf(fdxf,"\n 1\nFLA " PDB PDB PGB PDB PDB PD,
550 j,nep[j],pres[j],
551 noi[noffs[j] ], noi[noffs[j] +1], noi[noffs[j] +2]);
552 }
553
554 /*======================================================================
555 * Elementtyp 16
556 *=====================================================================*/
557 if(ityp[nep[j]]== 16)
558 {
559 fprintf(fdxf,"\n 1\nFLA " PDB PDB PGB PDB PDB PDB PDB PDB PD,
560 j,nep[j],pres[j],
561 noi[noffs[j] ], noi[noffs[j] +1],
562 noi[noffs[j] +2], noi[noffs[j] +3],
563 noi[noffs[j] +4], noi[noffs[j] +5]);
564 }
565
566 /*======================================================================
567 * Elementtypen 11 und 12
568 *=====================================================================*/
569 if(ityp[nep[j]]== 11 || ityp[nep[j]]== 12)
570 {
571 fprintf(fdxf,"\n 1\nFLA " PDB PDB PGB PGB PDB PDB PDB PD,
572 j,nep[j],pres[j],tr1[j],
573 noi[noffs[j] ], noi[noffs[j] +1],
574 noi[noffs[j] +2], noi[noffs[j] +3]);
575 }
576
577 /*======================================================================
578 * Elementtyp 18,19,20,23 und 24
579 *=====================================================================*/
580 if(ityp[nep[j]]== 18 || ityp[nep[j]]== 19 || ityp[nep[j]]== 20 ||
581 ityp[nep[j]]== 23 || ityp[nep[j]]== 24)
582 {
583 fprintf(fdxf,"\n 1\nFLA " PDB PDB PG,j,nep[j],pres[j]);
584 }
585
586 pyele+= -1.5 * texts;
587 } // Ende Flaechenlastschleife
588 } // Ende iqflag == 1
589 }
590
591 /***********************************************************************
592 * punkte setzen
593 ***********************************************************************/
594 for(i= 1; i <= nkp; i++)
595 {
596 fprintf(fdxf,"\n 0\nPOINT\n 8\nZ88PKT");
597 fprintf(fdxf,"\n 10\n" PG,x[i]);
598 fprintf(fdxf,"\n 20\n" PG,y[i]);
599 fprintf(fdxf,"\n 30\n" PG,z[i]);
600
601 fprintf(fdxf,"\n 0\nTEXT\n 8\nZ88KNR");
602 fprintf(fdxf,"\n 10\n" PG,x[i]);
603 fprintf(fdxf,"\n 20\n" PG,y[i]);
604 fprintf(fdxf,"\n 30\n" PG,z[i]);
605 fprintf(fdxf,"\n 40\n" PG,texts);
606 fprintf(fdxf,"\n 1\nP " PD,i);
607 }
608
609 /***********************************************************************
610 * grosse elementschleife fuer element-infos
611 ***********************************************************************/
612 wlog88x(0,LOG_SELE);
613 wrim88x(0,TX_SELE);
614
615 for(k= 1; k <= ne; k++)
616 {
617
618 /*---------------------------------------------------------------------
619 * 8 punkte fuer 8-k hexaeder
620 *--------------------------------------------------------------------*/
621 if(ityp[k] == 1)
622 {
623
624 /*=====================================================================
625 * koordinaten holen
626 *====================================================================*/
627 for(i= 1; i <= 8; i++)
628 {
629 px[i]= x[koi[koffs[k]+i-1]];
630 py[i]= y[koi[koffs[k]+i-1]];
631 pz[i]= z[koi[koffs[k]+i-1]];
632 }
633
634 /*=====================================================================
635 * element-infos schreiben (Z88I1.TXT)
636 *====================================================================*/
637 if(ICFLAG == 1 || ICFLAG == 2)
638 {
639 pxele= 0.5*(px[1]+px[7]);
640 pyele= 0.5*(py[1]+py[7]);
641 pzele= 0.5*(pz[1]+pz[7]);
642 fprintf(fdxf,"\n 0\nTEXT\n 8\nZ88EIO");
643 fprintf(fdxf,"\n 10\n" PG,pxele);
644 fprintf(fdxf,"\n 20\n" PG,pyele);
645 fprintf(fdxf,"\n 30\n" PG,pzele);
646 fprintf(fdxf,"\n 40\n" PG,texts);
647 fprintf(fdxf,"\n 1\nFE " PDB PD,k,ityp[k]);
648 }
649
650 }
651
652 /*---------------------------------------------------------------------
653 * 20 punkte fuer 20-k hexaeder
654 *--------------------------------------------------------------------*/
655 else if(ityp[k] == 10)
656 {
657
658 /*=====================================================================
659 * koordinaten holen
660 *====================================================================*/
661 for(i= 1; i <= 20; i++)
662 {
663 px[i]= x[koi[koffs[k]+i-1]];
664 py[i]= y[koi[koffs[k]+i-1]];
665 pz[i]= z[koi[koffs[k]+i-1]];
666 }
667
668 /*=====================================================================
669 * entweder element-infos schreiben (Z88I1.TXT)
670 *====================================================================*/
671 if(ICFLAG == 1 || ICFLAG == 2)
672 {
673 pxele= 0.5*(px[1]+px[7]);
674 pyele= 0.5*(py[1]+py[7]);
675 pzele= 0.5*(pz[1]+pz[7]);
676 fprintf(fdxf,"\n 0\nTEXT\n 8\nZ88EIO");
677 fprintf(fdxf,"\n 10\n" PG,pxele);
678 fprintf(fdxf,"\n 20\n" PG,pyele);
679 fprintf(fdxf,"\n 30\n" PG,pzele);
680 fprintf(fdxf,"\n 40\n" PG,texts);
681 fprintf(fdxf,"\n 1\nFE " PDB PD,k,ityp[k]);
682 }
683
684 /*=====================================================================
685 * .. oder superelement-infos knoten schreiben (Z88NI.TXT)
686 *====================================================================*/
687 else
688 {
689 pxele= 0.5*(px[1]+px[7]);
690 pyele= 0.5*(py[1]+py[7]);
691 pzele= 0.5*(pz[1]+pz[7]);
692 fprintf(fdxf,"\n 0\nTEXT\n 8\nZ88EIO");
693 fprintf(fdxf,"\n 10\n" PG,pxele);
694 fprintf(fdxf,"\n 20\n" PG,pyele);
695 fprintf(fdxf,"\n 30\n" PG,pzele);
696 fprintf(fdxf,"\n 40\n" PG,texts);
697 fprintf(fdxf,"\n 1\nSE " PDB PDB PDB PDB PCB PDB PCB PDB PC,
698 k,ityp[k],itypfe[k],jel[k],cjmode[k],iel[k],cimode[k],kel[k],ckmode[k]);
699 }
700
701 }
702
703 /*---------------------------------------------------------------------
704 * 16 punkte fuer 16-k Volumenschalenelement
705 *--------------------------------------------------------------------*/
706 else if(ityp[k] == 21)
707 {
708
709 /*=====================================================================
710 * koordinaten holen
711 *====================================================================*/
712 for(i= 1; i <= 16; i++)
713 {
714 px[i]= x[koi[koffs[k]+i-1]];
715 py[i]= y[koi[koffs[k]+i-1]];
716 pz[i]= z[koi[koffs[k]+i-1]];
717 }
718
719 /*=====================================================================
720 * entweder element-infos schreiben (Z88I1.TXT)
721 *====================================================================*/
722 if(ICFLAG == 1 || ICFLAG == 2)
723 {
724 pxele= 0.5*(px[1]+px[7]);
725 pyele= 0.5*(py[1]+py[7]);
726 pzele= 0.5*(pz[1]+pz[7]);
727 fprintf(fdxf,"\n 0\nTEXT\n 8\nZ88EIO");
728 fprintf(fdxf,"\n 10\n" PG,pxele);
729 fprintf(fdxf,"\n 20\n" PG,pyele);
730 fprintf(fdxf,"\n 30\n" PG,pzele);
731 fprintf(fdxf,"\n 40\n" PG,texts);
732 fprintf(fdxf,"\n 1\nFE " PDB PD,k,ityp[k]);
733 }
734
735 /*=====================================================================
736 * .. oder superelement-infos knoten schreiben (Z88NI.TXT)
737 *====================================================================*/
738 else
739 {
740 pxele= 0.5*(px[1]+px[11]);
741 pyele= 0.5*(py[1]+py[11]);
742 pzele= 0.5*(pz[1]+pz[11]);
743 fprintf(fdxf,"\n 0\nTEXT\n 8\nZ88EIO");
744 fprintf(fdxf,"\n 10\n" PG,pxele);
745 fprintf(fdxf,"\n 20\n" PG,pyele);
746 fprintf(fdxf,"\n 30\n" PG,pzele);
747 fprintf(fdxf,"\n 40\n" PG,texts);
748 fprintf(fdxf,"\n 1\nSE " PDB PDB PDB PDB PCB PDB PCB PDB PC,
749 k,ityp[k],itypfe[k],jel[k],cjmode[k],iel[k],cimode[k],kel[k],ckmode[k]);
750 }
751 }
752
753 /*---------------------------------------------------------------------
754 * 12 punkte fuer 12-k Volumenschalenelement
755 *--------------------------------------------------------------------*/
756 else if(ityp[k] == 22)
757 {
758
759 /*=====================================================================
760 * koordinaten holen
761 *====================================================================*/
762 for(i= 1; i <= 12; i++)
763 {
764 px[i]= x[koi[koffs[k]+i-1]];
765 py[i]= y[koi[koffs[k]+i-1]];
766 pz[i]= z[koi[koffs[k]+i-1]];
767 }
768
769 /*=====================================================================
770 * entweder element-infos schreiben (Z88I1.TXT)
771 *====================================================================*/
772 if(ICFLAG == 1 || ICFLAG == 2)
773 {
774 pxele= 0.5*(px[1]+px[11]);
775 pyele= 0.5*(py[1]+py[11]);
776 pzele= 0.5*(pz[1]+pz[11]);
777 fprintf(fdxf,"\n 0\nTEXT\n 8\nZ88EIO");
778 fprintf(fdxf,"\n 10\n" PG,pxele);
779 fprintf(fdxf,"\n 20\n" PG,pyele);
780 fprintf(fdxf,"\n 30\n" PG,pzele);
781 fprintf(fdxf,"\n 40\n" PG,texts);
782 fprintf(fdxf,"\n 1\nFE " PDB PD,k,ityp[k]);
783 }
784 }
785
786 /*----------------------------------------------------------------------
787 * 2 punkte fuer ebenen stab, ebener balken
788 *---------------------------------------------------------------------*/
789 else if(ityp[k]== 9 || ityp[k]== 13)
790 {
791
792 /*=====================================================================
793 * koordinaten holen
794 *====================================================================*/
795 for(i= 1; i <= 2; i++)
796 {
797 px[i]= x[koi[koffs[k]+i-1]];
798 py[i]= y[koi[koffs[k]+i-1]];
799 }
800
801 /*=====================================================================
802 * element-infos schreiben (Z88I1.TXT)
803 *====================================================================*/
804 if(ICFLAG == 1 || ICFLAG == 2)
805 {
806 pxele= 0.5*(px[1]+px[2]);
807 pyele= 0.5*(py[1]+py[2]);
808 fprintf(fdxf,"\n 0\nTEXT\n 8\nZ88EIO");
809 fprintf(fdxf,"\n 10\n" PG,pxele);
810 fprintf(fdxf,"\n 20\n" PG,pyele);
811 fprintf(fdxf,"\n 30\n0.0");
812 fprintf(fdxf,"\n 40\n" PG,texts);
813 fprintf(fdxf,"\n 1\nFE " PDB PD,k,ityp[k]);
814 }
815
816 }
817
818 /*----------------------------------------------------------------------
819 * 2 punkte fuer raeuml stab, welle, raeuml balken
820 *---------------------------------------------------------------------*/
821 else if(ityp[k]== 2 || ityp[k]== 4 || ityp[k]== 5 || ityp[k]== 25)
822 {
823
824 /*=====================================================================
825 * koordinaten holen
826 *====================================================================*/
827 for(i= 1; i <= 2; i++)
828 {
829 px[i]= x[koi[koffs[k]+i-1]];
830 py[i]= y[koi[koffs[k]+i-1]];
831 pz[i]= z[koi[koffs[k]+i-1]];
832 }
833
834 /*=====================================================================
835 * element-infos schreiben (Z88I1.TXT)
836 *====================================================================*/
837 if(ICFLAG == 1 || ICFLAG == 2)
838 {
839 pxele= 0.5*(px[1]+px[2]);
840 pyele= 0.5*(py[1]+py[2]);
841 pzele= 0.5*(pz[1]+pz[2]);
842 fprintf(fdxf,"\n 0\nTEXT\n 8\nZ88EIO");
843 fprintf(fdxf,"\n 10\n" PG,pxele);
844 fprintf(fdxf,"\n 20\n" PG,pyele);
845 fprintf(fdxf,"\n 30\n" PG,pzele);
846 fprintf(fdxf,"\n 40\n" PG,texts);
847 fprintf(fdxf,"\n 1\nFE " PDB PD,k,ityp[k]);
848 }
849
850 }
851
852 /*----------------------------------------------------------------------
853 * 6 punkte fuer 6-k scheibe bzw. platte
854 *---------------------------------------------------------------------*/
855 else if(ityp[k]== 3 || ityp[k]== 14 || ityp[k]== 15 || ityp[k]== 18)
856 {
857
858 /*=====================================================================
859 * koordinaten holen
860 *====================================================================*/
861 for(i= 1; i <= 6; i++)
862 {
863 px[i]= x[koi[koffs[k]+i-1]];
864 py[i]= y[koi[koffs[k]+i-1]];
865 }
866
867 /*=====================================================================
868 * element-infos schreiben (Z88I1.TXT)
869 *====================================================================*/
870 if(ICFLAG == 1 || ICFLAG == 2)
871 {
872 pxele= 0.333*(px[1]+px[2]+px[3]);
873 pyele= 0.333*(py[1]+py[2]+py[3]);
874 fprintf(fdxf,"\n 0\nTEXT\n 8\nZ88EIO");
875 fprintf(fdxf,"\n 10\n" PG,pxele);
876 fprintf(fdxf,"\n 20\n" PG,pyele);
877 fprintf(fdxf,"\n 30\n0.0");
878 fprintf(fdxf,"\n 40\n" PG,texts);
879 fprintf(fdxf,"\n 1\nFE " PDB PD,k,ityp[k]);
880 }
881
882 }
883
884 /*----------------------------------------------------------------------
885 * 6 punkte fuer 6-k schale
886 *---------------------------------------------------------------------*/
887 else if(ityp[k]== 24)
888 {
889
890 /*=====================================================================
891 * koordinaten holen
892 *====================================================================*/
893 for(i= 1; i <= 6; i++)
894 {
895 px[i]= x[koi[koffs[k]+i-1]];
896 py[i]= y[koi[koffs[k]+i-1]];
897 pz[i]= z[koi[koffs[k]+i-1]];
898 }
899
900 /*=====================================================================
901 * element-infos schreiben (Z88I1.TXT)
902 *====================================================================*/
903 if(ICFLAG == 1 || ICFLAG == 2)
904 {
905 pxele= 0.333*(px[1]+px[2]+px[3]);
906 pyele= 0.333*(py[1]+py[2]+py[3]);
907 pzele= 0.333*(pz[1]+pz[2]+pz[3]);
908 fprintf(fdxf,"\n 0\nTEXT\n 8\nZ88EIO");
909 fprintf(fdxf,"\n 10\n" PG,pxele);
910 fprintf(fdxf,"\n 20\n" PG,pyele);
911 fprintf(fdxf,"\n 30\n" PG,pzele);
912 fprintf(fdxf,"\n 40\n" PG,texts);
913 fprintf(fdxf,"\n 1\nFE " PDB PD,k,ityp[k]);
914 }
915
916 }
917
918 /*----------------------------------------------------------------------
919 * 3 punkte fuer 3-k torus
920 *---------------------------------------------------------------------*/
921 else if(ityp[k]== 6)
922 {
923
924 /*=====================================================================
925 * koordinaten holen
926 *====================================================================*/
927 for(i= 1; i <= 3; i++)
928 {
929 px[i]= x[koi[koffs[k]+i-1]];
930 py[i]= y[koi[koffs[k]+i-1]];
931 }
932
933 /*=====================================================================
934 * element-infos schreiben (Z88I1.TXT)
935 *====================================================================*/
936 if(ICFLAG == 1 || ICFLAG == 2)
937 {
938 pxele= 0.333*(px[1]+px[2]+px[3]);
939 pyele= 0.333*(py[1]+py[2]+py[3]);
940 fprintf(fdxf,"\n 0\nTEXT\n 8\nZ88EIO");
941 fprintf(fdxf,"\n 10\n" PG,pxele);
942 fprintf(fdxf,"\n 20\n" PG,pyele);
943 fprintf(fdxf,"\n 30\n0.0");
944 fprintf(fdxf,"\n 40\n" PG,texts);
945 fprintf(fdxf,"\n 1\nFE " PDB PD,k,ityp[k]);
946 }
947
948 }
949
950 /*---------------------------------------------------------------------
951 * 8 punkte fuer 8-k serendipity-scheibe & -torus bzw. platte
952 *--------------------------------------------------------------------*/
953 else if(ityp[k] == 7 || ityp[k] == 8 || ityp[k] == 20)
954 {
955
956 /*=====================================================================
957 * koordinaten holen
958 *====================================================================*/
959 for(i= 1; i <= 8; i++)
960 {
961 px[i]= x[koi[koffs[k]+i-1]];
962 py[i]= y[koi[koffs[k]+i-1]];
963 }
964
965 /*=====================================================================
966 * entweder element-infos schreiben (Z88I1.TXT)
967 *====================================================================*/
968 if(ICFLAG == 1 || ICFLAG == 2)
969 {
970 pxele= 0.5*(px[1]+px[3]);
971 pyele= 0.5*(py[1]+py[3]);
972 fprintf(fdxf,"\n 0\nTEXT\n 8\nZ88EIO");
973 fprintf(fdxf,"\n 10\n" PG,pxele);
974 fprintf(fdxf,"\n 20\n" PG,pyele);
975 fprintf(fdxf,"\n 30\n0.0");
976 fprintf(fdxf,"\n 40\n" PG,texts);
977 fprintf(fdxf,"\n 1\nFE " PDB PD,k,ityp[k]);
978 }
979
980 /*=====================================================================
981 * .. oder superelement-infos schreiben (Z88NI.TXT)
982 *====================================================================*/
983 else
984 {
985 pxele= 0.5*(px[1]+px[3]);
986 pyele= 0.5*(py[1]+py[3]);
987 fprintf(fdxf,"\n 0\nTEXT\n 8\nZ88EIO");
988 fprintf(fdxf,"\n 10\n" PG,pxele);
989 fprintf(fdxf,"\n 20\n" PG,pyele);
990 fprintf(fdxf,"\n 30\n0.0");
991 fprintf(fdxf,"\n 40\n" PG,texts);
992 fprintf(fdxf,"\n 1\nSE " PDB PDB PDB PDB PCB PDB PC,
993 k,ityp[k],itypfe[k],jel[k],cjmode[k],iel[k],cimode[k]);
994 }
995
996 }
997
998 /*---------------------------------------------------------------------
999 * 8 punkte fuer 8-k schale
1000 *--------------------------------------------------------------------*/
1001 else if(ityp[k] == 23)
1002 {
1003
1004 /*=====================================================================
1005 * koordinaten holen
1006 *====================================================================*/
1007 for(i= 1; i <= 8; i++)
1008 {
1009 px[i]= x[koi[koffs[k]+i-1]];
1010 py[i]= y[koi[koffs[k]+i-1]];
1011 pz[i]= z[koi[koffs[k]+i-1]];
1012 }
1013
1014 /*=====================================================================
1015 * entweder element-infos schreiben (Z88I1.TXT)
1016 *====================================================================*/
1017 if(ICFLAG == 1 || ICFLAG == 2)
1018 {
1019 pxele= 0.5*(px[1]+px[3]);
1020 pyele= 0.5*(py[1]+py[3]);
1021 pzele= 0.5*(pz[1]+pz[3]);
1022 fprintf(fdxf,"\n 0\nTEXT\n 8\nZ88EIO");
1023 fprintf(fdxf,"\n 10\n" PG,pxele);
1024 fprintf(fdxf,"\n 20\n" PG,pyele);
1025 fprintf(fdxf,"\n 30\n" PG,pzele);
1026 fprintf(fdxf,"\n 40\n" PG,texts);
1027 fprintf(fdxf,"\n 1\nFE " PDB PD,k,ityp[k]);
1028 }
1029
1030 }
1031
1032 /*----------------------------------------------------------------------
1033 * 12 punkte fuer 12-k serendipity-scheibe & -torus
1034 *---------------------------------------------------------------------*/
1035 else if(ityp[k]== 11 || ityp[k]== 12)
1036 {
1037
1038 /*=====================================================================
1039 * koordinaten holen
1040 *====================================================================*/
1041 for(i= 1; i <= 12; i++)
1042 {
1043 px[i]= x[koi[koffs[k]+i-1]];
1044 py[i]= y[koi[koffs[k]+i-1]];
1045 }
1046
1047 /*=====================================================================
1048 * entweder element-infos schreiben (Z88I1.TXT)
1049 *====================================================================*/
1050 if(ICFLAG == 1 || ICFLAG == 2)
1051 {
1052 pxele= 0.5*(px[1]+px[3]);
1053 pyele= 0.5*(py[1]+py[3]);
1054 fprintf(fdxf,"\n 0\nTEXT\n 8\nZ88EIO");
1055 fprintf(fdxf,"\n 10\n" PG,pxele);
1056 fprintf(fdxf,"\n 20\n" PG,pyele);
1057 fprintf(fdxf,"\n 30\n0.0");
1058 fprintf(fdxf,"\n 40\n" PG,texts);
1059 fprintf(fdxf,"\n 1\nFE " PDB PD,k,ityp[k]);
1060 }
1061
1062 /*=====================================================================
1063 * .. oder superelement-infos schreiben (Z88NI.TXT)
1064 *====================================================================*/
1065 else
1066 {
1067 pxele= 0.5*(px[1]+px[3]);
1068 pyele= 0.5*(py[1]+py[3]);
1069 fprintf(fdxf,"\n 0\nTEXT\n 8\nZ88EIO");
1070 fprintf(fdxf,"\n 10\n" PG,pxele);
1071 fprintf(fdxf,"\n 20\n" PG,pyele);
1072 fprintf(fdxf,"\n 30\n0.0");
1073 fprintf(fdxf,"\n 40\n" PG,texts);
1074 fprintf(fdxf,"\n 1\nSE " PDB PDB PDB PDB PCB PDB PC,
1075 k,ityp[k],itypfe[k],jel[k],cjmode[k],iel[k],cimode[k]);
1076 }
1077
1078 }
1079
1080 /*----------------------------------------------------------------------
1081 * 16 punkte fuer 16-k platte
1082 *---------------------------------------------------------------------*/
1083 else if(ityp[k]== 19)
1084 {
1085
1086 /*=====================================================================
1087 * koordinaten holen
1088 *====================================================================*/
1089 for(i= 1; i <= 16; i++)
1090 {
1091 px[i]= x[koi[koffs[k]+i-1]];
1092 py[i]= y[koi[koffs[k]+i-1]];
1093 }
1094
1095 /*=====================================================================
1096 * element-infos schreiben (Z88I1.TXT)
1097 *====================================================================*/
1098 if(ICFLAG == 1 || ICFLAG == 2)
1099 {
1100 pxele= 0.5*(px[1]+px[16]);
1101 pyele= 0.5*(py[1]+py[16]);
1102 fprintf(fdxf,"\n 0\nTEXT\n 8\nZ88EIO");
1103 fprintf(fdxf,"\n 10\n" PG,pxele);
1104 fprintf(fdxf,"\n 20\n" PG,pyele);
1105 fprintf(fdxf,"\n 30\n0.0");
1106 fprintf(fdxf,"\n 40\n" PG,texts);
1107 fprintf(fdxf,"\n 1\nFE " PDB PD,k,ityp[k]);
1108 }
1109
1110 }
1111
1112 /*----------------------------------------------------------------------
1113 * 4 punkte fuer 4-k tetraeder
1114 *---------------------------------------------------------------------*/
1115 else if(ityp[k]== 17)
1116 {
1117
1118 /*=====================================================================
1119 * koordinaten holen
1120 *====================================================================*/
1121 for(i= 1; i <= 4; i++)
1122 {
1123 px[i]= x[koi[koffs[k]+i-1]];
1124 py[i]= y[koi[koffs[k]+i-1]];
1125 pz[i]= z[koi[koffs[k]+i-1]];
1126 }
1127
1128 /*=====================================================================
1129 * element-infos schreiben (Z88I1.TXT)
1130 *====================================================================*/
1131 if(ICFLAG == 1 || ICFLAG == 2)
1132 {
1133 pxele= 0.25*(px[1]+px[2]+px[3]+px[4]);
1134 pyele= 0.25*(py[1]+py[2]+py[3]+py[4]);
1135 pzele= 0.25*(pz[1]+pz[2]+pz[3]+pz[4]);
1136 fprintf(fdxf,"\n 0\nTEXT\n 8\nZ88EIO");
1137 fprintf(fdxf,"\n 10\n" PG,pxele);
1138 fprintf(fdxf,"\n 20\n" PG,pyele);
1139 fprintf(fdxf,"\n 30\n" PG,pzele);
1140 fprintf(fdxf,"\n 40\n" PG,texts);
1141 fprintf(fdxf,"\n 1\nFE " PDB PD,k,ityp[k]);
1142 }
1143
1144 }
1145
1146 /*----------------------------------------------------------------------
1147 * 10 punkte fuer 10-k tetraeder
1148 *---------------------------------------------------------------------*/
1149 else if(ityp[k]== 16)
1150 {
1151
1152 /*=====================================================================
1153 * koordinaten holen
1154 *====================================================================*/
1155 for(i= 1; i <= 10; i++)
1156 {
1157 px[i]= x[koi[koffs[k]+i-1]];
1158 py[i]= y[koi[koffs[k]+i-1]];
1159 pz[i]= z[koi[koffs[k]+i-1]];
1160 }
1161
1162 /*=====================================================================
1163 * element-infos schreiben (Z88I1.TXT)
1164 *====================================================================*/
1165 if(ICFLAG == 1 || ICFLAG == 2)
1166 {
1167 pxele= 0.25*(px[1]+px[2]+px[3]+px[4]);
1168 pyele= 0.25*(py[1]+py[2]+py[3]+py[4]);
1169 pzele= 0.25*(pz[1]+pz[2]+pz[3]+pz[4]);
1170 fprintf(fdxf,"\n 0\nTEXT\n 8\nZ88EIO");
1171 fprintf(fdxf,"\n 10\n" PG,pxele);
1172 fprintf(fdxf,"\n 20\n" PG,pyele);
1173 fprintf(fdxf,"\n 30\n" PG,pzele);
1174 fprintf(fdxf,"\n 40\n" PG,texts);
1175 fprintf(fdxf,"\n 1\nFE " PDB PD,k,ityp[k]);
1176 }
1177
1178 }
1179
1180 }
1181
1182 /***********************************************************************
1183 * grosse elementschleife fuer linien
1184 ***********************************************************************/
1185 for(k= 1; k <= ne; k++)
1186 {
1187
1188 /*---------------------------------------------------------------------
1189 * 8 punkte fuer 8-k hexaeder
1190 *--------------------------------------------------------------------*/
1191 if(ityp[k] == 1)
1192 {
1193
1194 /*=====================================================================
1195 * koordinaten holen
1196 *====================================================================*/
1197 for(i= 1; i <= 8; i++)
1198 {
1199 px[i]= x[koi[koffs[k]+i-1]];
1200 py[i]= y[koi[koffs[k]+i-1]];
1201 pz[i]= z[koi[koffs[k]+i-1]];
1202 }
1203
1204 /*=====================================================================
1205 * linien ziehen
1206 *====================================================================*/
1207 for(j= 1; j <= 12; j++)
1208 {
1209 fprintf(fdxf,"\n 0\nLINE\n 8\nZ88NET");
1210 fprintf(fdxf,"\n 10\n" PG,px[i1point[j]]);
1211 fprintf(fdxf,"\n 20\n" PG,py[i1point[j]]);
1212 fprintf(fdxf,"\n 30\n" PG,pz[i1point[j]]);
1213 fprintf(fdxf,"\n 11\n" PG,px[j1point[j]]);
1214 fprintf(fdxf,"\n 21\n" PG,py[j1point[j]]);
1215 fprintf(fdxf,"\n 31\n" PG,pz[j1point[j]]);
1216 }
1217
1218 }
1219
1220 /*---------------------------------------------------------------------
1221 * 20 punkte fuer 20-k hexaeder
1222 *--------------------------------------------------------------------*/
1223 else if(ityp[k] == 10)
1224 {
1225
1226 /*=====================================================================
1227 * koordinaten holen
1228 *====================================================================*/
1229 for(i= 1; i <= 20; i++)
1230 {
1231 px[i]= x[koi[koffs[k]+i-1]];
1232 py[i]= y[koi[koffs[k]+i-1]];
1233 pz[i]= z[koi[koffs[k]+i-1]];
1234 }
1235
1236 /*=====================================================================
1237 * linien ziehen
1238 *====================================================================*/
1239 for(j= 1; j <= 24; j++)
1240 {
1241 fprintf(fdxf,"\n 0\nLINE\n 8\nZ88NET");
1242 fprintf(fdxf,"\n 10\n" PG,px[i10point[j]]);
1243 fprintf(fdxf,"\n 20\n" PG,py[i10point[j]]);
1244 fprintf(fdxf,"\n 30\n" PG,pz[i10point[j]]);
1245 fprintf(fdxf,"\n 11\n" PG,px[j10point[j]]);
1246 fprintf(fdxf,"\n 21\n" PG,py[j10point[j]]);
1247 fprintf(fdxf,"\n 31\n" PG,pz[j10point[j]]);
1248 }
1249
1250 }
1251
1252 /*---------------------------------------------------------------------
1253 * 16 punkte fuer 16-k volumenschalenelement
1254 *--------------------------------------------------------------------*/
1255 else if(ityp[k] == 21)
1256 {
1257
1258 /*=====================================================================
1259 * koordinaten holen
1260 *====================================================================*/
1261 for(i= 1; i <= 16; i++)
1262 {
1263 px[i]= x[koi[koffs[k]+i-1]];
1264 py[i]= y[koi[koffs[k]+i-1]];
1265 pz[i]= z[koi[koffs[k]+i-1]];
1266 }
1267
1268 /*=====================================================================
1269 * linien ziehen
1270 *====================================================================*/
1271 for(j= 1; j <= 20; j++)
1272 {
1273 fprintf(fdxf,"\n 0\nLINE\n 8\nZ88NET");
1274 fprintf(fdxf,"\n 10\n" PG,px[i21point[j]]);
1275 fprintf(fdxf,"\n 20\n" PG,py[i21point[j]]);
1276 fprintf(fdxf,"\n 30\n" PG,pz[i21point[j]]);
1277 fprintf(fdxf,"\n 11\n" PG,px[j21point[j]]);
1278 fprintf(fdxf,"\n 21\n" PG,py[j21point[j]]);
1279 fprintf(fdxf,"\n 31\n" PG,pz[j21point[j]]);
1280 }
1281
1282 }
1283
1284 /*---------------------------------------------------------------------
1285 * 12 punkte fuer 12-k volumenschalenelement
1286 *--------------------------------------------------------------------*/
1287 else if(ityp[k] == 22)
1288 {
1289
1290 /*=====================================================================
1291 * koordinaten holen
1292 *====================================================================*/
1293 for(i= 1; i <= 12; i++)
1294 {
1295 px[i]= x[koi[koffs[k]+i-1]];
1296 py[i]= y[koi[koffs[k]+i-1]];
1297 pz[i]= z[koi[koffs[k]+i-1]];
1298 }
1299
1300 /*=====================================================================
1301 * linien ziehen
1302 *====================================================================*/
1303 for(j= 1; j <= 15; j++)
1304 {
1305 fprintf(fdxf,"\n 0\nLINE\n 8\nZ88NET");
1306 fprintf(fdxf,"\n 10\n" PG,px[i22point[j]]);
1307 fprintf(fdxf,"\n 20\n" PG,py[i22point[j]]);
1308 fprintf(fdxf,"\n 30\n" PG,pz[i22point[j]]);
1309 fprintf(fdxf,"\n 11\n" PG,px[j22point[j]]);
1310 fprintf(fdxf,"\n 21\n" PG,py[j22point[j]]);
1311 fprintf(fdxf,"\n 31\n" PG,pz[j22point[j]]);
1312 }
1313 }
1314
1315 /*----------------------------------------------------------------------
1316 * 2 punkte fuer ebenen stab, ebener balken
1317 *---------------------------------------------------------------------*/
1318 else if(ityp[k]== 9 || ityp[k]== 13)
1319 {
1320
1321 /*=====================================================================
1322 * koordinaten holen
1323 *====================================================================*/
1324 for(i= 1; i <= 2; i++)
1325 {
1326 px[i]= x[koi[koffs[k]+i-1]];
1327 py[i]= y[koi[koffs[k]+i-1]];
1328 }
1329
1330 /*=====================================================================
1331 * linien ziehen
1332 *====================================================================*/
1333 fprintf(fdxf,"\n 0\nLINE\n 8\nZ88NET");
1334 fprintf(fdxf,"\n 10\n" PG,px[1]);
1335 fprintf(fdxf,"\n 20\n" PG,py[1]);
1336 fprintf(fdxf,"\n 30\n0.0");
1337 fprintf(fdxf,"\n 11\n" PG,px[2]);
1338 fprintf(fdxf,"\n 21\n" PG,py[2]);
1339 fprintf(fdxf,"\n 31\n0.0");
1340
1341 }
1342
1343 /*----------------------------------------------------------------------
1344 * 2 punkte fuer raeuml stab, welle, raeuml balken
1345 *---------------------------------------------------------------------*/
1346 else if(ityp[k]== 2 || ityp[k]== 4 || ityp[k]== 5 || ityp[k]== 25)
1347 {
1348
1349 /*=====================================================================
1350 * koordinaten holen
1351 *====================================================================*/
1352 for(i= 1; i <= 2; i++)
1353 {
1354 px[i]= x[koi[koffs[k]+i-1]];
1355 py[i]= y[koi[koffs[k]+i-1]];
1356 pz[i]= z[koi[koffs[k]+i-1]];
1357 }
1358
1359 /*=====================================================================
1360 * linien ziehen
1361 *====================================================================*/
1362 fprintf(fdxf,"\n 0\nLINE\n 8\nZ88NET");
1363 fprintf(fdxf,"\n 10\n" PG,px[1]);
1364 fprintf(fdxf,"\n 20\n" PG,py[1]);
1365 fprintf(fdxf,"\n 30\n" PG,pz[1]);
1366 fprintf(fdxf,"\n 11\n" PG,px[2]);
1367 fprintf(fdxf,"\n 21\n" PG,py[2]);
1368 fprintf(fdxf,"\n 31\n" PG,pz[2]);
1369
1370 }
1371
1372 /*----------------------------------------------------------------------
1373 * 6 punkte fuer 6-k scheibe bzw. platte
1374 *---------------------------------------------------------------------*/
1375 else if(ityp[k]== 3 || ityp[k]== 14 || ityp[k]== 15 || ityp[k]== 18)
1376 {
1377
1378 /*=====================================================================
1379 * koordinaten holen
1380 *====================================================================*/
1381 for(i= 1; i <= 6; i++)
1382 {
1383 px[i]= x[koi[koffs[k]+i-1]];
1384 py[i]= y[koi[koffs[k]+i-1]];
1385 }
1386
1387 /*=====================================================================
1388 * linien ziehen
1389 *====================================================================*/
1390 for(j= 1; j <= 6; j++)
1391 {
1392 fprintf(fdxf,"\n 0\nLINE\n 8\nZ88NET");
1393 fprintf(fdxf,"\n 10\n" PG,px[i3point[j]]);
1394 fprintf(fdxf,"\n 20\n" PG,py[i3point[j]]);
1395 fprintf(fdxf,"\n 30\n0.0");
1396 fprintf(fdxf,"\n 11\n" PG,px[j3point[j]]);
1397 fprintf(fdxf,"\n 21\n" PG,py[j3point[j]]);
1398 fprintf(fdxf,"\n 31\n0.0");
1399 }
1400
1401 }
1402
1403 /*----------------------------------------------------------------------
1404 * 6 punkte fuer 6-k schale
1405 *---------------------------------------------------------------------*/
1406 else if(ityp[k]== 24)
1407 {
1408
1409 /*=====================================================================
1410 * koordinaten holen
1411 *====================================================================*/
1412 for(i= 1; i <= 6; i++)
1413 {
1414 px[i]= x[koi[koffs[k]+i-1]];
1415 py[i]= y[koi[koffs[k]+i-1]];
1416 pz[i]= z[koi[koffs[k]+i-1]];
1417 }
1418
1419 /*=====================================================================
1420 * linien ziehen
1421 *====================================================================*/
1422 for(j= 1; j <= 6; j++)
1423 {
1424 fprintf(fdxf,"\n 0\nLINE\n 8\nZ88NET");
1425 fprintf(fdxf,"\n 10\n" PG,px[i3point[j]]);
1426 fprintf(fdxf,"\n 20\n" PG,py[i3point[j]]);
1427 fprintf(fdxf,"\n 30\n" PG,pz[i3point[j]]);
1428 fprintf(fdxf,"\n 11\n" PG,px[j3point[j]]);
1429 fprintf(fdxf,"\n 21\n" PG,py[j3point[j]]);
1430 fprintf(fdxf,"\n 31\n" PG,pz[j3point[j]]);
1431 }
1432
1433 }
1434
1435 /*----------------------------------------------------------------------
1436 * 3 punkte fuer 3-k torus
1437 *---------------------------------------------------------------------*/
1438 else if(ityp[k]== 6)
1439 {
1440
1441 /*=====================================================================
1442 * koordinaten holen
1443 *====================================================================*/
1444 for(i= 1; i <= 3; i++)
1445 {
1446 px[i]= x[koi[koffs[k]+i-1]];
1447 py[i]= y[koi[koffs[k]+i-1]];
1448 }
1449
1450 /*=====================================================================
1451 * linien ziehen
1452 *====================================================================*/
1453 for(j= 1; j <= 3; j++)
1454 {
1455 fprintf(fdxf,"\n 0\nLINE\n 8\nZ88NET");
1456 fprintf(fdxf,"\n 10\n" PG,px[i6point[j]]);
1457 fprintf(fdxf,"\n 20\n" PG,py[i6point[j]]);
1458 fprintf(fdxf,"\n 30\n0.0");
1459 fprintf(fdxf,"\n 11\n" PG,px[j6point[j]]);
1460 fprintf(fdxf,"\n 21\n" PG,py[j6point[j]]);
1461 fprintf(fdxf,"\n 31\n0.0");
1462 }
1463
1464 }
1465
1466 /*---------------------------------------------------------------------
1467 * 8 punkte fuer 8-k serendipity-scheibe & -torus bzw. platte
1468 *--------------------------------------------------------------------*/
1469 else if(ityp[k] == 7 || ityp[k] == 8 || ityp[k]== 20)
1470 {
1471
1472 /*=====================================================================
1473 * koordinaten holen
1474 *====================================================================*/
1475 for(i= 1; i <= 8; i++)
1476 {
1477 px[i]= x[koi[koffs[k]+i-1]];
1478 py[i]= y[koi[koffs[k]+i-1]];
1479 }
1480
1481 /*=====================================================================
1482 * linien ziehen
1483 *====================================================================*/
1484 for(j= 1; j <= 8; j++)
1485 {
1486 fprintf(fdxf,"\n 0\nLINE\n 8\nZ88NET");
1487 fprintf(fdxf,"\n 10\n" PG,px[i7point[j]]);
1488 fprintf(fdxf,"\n 20\n" PG,py[i7point[j]]);
1489 fprintf(fdxf,"\n 30\n0.0");
1490 fprintf(fdxf,"\n 11\n" PG,px[j7point[j]]);
1491 fprintf(fdxf,"\n 21\n" PG,py[j7point[j]]);
1492 fprintf(fdxf,"\n 31\n0.0");
1493 }
1494
1495 }
1496
1497 /*---------------------------------------------------------------------
1498 * 8 punkte fuer 8-k schale
1499 *--------------------------------------------------------------------*/
1500 else if(ityp[k] == 23)
1501 {
1502
1503 /*=====================================================================
1504 * koordinaten holen
1505 *====================================================================*/
1506 for(i= 1; i <= 8; i++)
1507 {
1508 px[i]= x[koi[koffs[k]+i-1]];
1509 py[i]= y[koi[koffs[k]+i-1]];
1510 pz[i]= z[koi[koffs[k]+i-1]];
1511 }
1512
1513 /*=====================================================================
1514 * linien ziehen
1515 *====================================================================*/
1516 for(j= 1; j <= 8; j++)
1517 {
1518 fprintf(fdxf,"\n 0\nLINE\n 8\nZ88NET");
1519 fprintf(fdxf,"\n 10\n" PG,px[i7point[j]]);
1520 fprintf(fdxf,"\n 20\n" PG,py[i7point[j]]);
1521 fprintf(fdxf,"\n 30\n" PG,pz[i7point[j]]);
1522 fprintf(fdxf,"\n 11\n" PG,px[j7point[j]]);
1523 fprintf(fdxf,"\n 21\n" PG,py[j7point[j]]);
1524 fprintf(fdxf,"\n 31\n" PG,pz[j7point[j]]);
1525 }
1526
1527 }
1528
1529 /*----------------------------------------------------------------------
1530 * 12 punkte fuer 12-k serendipity-scheibe & -torus
1531 *---------------------------------------------------------------------*/
1532 else if(ityp[k]== 11 || ityp[k]== 12)
1533 {
1534
1535 /*=====================================================================
1536 * koordinaten holen
1537 *====================================================================*/
1538 for(i= 1; i <= 12; i++)
1539 {
1540 px[i]= x[koi[koffs[k]+i-1]];
1541 py[i]= y[koi[koffs[k]+i-1]];
1542 }
1543
1544 /*=====================================================================
1545 * linien ziehen
1546 *====================================================================*/
1547 for(j= 1; j <= 12; j++)
1548 {
1549 fprintf(fdxf,"\n 0\nLINE\n 8\nZ88NET");
1550 fprintf(fdxf,"\n 10\n" PG,px[i11point[j]]);
1551 fprintf(fdxf,"\n 20\n" PG,py[i11point[j]]);
1552 fprintf(fdxf,"\n 30\n0.0");
1553 fprintf(fdxf,"\n 11\n" PG,px[j11point[j]]);
1554 fprintf(fdxf,"\n 21\n" PG,py[j11point[j]]);
1555 fprintf(fdxf,"\n 31\n0.0");
1556 }
1557
1558 }
1559
1560 /*---------------------------------------------------------------------
1561 * 16 punkte fuer 16-k lagrange platte
1562 *--------------------------------------------------------------------*/
1563 else if(ityp[k] == 19)
1564 {
1565
1566 /*=====================================================================
1567 * koordinaten holen
1568 *====================================================================*/
1569 for(i= 1; i <= 16; i++)
1570 {
1571 px[i]= x[koi[koffs[k]+i-1]];
1572 py[i]= y[koi[koffs[k]+i-1]];
1573 }
1574
1575 /*=====================================================================
1576 * linien ziehen
1577 *====================================================================*/
1578 for(j= 1; j <= 16; j++)
1579 {
1580 fprintf(fdxf,"\n 0\nLINE\n 8\nZ88NET");
1581 fprintf(fdxf,"\n 10\n" PG,px[i19point[j]]);
1582 fprintf(fdxf,"\n 20\n" PG,py[i19point[j]]);
1583 fprintf(fdxf,"\n 30\n0.0");
1584 fprintf(fdxf,"\n 11\n" PG,px[j19point[j]]);
1585 fprintf(fdxf,"\n 21\n" PG,py[j19point[j]]);
1586 fprintf(fdxf,"\n 31\n0.0");
1587 }
1588
1589 }
1590
1591 /*---------------------------------------------------------------------
1592 * 4 punkte fuer 4-k tetraeder
1593 *--------------------------------------------------------------------*/
1594 if(ityp[k] == 17)
1595 {
1596
1597 /*=====================================================================
1598 * koordinaten holen
1599 *====================================================================*/
1600 for(i= 1; i <= 4; i++)
1601 {
1602 px[i]= x[koi[koffs[k]+i-1]];
1603 py[i]= y[koi[koffs[k]+i-1]];
1604 pz[i]= z[koi[koffs[k]+i-1]];
1605 }
1606
1607 /*=====================================================================
1608 * linien ziehen
1609 *====================================================================*/
1610 for(j= 1; j <= 6; j++)
1611 {
1612 fprintf(fdxf,"\n 0\nLINE\n 8\nZ88NET");
1613 fprintf(fdxf,"\n 10\n" PG,px[i17point[j]]);
1614 fprintf(fdxf,"\n 20\n" PG,py[i17point[j]]);
1615 fprintf(fdxf,"\n 30\n" PG,pz[i17point[j]]);
1616 fprintf(fdxf,"\n 11\n" PG,px[j17point[j]]);
1617 fprintf(fdxf,"\n 21\n" PG,py[j17point[j]]);
1618 fprintf(fdxf,"\n 31\n" PG,pz[j17point[j]]);
1619 }
1620
1621 }
1622
1623 /*---------------------------------------------------------------------
1624 * 10 punkte fuer 10-k tetraeder
1625 *--------------------------------------------------------------------*/
1626 if(ityp[k] == 16)
1627 {
1628
1629 /*=====================================================================
1630 * koordinaten holen
1631 *====================================================================*/
1632 for(i= 1; i <= 10; i++)
1633 {
1634 px[i]= x[koi[koffs[k]+i-1]];
1635 py[i]= y[koi[koffs[k]+i-1]];
1636 pz[i]= z[koi[koffs[k]+i-1]];
1637 }
1638
1639 /*=====================================================================
1640 * linien ziehen
1641 *====================================================================*/
1642 for(j= 1; j <= 12; j++)
1643 {
1644 fprintf(fdxf,"\n 0\nLINE\n 8\nZ88NET");
1645 fprintf(fdxf,"\n 10\n" PG,px[i16point[j]]);
1646 fprintf(fdxf,"\n 20\n" PG,py[i16point[j]]);
1647 fprintf(fdxf,"\n 30\n" PG,pz[i16point[j]]);
1648 fprintf(fdxf,"\n 11\n" PG,px[j16point[j]]);
1649 fprintf(fdxf,"\n 21\n" PG,py[j16point[j]]);
1650 fprintf(fdxf,"\n 31\n" PG,pz[j16point[j]]);
1651 }
1652
1653 }
1654
1655
1656 } // Ende Elementschleife
1657
1658 /***********************************************************************
1659 * file schliessen
1660 ***********************************************************************/
1661 fprintf(fdxf,"\n 0\nENDSEC\n 0\nEOF\n");
1662 fclose(fdxf);
1663
1664 /***********************************************************************
1665 * Ende Z88TX
1666 ***********************************************************************/
1667 wlog88x(0,LOG_EXITZ88TX);
1668 wrim88x(0,TX_EXITZ88TX);
1669 return(0);
1670 }
1671
1672