Debian Codegraph @

packages/seacas/applications/gen3d/g3_renumb.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 RENUMB (A, BLKTYP, NUMELB, LINK, XN, YN,
9 & IXEL, INCEL, NREL, IELCOL, IXNP, NRNP, NPCEN, IELROW, IROT)
10 C=======================================================================
11
12 C --*** RENUMB *** (GEN3D) Find the new element and node numbers
13 C -- Written by Amy Gilkey - revised 04/22/88
14 C --
15 C --RENUMB calculates the new node and element numbers and the number
16 C --of nodes/element generated for each node/element. Unless the
17 C --node or element is part of a center block, the number generated
18 C --is simply the number of repetitions. For a center block, the
19 C --elements and nodes are ordered by row and column, and the number
20 C --of repetitions is assigned from the column number. The new node
21 C --number is assigned so that the node and all the nodes it generates
22 C --are grouped together. For example, if the new node number is 20,
23 C --the node it generates in the first translation would be 21. The
24 C --elements are handled the same way.
25 C --
26 C --The output number of nodes and elements are set.
27 C --
28 C --Parameters:
29 C -- A - IN - the dynamic memory base
30 C -- BLKTYP - IN - the element block type
31 C -- NUMELB - IN - the number of elements for each block
32 C -- LINK - IN - the connectivity for the 2D elements, always 4 nodes
33 C -- XN, YN - IN - the nodal coordinates
34 C -- IXEL - OUT - the new index for each element
35 C -- INCEL - OUT - the increment for each element, needed for blocks that
36 C -- become multiple blocks
37 C -- NREL - OUT - the number of new elements generated for each element
38 C -- IELCOL - OUT - the row number for each element, 0 if not needed,
39 C -- needed for single point center, useful for other centers
40 C -- IXNP - OUT - the new index for each node
41 C -- NRNP - OUT - the number of new nodes generated for each node
42 C -- NPCEN - OUT - the node numbers of the center nodes by column and row
43 C -- IELROW - SCRATCH - size = NUMEL
44 C -- IROT - OUT - tracks connectivity rotation to update sset faces
45 C --
46 C --Common Variables:
47 C -- Uses NUMNP, NUMEL of /DBNUMS/
48 C -- Sets NUMNP3, NUMEL3 of /DBNUM3/
49 C -- Uses NNREPL, NEREPL, DIM3, NUMCOL, NUMROW of /PARAMS/
50
51 INCLUDE 'g3_dbnums.blk'
52 INCLUDE 'g3_dbnum3.blk'
53 INCLUDE 'g3_params.blk'
54
55 DIMENSION A(*)
56 CHARACTER BLKTYP(*)
57 INTEGER NUMELB(*)
58 INTEGER LINK(4,*)
59 REAL XN(NUMNP), YN(NUMNP)
60 INTEGER IXEL(*), INCEL(*), NREL(*), IELCOL(*)
61 INTEGER IXNP(*), NRNP(*)
62 C.............NPCEN(NUMCOL,NUMROW)
63 INTEGER NPCEN(*)
64 INTEGER IELROW(NUMEL)
65 INTEGER IROT(NUMEL)
66
67 LOGICAL ALLCEN
68
69 C --Most elements generate an element for each plate/slice
70
71 DO 10 I = 1, NUMEL
72 NREL(I) = NEREPL
73 IELCOL(I) = 0
74 IROT(I) = 1
75 10 CONTINUE
76
77 C --Most nodes generate a node for each plate/slice (+1)
78
79 DO 20 INP = 1, NUMNP
80 NRNP(INP) = NNREPL
81 20 CONTINUE
82
83 IF (NUMCOL .GT. 0) THEN
84 NEROW = 0
85 NUMROW = 0
86
87 C --Save the element numbers of center block element in IELROW
88
89 NCEN = 0
90 IEL = 1
91 DO 40 IELB = 1, NELBLK
92 IF (BLKTYP(IELB) .EQ. 'C') THEN
93 DO 30 I = 1, NUMELB(IELB)
94 NCEN = NCEN + 1
95 IELROW(NCEN) = IEL
96 IEL = IEL + 1
97 30 CONTINUE
98 ELSE
99 IEL = IEL + NUMELB(IELB)
100 END IF
101 40 CONTINUE
102
103 C --Set up the connectivity indices
104 CALL IXLINK (NCEN, IELROW, LINK, XN, YN, IROT)
105
106 C --Order elements by rows and columns
107
108 CALL MDRSRV ('IXROW', KIXROW, NUMEL+1)
109 CALL MDSTAT (NERR, MEM)
110 IF (NERR .GT. 0) GOTO 90
111
112 CALL MAKROW (LINK, XN, NCEN, NUMCOL, NEROW, IELROW, A(KIXROW))
113
114 CALL MDLONG ('IXROW', KIXROW, NEROW+1)
115 CALL MDSTAT (NERR, MEM)
116 IF (NERR .GT. 0) GOTO 90
117
118 C --Put elements into row by column array (column 1 of each row is
119 C --not necessarily the center)
120
121 CALL MDRSRV ('IELCEN', KELCEN, NUMCOL * NEROW)
122 CALL MDSTAT (NERR, MEM)
123 IF (NERR .GT. 0) GOTO 90
124
125 CALL FELCEN (NUMCOL, NEROW, IELROW, A(KIXROW), A(KELCEN))
126
127 CALL MDDEL ('IXROW')
128 CALL MDSTAT (NERR, MEM)
129 IF (NERR .GT. 0) GOTO 90
130
131 C --Determine which elements are on the center column
132
133 CALL MDRSRV ('ICOL1', KICOL1, NEROW)
134 CALL MDSTAT (NERR, MEM)
135 IF (NERR .GT. 0) GOTO 90
136
137 CALL MRKCEN (LINK, XN, NUMCOL, NEROW, A(KELCEN),
138 & A(KICOL1), ALLCEN)
139
140 C --Find the proper columns for the elements
141
142 CALL MDRSRV ('IRBOT', KIRBOT, NEROW)
143 CALL MDRSRV ('IRTOP', KIRTOP, NEROW)
144
145 CALL MDRSRV ('IRBDIF', KIBDIF, NEROW)
146 CALL MDRSRV ('NPBROW', KNPBR, NUMNP)
147 CALL MDRSRV ('NPBCOL', KNPBC, NUMNP)
148 CALL MDRSRV ('NPTROW', KNPTR, NUMNP)
149 CALL MDRSRV ('NPTCOL', KNPTC, NUMNP)
150 CALL MDSTAT (NERR, MEM)
151 IF (NERR .GT. 0) GOTO 90
152
153 CALL MAKCOL (LINK, NUMNP,
154 & NUMCOL, NEROW, A(KELCEN), A(KICOL1),
155 & A(KIRBOT), A(KIRTOP), A(KIBDIF),
156 & A(KNPBR), A(KNPBC), A(KNPTR), A(KNPTC))
157
158 CALL MDDEL ('NPBROW')
159 CALL MDDEL ('NPBCOL')
160 CALL MDDEL ('NPTROW')
161 CALL MDDEL ('NPTCOL')
162 CALL MDDEL ('IRBDIF')
163
164 CALL MDDEL ('ICOL1')
165
166 C --Fill in the number of repetitions for the elements and nodes
167 C --(NREL and NRNP) and the element column numbers (IELCOL) and
168 C --the node rows and columns (NPCEN)
169
170 CALL MDRSRV ('NRBOT', KNRBOT, NEROW)
171 CALL MDRSRV ('NRTOP', KNRTOP, NEROW)
172 CALL MDSTAT (NERR, MEM)
173 IF (NERR .GT. 0) GOTO 90
174
175 N4 = NINT (DIM3 / 90)
176
177 CALL FNPCEN (LINK, N4, NUMCOL, NEROW, A(KELCEN),
178 & A(KIRBOT), A(KIRTOP), NUMROW, NPCEN, NREL, IELCOL, NRNP,
179 & A(KNRBOT), A(KNRTOP))
180
181 CALL MDDEL ('NRBOT')
182 CALL MDDEL ('NRTOP')
183 CALL MDDEL ('IRBOT')
184 CALL MDDEL ('IRTOP')
185 CALL MDDEL ('IELCEN')
186 CALL MDSTAT (NERR, MEM)
187 IF (NERR .GT. 0) GOTO 90
188 END IF
189
190 C --Calculate the new element numbers and increments
191
192 IEL = 1
193 JEL = 1
194 DO 70 IELB = 1, NELBLK
195
196 IF ((BLKTYP(IELB) .EQ. 'T') .OR. (BLKTYP(IELB) .EQ. 'S')) THEN
197
198 C --Blocks that become multiple blocks do a plate/slice at a time
199
200 DO 50 I = 1, NUMELB(IELB)
201 IXEL(IEL) = JEL
202 INCEL(IEL) = NUMELB(IELB)
203 JEL = JEL + 1
204 IEL = IEL + 1
205 50 CONTINUE
206 JEL = JEL + (NEREPL-1) * NUMELB(IELB)
207 ELSE
208
209 C --Other elements do an element at a time
210
211 DO 60 I = 1, NUMELB(IELB)
212 IXEL(IEL) = JEL
213 INCEL(IEL) = 1
214 JEL = JEL + NREL(IEL)
215 IEL = IEL + 1
216 60 CONTINUE
217 END IF
218 70 CONTINUE
219
220 C --New number of elements
221 NUMEL3 = JEL - 1
222
223 C --Calculate the new node numbers
224
225 JNP = 1
226 DO 80 INP = 1, NUMNP
227 IXNP(INP) = JNP
228 JNP = JNP + NRNP(INP)
229 80 CONTINUE
230
231 C --New number of nodes
232 NUMNP3 = JNP - 1
233
234 90 CONTINUE
235 RETURN
236 END