Debian Codegraph @

packages/seacas/applications/grepos/gp_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 (IDESS, NEESS, IXEESS, LTEESS, LTSSS,
9 $ IBLOCK, BLKTYP, ALLONE, COMTOP)
10 C=======================================================================
11
12 C --*** MIRSS *** (GJOIN) Mirror element side sets
13 C -- Written by Greg Sjaardema
14 C --
15 C --MIRSS mirrors a side set and (if USESDF true) the distribution factors
16 C --applied to the nodes.
17 C --
18 C --Parameters:
19 C --
20 C -- NUMESS - IN/OUT - the number of element side sets
21 C -- LESSEL - IN/OUT - the length of the element side sets element list
22 C -- IDESS - IN/OUT - the element side set ID for each set
23 C -- NEESS - IN/OUT - the number of elements for each set
24 C -- IXEESS - IN/OUT - the index of the first element for each set
25 C -- LTEESS - IN/OUT - the elements for all sets
26 C -- LTSSS - IN/OUT - the sides for all sets
27 C -- ALLONE - IN - true if df are all unity, false if not all unity
28
29 include 'gp_params.blk'
30 include 'gp_dbnums.blk'
31 INTEGER IDESS(*) ! NUMESS
32 INTEGER NEESS(*) ! NUMESS
33 INTEGER IXEESS(*) ! NUMESS
34 INTEGER LTEESS(*) ! LESSEL
35 INTEGER LTSSS(*) ! LESSEL
36 INTEGER IBLOCK(*) ! NELBLK - gives index of last element in block
37 CHARACTER*(MXSTLN) BLKTYP(*)
38
39 LOGICAL ALLONE
40 CHARACTER*(*) COMTOP
41
42 C The routine now provides more checking and will return with a warning
43 C if applied to elements on other faces...
44
45 if (comtop(:8) .eq. 'MULTIPLE') THEN
46 DO NL = 1, NUMESS
47 iel = IXEESS(NL)
48 call mirs2(NEESS(NL), LTEESS(iel),
49 * LTSSS(iel), iblock, blktyp, nelblk, ndim)
50 end do
51 return
52 else
53 C ... comtop was not equal to "MULTIPLE_TOPOLOGIES", so
54 C at this point, the underlying element topology for all elements
55 C is the same....
56 DO NL = 1, NUMESS
57 iel = IXEESS(NL)
58 call mirs1(NEESS(NL), LTSSS(iel), blktyp(1), ndim)
59 end do
60 end if
61 IF (.NOT. ALLONE) THEN
62 CALL PRTERR ('WARNING',
63 * 'Mirroring of sideset distribution factors not supported')
64 END IF
65
66 RETURN
67 END
68
69 subroutine mirs1(numsid, side, type, ndim)
70
71 include 'gp_params.blk'
72
73 integer numsid
74 integer side(*)
75 CHARACTER*(MXSTLN) TYPE
76
77 if (type(:3) .eq. 'HEX') then
78 do i = 1, numsid
79 if (side(i) .le. 4) then
80 side(i) = 5 - side(i)
81 else
82 side(i) = side(i)
83 end if
84 end do
85 else if (type(:4) .eq. 'QUAD') then
86 do i = 1, numsid
87 side(i) = 5 - side(i)
88 end do
89 else if (type(:5) .eq. 'SHELL') then
90 return
91 else if (type(:5) .eq. 'TRUSS' .or.
92 $ type(:4) .eq. 'BEAM') then
93 return
94 else if (type(:3) .eq. 'TET') then
95 do i = 1, numsid
96 if (side(i) .eq. 3) then
97 side(i) = 1
98 else if (side(i) .eq. 1) then
99 side(i) = 3
100 end if
101 end do
102 else if (type(:3) .eq. 'TRI') then
103 C ... 'TRI' can be triangle or trishell
104 if (ndim .eq. 2) then
105 do i = 1, numsid
106 side(i) = 4 - side(i)
107 end do
108 end if
109 else if (type(:5) .eq. 'WEDGE') then
110 do i = 1, numsid
111 if (side(i) .eq. 3) then
112 side(i) = 1
113 else if (side(i) .eq. 1) then
114 side(i) = 3
115 end if
116 end do
117 end if
118 return
119 end
120
121 subroutine mirs2(numsid, elems, side,
122 $ iblock, blktyp, nelblk, ndim)
123
124 include 'gp_params.blk'
125 integer numsid, nelblk, elem
126 integer elems(*), side(*), iblock(*)
127 CHARACTER*(MXSTLN) BLKTYP(*)
128
129 lstelem = 0
130 lstblk = 1
131 iblk = 0
132 do i = 1, numsid
133 elem = elems(i)
134 if (elem .gt. lstelem) then
135 do j = lstblk, nelblk
136 if (elem .le. iblock(j)) then
137 iblk = j;
138 goto 30
139 end if
140 end do
141 30 continue
142 else
143 do j = 1, nelblk
144 if (elem .le. iblock(j)) then
145 iblk = j;
146 goto 20
147 end if
148 end do
149 20 continue
150 end if
151 lstelem = elem
152 lstblk = iblk
153
154 if (blktyp(iblk)(:3) .eq. 'HEX') then
155 if (side(i) .le. 4) then
156 side(i) = 5 - side(i)
157 else
158 side(i) = side(i)
159 end if
160 else if (blktyp(iblk)(:4) .eq. 'QUAD') then
161 side(i) = 5 - side(i)
162 else if (blktyp(iblk)(:5) .eq. 'SHELL') then
163 side(i) = side(i)
164 else if (blktyp(iblk)(:5) .eq. 'TRUSS' .or.
165 $ blktyp(iblk)(:4) .eq. 'BEAM') then
166 side(i) = side(i)
167 else if (blktyp(iblk)(:3) .eq. 'TET') then
168 if (side(i) .eq. 3) then
169 side(i) = 1
170 else if (side(i) .eq. 1) then
171 side(i) = 3
172 end if
173 else if (blktyp(iblk)(:3) .eq. 'TRI') then
174 C ... 'TRI' can be triangle or trishell
175 if (ndim .eq. 2) then
176 side(i) = 4 - side(i)
177 end if
178 else if (blktyp(iblk)(:5) .eq. 'WEDGE') then
179 if (side(i) .eq. 3) then
180 side(i) = 1
181 else if (side(i) .eq. 1) then
182 side(i) = 3
183 end if
184 end if
185 C ... If not in list above, assume that they need no adjustment.
186 end do
187 return
188 end