File: z88x.c

package info (click to toggle)
z88 13.0.0%2Bdfsg2-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 107,800 kB
  • ctags: 3,296
  • sloc: ansic: 45,530; sh: 71; makefile: 14
file content (369 lines) | stat: -rw-r--r-- 11,265 bytes parent folder | download | duplicates (4)
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
/***********************************************************************
* 
*               *****   ***    ***
*                  *   *   *  *   *
*                 *     ***    ***
*                *     *   *  *   *
*               *****   ***    ***
*
* A FREE Finite Elements Analysis Program in ANSI C for the UNIX OS.
*
* Composed and edited and copyright by 
* Professor Dr.-Ing. Frank Rieg, University of Bayreuth, Germany
*
* eMail: 
* frank.rieg@uni-bayreuth.de
* dr.frank.rieg@t-online.de
* 
* V12.0  February 14, 2005
*
* Z88 should compile and run under any UNIX OS and Motif 2.0.
*
* This program 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 2, or (at your option)
* any later version.
*
* This program 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.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING.  If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
***********************************************************************/ 
/****************************************************************************
*  Programm z88x.c
*  22.1.2008 Rieg
****************************************************************************/

/***********************************************************************
* Fuer UNIX
***********************************************************************/
#ifdef FR_UNIX
#include <z88x.h>  
#include <stdio.h>    /* FILE */
#include <ctype.h>    /* toupper */
#include <string.h>   /* strcpy,strcmp */
#include <stdlib.h>     /* atof */
#endif

/****************************************************************************
*  Function-Declarationen
****************************************************************************/
int lan88x(void);
int dyn88x(void);
int ale88x(int);
int who88x(void);
int rea88x(void);
int rdxf88x(void);
int z88tx(void);
int z88fx(void);
int wrim88x(FR_INT4,int);
int wlog88x(FR_INT4,int);
void stop88x(void);
void sub88x(FR_INT4);

/****************************************************************************
*  globale Variable
****************************************************************************/
/*--------------------------------------------------------------------------
* Files
*-------------------------------------------------------------------------*/
FILE *fdyn,*fwlo,*fz88,*fdxf,*fi2,*fi3,*fi5;

/*  
**   fdyn= z88.dyn
**   fwlo= z88x.log
**   fz88= z88ni.txt oder z88i1.txt
**   fdxf= z88x.dxf oder z88x.dxf
**   fi2 = z88i2.txt
**   fi3 = z88i3.txt
**   fi5 = z88i5.txt
*/ 

char cdyn[8] = "z88.dyn";
char clgd[9] = "z88x.log";
char ci1[10] = "z88i1.txt";
char ci2[10] = "z88i2.txt";
char ci3[10] = "z88i3.txt";
char ci5[10] = "z88i5.txt";
char cni[10] = "z88ni.txt";
char cxx[10] = "z88x.dxf";
  
/*--------------------------------------------------------------------------
* Pointer
*-------------------------------------------------------------------------*/
FR_DOUBLEAY x;
FR_DOUBLEAY y;
FR_DOUBLEAY z;
FR_DOUBLEAY emod;
FR_DOUBLEAY rnue;
FR_DOUBLEAY qpara;
FR_DOUBLEAY riyy;
FR_DOUBLEAY eyy;
FR_DOUBLEAY rizz;
FR_DOUBLEAY ezz;
FR_DOUBLEAY rit;
FR_DOUBLEAY wt;
FR_DOUBLEAY wert;
FR_DOUBLEAY pres;
FR_DOUBLEAY tr1;
FR_DOUBLEAY tr2;

FR_INT4AY koi;
FR_INT4AY ifrei; 
FR_INT4AY ioffs;
FR_INT4AY koffs;
FR_INT4AY ityp;
FR_INT4AY itypfe;
FR_INT4AY ivon;
FR_INT4AY ibis;
FR_INT4AY intord;
FR_INT4AY jel;
FR_INT4AY iel;
FR_INT4AY kel;
FR_INT4AY nkn;
FR_INT4AY ifg;
FR_INT4AY irflag;
FR_INT4AY nep;
FR_INT4AY noi;
FR_INT4AY noffs;

FR_CHARAY cjmode;
FR_CHARAY cimode;
FR_CHARAY ckmode;

/*--------------------------------------------------------------------------
* Variable
*-------------------------------------------------------------------------*/
FR_DOUBLE epsx,epsy,epsz;
FR_DOUBLE texts;

FR_INT4 intore,nel,ktyp;
FR_INT4 LANG,IDYNMEM,ICFLAG;
FR_INT4 ndim,nkp,ne,nfg,neg,nkoi,kflag,ibflag,ipflag,iqflag,niflag;
FR_INT4 nrb,npr,ninto,ksflag,isflag;
FR_INT4 ianz,ifrej;

char cflag[10];

/*--------------------------------------------------------------------------
* vorbelegte Variable
*-------------------------------------------------------------------------*/
FR_INT4 MAXNFG=0,MAXK=0,MAXE=0,MAXKOI=0,MAXNEG=0,MAXPR=0;
FR_INT4 ITSFLAG= 0;

