Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
WRITE_OUTPUT_2.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 write_output_2
55 
56  IMPLICIT NONE
57 
58  CHARACTER*4 :: ichr4
59 
60  INTEGER :: ii
61 
62  WRITE(ichr4,'(i4.4)') i
63 
64  OPEN(35, file = prefix(1:length(prefix))//'/'//prefix(1:length(prefix))//'.'//ichr4//'.inp', &
65  status = 'UNKNOWN')
66 
67  ! Writing first record: <# of elements> <# of nodes> <Number of sister nodes>
68 ! WRITE(35,*) numnp, numel
69 !
70 ! WRITE(35,*) delta
71 ! WRITE(35,*) numprop
72 !
73 ! DO l = 1, numprop
74 ! WRITE(35,*) ts_proportion(l),proportion(l)
75 ! ENDDO
76 !
77  write(35,*) 1
78  write(35,*) 2.5
79 
80 
81  write(35,*) 2
82  WRITE(35,*) numnp,0,0,0,0
83 
84  ! <Node ID> < X > < Y > < Z >
85  DO l = 1,numnp
86  WRITE(35,*) l , node(l)%coord(1:3),0 ! , 0 ! no corners
87  ENDDO
88 
89 
90 100 FORMAT(i4,1x,$) ! for the file ID write statement (used only once per list)
91 110 FORMAT(i8,1x,$) ! for the nodelist (used numscale_np/2 times)
92  ! If this is the first file to be written, Then only write information for one other file
93  IF (count .EQ. 1) THEN
94  write(35,*) 3
95  WRITE(35,*) numboundfirst,0
96  frontfile = 1
97 
98  DO l = 1, numbound
99  IF((id(l)%NdBCflag .GE. 10) .AND. (id(l)%NdBCflag .LT. 100)) THEN
100  WRITE(35,*) id(l)%ID, id(l)%NdBCflag/10,0
101  ELSE IF (id(l)%NdBCflag .LT. 10) THEN
102  WRITE(35,*) id(l)%ID, id(l)%NdBCflag,0
103  END IF
104  END DO
105 
106  write(35,*) 4
107  WRITE(35,*) numbmeshfirst,0
108  WRITE(6,*) numbmeshfirst
109 
110  DO l = 1, numboundmesh
111  IF((idmesh(l)%NdBCflag .GE. 10) .AND. (idmesh(l)%NdBCflag .LT. 100)) THEN
112  WRITE(35,*) idmesh(l)%ID, idmesh(l)%NdBCflag/10,0
113  ELSE IF (idmesh(l)%NdBCflag .LT. 10) THEN
114  WRITE(35,*) idmesh(l)%ID, idmesh(l)%NdBCflag,0
115  END IF
116  END DO
117 
118  ! Else if writing the last file, Then only write the current and last file information
119  ELSE IF (count .EQ. scale) THEN
120  backfile = scale - 2
121 
122  write(35,*) 3
123  WRITE(35,*) numboundend,0
124 
125  DO l = 1, numbound
126  IF (id(l)%NdBCflag .LT. 10) THEN
127  WRITE(35,*) id(l)%ID, id(l)%NdBCflag,0
128  ELSE IF (id(l)%NdBCflag .GE. 100) THEN
129  WRITE(35,*) id(l)%ID, id(l)%NdBCflag/100,0
130  END IF
131  END DO
132 
133  ! Next Record
134  write(35,*) 4
135  WRITE(35,*) numbmeshend,0
136 
137  DO l = 1, numboundmesh
138  IF(idmesh(l)%NdBCflag .LT. 10) THEN
139  WRITE(35,*) idmesh(l)%ID, idmesh(l)%NdBCflag,0
140  ELSE IF (idmesh(l)%NdBCflag .GE. 100) THEN
141  WRITE(35,*) idmesh(l)%ID, idmesh(l)%NdBCflag/100,0
142  END IF
143  END DO
144 
145  ! Else if writing a middle file, Then write both back and front file information
146  ELSE
147  backfile = i - 1
148  frontfile = i + 1
149  write(35,*) 3
150  WRITE(35,*) numboundmid,0
151 
152  DO l = 1, numbound
153  IF (id(l)%NdBCflag .LT. 10) THEN
154  WRITE(35,*) id(l)%ID, id(l)%NdBCflag,0
155  END IF
156  END DO
157 
158  ! Next Record
159  write(35,*) 4
160  WRITE(35,*) numbmeshmid
161 
162  DO l = 1, numboundmesh
163  IF(idmesh(l)%NdBCflag .LT. 10) THEN
164  WRITE(35,*) idmesh(l)%ID, idmesh(l)%NdBCflag,0
165  END IF
166  END DO
167 
168  END IF
169 
170  write(35,*) 5
171  WRITE(35,*) numcstet, nboundryel3d,numcstet, nboundryel3d,4,0
172 
173  elemlist => firstelem
174  eboundlist => firstebound
175 
176 ! fix:Scot -- Added a one for where the material id goes
177 ! instead of the element id number
178 
179  ii = 0
180 
181  DO WHILE(associated(eboundlist%next))
182  ii = ii + 1
183  WRITE(35,*) 1, eboundlist%conn(1:4),0,0
184  eboundlist => eboundlist%next
185  ENDDO
186  print*,'Number of Boundary Elements =', ii
187 
188  DO WHILE(associated(elemlist%next))
189  ii = ii + 1
190  WRITE(35,*) 1, elemlist%conn(1:4),0,0
191  elemlist => elemlist%next
192  ENDDO
193  print*,'Total Number =',ii,numcstet
194 
195  ! These are all zero because cohesive elements are not yet supported
196 ! iaux = 0
197 ! DO l = 0, scale - 1
198 ! WRITE(35,*) iaux
199 ! ENDDO
200 ! WRITE(35,*) iaux
201 
202  write(35,*) 6
203 
204  j = i ! id processor
205 
206 
207  IF (j .EQ. 0) THEN
208  WRITE(35,*) 1 ! The number of files communicating with
209 ! WRITE(35,*) 1 ! The fileID the current proc. is communicating with
210  ELSE IF (j .EQ. scale - 1) THEN
211  WRITE(35,*) 1 ! The number of files communicating with
212 ! WRITE(35,*) scale - 2 ! The fileID the current proc. is communicating with
213  ELSE
214  WRITE(35,*) 2 ! The number of files communicating with
215 ! WRITE(35,*) j - 1, j + 1 ! The fileID's the current proc. is communicating with
216  END IF
217 
218  DO k = 0, scale-1
219  IF (k .EQ. j+1) THEN
220  IF(j.EQ.0)THEN
221  WRITE(35,*) 1,fileid(j)%num_sister_np
222  ELSE IF(j.EQ.scale-1)THEN
223  WRITE(35,*) scale - 2,fileid(j)%num_sister_np
224  ELSE
225  WRITE(35,*) j+1,fileid(j)%num_sister_np/2
226  ENDIF
227  backnode => first_back_node
228  DO WHILE(associated(backnode%next))
229  WRITE(35,*) backnode%sister%ID
230  backnode => backnode%next
231  END DO
232 
233  ELSE IF(k.EQ.j-1)THEN
234  IF(j.EQ.0)THEN
235  WRITE(35,*) 1,fileid(j)%num_sister_np
236  elseif(j.EQ.scale-1)THEN
237  WRITE(35,*) scale - 2,fileid(j)%num_sister_np
238  ELSE
239  WRITE(35,*) j-1,fileid(j)%num_sister_np/2
240  ENDIF
241  backnode => first_back_node
242  DO WHILE(associated(backnode%next))
243  WRITE(35,*) backnode%ID
244  backnode => backnode%next
245  END DO
246 ! ELSE
247 ! WRITE(35,*) 0
248  ENDIF
249 
250  END DO
251 
252  ! Writes out neighboring file information
253 
254 !!$ iaux = 0
255 !!$ DO l = 0, scale - 1
256 !!$ WRITE(35,*) iaux
257 !!$ ENDDO
258 !!$ WRITE(35,*) iaux
259 
260  write(35,*) 99
261 
262  CLOSE(35)
263 
264  END SUBROUTINE write_output_2
265 
266 
267 
268 
269 
270 
subroutine write_output_2
j indices k indices k
Definition: Indexing.h:6
int status() const
Obtain the status of the attribute.
Definition: Attribute.h:240
Definition: adj.h:150
void scale(const Real &a, Nodal_data &x)
blockLoc i
Definition: read.cpp:79
void int int REAL * x
Definition: read.cpp:74
virtual std::ostream & print(std::ostream &os) const
j indices j
Definition: Indexing.h:6
unsigned long id(const Leda_like_handle &x)
Definition: Handle.h:107