File: z88g.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 (190 lines) | stat: -rw-r--r-- 5,639 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
/***********************************************************************
* 
*               *****   ***    ***
*                  *   *   *  *   *
*                 *     ***    ***
*                *     *   *  *   *
*               *****   ***    ***
*
* 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  January 22, 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.
***********************************************************************/ 
/***********************************************************************
* Z88G
* 22.1.2008 Rieg
* wandelt COSMOS- Files oder NASTRAN- Files 
* aus Pro/MESH (PTC, Pro/ENGINEER) 
* in Z88I*.TXT- Files fuer die Z88- Elementtypen:
* * Scheiben  Nr. 7 ( 8 Knoten) und Nr.14 (6 Knoten)
* * Tetraeder Nr.16 (10 Knoten) und Nr.17 (4 Knoten)
* * Platten   Nr.20 ( 8 Knoten) und Nr.18 (6 Knoten)
* * Tori      Nr. 8 ( 8 Knoten) und Nr.15 (6 Knoten)
***********************************************************************/

/***********************************************************************
* Include- Files
***********************************************************************/
#ifdef FR_UNIX
#include <z88g.h> 
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#endif

/****************************************************************************
*  Function-Declarationen
****************************************************************************/
int who88g(void);
int lan88g(void);
int cosm88(void);
int nast88(void);
int dnas88(void);
int ale88g(int);
void stop88g(void);
int wrim88g(FR_INT4,int);
int wlog88g(FR_INT4,int);

/****************************************************************************
*  globale Variable
****************************************************************************/
/*--------------------------------------------------------------------------
* Files
*-------------------------------------------------------------------------*/
FILE *fdyn,*fwlo,*fpro,*fin,*fi1,*fi2,*fi3,*fi5;

/*  
**   fdyn= z88.dyn
**   fwlo= z88g.log
**   fpro= z88g.cos oder z88g.nas
**   fin = z88g.in
**   fi1=  z88i1.txt
**   fi2=  z88i2.txt
**   fi3=  z88i3.txt
**   fi5=  z88i5.txt
*/ 

char cdyn[8] = "z88.dyn";
char clgd[9] = "z88g.log";
char ccos[9] = "z88g.cos";
char cnas[9] = "z88g.nas";
char cin[8]  = "z88g.in";
char ci1[10] = "z88i1.txt";
char ci2[10] = "z88i2.txt";
char ci3[10] = "z88i3.txt";
char ci5[10] = "z88i5.txt";

/*--------------------------------------------------------------------------
* Variable
*-------------------------------------------------------------------------*/

FR_INT4 IFFLAG=0,ICFLAG= 0,LANG;

/***********************************************************************
* Hauptprogramm
***********************************************************************/
int main(void)
{               
extern FILE *fdyn,*fwlo,*fpro,*fin,*fi1,*fi2,*fi3,*fi5;

extern FR_INT4 LANG,ICFLAG;

FR_INT4 iret;

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

if(iret != 0)
  {
  ale88g(iret);
  stop88g();
  }

/*---------------------------------------------------------------------------
*  Ueberschrift
*--------------------------------------------------------------------------*/
who88g();

/*----------------------------------------------------------------------
* COSMOS oder NASTRAN ? Scheiben oder Platten ?
*---------------------------------------------------------------------*/	
wlog88g(0,LOG_BZ88);

Lfagain:;
  wrim88g(0,TX_COSNAS);
  scanf("%ld",&IFFLAG);
  if(!(IFFLAG == 1 || IFFLAG == 2 )) goto Lfagain; 

wrim88g(IFFLAG,TX_FILEF);
wlog88g(IFFLAG,LOG_FILEF);

Lcagain:;
  if(IFFLAG == 1) wrim88g(0,TX_CHOICOS);
  if(IFFLAG == 2) wrim88g(0,TX_CHOINAS);
  scanf("%ld",&ICFLAG);
  if(IFFLAG == 1)
    {
    if(!(ICFLAG == 1 || ICFLAG == 2 || 
         ICFLAG == 3 || ICFLAG == 4 )) goto Lcagain;
    } 
  if(IFFLAG == 2)
    {
    if(!(ICFLAG == 2 || ICFLAG == 3 || 
         ICFLAG == 4 || ICFLAG == 5 )) goto Lcagain;
    } 


wrim88g(ICFLAG,TX_SHEIPLA);
wlog88g(ICFLAG,LOG_SHEIPLA);

/*----------------------------------------------------------------------
* Umsetzen
*---------------------------------------------------------------------*/
if(IFFLAG == 1)   iret= cosm88();
if(IFFLAG == 2)
  {
  if(ICFLAG != 5) iret= nast88();
  else            iret= dnas88();
  }

if(iret != 0)
  {
  ale88g(iret);
  stop88g();              
  } 
          	
/*----------------------------------------------------------------------
* Fertig
*---------------------------------------------------------------------*/
wrim88g(0,TX_Z88DONE);
wlog88g(0,LOG_Z88DONE);

return 0;
}