File: z88n.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 (256 lines) | stat: -rw-r--r-- 7,132 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
/***********************************************************************
* 
*               *****   ***    ***
*                  *   *   *  *   *
*                 *     ***    ***
*                *     *   *  *   *
*               *****   ***    ***
*
* 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 z88n.c
* 22.1.2008 Rieg
****************************************************************************/

/***********************************************************************
* Fuer UNIX
***********************************************************************/
#ifdef FR_UNIX
#include <z88n.h>  
#include <stdio.h>    /* FILE */
#endif

/****************************************************************************
* Function-Declarationen
****************************************************************************/
int dyn88n(void);
int ale88n(int);
int who88n(void);
int rni88(void);
int join88(void);
int mc188n(void);
int mc288n(void);
int mc388n(void);
int mc488n(void);
int mc588n(void);
void stop88n(void);
int lan88n(void);

/****************************************************************************
* globale Variable
****************************************************************************/
/*--------------------------------------------------------------------------
* Files
*-------------------------------------------------------------------------*/
FILE *fdyn,*fwlo,*fni,*fi1;

/*  
**   fdyn= z88.dyn
**   fwlo= z88n.log
**   fni=  z88ni.txt
**   fi1=  z88i1.txt
*/ 

char cdyn[8] = "z88.dyn";
char clgd[9] = "z88n.log";
char cni[10] = "z88ni.txt";
char ci1[10] = "z88i1.txt";
  
/*--------------------------------------------------------------------------
* Pointer
*-------------------------------------------------------------------------*/
FR_DOUBLEAY x;
FR_DOUBLEAY y;
FR_DOUBLEAY z;
FR_DOUBLEAY xss;
FR_DOUBLEAY yss;
FR_DOUBLEAY zss;
FR_DOUBLEAY qparass;
FR_DOUBLEAY riyyss;
FR_DOUBLEAY emodss;
FR_DOUBLEAY rnuess;

FR_INT4AY koima;
FR_INT4AY join; 
FR_INT4AY koiss;
FR_INT4AY ioffss;
FR_INT4AY koffss;
FR_INT4AY jel;
FR_INT4AY iel;
FR_INT4AY kel;
FR_INT4AY ivonss;
FR_INT4AY ibisss;
FR_INT4AY intoss;
FR_INT4AY ivon;
FR_INT4AY ibis;

FR_CHARAY cjmode;
FR_CHARAY cimode;
FR_CHARAY ckmode;

/*--------------------------------------------------------------------------
* Arrays
*-------------------------------------------------------------------------*/
FR_DOUBLE h[21];

FR_INT4 jhxsta[21]= {0,1,3,3,1,1,3,3,1,2,3,2,1,2,3,2,1,1,3,3,1};
FR_INT4 ihxsta[21]= {0,1,1,3,3,1,1,3,3,1,2,3,2,1,2,3,2,1,1,3,3};
FR_INT4 khxsta[21]= {0,1,1,1,1,3,3,3,3,1,1,1,1,3,3,3,3,2,2,2,2};
FR_INT4 jlqsta[9] = {0,1,2,2,1,1,2,2,1};
FR_INT4 ilqsta[9] = {0,1,1,2,2,1,1,2,2};
FR_INT4 klqsta[9] = {0,1,1,1,1,2,2,2,2};
FR_INT4 jcssta[9] = {0,1,3,3,1,2,3,2,1};
FR_INT4 icssta[9] = {0,1,1,3,3,1,2,3,2};
FR_INT4 jklsta[17]= {0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4};
FR_INT4 iklsta[17]= {0,1,2,3,4,1,2,3,4,1,2,3,4,1,2,3,4};

/*--------------------------------------------------------------------------
* Variable
*-------------------------------------------------------------------------*/
FR_INT4 IDYNMEM,LANG;
FR_INT4 ndim,nkpss,ness,nfreis,negss,kflags,ifrei;
FR_INT4 itypss,ityp;
FR_INT4 ibflag,ipflag,iqflag,niflag;

/*--------------------------------------------------------------------------
* vorbelegte Variable
*-------------------------------------------------------------------------*/
FR_DOUBLE epsx=  0.01;
FR_DOUBLE epsy=  0.01;
FR_DOUBLE epsz=  0.01;

FR_INT4 MAXSE=0,MAXESS=0,MAXKSS=0,MAXK=0,MAXE=0,MAXNFG=0,MAXNEG=0,MAXAN=0;

FR_INT4 kflag= 0;

/*****************************************************************************
* Hauptprogramm
*****************************************************************************/
int main(void)
{
int iret;

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

if(iret != 0)
  {
  ale88n(iret);
  stop88n();
  }

/*---------------------------------------------------------------------------
* Ueberschrift
*--------------------------------------------------------------------------*/
who88n();
     
/*---------------------------------------------------------------------------
* dyn88n starten: anfordern dynamic memory
*--------------------------------------------------------------------------*/
iret= dyn88n();
if(iret != 0)
  {
  ale88n(iret);
  stop88n();              
  }           

/*---------------------------------------------------------------------------
* Einlesen Z88NI.TXT
*--------------------------------------------------------------------------*/
iret= rni88();
if(iret != 0)
  {
  ale88n(iret);
  stop88n();              
  }           

/*---------------------------------------------------------------------------
* join berechnen
*--------------------------------------------------------------------------*/
join88();

/*---------------------------------------------------------------------------
* Entscheiden, welche Function mcX88n
*--------------------------------------------------------------------------*/
if( itypss == 10 && ityp == 10 ) 
  {
  iret= mc188n();
  if(iret != 0)
    {
    ale88n(iret);
    stop88n();              
    }           
  }

if( itypss == 10 && ityp == 1 ) 
  {
  iret= mc288n();
  if(iret != 0)
    {
    ale88n(iret);
    stop88n();              
    }           
  }

if( (itypss == 7 || itypss == 8 || itypss == 20) && 
    (ityp == 7 || ityp == 8 || ityp == 20)) 
  {
  iret= mc388n();
  if(iret != 0)
    {
    ale88n(iret);
    stop88n();              
    }           
  }

if( (itypss == 11 || itypss == 12) && (ityp == 7 || ityp == 8)) 
  {
  iret= mc488n();
  if(iret != 0)
    {
    ale88n(iret);
    stop88n();              
    }           
  }
  
if( itypss == 20 && ityp == 19) 
  {
  iret= mc588n();
  if(iret != 0)
    {
    ale88n(iret);
    stop88n();              
    }           
  }

return(0);
}