Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
utilities/RocfracPrep/readinp.f90
Go to the documentation of this file.
1 !*********************************************************************
2 !* Illinois Open Source License *
3 !* *
4 !* University of Illinois/NCSA *
5 !* Open Source License *
6 !* *
7 !* Copyright@2008, University of Illinois. All rights reserved. *
8 !* *
9 !* Developed by: *
10 !* *
11 !* Center for Simulation of Advanced Rockets *
12 !* *
13 !* University of Illinois *
14 !* *
15 !* www.csar.uiuc.edu *
16 !* *
17 !* Permission is hereby granted, free of charge, to any person *
18 !* obtaining a copy of this software and associated documentation *
19 !* files (the "Software"), to deal with the Software without *
20 !* restriction, including without limitation the rights to use, *
21 !* copy, modify, merge, publish, distribute, sublicense, and/or *
22 !* sell copies of the Software, and to permit persons to whom the *
23 !* Software is furnished to do so, subject to the following *
24 !* conditions: *
25 !* *
26 !* *
27 !* @ Redistributions of source code must retain the above copyright *
28 !* notice, this list of conditions and the following disclaimers. *
29 !* *
30 !* @ Redistributions in binary form must reproduce the above *
31 !* copyright notice, this list of conditions and the following *
32 !* disclaimers in the documentation and/or other materials *
33 !* provided with the distribution. *
34 !* *
35 !* @ Neither the names of the Center for Simulation of Advanced *
36 !* Rockets, the University of Illinois, nor the names of its *
37 !* contributors may be used to endorse or promote products derived *
38 !* from this Software without specific prior written permission. *
39 !* *
40 !* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
41 !* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *
42 !* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND *
43 !* NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR *
44 !* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
45 !* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
46 !* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
47 !* USE OR OTHER DEALINGS WITH THE SOFTWARE. *
48 !*********************************************************************
49 !* Please acknowledge The University of Illinois Center for *
50 !* Simulation of Advanced Rockets in works and publications *
51 !* resulting from this software or its derivatives. *
52 !*********************************************************************
53 SUBROUTINE readinp(ntime)
54 
55  USE meshdata
56 
57  IMPLICIT NONE
58 
59  INTEGER :: i
60  INTEGER :: ntime
61 
62 ! -- local
63  CHARACTER*200 :: keywd ! keyword parameter
64  INTEGER :: ios ! io error
65 
66 ! -- Default
67 
68  numnodeio = 0
69  ioformat = 1
70  numvertx = 4
71 !
72 ! -- Open Analysis Deck File
73 
74  OPEN(io_input,file='fractography3d.inp',status='old',iostat=ios)
75 
76 
77  IF(ios.NE.0)THEN
78  print*, 'Unable to find fractography3d.inp'
79  print*, ' ...Trying RocfracControl.txt'
80 
81  OPEN(io_input,file='RocfracControl.txt',status='old',iostat=ios)
82  IF(ios.NE.0)THEN
83  print*, 'Unable to find RocfracControl.txt'
84  print*, ' ...STOPPING'
85  stop
86  ENDIF
87  ENDIF
88 
89 ! CALL COM_call_system('mkdir -p Rocin')
90 !
91 ! -- Read Analysis Deck File
92 
93  rewind io_input
94 10 READ(io_input,'(A)',iostat=ios) keywd
95  IF(ios.LT.0) THEN ! Negative ios means end-of-file
96  print*,' *END parameter not found - STOPPING'
97  stop
98  ENDIF
99  IF(keywd(1:4).EQ.'*END') THEN
100  goto 40
101  ELSE IF(keywd(1:7).EQ.'*PREFIX') THEN
102  CALL prefix_sub()
103 !!$ CALL system ('mkdir '//prefx(1:prefx_lngth))
104  goto 10
105  ELSE IF(keywd(1:7).EQ.'*MATVOL'.OR.keywd(1:13).EQ.'*HYPERELASTIC'.OR. &
106  keywd(1:8).EQ.'*ELASTIC') THEN ! Read volumetric material props.
107  CALL matvol_sub()
108  goto 10
109  ELSE IF(keywd(1:8).EQ.'*ELEMENT'.AND.keywd(1:15).NE.'*ELEMENT OUTPUT')THEN
110  CALL element_sub(keywd)
111  goto 10
112 ! ELSE IF(keywd(1:5).EQ.'*NODE') THEN
113 ! CALL NODEIO_SUB()
114 ! GOTO 10
115  ELSE IF(keywd(1:9).EQ.'*IOFORMAT') THEN
116  CALL ioformat_sub()
117  goto 10
118  ELSE
119  goto 10
120  ENDIF
121 
122 40 READ(io_input,'(A)',iostat=ios) keywd
123  IF(ios.LT.0) THEN ! Negative ios means end-of-file
124  print*,' *END parameter not found - STOPPING'
125  stop
126  ENDIF
127  IF(keywd(1:3).EQ.'*END') THEN
128  goto 50
129 ! ELSE IF(keywd(1:3).EQ.'*BC') THEN
130 ! CALL BC_SUB()
131 ! GOTO 40
132  ELSE IF(keywd(1:9).EQ.'*MESHSOFT') THEN
133  CALL meshsoft_sub()
134  goto 40
135  ENDIF
136 50 CONTINUE
137 
138  CLOSE(io_input)
139 
140  RETURN
141 END SUBROUTINE readinp
142 
143 SUBROUTINE prefix_sub()
144 
145  USE meshdata
146 
147  IMPLICIT NONE
148 
149  READ(io_input,'(a20)') prefx
150  prefx_lngth = len_trim(prefx)
151 
152  RETURN
153 END SUBROUTINE prefix_sub
154 
155 SUBROUTINE nrun_sub(ntime)
156 
157  USE meshdata
158 
159  IMPLICIT NONE
160 
161  INTEGER :: ntime,ii
162  REAL*8 :: iaux
163  READ(io_input,*) iaux, numvertx
164 
165  RETURN
166 END SUBROUTINE nrun_sub
167 
168 SUBROUTINE matvol_sub()
169 
170  USE meshdata
171 
172  IMPLICIT NONE
173 
174  INTEGER :: i ! loop counter
175 
176  INTEGER :: numat_vol ! number of volumetric materials
177 
178  REAL*8 :: e, xnu, rho, alpha
179 
180  READ(io_input,*) numat_vol
181 
182  cd_fastest = 0.d0
183  DO i = 1, numat_vol
184  READ(io_input,*) e, xnu, rho, alpha
185  cd_fastest = max( cd_fastest, &
186  sqrt(e*(1.d0-xnu)/rho/(1.d0+xnu)/(1.d0-2.d0*xnu)) )
187  ENDDO
188 
189  RETURN
190 END SUBROUTINE matvol_sub
191 
192 SUBROUTINE bc_sub()
193 
194  USE meshdata
195 
196  IMPLICIT NONE
197 
198  INTEGER :: iaux
199  INTEGER :: i
200 
201  DO i = 1, 32
202  READ(io_input,*) iaux, bc_conditions(i)%b1, bc_conditions(i)%b2, bc_conditions(i)%b3, &
203  bc_conditions(i)%bc1, bc_conditions(i)%bc2, bc_conditions(i)%bc3
204  ENDDO
205 
206  RETURN
207 END SUBROUTINE bc_sub
208 
209 SUBROUTINE nodeio_sub()
210 
211  USE meshdata
212 
213  IMPLICIT NONE
214 
215  INTEGER :: i ! loop counter
216 
217  READ(io_input,*) numnodeio
218 
219  ALLOCATE(nodeio(1:numnodeio))
220 
221  DO i = 1, numnodeio
222  READ(io_input,*) nodeio(i)
223  ENDDO
224 
225  RETURN
226 END SUBROUTINE nodeio_sub
227 
228 SUBROUTINE meshsoft_sub()
229 
230  USE meshdata
231 
232  IMPLICIT NONE
233 
234  CHARACTER*1 :: chr
235 
236  READ(io_input,*) chr
237 
238  iansys = 0 ! set default -no-
239  ipatran = 0
240  itetmesh = 0
241  ipatcohin = 0
242  itetcohin = 0
243 
244  IF(chr.EQ.'T'.OR.chr.EQ.'t')THEN
245  itetmesh = 1
246  ELSE IF(chr.EQ.'A'.OR.chr.EQ.'a')THEN
247  iansys = 1
248  ELSE IF(chr.EQ.'P'.OR.chr.EQ.'p')THEN
249  ipatran = 1
250  ELSE IF(chr.EQ.'C'.OR.chr.EQ.'c')THEN
251  READ(io_input,*) chr
252  IF(chr.EQ.'P'.OR.chr.EQ.'p')THEN
253  ipatcohin = 1
254  ELSE IF(chr.EQ.'T'.OR.chr.EQ.'t')THEN
255  itetcohin = 1
256  ENDIF
257  ELSE
258  print*,' ERROR: MESHING PACKAGE NOT SUPPORTED'
259  print*,'STOPPING'
260  stop
261  ENDIF
262 
263  RETURN
264 END SUBROUTINE meshsoft_sub
265 
266 SUBROUTINE ioformat_sub()
267 
268  USE meshdata
269 
270  IMPLICIT NONE
271 
272 ! 0 = binary
273 ! 1 = ascii
274 
275  READ(io_input,*) ioformat
276 
277  RETURN
278 END SUBROUTINE ioformat_sub
279 SUBROUTINE element_sub(keywd)
280 
281  USE meshdata
282 
283  IMPLICIT NONE
284 
285  CHARACTER(len=200) :: keywd
286  INTEGER :: k1, k2
287 
288  CHARACTER(len=16) :: eltype
289 
290  CALL locchr(keywd,'TYPE ',4,8,k1,k2)
291 
292  eltype = keywd(k1:k2)
293 
294  SELECT CASE (trim(eltype))
295  CASE ('V3D4')
296  numvertx = 4
297  CASE ('V3D4NCC')
298  numvertx = 4
299  CASE ('V3D4N')
300  numvertx = 4
301  CASE ('V3D10R')
302  numvertx = 10
303  CASE ('V3D10BBAR')
304  numvertx = 10
305  CASE ('V3D10')
306  numvertx = 10
307  CASE ('V3D8')
308  numvertx = 8
309  CASE ('V3D8ME')
310  numvertx = 8
311  CASE default
312  print*,' ERROR:'
313  print*,'*ELEMENT TYPE NOT FOUND'
314  stop
315  END SELECT
316  RETURN
317 END SUBROUTINE element_sub
318 
subroutine element_sub(glb, keywd)
Definition: feminp.f90:1076
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:354
int status() const
Obtain the status of the attribute.
Definition: Attribute.h:240
double sqrt(double d)
Definition: double.h:73
subroutine matvol_sub(glb, tmp_E, tmp_xnu, tmp_rho, tmp_alpha, tmp_iSolnType)
Definition: feminp.f90:780
blockLoc i
Definition: read.cpp:79
subroutine readinp(ntime)
subroutine locchr(text, varna, lvari, kpos0, kpos1, kpos2)
virtual std::ostream & print(std::ostream &os) const
subroutine prefix_sub(glb)
Definition: feminp.f90:431
subroutine nodeio_sub(myid)
Definition: feminp.f90:857
unsigned char alpha() const
Definition: Color.h:75
subroutine nrun_sub(glb)
Definition: feminp.f90:491