File: wrim88f.c

package info (click to toggle)
z88 13.0.0+dfsg2-6
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 107,792 kB
  • sloc: ansic: 45,530; sh: 71; makefile: 14
file content (259 lines) | stat: -rw-r--r-- 7,426 bytes parent folder | download | duplicates (3)
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
/***********************************************************************
* 
*               *****   ***    ***
*                  *   *   *  *   *
*                 *     ***    ***
*                *     *   *  *   *
*               *****   ***    ***
*
* 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.
***********************************************************************/ 
/***********************************************************************
* Diese Compilerunit umfasst:
* - wrim88f gibt Texte aus (1 FR_INT4)
* - wproz88 gibt Prozentanteil aus (1 FR_INT4, 1 FR_DOUBLE)
* - wtyp88f gibt Elementtypen aus (1 FR_INT4, 1 FR_INT4)
* 18.1.2008 Rieg
***********************************************************************/ 

/***********************************************************************
* Fuer UNIX
***********************************************************************/
#ifdef FR_UNIX
#include <z88f.h>
#include <stdio.h>    /* printf */
#endif

/***********************************************************************
* Formate
***********************************************************************/
#ifdef FR_XINT
#define PD "%d"
#define P5D "%5d"
#endif

#ifdef FR_XLONG
#define PD "%ld"
#define P5D "%5ld"
#endif

#ifdef FR_XLOLO
#define PD "%lld"
#define P5D "%5lld"
#endif

#ifdef FR_XDOUB
#define P6F "%6.2lf"
#endif

#ifdef FR_XQUAD
#define P6F "%6.2Lf"
#endif

