Debian Codegraph @

packages/seacas/applications/gen3d/g3_mirss.f

raw
1 C Copyright(C) 1999-2020 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 SUBROUTINE MIRSS (IDFRO, IDBCK,
9 & NESUR, NESFRO, NESBCK, LTEES3, LTSSS3,
10 * COMTOP, NAMELB, NUMELB, IDXELB)
11 C=======================================================================
12
13 C --*** MIRSS *** (GEN3D) Modifies sideset node order to account
14 C for mirroring about axes
15 C -- Written by Greg Sjaardema - revised 02/10/89
16 C -- Modified from WRESS written by Amy Gilkey
17 C --
18 C --Parameters:
19 C -- IDFRO - IN - ids for front surface side sets; (0) = length
20 C -- IDBCK - IN - ids for back surface side sets; (0) = length
21 C -- NESUR - IN - the number of elements in the surface side set
22 C -- NESFRO - IN - the elements in the front surface side set
23 C -- NESBCK - IN - the elements in the back surface side set
24 C -- LTEES3 - IN - the element faces for all 3D sets
25 C --
26 C --Common Variables:
27 C -- Uses NUMESS of /DBNUMS/
28 C -- Uses LESSEO of /DBNUM3/
29 C --
30 INCLUDE 'g3_dbnums.blk'
31 INCLUDE 'g3_dbnum3.blk'
32 INCLUDE 'exodusII.inc'
33
34 INTEGER IDFRO(0:*)
35 INTEGER IDBCK(0:*)
36 INTEGER NESFRO(*), NESBCK(*)
37 INTEGER LTSSS3(*), LTEES3(*)
38 CHARACTER*(*) COMTOP
39 CHARACTER*(MXSTLN) NAMELB(NELBLK)
40 INTEGER NUMELB(*)
41 INTEGER IDXELB(0:*)
42
43 LOGICAL ANYESS
44
45 INTEGER NEWFAC(6)
46 INTEGER NEWWED(5)
47 DATA NEWFAC /4, 3, 2, 1, 5, 6/
48 DATA NEWWED /3, 2, 1, 4, 5/
49
50 NFRO = IDFRO(0)
51 NBCK = IDBCK(0)
52 ANYESS = (NFRO .GT. 0) .OR. (NBCK .GT. 0) .OR. (NUMESS .GT. 0)
53
54 C --Write 3D
55
56 C ... If topology is anything other than QUAD or TRI (HEX or WEDGE)
57 C it is ignored in this routine.
58
59 c ... NOTE: COMTOP is in the 2D topology, NAMELB is in the 3D topology
60
61 IF (ANYESS) THEN
62 if (comtop(:8) .eq. 'MULTIPLE') THEN
63 C ... Sidesets are possibly mixed topology (HEX and WEDGE)
64 C Need to iterate the sideset element/side and determine
65 C which block the element/side belongs to and then
66 C adjust accordingly.
67 C This could probably be optimized...
68
69 C ... First, set up the index structure to map an element id to the block it is in.
70 idxelb(0) = 0
71 do i=1, nelblk
72 idxelb(i) = numelb(i)
73 end do
74 do i=1, nelblk
75 idxelb(i) = idxelb(i-1) + idxelb(i)
76 end do
77
78 C ... Now iterate the sideset element/faces
79 do nl = 1, lesseo
80 iel = ltees3(nl)
81 do i=1, nelblk
82 if (iel .gt. idxelb(i-1) .and. iel .le. idxelb(i)) then
83 iblk = i
84 go to 20
85 end if
86 end do
87 20 continue
88
89 if (namelb(iblk)(:1) .eq. 'H') then
90 LTSSS3(NL) = NEWFAC(LTSSS3(NL))
91 else if (namelb(iblk)(:1) .eq. 'W') then
92 LTSSS3(NL) = NEWWED(LTSSS3(NL))
93 end if
94 end do
95 else
96 C ... comtop was not equal to "MULTIPLE_TOPOLOGIES", so
97 C at this point, the underlying element topology for all elements
98 C is the same....
99
100 if (comtop(:4) .eq. 'QUAD') then
101 C ... Quad -> hex
102 DO NL = 1, LESSEO
103 C ... non-front and non-back sidesets
104 C ... Front and back don't get mirrored...(?)
105 LTSSS3(NL) = NEWFAC(LTSSS3(NL))
106 END DO
107
108 else if (comtop(:3) .eq. 'TRI') then
109 C ... Tri -> wedge
110 DO NL = 1, LESSEO
111 LTSSS3(NL) = NEWWED(LTSSS3(NL))
112 END DO
113 end if
114 END IF
115 end if
116 RETURN
117 END