| 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 MSSTEP (A, ISTEP, NEWSET, NEWFAC, ANYDEF, ANYUND, |
| 9 |
& DOIXF, DON2B, DOELED, DOELEU, DODEAD, DONPS, DOESS, |
| 10 |
& LENF, NLNKF, LINKF, LENL, KLNSET, |
| 11 |
& KHIDEN, KHIDEF, KIXFAC, |
| 12 |
& KXN, KYN, KZN, KHZ, KVT, KPD, KDHZ, KDVT, KDPD, |
| 13 |
& KXF, KYF, KZF, KDXF, KDYF, KDZF, |
| 14 |
& NEWELB, IELBST, KN2ELB, KDN2B, IF2EL, KNPSUR) |
| 15 |
C======================================================================= |
| 16 |
|
| 17 |
C --*** MSSTEP *** (MESH) Compute coordinates, etc for time step |
| 18 |
C -- Written by Amy Gilkey - revised 05/26/88 |
| 19 |
C -- |
| 20 |
C --MSSTEP computes the values needed for the mesh plot of a particular |
| 21 |
C --time step. These values include the nodal deformed coordinates, |
| 22 |
C --the face coordinates (both deformed and undeformed), and |
| 23 |
C --the line set. The memory for these values is expanded if needed. |
| 24 |
C --The values which do not change between time steps (e.g., the |
| 25 |
C --undeformed coordinates are not recalculated. |
| 26 |
C -- |
| 27 |
C --This routine uses MDFIND to find the following dynamic memory arrays: |
| 28 |
C -- IF2EL2 - the secondary element number of each face |
| 29 |
C -- IE2ELB - the element block for each element |
| 30 |
C -- |
| 31 |
C --Parameters: |
| 32 |
C -- A - IN - the dynamic memory base array |
| 33 |
C -- ISTEP - IN - the time step number |
| 34 |
C -- NEWSET - IN - true iff start of a new plot set |
| 35 |
C -- NEWFAC - IN - true iff the faces have changed |
| 36 |
C -- ANYDEF - IN - true iff any deformed mesh is to be plotted |
| 37 |
C -- ANYUND - IN - true iff any undeformed mesh is to be plotted |
| 38 |
C -- DOIXF - IN - true iff the IXFAC array is needed |
| 39 |
C -- DON2B - IN - true iff the IN2ELB array is needed |
| 40 |
C -- DOELED - IN - true iff the deformed element quarilateral centers |
| 41 |
C -- are needed |
| 42 |
C -- DOELEU - IN - true iff the undeformed element quarilateral centers |
| 43 |
C -- are needed |
| 44 |
C -- DODEAD - IN - true iff dead nodes are needed |
| 45 |
C -- DONPS - IN - true iff node set information is needed |
| 46 |
C -- DOESS - IN - true iff side set information is needed |
| 47 |
C -- LENF - IN/OUT - the cumulative face counts by element block |
| 48 |
C -- NLNKF - IN - the number of nodes per face |
| 49 |
C -- LINKF - IN/OUT - the connectivity for all faces |
| 50 |
C -- LENL - IN/OUT - the cumulative line counts by element block |
| 51 |
C -- KLNSET - IN/OUT - the dynamic memory index of the sorted line set |
| 52 |
C -- KHIDEN - OUT - the index of HIDENP - sized only |
| 53 |
C -- KHIDEF - OUT - the index of HIDEF - sized only |
| 54 |
C -- KIXFAC - OUT - the index of IXFAC - sized only |
| 55 |
C -- KXN, KYN, KZN - IN/OUT - the indices of XN, YN, ZN - |
| 56 |
C -- the nodal coordinates (ZN for 3D only) |
| 57 |
C -- KHZ, KVT, KPD - IN/OUT - the indices of HZ, VT, PD - |
| 58 |
C -- the undeformed nodal coordinates |
| 59 |
C -- (rotated for 3D, PD for 3D only) |
| 60 |
C -- KDHZ, KDVT, KDPD - IN/OUT - the indices of DHZ, DVT, DPD - |
| 61 |
C -- the deformed nodal coordinates |
| 62 |
C -- (rotated for 3D, DPD for 3D only) |
| 63 |
C -- KXF, KYF, KZF - IN/OUT - the indices of XF, YF, ZF - |
| 64 |
C -- the element face center coordinates |
| 65 |
C -- (rotated for 3D, ZF for 3D only) |
| 66 |
C -- KDXF, KDYF, KDZF - IN/OUT - the indices of DXF, DYF, DZF - |
| 67 |
C -- the deformed face center coordinates |
| 68 |
C -- (rotated for 3D, DZF for 3D only) |
| 69 |
C -- NEWELB - IN/OUT - the new element blocks flag: |
| 70 |
C -- 0 = no new element blocks |
| 71 |
C -- 1 = new selected element blocks |
| 72 |
C -- 2 = new displayed element blocks (implies new selected blocks) |
| 73 |
C -- IELBST - IN/OUT - the element block status: |
| 74 |
C -- -1 = OFF, 0 = ON, but not selected, 1 = selected |
| 75 |
C -- KN2ELB - IN/OUT - the index of IN2ELB - |
| 76 |
C - the element block for each node; |
| 77 |
C -- <0 if not in any selected element block |
| 78 |
C -- =0 if in more than one selected element block |
| 79 |
C -- KDN2B - IN/OUT - the index of IDN2B - |
| 80 |
C -- the element block for each dead node; dead if >= 0 |
| 81 |
C -- IF2EL - IN - the element number of each face |
| 82 |
C -- KNPSUR - IN/OUT - the index of NPSURF - |
| 83 |
C -- the node numbers of the surface nodes or mesh boundary nodes (2D) |
| 84 |
C -- |
| 85 |
C --Common Variables: |
| 86 |
C -- Uses NDIM, NELBLK of /DBNUMS/ |
| 87 |
C -- Uses IS3DIM, NNPSUR, NUMNPF, LLNSET of /D3NUMS/ |
| 88 |
C -- Uses DEFPRO, DEFOK, DFAC of /DEFORM/ |
| 89 |
C -- Uses ROTMAT, ROTCEN of /ROTOPT/ |
| 90 |
|
| 91 |
include 'dbnums.blk' |
| 92 |
include 'd3nums.blk' |
| 93 |
include 'deform.blk' |
| 94 |
include 'rotopt.blk' |
| 95 |
include 'sizes.blk' |
| 96 |
|
| 97 |
DIMENSION A(*) |
| 98 |
LOGICAL NEWSET, NEWFAC |
| 99 |
LOGICAL ANYDEF, ANYUND |
| 100 |
LOGICAL DOIXF, DON2B, DOELED, DOELEU, DODEAD, DONPS, DOESS |
| 101 |
INTEGER LENF(0:NELBLK+4) |
| 102 |
INTEGER NLNKF(NELBLK) |
| 103 |
INTEGER LINKF(*) |
| 104 |
INTEGER LENL(-2:NELBLK) |
| 105 |
INTEGER NEWELB |
| 106 |
INTEGER IELBST(NELBLK) |
| 107 |
INTEGER IF2EL(*) |
| 108 |
|
| 109 |
LOGICAL NEWNPD, NEWNPU, NEWELD, NEWELU |
| 110 |
SAVE NEWNPU, NEWELU |
| 111 |
|
| 112 |
DATA NEWNPU, NEWELU / .TRUE., .TRUE. / |
| 113 |
|
| 114 |
IF (NEWFAC) THEN |
| 115 |
C --Force the re-calculation of connected element count, if needed |
| 116 |
NEWELB = 1 |
| 117 |
|
| 118 |
C --Force the re-calculation of undeformed nodal and face coordinates |
| 119 |
NEWNPU = .TRUE. |
| 120 |
NEWELU = .TRUE. |
| 121 |
|
| 122 |
C --Set size of deformed coordinate arrays for hidden line algorithm |
| 123 |
NPSIZ = NUMNPF |
| 124 |
IF (IS3DIM) NPSIZ = (13 * NUMNPF) / 10 |
| 125 |
END IF |
| 126 |
|
| 127 |
C --Force the re-calculation of deformed nodal and face coordinates |
| 128 |
NEWNPD = DEFOK .AND. DEFPRO |
| 129 |
NEWELD = DEFOK .AND. DEFPRO |
| 130 |
|
| 131 |
C --Force the re-calculation of undeformed nodal and face coordinates |
| 132 |
IF (NEWROT .OR. NEWSET) THEN |
| 133 |
NEWNPU = .TRUE. |
| 134 |
NEWELU = .TRUE. |
| 135 |
END IF |
| 136 |
|
| 137 |
C --Release memory that will vary in size or not be needed |
| 138 |
|
| 139 |
IF (NEWSET .OR. NEWFAC) THEN |
| 140 |
IF (NEWELB .GE. 1) THEN |
| 141 |
CALL MDLONG ('IN2ELB', KN2ELB, 0) |
| 142 |
END IF |
| 143 |
IF (DODEAD) CALL MDLONG ('IDN2B', KDN2B, 0) |
| 144 |
END IF |
| 145 |
IF (NNPSUR .LT. 0) THEN |
| 146 |
CALL MDLONG ('NPSURF', KNPSUR, 0) |
| 147 |
END IF |
| 148 |
IF (IS3DIM .AND. NEWNPU) THEN |
| 149 |
CALL MDLONG ('HZ', KHZ, 0) |
| 150 |
CALL MDLONG ('VT', KVT, 0) |
| 151 |
IF (IS3DIM) CALL MDLONG ('PD', KPD, 0) |
| 152 |
END IF |
| 153 |
IF (NEWNPD) THEN |
| 154 |
CALL MDLONG ('DHZ', KDHZ, 0) |
| 155 |
CALL MDLONG ('DVT', KDVT, 0) |
| 156 |
IF (IS3DIM) CALL MDLONG ('DPD', KDPD, 0) |
| 157 |
END IF |
| 158 |
IF (NEWELU) THEN |
| 159 |
CALL MDLONG ('XF', KXF, 0) |
| 160 |
CALL MDLONG ('YF', KYF, 0) |
| 161 |
IF (IS3DIM) CALL MDLONG ('ZF', KZF, 0) |
| 162 |
END IF |
| 163 |
IF (NEWELD) THEN |
| 164 |
CALL MDLONG ('DXF', KDXF, 0) |
| 165 |
CALL MDLONG ('DYF', KDYF, 0) |
| 166 |
IF (IS3DIM) CALL MDLONG ('DZF', KDZF, 0) |
| 167 |
END IF |
| 168 |
IF (IS3DIM .AND. NEWFAC) THEN |
| 169 |
CALL MDLONG ('HIDENP', KHIDEN, 0) |
| 170 |
CALL MDLONG ('HIDEF', KHIDEF, 0) |
| 171 |
IF (DOIXF) CALL MDLONG ('IXFAC', KIXFAC, 0) |
| 172 |
END IF |
| 173 |
|
| 174 |
CALL MDSTAT (NERR, MEM) |
| 175 |
IF (NERR .GT. 0) GOTO 100 |
| 176 |
|
| 177 |
C --Compute new line set if new faces |
| 178 |
|
| 179 |
IF (NEWFAC) THEN |
| 180 |
CALL MSLINS (A, LENF, NLNKF, LINKF, IF2EL, LENL, KLNSET) |
| 181 |
CALL MDSTAT (NERR, MEM) |
| 182 |
IF (NERR .GT. 0) GOTO 100 |
| 183 |
END IF |
| 184 |
|
| 185 |
C --Compute node to element block and dead node to element block, |
| 186 |
C --if needed |
| 187 |
|
| 188 |
IF ((NEWELB .GE. 1) .AND. (DON2B .OR. DONPS .OR. DOESS)) THEN |
| 189 |
IF (NEWSET .OR. NEWFAC) THEN |
| 190 |
CALL MDLONG ('IN2ELB', KN2ELB, NUMNPF) |
| 191 |
CALL MDSTAT (NERR, MEM) |
| 192 |
IF (NERR .GT. 0) GOTO 100 |
| 193 |
END IF |
| 194 |
|
| 195 |
CALL MAKN2B (LENF, NLNKF, LINKF, IELBST, A(KN2ELB)) |
| 196 |
NEWELB = 0 |
| 197 |
END IF |
| 198 |
|
| 199 |
IF (DODEAD) THEN |
| 200 |
IF (NEWSET .OR. NEWFAC) THEN |
| 201 |
CALL MDLONG ('IDN2B', KDN2B, NUMNPF) |
| 202 |
END IF |
| 203 |
IF (IS3DIM) THEN |
| 204 |
CALL MDFIND ('IF2EL2', KIF2E2, IDUM) |
| 205 |
ELSE |
| 206 |
KIF2E2 = 1 |
| 207 |
KE2ELB = 1 |
| 208 |
END IF |
| 209 |
CALL MDFIND ('IE2ELB', KE2ELB, IDUM) |
| 210 |
CALL MDSTAT (NERR, MEM) |
| 211 |
IF (NERR .GT. 0) GOTO 100 |
| 212 |
|
| 213 |
CALL MAKD2B (LENF, NLNKF, LINKF, IELBST, |
| 214 |
& IF2EL, A(KIF2E2), A(KE2ELB), A(KDN2B)) |
| 215 |
|
| 216 |
END IF |
| 217 |
|
| 218 |
C --Compute NPSURF nodes for 3D, if changed |
| 219 |
|
| 220 |
IF (NNPSUR .LT. 0) THEN |
| 221 |
CALL MDLONG ('NPSURF', KNPSUR, NUMNPF) |
| 222 |
CALL MDSTAT (NERR, MEM) |
| 223 |
IF (NERR .GT. 0) GOTO 100 |
| 224 |
|
| 225 |
CALL MAKSUR (LENF, NLNKF, LINKF, |
| 226 |
& DODEAD, A(KDN2B), A(KNPSUR)) |
| 227 |
|
| 228 |
CALL MDLONG ('NPSURF', KNPSUR, NNPSUR) |
| 229 |
END IF |
| 230 |
|
| 231 |
C --Put rotated undeformed coordinates in undeformed arrays, if needed |
| 232 |
|
| 233 |
IF (NEWNPU .AND. ANYUND) THEN |
| 234 |
IF (IS3DIM) THEN |
| 235 |
CALL MDLONG ('HZ', KHZ, NPSIZ) |
| 236 |
CALL MDLONG ('VT', KVT, NPSIZ) |
| 237 |
IF (IS3DIM) CALL MDLONG ('PD', KPD, NPSIZ) |
| 238 |
ELSE |
| 239 |
KHZ = KXN |
| 240 |
KVT = KYN |
| 241 |
KPD = KZN |
| 242 |
END IF |
| 243 |
|
| 244 |
IF (IS3DIM) THEN |
| 245 |
CALL BL_ROTATE (NNPSUR, A(KNPSUR), ROTMAT, ROTCEN, |
| 246 |
& A(KXN), A(KYN), A(KZN), A(KHZ), A(KVT), A(KPD)) |
| 247 |
|
| 248 |
C --Force the re-calculation of undeformed face coordinates |
| 249 |
NEWELU = .TRUE. |
| 250 |
END IF |
| 251 |
|
| 252 |
NEWNPU = .FALSE. |
| 253 |
NEWROT = .FALSE. |
| 254 |
END IF |
| 255 |
|
| 256 |
C --Compute deformed nodal coordinates, if needed |
| 257 |
|
| 258 |
IF (NEWNPD .AND. ANYDEF) THEN |
| 259 |
CALL MDLONG ('DHZ', KDHZ, NPSIZ) |
| 260 |
CALL MDLONG ('DVT', KDVT, NPSIZ) |
| 261 |
IF (IS3DIM) CALL MDLONG ('DPD', KDPD, NPSIZ) |
| 262 |
|
| 263 |
CALL DEFXYZ (A, ISTEP, DFAC, IS3DIM, A(KNPSUR), |
| 264 |
& A(KXN), A(KYN), A(KZN), A(KDHZ), A(KDVT), A(KDPD)) |
| 265 |
|
| 266 |
IF (IS3DIM) THEN |
| 267 |
CALL BL_ROTATE (NNPSUR, A(KNPSUR), ROTMAT, ROTCEN, |
| 268 |
& A(KDHZ), A(KDVT), A(KDPD), A(KDHZ), A(KDVT), A(KDPD)) |
| 269 |
END IF |
| 270 |
|
| 271 |
C --Force the re-calculation of deformed face coordinates |
| 272 |
NEWELD = .TRUE. |
| 273 |
|
| 274 |
NEWNPU = .FALSE. |
| 275 |
END IF |
| 276 |
|
| 277 |
C --Get face coordinates, if changed |
| 278 |
|
| 279 |
IF (NEWELU .AND. DOELEU) THEN |
| 280 |
IF (NEWELU) THEN |
| 281 |
CALL MDLONG ('XF', KXF, LENF(NELBLK)) |
| 282 |
CALL MDLONG ('YF', KYF, LENF(NELBLK)) |
| 283 |
IF (IS3DIM) CALL MDLONG ('ZF', KZF, LENF(NELBLK)) |
| 284 |
CALL MDSTAT (NERR, MEM) |
| 285 |
IF (NERR .GT. 0) GOTO 100 |
| 286 |
END IF |
| 287 |
|
| 288 |
CALL ELECOR (NDIM, NELBLK, LENF, NLNKF, LINKF, |
| 289 |
& A(KHZ), A(KVT), A(KPD), A(KXF), A(KYF), A(KZF)) |
| 290 |
NEWELU = .FALSE. |
| 291 |
END IF |
| 292 |
|
| 293 |
IF (NEWELD .AND. DOELED) THEN |
| 294 |
IF (NEWELD) THEN |
| 295 |
CALL MDLONG ('DXF', KDXF, LENF(NELBLK)) |
| 296 |
CALL MDLONG ('DYF', KDYF, LENF(NELBLK)) |
| 297 |
IF (IS3DIM) CALL MDLONG ('DZF', KDZF, LENF(NELBLK)) |
| 298 |
CALL MDSTAT (NERR, MEM) |
| 299 |
IF (NERR .GT. 0) GOTO 100 |
| 300 |
END IF |
| 301 |
|
| 302 |
CALL ELECOR (NDIM, NELBLK, LENF, NLNKF, LINKF, |
| 303 |
& A(KDHZ), A(KDVT), A(KDPD), A(KDXF), A(KDYF), A(KDZF)) |
| 304 |
NEWELD = .FALSE. |
| 305 |
END IF |
| 306 |
|
| 307 |
IF (IS3DIM .AND. NEWFAC) THEN |
| 308 |
CALL MDLONG ('HIDENP', KHIDEN, NUMNPF) |
| 309 |
CALL MDLONG ('HIDEF', KHIDEF, LENF(NELBLK)) |
| 310 |
IF (DOIXF) CALL MDLONG ('IXFAC', KIXFAC, LENF(NELBLK)) |
| 311 |
CALL MDSTAT (NERR, MEM) |
| 312 |
IF (NERR .GT. 0) GOTO 100 |
| 313 |
END IF |
| 314 |
|
| 315 |
100 CONTINUE |
| 316 |
RETURN |
| 317 |
END |