/*****************************************************************************
* hauptprogramm
*****************************************************************************/
int main(int argc,char *argv[])
{
int iret,i;
char cflagul[10], cftexts[10], cfts[10];

/*---------------------------------------------------------------------------
*  Die Sprache feststellen
*--------------------------------------------------------------------------*/
LANG = 0;
iret= lan88x();

if(iret != 0)
  {
  ale88x(iret);
  stop88x();
  }

/*---------------------------------------------------------------------------
*  Ueberschrift
*--------------------------------------------------------------------------*/
who88x();

/*---------------------------------------------------------------------------
*  Die Flags abfragen
*--------------------------------------------------------------------------*/
ICFLAG= 0;

if(argc <= 1)
  {
  ale88x(AL_NOCFLAG); 
  stop88x();              
  }

/*==========================================================================
* Steuerflag
*=========================================================================*/
strcpy(cflagul,argv[1]);  
for(i= 0; i < 6; i++)
  cflag[i]= toupper(cflagul[i]);
  
if     (strcmp("-I1TX",cflag) == 0)
  ICFLAG= 1;
else if(strcmp("-IATX",cflag) == 0)
  ICFLAG= 2;
else if(strcmp("-NITX",cflag) == 0)
  ICFLAG= 3;
else if(strcmp("-I1FX",cflag) == 0)
  ICFLAG= 4;
else if(strcmp("-IAFX",cflag) == 0)
  ICFLAG= 5;
else if(strcmp("-NIFX",cflag) == 0)
  ICFLAG= 6;
else if(strcmp("-BDOF",cflag) == 0)
  printf("\n140655\n");
else
  { 
  wrim88x(ICFLAG,TX_CFLAG);
  ale88x(AL_WROCFLAG); 
  stop88x();              
  }      

wrim88x(ICFLAG,TX_CFLAG);

/*==========================================================================
* Textgroesse
*=========================================================================*/
if(argc == 4)
  {
  strcpy(cftexts,argv[2]);  
  for(i= 0; i < 4; i++)
    cfts[i]= toupper(cftexts[i]);
  
  if(strcmp("-TS",cfts) == 0)
    {
    ITSFLAG= 1;
    texts= (FR_DOUBLE) atof(argv[3]);
    printf("-ts %lg\n",texts);
    }
  }

/*---------------------------------------------------------------------------
* dyn88x starten: anfordern dynamic memory
*--------------------------------------------------------------------------*/
iret= dyn88x();
if(iret != 0)
  {
  ale88x(iret);
  stop88x();              
  }           

/*---------------------------------------------------------------------------
* Entscheiden, welcher Berechnungsgang
*--------------------------------------------------------------------------*/
if(ICFLAG == 1 || ICFLAG == 2)
  {                                    /* Start -I1TX oder -IATX */ 

/*---------------------------------------------------------------------------
* Berechnungsgang 1: von Z88I1.TXT nach Z88X.DXF
* Berechnungsgang 2: von Z88I1.TXT, Z88I2.TXT, Z88I3.TXT nach Z88X.DXF
*--------------------------------------------------------------------------*/
/*===========================================================================
* Einlesen Z88I1.TXT
*==========================================================================*/
  iret= rea88x();
  if(iret != 0)
    {
    ale88x(iret);
    stop88x();              
    }           
  
/*===========================================================================
* Rechnen
*==========================================================================*/
  iret= z88tx();
  if(iret != 0)
    {
    ale88x(iret);
    stop88x();              
    }           

  wrim88x(0,TX_EXITZ88X);
  return(0);
  }                                    /* Ende -I1TX und -IATX */
/*---------------------------------------------------------------------------
* Ende Berechnungsgang 1 und 2
*--------------------------------------------------------------------------*/

if(ICFLAG == 3)
  {                                    /* Start -NITX */ 

/*---------------------------------------------------------------------------
* Berechnungsgang 3: von Z88NI.TXT nach Z88X.DXF
*--------------------------------------------------------------------------*/
/*===========================================================================
* Einlesen Z88NI.TXT
*==========================================================================*/
  iret= rea88x();
  if(iret != 0)
    {
    ale88x(iret);
    stop88x();              
    }           
  
/*===========================================================================
* Rechnen
*==========================================================================*/
  iret= z88tx();
  if(iret != 0)
    {
    ale88x(iret);
    stop88x();              
    }           

  wrim88x(0,TX_EXITZ88X);
  return(0);
  }                                    /* Ende -NITX */
/*---------------------------------------------------------------------------
* Ende Berechnungsgang 3
*--------------------------------------------------------------------------*/

if(ICFLAG == 4 || ICFLAG == 5)
  {                                    /* Start -I1FX oder -IAFX */ 

/*---------------------------------------------------------------------------
* Berechnungsgang 4: von Z88X.DXF nach Z88I1.TXT
* Berechnungsgang 5: von Z88X.DXF nach Z88I1.TXT, Z88I2.TXT, Z88I3.TXT
*--------------------------------------------------------------------------*/
/*===========================================================================
* Rechnen
*==========================================================================*/
  iret= z88fx();
  if(iret != 0)
    {
    ale88x(iret);
    stop88x();              
    }           

  wrim88x(0,TX_EXITZ88X);
  return(0);
  }                                    /* Ende -I1FX oder -IAFX */
/*---------------------------------------------------------------------------
* Ende Berechnungsgang 4 und 5
*--------------------------------------------------------------------------*/

if(ICFLAG == 6)
  {                                    /* Start -NIFX */ 

/*---------------------------------------------------------------------------
* Berechnungsgang 6: von Z88X.DXF nach Z88NI.TXT
*--------------------------------------------------------------------------*/
/*===========================================================================
* Rechnen
*==========================================================================*/
  iret= z88fx();
  if(iret != 0)
    {
    ale88x(iret);
    stop88x();              
    }           

  wrim88x(0,TX_EXITZ88X);
  return(0);
  }                                    /* Ende -NIFX */
/*---------------------------------------------------------------------------
* Ende Berechnungsgang 6
*--------------------------------------------------------------------------*/

return(0);
}