Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SourceIMP/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 IF(keywd(1:18).EQ.'*DYNAMIC, IMPLICIT') THEN
119  imp = .true.
120  goto 10
121  ELSE
122  goto 10
123  ENDIF
124 
125 40 READ(io_input,'(A)',iostat=ios) keywd
126  IF(ios.LT.0) THEN ! Negative ios means end-of-file
127  print*,' *END parameter not found - STOPPING'
128  stop
129  ENDIF
130  IF(keywd(1:3).EQ.'*END') THEN
131  goto 50
132 ! ELSE IF(keywd(1:3).EQ.'*BC') THEN
133 ! CALL BC_SUB()
134 ! GOTO 40
135  ELSE IF(keywd(1:9).EQ.'*MESHSOFT') THEN
136  CALL meshsoft_sub()
137  goto 40
138  ENDIF
139 50 CONTINUE
140 
141  CLOSE(io_input)
142 
143  RETURN
144 END SUBROUTINE readinp
145 
146 SUBROUTINE prefix_sub()
147 
148  USE meshdata
149 
150  IMPLICIT NONE
151 
152  READ(io_input,'(a20)') prefx
153  prefx_lngth = len_trim(prefx)
154 
155  RETURN
156 END SUBROUTINE prefix_sub
157 
158 SUBROUTINE nrun_sub(ntime)
159 
160  USE meshdata
161 
162  IMPLICIT NONE
163 
164  INTEGER :: ntime,ii
165  REAL*8 :: iaux
166  READ(io_input,*) iaux, numvertx
167 
168  RETURN
169 END SUBROUTINE nrun_sub
170 
171 SUBROUTINE matvol_sub()
172 
173  USE meshdata
174 
175  IMPLICIT NONE
176 
177  INTEGER :: i ! loop counter
178 
179  INTEGER :: numat_vol ! number of volumetric materials
180 
181  REAL*8 :: e, xnu, rho, alpha
182 
183  READ(io_input,*) numat_vol
184 
185  cd_fastest = 0.d0
186  DO i = 1, numat_vol
187  READ(io_input,*) e, xnu, rho, alpha
188  cd_fastest = max( cd_fastest, &
189  sqrt(e*(1.d0-xnu)/rho/(1.d0+xnu)/(1.d0-2.d0*xnu)) )
190  ENDDO
191 
192  RETURN
193 END SUBROUTINE matvol_sub
194 
195 SUBROUTINE bc_sub()
196 
197  USE meshdata
198 
199  IMPLICIT NONE
200 
201  INTEGER :: iaux
202  INTEGER :: i
203 
204  DO i = 1, 32
205  READ(io_input,*) iaux, bc_conditions(i)%b1, bc_conditions(i)%b2, bc_conditions(i)%b3, &
206  bc_conditions(i)%bc1, bc_conditions(i)%bc2, bc_conditions(i)%bc3
207  ENDDO
208 
209  RETURN
210 END SUBROUTINE bc_sub
211 
212 SUBROUTINE nodeio_sub()
213 
214  USE meshdata
215 
216  IMPLICIT NONE
217 
218  INTEGER :: i ! loop counter
219 
220  READ(io_input,*) numnodeio
221 
222  ALLOCATE(nodeio(1:numnodeio))
223 
224  DO i = 1, numnodeio
225  READ(io_input,*) nodeio(i)
226  ENDDO
227 
228  RETURN
229 END SUBROUTINE nodeio_sub
230 
231 SUBROUTINE meshsoft_sub()
232 
233  USE meshdata
234 
235  IMPLICIT NONE
236 
237  CHARACTER*1 :: chr
238 
239  READ(io_input,*) chr
240 
241  iansys = 0 ! set default -no-
242  ipatran = 0
243  itetmesh = 0
244  ipatcohin = 0
245  itetcohin = 0
246 
247  IF(chr.EQ.'T'.OR.chr.EQ.'t')THEN
248  itetmesh = 1
249  ELSE IF(chr.EQ.'A'.OR.chr.EQ.'a')THEN
250  iansys = 1
251  ELSE IF(chr.EQ.'P'.OR.chr.EQ.'p')THEN
252  ipatran = 1
253  ELSE IF(chr.EQ.'C'.OR.chr.EQ.'c')THEN
254  READ(io_input,*) chr
255  IF(chr.EQ.'P'.OR.chr.EQ.'p')THEN
256  ipatcohin = 1
257  ELSE IF(chr.EQ.'T'.OR.chr.EQ.'t')THEN
258  itetcohin = 1
259  ENDIF
260  ELSE
261  print*,' ERROR: MESHING PACKAGE NOT SUPPORTED'
262  print*,'STOPPING'
263  stop
264  ENDIF
265 
266  RETURN
267 END SUBROUTINE meshsoft_sub
268 
269 SUBROUTINE ioformat_sub()
270 
271  USE meshdata
272 
273  IMPLICIT NONE
274 
275 ! 0 = binary
276 ! 1 = ascii
277 
278  READ(io_input,*) ioformat
279 
280  RETURN
281 END SUBROUTINE ioformat_sub
282 SUBROUTINE element_sub(keywd)
283 
284  USE meshdata
285 
286  IMPLICIT NONE
287 
288  CHARACTER(len=200) :: keywd
289  INTEGER :: k1, k2
290 
291  CHARACTER(len=16) :: eltype
292 
293  CALL locchr(keywd,'TYPE ',4,8,k1,k2)
294 
295  eltype = keywd(k1:k2)
296 
297  SELECT CASE (trim(eltype))
298  CASE ('V3D4')
299  numvertx = 4
300  CASE ('V3D4NCC')
301  numvertx = 4
302  CASE ('V3D4N')
303  numvertx = 4
304  CASE ('V3D10R')
305  numvertx = 10
306  CASE ('V3D10BBAR')
307  numvertx = 10
308  CASE ('V3D10')
309  numvertx = 10
310  CASE ('V3D8')
311  numvertx = 8
312  CASE ('V3D8ME')
313  numvertx = 8
314  CASE default
315  print*,' ERROR:'
316  print*,'*ELEMENT TYPE NOT FOUND'
317  stop
318  END SELECT
319  RETURN
320 END SUBROUTINE element_sub
321 
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