/***********************************************************************
*  hier beginnt Function wrim88f
***********************************************************************/
int wrim88f(FR_INT4 i,int iatx)
{
extern FR_INT4 LANG;

switch(iatx)
  {
  case TX_CHOJ:
    printf("\r" PD,i);
  break;

  case TX_ELE:
    if(LANG == 1) printf("\rElement " PD,i);
    if(LANG == 2) printf("\relement " PD,i);
  break;

  case TX_NFG:
    if(LANG == 1) printf(PD " x " PD " = Groesse Gleichungsystem \n",i,i);
    if(LANG == 2) printf(PD " x " PD " = size of system of equations\n",i,i);
  break;
 
  case TX_REAI1:
    if(LANG == 1) printf("Z88I1.TXT einlesen\n");
    if(LANG == 2) printf("reading Z88I1.TXT\n");
  break;

  case TX_REAI5:
    if(LANG == 1) printf("\n***** Lastvektoren berechnen *****");
    if(LANG == 2) printf("\n***** computing load vectors *****");
  break;

  case TX_KOOR:
    if(LANG == 1) printf("Koordinaten einlesen\n");
    if(LANG == 2) printf("reading coordinates\n");
  break;

  case TX_POLAR:
    if(LANG == 1) printf("Polar/Zylinder-Koordinaten umrechnen\n");
    if(LANG == 2) printf("converting polar/cylinder coordinates\n");
  break;

  case TX_KOIN:
    if(LANG == 1) printf("Koinzidenz einlesen\n");
    if(LANG == 2) printf("reading element information\n");
  break;

  case TX_EGES:
    if(LANG == 1) printf("Elastizitaetsgesetze einlesen\n");
    if(LANG == 2) printf("reading material information\n");
  break;

  case TX_Z88A:
    if(LANG == 1) printf(">>> Start Z88A: Pass 1 von Z88F <<<\n");
    if(LANG == 2) printf(">>> start Z88A: pass 1 of Z88F <<<\n");
  break;

  case TX_Z88B:
    if(LANG == 1) printf(">>> Start Z88B: Pass 2 von Z88F <<<\n");
    if(LANG == 2) printf(">>> start Z88B: pass 2 of Z88F <<<\n");
  break;

  case TX_FORMA:
    if(LANG == 1) printf("***** Formatieren *****\n");
    if(LANG == 2) printf("***** formatting *****\n");
  break;

  case TX_WRIO0:
    if(LANG == 1) printf("Z88O0.TXT beschreiben\n");
    if(LANG == 2) printf("writing Z88O0.TXT\n");
  break;

  case TX_WRIO1:
    if(LANG == 1) printf("Z88O1.TXT beschreiben\n");
    if(LANG == 2) printf("writing Z88O1.TXT\n");
  break;

  case TX_WRIO2:
    if(LANG == 1) printf("Z88O2.TXT beschreiben, Ende Z88F\n");
    if(LANG == 2) printf("writing Z88O2.TXT, Z88F done\n");
  break;

  case TX_WRI1Y:
    if(LANG == 1) printf("\nZ88O1.BNY beschreiben\n");
    if(LANG == 2) printf("\nwriting Z88O1.BNY\n");
  break;

  case TX_GSERF:
    if(LANG == 1) printf("Vektor GS erfordert " PD " Elemente\n",i);
    if(LANG == 2) printf("vector GS needs " PD " elements\n",i);
  break;

  case TX_KOIERF:
    if(LANG == 1) printf("Vektor KOI erfordert " PD " Elemente\n",i);
    if(LANG == 2) printf("vector KOI needs " PD " elements\n",i);
  break;

  case TX_WRI3Y:
    if(LANG == 1) printf("Z88O3.BNY beschreiben\n");
    if(LANG == 2) printf("writing Z88O3.BNY\n");
  break;

  case TX_COMPI:
    if(LANG == 1) printf("***** Compilation *****\n");
    if(LANG == 2) printf("***** compilation *****\n");
  break;

  case TX_Z88CC:
    if(LANG == 1) printf(">>> Start Z88CC: Pass 3 von Z88F <<<\n");
    if(LANG == 2) printf(">>> start Z88CC: pass 3 of Z88F <<<\n");
  break;

  case TX_REAI2:
    if(LANG == 1) printf("Einlesen von Randbedingungsfile Z88I2.TXT\n");
    if(LANG == 2) printf("reading constraint file Z88I2.TXT\n");
  break;

  case TX_ERBPA:
    if(LANG == 1) printf("Einarbeiten der Randbedingungen Pass " PD "\n",i);
    if(LANG == 2) printf("incorporating constraints pass " PD "\n",i);
  break;

  case TX_SCAL88:
    if(LANG == 1) printf("Start SCAL88\n");
    if(LANG == 2) printf("start SCAL88\n");
  break;

  case TX_CHOY88:
    if(LANG == 1)
    printf("***** Start des Cholesky- Verfahrens CHOY88 *****\n");
    if(LANG == 2)
    printf("***** start of Cholesky solver CHOY88 *****\n");
  break;

  case TX_VORW:
    if(LANG == 1) printf("\nVorwaertseinsetzen\n");
    if(LANG == 2) printf("\nforward-substitution\n");
  break;

  case TX_RUECKW:
    if(LANG == 1) printf("Rueckwaertseinsetzen\n");
    if(LANG == 2) printf("back-substitution\n");
  break;
  }

return(0);
}

/***********************************************************************
* function wproz88 gibt Prozentanteil aus
***********************************************************************/ 
int wproz88(FR_INT4 iltx,FR_DOUBLE proz)
{
extern FR_INT4 LANG;

if(LANG == 1)
  {
  printf("\nVektor GS enthaelt " PD " Elemente\n",iltx);
  printf("Anteil Nullelemente in GS ist " P6F " Prozent\n",proz);
  }
if(LANG == 2)
  {
  printf("\nvector GS has " PD " elements\n",iltx);
  printf("portion of zero-elements in GS is " P6F " p.c.\n",proz);
  }

return(0);
}

/***********************************************************************
*  function wtyp88f gibt Elementtypen in Z88F aus
***********************************************************************/ 
int wtyp88f(FR_INT4 k,FR_INT4 i)
{
extern FR_INT4 LANG;

if(LANG == 1) printf("\rNr. " P5D " Typ " P5D,k,i);
if(LANG == 2) printf("\rno. " P5D " type " P5D,k,i);

return(0);
}