Debian Codegraph @

packages/seacas/applications/gen3d/gen3d.f

raw
1 C Copyright(C) 1999-2020, 2022 National Technology & Engineering Solutions
2 C of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
3 C NTESS, the U.S. Government retains certain rights in this software.
4 C
5 C See packages/seacas/LICENSE for details
6
7 C=======================================================================
8 PROGRAM GEN3D
9 C=======================================================================
10
11 C --*** GEN3D *** (GEN3D) GENESIS 2D to 3D Program
12 C --
13 C --GEN3D inputs a 2D GENESIS database and outputs a 3D GENESIS database.
14 C --The input mesh is either translated along the Z coordinate or rotated
15 C --around a Y axis. The user specifies the number of translations or
16 C --rotations. For rotations, the total number of degrees the 2D mesh
17 C --is to be rotated is also user-specified. The mesh may be rotated
18 C --around an edge of the input mesh (creating part of a cylinder-shaped
19 C --mesh) or around a line outside the input mesh (creating part of a
20 C --cylinder-shaped mesh with a hole in a middle).
21 C --
22 C --Expected input:
23 C -- o The commands on the standard input device.
24 C -- o The 2D GENESIS database on unit 9
25 C -- (must have 4 nodes per element,
26 C --
27 C --Output:
28 C -- o A listing of the input database information and any errors
29 C -- found on the standard output device.
30 C -- o The 3D GENESIS database on unit 10.
31
32 C --Developed at Sandia National Laboratories.
33 C --
34 C --Current author and code sponsor: Gregory D. Sjaardema
35 C --
36 C --Revision History:
37 C -- 04/86 Created (Amy Gilkey)
38 C --
39 C --Source is in FORTRAN 77
40 C --
41 C --External software used:
42 C -- SUPES package (dynamic memory, free-field reader, FORTRAN extensions)
43 C --
44 C --Runs on Unix systems
45
46 C --Documentation:
47 C -- "User's Manual for GEN3D"
48
49 include 'exodusII.inc'
50
51 INCLUDE 'g3_progqa.blk'
52 INCLUDE 'g3_dbase.blk'
53 INCLUDE 'g3_dbtitl.blk'
54 INCLUDE 'g3_dbnums.blk'
55 INCLUDE 'g3_dbnum3.blk'
56 INCLUDE 'g3_params.blk'
57 INCLUDE 'g3_xyzoff.blk'
58 INCLUDE 'g3_xyzrot.blk'
59 INCLUDE 'g3_xyzmir.blk'
60 INCLUDE 'g3_twist.blk'
61 INCLUDE 'argparse.inc'
62
63 CHARACTER*2048 FILIN, FILOUT, SCRATCH
64
65 CHARACTER*(MXSTLN) NAMECO(6)
66 C --NAMECO - the coordinate names
67
68 C... String containing name of common element topology in model
69 C or 'MULTIPLE_TOPOLOGIES' if not common topology.
70 character*(MXSTLN) comtop
71
72 CHARACTER CDUM
73 logical l64bit
74
75 INTEGER CMPSIZ, IOWS
76
77 DIMENSION A(1)
78 INTEGER IA(1)
79 EQUIVALENCE (A(1), IA(1))
80 CHARACTER*1 C(1)
81 C --A - the dynamic numeric memory base array
82
83 INTEGER IDNSET(0:MAXSET,2)
84 INTEGER IDESET(0:MAXSET,2)
85
86 INCLUDE 'g3_qainfo.blk'
87
88 CALL STRTUP (QAINFO)
89
90 WRITE (*, 70)
91 WRITE (*, 80)
92 CALL BANNER (0, QAINFO,
93 & 'AN EXODUSII DATABASE 2D TO 3D CONVERSION PROGRAM',
94 & ' ', ' ')
95 call cpyrgt (0, '1989')
96
97 CALL MDINIT (A)
98 CALL MCINIT (C)
99 CALL MDSTAT (NERR, MEM)
100 IF (NERR .GT. 0) GOTO 40
101
102 C .. Get filename from command line. If not specified, emit error message
103 l64bit = .false.
104 NARG = argument_count()
105 iarg = 1
106
107 if (narg .lt. 2) then
108 CALL PRTERR ('FATAL', 'Filenames not specified.')
109 CALL PRTERR ('CMDSPEC',
110 * 'Syntax is: "gen3d [-64] 2dfilename 3dfilename"')
111 CALL PRTERR ('CMDSPEC',
112 * 'Documentation: https://sandialabs.github.io' //
113 $ '/seacas-docs/sphinx/html/index.html#gen3d')
114 GOTO 60
115 else if (narg .eq. 3) then
116 CALL get_argument(iarg,FILIN, LNAM)
117 if (filin(:lnam) .eq. '-64') then
118 l64bit = .true.
119 else
120 SCRATCH = 'Unrecognized command option "'//FILIN(:LNAM)//'"'
121 CALL PRTERR ('FATAL', SCRATCH(:LENSTR(SCRATCH)))
122 CALL PRTERR ('CMDSPEC',
123 * 'Syntax is: "gen3d [-64] 2dfilename 3dfilename"')
124 CALL PRTERR ('CMDSPEC',
125 * 'Documentation: https://sandialabs.github.io' //
126 $ '/seacas-docs/sphinx/html/index.html#gen3d')
127 GOTO 60
128 end if
129 iarg = 2;
130 else if (narg .gt. 3) then
131 CALL PRTERR ('FATAL', 'Too many arguments specified.')
132 CALL PRTERR ('CMDSPEC',
133 * 'Syntax is: "gen3d [-64] 2dfilename 3dfilename"')
134 CALL PRTERR ('CMDSPEC',
135 * 'Documentation: https://sandialabs.github.io' //
136 $ '/seacas-docs/sphinx/html/index.html#gen3d')
137 GOTO 60
138 end if
139
140 C --Open the input database and read the initial variables
141
142 NDBIN = 9
143 NDBOUT = 10
144
145 CMPSIZ = 0
146 IOWS = 0
147
148 FILIN = ' '
149 CALL get_argument(iarg,FILIN, LNAM)
150 NDBIN = exopen(filin(:lnam), EXREAD, CMPSIZ, IOWS, vers, IERR)
151 IF (IERR .NE. 0) THEN
152 SCRATCH = 'Database "'//FILIN(:LNAM)//'" does not exist.'
153 CALL PRTERR ('FATAL', SCRATCH(:LENSTR(SCRATCH)))
154 GOTO 60
155 END IF
156
157 call exgini(ndbin, title, ndim, numnp, numel, nelblk,
158 * numnps, numess, ierr)
159 if (numnps .gt. 0) then
160 call exinq(ndbin, EXNSNL, lnpsnl, rdum, cdum, ierr)
161 call exinq(ndbin, EXNSDF, lnpsdf, rdum, cdum, ierr)
162 else
163 lnpsnl = 0
164 lnpsdf = 0
165 end if
166 if (numess .gt. 0) then
167 call exinq(ndbin, EXSSNL, lessnl, rdum, cdum, ierr)
168 call exinq(ndbin, EXSSEL, lessel, rdum, cdum, ierr)
169 call exinq(ndbin, EXSSDF, lessdf, rdum, cdum, ierr)
170 else
171 lessnl = 0
172 lessel = 0
173 lessdf = 0
174 end if
175
176 CALL DBPINI ('NTIS', NDBIN, TITLE, NDIM, NUMNP, NUMEL, NELBLK,
177 & NUMNPS, LNPSNL, LNPSDF, NUMESS, LESSEL, LESSNL,
178 & LESSDF, IDUM, IDUM, IDUM, FILIN)
179
180 IF (NDIM .NE. 2) THEN
181 CALL PRTERR ('FATAL', 'Number of dimensions must be 2')
182 GOTO 60
183 END IF
184
185 C --Reserve memory for the 2D information
186
187 CALL MDRSRV ('XN', KXN, NUMNP)
188 CALL MDRSRV ('YN', KYN, NUMNP)
189 KZN = 1
190
191 CALL MDRSRV ('IDELB', KIDELB, NELBLK)
192 CALL MDRSRV ('NUMELB', KNELB, NELBLK)
193 CALL MDRSRV ('NUMLNK', KNLNK, NELBLK)
194 CALL MDRSRV ('NUMATR', KNATR, NELBLK)
195 CALL MCRSRV ('NAMELB', KNMLB, MXSTLN*NELBLK)
196 CALL MCRSRV ('BLKTYP', KBKTYP, NELBLK)
197
198 CALL MDRSRV ('LINK', KLINK, 4 * NUMEL)
199 CALL MDRSRV ('IDNPS', KIDNS, NUMNPS)
200 CALL MDRSRV ('NNNPS', KNNNS, NUMNPS)
201 CALL MDRSRV ('NDNPS', KNDNPS, NUMNPS)
202 CALL MDRSRV ('IXNNPS', KIXNNS, NUMNPS)
203 CALL MDRSRV ('IXDNPS', KIXDNS, NUMNPS)
204 CALL MDRSRV ('LTNNPS', KLTNNS, LNPSNL)
205 CALL MDRSRV ('FACNPS', KFACNS, LNPSNL)
206
207 CALL MDRSRV ('IDESS', KIDSS, NUMESS)
208 CALL MDRSRV ('NEESS', KNESS, NUMESS)
209 CALL MDRSRV ('NNESS', KNNSS, NUMESS)
210 CALL MDRSRV ('NDESS', KNDSS, NUMESS)
211 CALL MDRSRV ('IXEESS', KIXESS, NUMESS)
212 CALL MDRSRV ('IXNESS', KIXNSS, NUMESS)
213 CALL MDRSRV ('IXDESS', KIXDSS, NUMESS)
214 CALL MDRSRV ('LTNNSS', KLTNNN, LESSEL)
215 CALL MDRSRV ('LTEESS', KLTESS, LESSEL)
216 CALL MDRSRV ('LTNESS', KLTNSS, LESSNL)
217 CALL MDRSRV ('LTSESS', KLTSSS, LESSEL)
218 CALL MDRSRV ('FACESS', KFACSS, LESSNL)
219
220 CALL MDSTAT (NERR, MEM)
221 IF (NERR .GT. 0) GOTO 40
222
223 C --Read 2D information from the database and close file
224
225 call exgcor (ndbin, a(kxn), a(kyn), a(kzn), ierr)
226
227 C ... Don't warn about no map stored in file
228 call exopts (0, ierr)
229 call exopts (EXVRBS, ierr)
230
231 CALL INISTR (NDIM, ' ', NAMECO)
232 call exgcon (ndbin, nameco, ierr)
233
234 CALL RDELB (A, IA(KIDELB), C(KNMLB), IA(KNELB), IA(KNLNK),
235 & IA(KNATR), IA(KLINK), KATRIB, *60)
236 CALL MDSTAT (NERR, MEM)
237 IF (NERR .GT. 0) GOTO 40
238
239 call CHKTOP(NELBLK, C(KNMLB), COMTOP)
240
241 if (numnps .gt. 0) then
242 call exgcns(ndbin, ia(kidns), ia(knnns), ia(kndnps),
243 & ia(kixnns), ia(kixdns), ia(kltnns), a(kfacns), ierr)
244 if (lnpsdf .eq. 0) then
245 call inirea(lnpsnl, 1.0, a(kfacns))
246 end if
247 end if
248 if (numess .gt. 0) then
249 call exgcss(ndbin, ia(kidss), ia(kness), ia(kndss),
250 & ia(kixess), ia(kixdss), IA(KLTeSS), ia(kltsss),
251 & a(kfacss), ierr)
252 if (ierr .ne. 0) go to 50
253 if (lessdf .eq. 0) then
254 call inirea(lessnl, 1.0, a(kfacss))
255 end if
256
257 c ... Now convert sides to nodes.... ia(kltsss),
258 C ... This code stolen from ex2ex1v2, Vic Yarberry
259 C offset into element list for current side set
260 isoff = 0
261 C node count for current side set
262 nodcnt = 0
263 do 104 i=0,numess-1
264 C update index array
265 ia(kixnss+i)=nodcnt+1
266 C get num of sides & df
267 call exgsp(ndbin,ia(kidss+i),nsess,ndess,nerr)
268 if (nerr .gt. 0) goto 50
269
270 C get side set nodes
271 call exgssn(ndbin,ia(kidss+i),ia(kltnnn+isoff),
272 & ia(kltnss+nodcnt),nerr)
273 if (nerr .gt. 0) goto 50
274 nness = 0
275 C sum node counts to calculate next index
276 do 102 ii=0,nsess-1
277 nness=nness+ia(kltnnn+isoff+ii)
278 102 continue
279 ia(knnss+i)=nness
280 nodcnt=nodcnt+nness
281 isoff=isoff+nsess
282 104 continue
283
284 end if
285
286 call exinq(ndbin, EXQA, nqarec, rdum, cdum, ierr)
287 call exinq(ndbin, EXINFO, ninfo, rdum, cdum, ierr)
288 call mcrsrv('QAREC', kqarec, (nqarec+1) * 4 * MXSTLN)
289 call mcrsrv('INFREC', kinfo, (ninfo+1) * MXLNLN)
290 CALL MCSTAT (NERR, MEM)
291 IF (NERR .GT. 0) GOTO 40
292 if (nqarec .gt. 0) then
293 C ... Wrapper to get strings the right length
294 call exgqaw(ndbin, c(kqarec), ierr)
295 end if
296 if (ninfo .gt. 0) then
297 C ... Wrapper to get info record the right length
298 call exginw(ndbin, c(kinfo), ierr)
299 end if
300
301 IF ((NQAREC .GT. 0) .OR. (NINFO .GT. 0)) THEN
302 CALL DBPQA ('*', NQAREC, c(kqarec), NINFO, c(kinfo))
303 END IF
304
305 C --Read in runtime parameters
306
307 CALL MDRSRV ('IBPARM', KIBPAR, 4 * NELBLK)
308 C -- This assumes only one attribute per element block
309 CALL MDRSRV ('ELATTR', KELATT, NELBLK)
310 CALL MDSTAT (NERR, MEM)
311 IF (NERR .GT. 0) GOTO 40
312
313 CALL COMAND (IA(KIDNS), IA(KIDSS), IDNSET, IDESET,
314 & C(KBKTYP), IA(KIBPAR), IA(KIDELB), IA(KNELB), IA(KNLNK),
315 & C(KNMLB), A(KELATT), A(KXN), A(KYN), A, *60)
316
317 C --Get the new numbers for the elements and nodes
318
319 CALL MDRSRV ('IXEL', KIXEL, NUMEL)
320 CALL MDRSRV ('INCEL', KINCEL, NUMEL)
321 CALL MDRSRV ('NREL', KNREL, NUMEL)
322 CALL MDRSRV ('IELCOL', KIECOL, NUMEL)
323 CALL MDRSRV ('IXNP', KIXNP, NUMNP)
324 CALL MDRSRV ('NRNP', KNRNP, NUMNP)
325 CALL MDRSRV ('NPCEN', KNPCEN, NUMCOL * 2 * NUMEL)
326 CALL INIINT (NUMCOL*2*NUMEL, 0, IA(KNPCEN))
327 CALL MDRSRV ('IELROW', KELROW, NUMEL)
328 CALL MDRSRV ('IROT', KROT, NUMEL)
329 CALL MDSTAT (NERR, MEM)
330 IF (NERR .GT. 0) GOTO 40
331
332 CALL RENUMB (A, C(KBKTYP), IA(KNELB), IA(KLINK), A(KXN), A(KYN),
333 & IA(KIXEL), IA(KINCEL), IA(KNREL), IA(KIECOL), IA(KIXNP),
334 & IA(KNRNP), IA(KNPCEN), IA(KELROW), IA(KROT))
335
336 CALL MDDEL ('IELROW')
337 CALL MDLONG ('NPCEN', KNPCEN, NUMCOL * NUMROW)
338 CALL MDSTAT (NERR, MEM)
339 IF (NERR .GT. 0) GOTO 40
340
341 C --Get the node sets
342
343 LNPSNO = INTADD (NUMNPS, IA(KNNNS)) * NNREPL
344 CALL MDRSRV ('NNNP3', KNNN3, NUMNPS)
345 CALL MDRSRV ('IXNNP3', KIXNN3, NUMNPS)
346 CALL MDRSRV ('LTNNP3', KLTNN3, LNPSNO)
347 CALL MDRSRV ('FACNP3', KFACN3, LNPSNO)
348 CALL MDSTAT (NERR, MEM)
349 IF (NERR .GT. 0) GOTO 40
350
351 CALL NEWNPS (IDNSET(0,1), IDNSET(0,2),
352 & IA(KIDNS), IA(KNNNS), IA(KNNN3), IA(KIXNNS), IA(KIXNN3),
353 & IA(KLTNNS), IA(KLTNN3), A(KFACNS), A(KFACN3),
354 & IA(KIXNP), IA(KNRNP))
355
356 CALL MDDEL ('NNNPS')
357 CALL MDDEL ('IXNNPS')
358 CALL MDDEL ('LTNNPS')
359 CALL MDDEL ('FACNPS')
360 CALL MDLONG ('LTNNP3', KLTNN3, LNPSNO)
361 CALL MDLONG ('FACNP3', KFACN3, LNPSNO)
362 CALL MDSTAT (NERR, MEM)
363 IF (NERR .GT. 0) GOTO 40
364
365 C --Get the side sets, and the front and back side sets
366
367 NSSET = IDESET(0,1)+IDESET(0,2)
368 IF (NSSET .GT. 0) THEN
369 CALL MDRSRV ('ISSFRO', KISFRO, NUMEL)
370 CALL MDRSRV ('ISSBCK', KISBCK, NUMEL)
371 CALL MDRSRV ('NSSFRO', KNSFRO, 4*NUMEL)
372 CALL MDRSRV ('NSSBCK', KNSBCK, 4*NUMEL)
373 ELSE
374 KISFRO = 1
375 KISBCK = 1
376 KNSFRO = 1
377 KNSBCK = 1
378 END IF
379
380 LESSEO = INTADD (NUMESS, IA(KNESS)) * NEREPL
381 LESSNO = 4 * LESSEO
382 CALL MDRSRV ('NEES3', KNES3, NUMESS)
383 CALL MDRSRV ('NNES3', KNNS3, NUMESS)
384 CALL MDRSRV ('IXEES3', KIXES3, NUMESS)
385 CALL MDRSRV ('IXNES3', KIXNS3, NUMESS)
386 CALL MDRSRV ('LTEES3', KLTES3, LESSEO)
387 CALL MDRSRV ('LTSES3', KLTSS3, LESSEO)
388 CALL MDRSRV ('LTNES3', KLTNS3, LESSNO)
389 CALL MDRSRV ('FACES3', KFACS3, LESSNO)
390 CALL MDSTAT (NERR, MEM)
391 IF (NERR .GT. 0) GOTO 40
392
393 CALL NEWESS
394 & (IDESET(0,1), IDESET(0,2),
395 & IA(KLINK), IA(KISFRO), IA(KISBCK), NSSUR, NESUR,
396 & IA(KNSFRO), IA(KNSBCK),
397 & IA(KIDSS), IA(KNESS), IA(KNES3), IA(KNNSS), IA(KNNS3),
398 & IA(KIXESS), IA(KIXES3), IA(KIXNSS), IA(KIXNS3),
399 & IA(KLTESS), IA(KLTES3), IA(KLTSSS), IA(KLTSS3),
400 & IA(KLTNSS), IA(KLTNS3), A(KFACSS), A(KFACS3),
401 & IA(KIXEL), IA(KINCEL), IA(KNREL), IA(KIECOL), IA(KIXNP),
402 & IA(KNRNP), IA(KROT))
403
404 CALL MDDEL ('NEESS')
405 CALL MDDEL ('NNESS')
406 CALL MDDEL ('IXEESS')
407 CALL MDDEL ('IXNESS')
408 CALL MDDEL ('LTEESS')
409 CALL MDDEL ('LTNESS')
410 CALL MDDEL ('FACESS')
411 CALL MDDEL ('IROT')
412 CALL MDLONG ('LTEES3', KLTES3, LESSEO)
413 CALL MDLONG ('LTNES3', KLTNS3, LESSNO)
414 CALL MDLONG ('FACES3', KFACS3, LESSNO)
415 IF (NSSET .GT. 0) THEN
416 CALL MDLONG ('NSSFRO', KNSFRO, NSSUR)
417 CALL MDLONG ('NSSBCK', KNSBCK, NSSUR)
418 END IF
419 CALL MDSTAT (NERR, MEM)
420 IF (NERR .GT. 0) GOTO 40
421
422 C --Open the output database
423
424 FILOUT = ' '
425 CALL get_argument(iarg+1,FILOUT, LFIL)
426 CMPSIZ = 0
427 IOWS = iowdsz()
428 MODE = EXCLOB
429 if (l64bit) then
430 MODE = MODE + EX_ALL_INT64_DB + EX_ALL_INT64_API
431 end if
432 ndbout = excre(filout(:lfil), MODE, CMPSIZ, IOWS, IERR)
433 if (ierr .lt. 0) then
434 call exopts (EXVRBS, ierr)
435 call exerr('grepos', 'Error from excre', ierr)
436 go to 50
437 endif
438 if (l64bit) then
439 C ... Compress the output
440 call exsetopt(ndbout, EX_OPT_COMPRESSION_LEVEL, 1, ierr)
441 call exsetopt(ndbout, EX_OPT_COMPRESSION_SHUFFLE, 1, ierr)
442 end if
443
444 C --Write the QA records
445 CALL DBOQA (NDBOUT, QAINFO, NQAREC, c(kqarec),
446 & NINFO, c(kinfo), ' Gen3D: ', FILIN)
447
448 C --Write the initial variables
449
450 CALL NEWINI (IDNSET(0,1)+IDNSET(0,2), IDESET(0,1)+IDESET(0,2),
451 & NSSUR, NESUR, C(KBKTYP), IA(KIBPAR))
452 call expini (ndbout, title, ndim3, numnp3, numel3, nelbl3,
453 & nnps3, ness3, ierr)
454 if (ierr .lt. 0) then
455 call exerr('gen3d2', 'Error from expini', exlmsg)
456 go to 40
457 endif
458
459 CALL DBPINI ('NTIS', NDBOUT, TITLE, NDIM3, NUMNP3, NUMEL3, NELBL3,
460 & NNPS3, LNPSN3, LNPSN3, NESS3, LESSE3, LESSN3, LESSN3,
461 & IDUM, IDUM, IDUM, FILOUT)
462
463 C --Write the coordinates
464
465 CALL MDRSRV ('ZCORD', KZCORD, NNREPL)
466 CALL MDRSRV ('SINANG', KSINA, NNREPL)
467 CALL MDRSRV ('COSANG', KCOSA, NNREPL)
468
469 CALL MDRSRV ('XN3', KXN3, NUMNP3)
470 CALL MDRSRV ('YN3', KYN3, NUMNP3)
471 CALL MDRSRV ('ZN3', KZN3, NUMNP3)
472 CALL MDSTAT (NERR, MEM)
473 IF (NERR .GT. 0) GOTO 40
474
475 CALL NEWXYZ (A(KXN), A(KYN), A(KXN3), A(KYN3), A(KZN3),
476 & IA(KIXNP), IA(KNRNP), IA(KNPCEN), A(KZCORD),
477 & A(KSINA), A(KCOSA), A)
478 call expcor (ndbout, a(kxn3), a(kyn3), a(kzn3), ierr)
479 if (ierr .lt. 0) then
480 call exerr('gen3d2', 'Error from expcor', exlmsg)
481 go to 40
482 endif
483
484 NAMECO(1) = 'X'
485 NAMECO(2) = 'Y'
486 NAMECO(3) = 'Z'
487 call expcon(ndbout, nameco, ierr)
488 if (ierr .lt. 0) then
489 call exerr('gen3d2', 'Error from expcon', exlmsg)
490 go to 40
491 endif
492
493 CALL MDDEL ('ZCORD')
494 CALL MDDEL ('SINANG')
495 CALL MDDEL ('COSANG')
496
497 CALL MDDEL ('XN')
498 CALL MDDEL ('YN')
499 CALL MDDEL ('XN3')
500 CALL MDDEL ('YN3')
501 CALL MDDEL ('ZN3')
502 CALL MDRSRV ('NUMELB3', KNELB3, NELBLK)
503 CALL MDSTAT (NERR, MEM)
504 IF (NERR .GT. 0) GOTO 40
505
506 CALL WRELB (A, IA, C(KBKTYP), C(KNMLB), IA(KIBPAR),
507 & IA(KIDELB), IA(KNELB), IA(KNLNK), IA(KNATR),
508 & IA(KLINK), A(KATRIB), A(KELATT),
509 & IA(KIXEL), IA(KINCEL), IA(KNREL), IA(KIECOL), IA(KIXNP),
510 & IA(KNRNP), IA(KNELB3))
511
512 CALL MDDEL ('LINK')
513 CALL MDDEL ('ATRIB')
514 CALL MDSTAT (NERR, MEM)
515 IF (NERR .GT. 0) GOTO 40
516
517 C --Write the node sets
518
519 CALL WRNPS (A, IA, IDNSET(0,1), IDNSET(0,2),
520 & IA(KIDNS), IA(KNNN3), IA(KIXNN3), IA(KLTNN3), A(KFACN3),
521 & IA(KIXNP), IA(KNRNP), *40)
522
523 CALL MDDEL ('IDNPS')
524 CALL MDDEL ('NNNP3')
525 CALL MDDEL ('IXNNP3')
526 CALL MDDEL ('LTNNP3')
527 CALL MDDEL ('FACNP3')
528 CALL MDSTAT (NERR, MEM)
529 IF (NERR .GT. 0) GOTO 40
530
531 C --Fixup sides sets if mirrored
532 IF (XMIRR * YMIRR * ZMIRR .LT. 0.0) THEN
533 CALL MDRSRV ('IDXELB', KIDXELB, NELBLK+1)
534 CALL MDSTAT (NERR, MEM)
535 IF (NERR .GT. 0) GOTO 40
536 CALL MIRSS (IDESET(0,1), IDESET(0,2),
537 & NESUR, IA(KISFRO), IA(KISBCK), IA(KLTES3), IA(KLTSS3),
538 * COMTOP, C(KNMLB), IA(KNELB3), IA(KIDXELB))
539 CALL MDDEL ('IDXELB')
540 CALL MDSTAT (NERR, MEM)
541 IF (NERR .GT. 0) GOTO 40
542 END IF
543 CALL MDDEL('NUMELB3')
544 C --Write the side sets
545
546 CALL WRESS (A, IA, IDESET(0,1), IDESET(0,2),
547 & IA(KISFRO), IA(KISBCK), NSSUR, NESUR, IA(KNSFRO), IA(KNSBCK),
548 & IA(KIDSS), IA(KNES3), IA(KNNS3),
549 & IA(KIXES3), IA(KIXNS3), IA(KLTES3), IA(KLTSS3),
550 & IA(KLTNS3), A(KFACS3), *40)
551
552 IF (NSSET .GT. 0) THEN
553 CALL MDDEL ('ISSFRO')
554 CALL MDDEL ('ISSBCK')
555 CALL MDDEL ('NSSFRO')
556 CALL MDDEL ('NSSBCK')
557 END IF
558 CALL MDDEL ('IDESS')
559 CALL MDDEL ('NEES3')
560 CALL MDDEL ('NNES3')
561 CALL MDDEL ('IXEES3')
562 CALL MDDEL ('IXNES3')
563 CALL MDDEL ('LTEES3')
564 CALL MDDEL ('LTNES3')
565 CALL MDDEL ('FACES3')
566 CALL MDSTAT (NERR, MEM)
567 IF (NERR .GT. 0) GOTO 40
568
569 GOTO 50
570
571 40 CONTINUE
572 CALL MEMERR
573 GOTO 50
574
575 50 CONTINUE
576 call exerr('gen3d', ' ', EXLMSG)
577 call mdfree()
578 call exclos(ndbin, ierr)
579 if (ndbout .ne. 10) call exclos(ndbout, ierr)
580
581 60 CONTINUE
582 call addlog (QAINFO(1)(:lenstr(QAINFO(1))))
583 CALL WRAPUP (QAINFO(1))
584
585 70 FORMAT (/
586 & 16X,' GGGGGG EEEEEEEEEE NN NN 3333333 ',
587 $ ' DDDDDDD ', /
588 & 15X,' GGGGGGGG EEEEEEEEEE NN NN 333333333 ',
589 $ ' DDDDDDDD ', /
590 & 14X,'GG GG EE NNN NN 33 33 ',
591 $ ' DD DD', /
592 & 13X,'GG EE NNNN NN 33 ',
593 $ ' DD DD')
594 80 FORMAT (
595 & 12X,'GG EEEEEEEE NN NN NN 33333 ',
596 $ ' DD DD', /
597 & 11X,'GG GGGG EEEEEEEE NN NN NN 33333 ',
598 $ ' DD DD', /
599 & 10X,'GG GGGG EE NN NN NN 33 ',
600 $ ' DD DD', /
601 & 9X,'GG GG EE NN NNNN 33 33 ',
602 $ ' DD DD', /
603 & 8X,' GGGGGGGG EEEEEEEEEE NN NNN 333333333 ',
604 $ ' DDDDDDDD ', /
605 & 7X,' GGGGGG EEEEEEEEEE NN NN 3333333 ',
606 $ ' DDDDDDD II')
607 END
608 subroutine exgqaw(ndb, qarec, ierr)
609 include 'exodusII.inc'
610 character*(mxstln) qarec(4, *)
611 call exgqa(ndb, qarec, ierr)
612 return
613 end
614 subroutine exginw(ndb, info, ierr)
615 include 'exodusII.inc'
616 character*(mxlnln) info(*)
617 call exginf(ndb, info, ierr)
618 return
619 end
620
621 C...Check whether model contains elements of a single topology.
622 C This is currently used in the sideset mirroring code
623 subroutine chktop(nelblk, blktyp, comtop)
624
625 include 'exodusII.inc'
626 integer nelblk
627 character*(MXSTLN) blktyp(nelblk)
628 character*(MXSTLN) comtop
629
630 comtop = blktyp(1)(:3)
631 do 10 i=2, nelblk
632 if (blktyp(i)(:3) .ne. comtop(:3)) then
633 comtop = 'MULTIPLE_TOPOLOGIES'
634 return
635 end if
636 10 continue
637 return
638 end