File: g1i388.c

package info (click to toggle)
z88 13.0.0%2Bdfsg2-4
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 107,800 kB
  • ctags: 3,296
  • sloc: ansic: 45,530; sh: 71; makefile: 14
file content (187 lines) | stat: -rw-r--r-- 6,197 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
/***********************************************************************
* 
*               *****   ***    ***
*                  *   *   *  *   *
*                 *     ***    ***
*                *     *   *  *   *
*               *****   ***    ***
*
* 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
* 
* V13.0  December 12, 2008
*
* 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.
***********************************************************************/ 
/**********************************************************************
* Function g1i388 prueft Z88I3.TXT
* 29.11.2008 Rieg
**********************************************************************/

/***********************************************************************
* Fuer UNIX
***********************************************************************/
#ifdef FR_UNIX
#include <z88v.h>
#include <stdio.h>   /* FILE,printf */
#endif

/***********************************************************************
* Functions
***********************************************************************/
void erif88(FR_INT4 izeile);

/***********************************************************************
* Start G1I388
***********************************************************************/
int g1i388(void)
{
extern FILE *fdatei;

extern FR_INT4 ispann,izeile,LANG;

FR_INT4 ninto,kflag,isflag;

int ier;

char *cresult;
char cline[256];

/**********************************************************************
* File ueberhaupt notwendig ?
**********************************************************************/
if(ispann == 0)
  {
  if(LANG == 1)
    {
    printf("? File Z88I3.TXT (Parameterfile Spannungen) ist\n");
    printf("? inhaltlich fuer das vorgesehene Eingabefile\n");
    printf("? Z88I1.TXT nicht noetig\n");
    printf("? Inhalt von Z88I3.TXT kann daher beliebig sein\n");          
    }
  if(LANG == 2)
    {
    printf("? file Z88I3.TXT (stress flag file) is of no \n");
    printf("? importance for this general input file Z88I1.TXT\n");
    printf("? contents of Z88I3.TXT can be arbitrary\n");          
    }
  return(0);
  }

/**********************************************************************
* Checken der 1.Zeile
**********************************************************************/
izeile= 1; 

cresult= fgets(cline,256,fdatei);
if(!cresult)
  {
  erif88(izeile);
  return(2);
  }

ier= sscanf(cline,"%ld %ld %ld",&ninto,&kflag,&isflag);
if(ier != 3) 
  {
  printf("%s\n",cline);
  if(LANG == 1)
    printf("### Schreibfehler oder fehlende Daten in Zeile 1 entdeckt\n");
  if(LANG == 2)
    printf("### typing error or missing entries in line 1 detected\n");
  return(2);
  }
        
/*----------------------------------------------------------------------
* logische Pruefungen
*---------------------------------------------------------------------*/
if(!(ninto == 0 || ninto == 1 || ninto == 2 || ninto == 3 ||
     ninto == 4 || ninto == 5 || ninto == 7 || ninto == 13))
  {
  printf("%s\n",cline);
  if(LANG == 1)
    {
    printf("### Falsche Integrationsordnung:\n");
    printf("### Zulaessig fuer Element-Typen 2,3,4,5,6,9,13: 0\n");
    printf("### Zulaessig fuer Element-Typen 1,7,8,10,11,12: 1,2,3,4\n");
    printf("### Zulaessig fuer Element-Typen 14,15         : 3,7,13\n");
    printf("### Zulaessig fuer Element-Typen 16,17         : 1,4,5\n");
    printf("### 1.Wert in Zeile 1 ueberpruefen\n");
    }
  if(LANG == 2)
    {
    printf("### wrong integration value\n");
    printf("### allowed values for element types 2,3,4,5,6,9,13: 0\n");
    printf("### allowed values for element types 1,7,8,10,11,12: 1,2,3,4\n");
    printf("### allowed values for element types 14,15         : 3,7,13\n");
    printf("### allowed values for element types 16,17         : 1,4,5\n");
    printf("### check 1st entry in line 1\n");
    }
  return(2);
  }

if(kflag < 0 || kflag > 1)
  {
  printf("%s\n",cline);
  if(LANG == 1)
    {
    printf("### KFLAG unzulaessig\n");
    printf("### Zulaessig: 0 = Standard-Spannungsrechung\n");
    printf("###            1 = zusaetzlich Radial- und Tangentialsp.\n");
    printf("### 2.Wert in Zeile 1 ueberpruefen\n");
    }
  if(LANG == 2)
    {
    printf("### KFLAG invalid\n");
    printf("### allowed: 0 = computing standard stresses\n");
    printf("###          1 = radial- and tangential stresses added\n");
    printf("### check 2nd entry in line 1\n");
    }
  return(2);
  }

if(isflag < 0 || isflag > 3)
  {
  printf("%s\n",cline);
  if(LANG == 1)
    {
    printf("### Steuerflag fuer Vergleichsspannungen unzulaessig\n");
    printf("### Zulaessig: 0 = keine Vergleichsspannungsrechnung\n");
    printf("###            1 = Gestaltsaenderungsenergie-Hypothese\n");
    printf("###            2 = Normalspannungs-Hypothese\n");
    printf("###            3 = Schubspannungs-Hypothese\n");
    printf("### 3.Wert in Zeile 1 ueberpruefen\n");
    }
  if(LANG == 2)
    {
    printf("### flag for reduced stress invalid\n");
    printf("### allowed: 0 = no computing of reduced stresses\n");
    printf("###          1 = compute von Mises stresses\n");
    printf("###          2 = compute principal stresses\n");
    printf("###          3 = compute Tresca stresses\n");
    printf("### check 3rd entry in line 1\n");
    }
  return(2);
  }

return(0);
}