Debian Codegraph @

packages/seacas/applications/blot/prochs.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 PROCHS (A, IA, NELBLK, IDELB, IDSCR, NELB, NLNK, NATR,
9 & KLINKE, KATRIB, NAMELB, LPTR, ISHEX, HEXID, *)
10 C=======================================================================
11 C --PROCHS - PROCess HexShell elements
12 C --To visualize a HEXSHELL element the 12-noded HEXSHELL needs to
13 C --be separated into an 8-noded HEX and 4-node SHELL. A New element
14 C --block will be created for every element block that contains a
15 C --HEXSHELL element.
16 C --An error message is displayed if the end of file is read.
17 C --Parameters:
18 C -- IA - I/O - dynamic memory array for integer values
19 C -- A - I/O - dynamic memory array for real values
20 C -- C - I/0 - dynamic memory array for character values
21 C -- NELBLK - IN - number of element blocks
22 C -- IDELB - I/O - array: element block ids
23 C -- NELB - I/O - array: number of elements per element block
24 C -- NLNK - I/O - array: number of nodes per element
25 C -- NATR - I/O - array: number of attributes
26 C -- LINK - I/O - array: link array
27 C -- ATRIB - I/O - array: attribute array
28 C -- LPTR - IN - array: link pointer array
29 C -- ISHEX - IN - number of element blocks with hex shells
30 C -- KHEXID - IN - array storing HEXSHELL element block ids
31
32 DIMENSION A(*),IA(*)
33 INTEGER NELBLK
34 CHARACTER*(*) NAMELB(*)
35 INTEGER IDELB(*), IDSCR(*), NELB(*), NLNK(*), NATR(*)
36 INTEGER KLINKE, KATRIB
37 INTEGER LPTR(*)
38 INTEGER ISHEX, HEXID(*)
39
40 IHEX = 1
41 100 CONTINUE
42 IF (IHEX .GT. ISHEX) GO TO 200
43 C HEXSHELL element block ID - will remain HEX element block id
44 IDH = HEXID(IHEX)
45 C New element block ID for SHELL
46 IDS = IDH + 5000
47 C Sort the element block id array
48 DO 10 J = NELBLK+ISHEX, 1, -1
49 IF (IDELB(J) .EQ. IDH) THEN
50 C Element block id for shell element block
51 IDELB(J+1) = IDS
52 C Number of elements in shell element block
53 NELB(J+1) = NELB(J)
54 C Number of nodes per element for hex element block
55 NLNK(J) = 8
56 C Number of nodes per element for shell element block
57 NLNK(J+1) = 4
58 C Number of attributes in hex element block
59 NATR(J) = 0
60 C Number of attributes in shell element block
61 NATR(J+1) = 1
62 C Named type for hex element block
63 NAMELB(J) = 'HEX'
64 C Named type for shell element block
65 NAMELB(J+1)= 'SHELL'
66 C Process link array
67 C Pointer to LINK array for element block J
68 CALL GETPTR (IDH,NELBLK,IDSCR,LPTR,IPTR)
69 C Size of link array for HEXSHELL element block
70 NELEM = NELB(J)
71 C Reserve space for link array - HEX element block
72 CALL MDRSRV('HSCR', KHSCR, 8*NELEM)
73 C Reserve space for link array - SHELL element block
74 CALL MDRSRV('SSCR', KSSCR, 4*NELEM)
75 CALL MDSTAT (NERR, MEM)
76 IF (NERR .GT. 0) RETURN 1
77 CALL MODLNK(NELEM, IA(KHSCR), IA(KSSCR), IA(IPTR))
78 CALL MDDEL('HSCR')
79 CALL MDDEL('SSCR')
80 CALL MDSTAT (NERR, MEM)
81 IF (NERR .GT. 0) RETURN 1
82 GOTO 150
83 ELSE
84 IDELB(J) = IDELB(J-1)
85 NELB(J) = NELB(J-1)
86 NLNK(J) = NLNK(J-1)
87 NAMELB(J) = NAMELB(J-1)
88 ENDIF
89 10 CONTINUE
90 150 CONTINUE
91 IHEX = IHEX + 1
92 GO TO 100
93 200 CONTINUE
94
95 RETURN
96 END
97
98 SUBROUTINE GETPTR(ID, NELBLK, IDS, LPTR, IPTR)
99 C ID - IN - element block id of link array
100 C NELBLK - IN - number of element blocks
101 C IDS - IN - element blocks id of original elements
102 C LPTR - IN - 1st pointers in each element block for LINKE array
103 C IPTR - OUT - pointer into link array
104
105 INTEGER ID, NELBLK, IDS(*), LPTR(*)
106
107 C Search for element block id ID in IDS
108 DO 400 I = 1, NELBLK
109 IF (ID .EQ. IDS(I)) THEN
110 IPTR = LPTR(I)
111 GOTO 450
112 ENDIF
113 400 CONTINUE
114 450 CONTINUE
115
116 RETURN
117 END
118
119 SUBROUTINE MODLNK(NELEM, HEX, SHELL, LINKE)
120 C The LINKE array contains the connectivity for a 12 node HEXSHELL element.
121 C This subroutine will create a connectivity array for a HEX element block
122 C and a connectivity array for a SHELL element block. To create the
123 C HEX connectivity array the first 8 of 12 nodes from every element in
124 C the HEXSHELL element block connectivity are copied into the HEX(*)
125 C array (e.g. if the HEXSHELL element block has 2 elements, LINKE(1-8)
126 C and LINKE(13-20) are copied into the HEX array). The SHELL connectivity
127 C is created by copying nodes 9 through 12 from every element in the
128 C HEXSHELL element block connectivity into the SHELL connectivity
129 C (e.g. For 2 HEXSHELL elements, LINKE(9-12) and LINKE(21-24) will be
130 C copied into the SHELL connectivity). After the HEX and SHELL
131 C connectivity arrays have been created, they are copied back into
132 C the LINKE array. First HEX and then SHELL ares copied back into LINKE.
133 C C. Forsythe 7/31/97
134
135 INTEGER NELEM
136 INTEGER HEX(*), SHELL(*), LINKE(*)
137 INTEGER IH, IS
138
139 IH = 8*NELEM
140 IS = 4*NELEM
141 C Create HEX connectivity array - copy the first 8 of 12 nodes from
142 C every HEXSHELL element into the HEX connectivity array.
143 DO 300 I = 1, IH
144 INC = (I-1)/8
145 J = I + INC*4
146 HEX(I) = LINKE(J)
147 300 CONTINUE
148
149 C Create SHELL connectivity array - copy nodes 9-12 from every HEXSHELL
150 C element into the SHELL connectivity array.
151 DO 310 I = 1, IS
152 INC = (I-1)/4 + 1
153 J = I + INC*8
154 SHELL(I) = LINKE(J)
155 310 CONTINUE
156
157 C Copy the HEX and then the SHELL link arrays back into the LINKE array
158 DO 320 I = 1, IH
159 LINKE(I) = HEX(I)
160 320 CONTINUE
161 DO 330 I = 1, IS
162 J = IH + I
163 LINKE(J) = SHELL(I)
164 330 CONTINUE
165
166 RETURN
167 END