Debian Codegraph @

packages/seacas/applications/blot/meshup.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 MESHUP (WIDLIN, MSHLIN, MLNTYP,
9 & IELBST, LENL, LINSET, BLKCOL, XN, YN, ZN,
10 & IDELB, *)
11 C=======================================================================
12
13 C --*** MESHUP *** (MESH) Plot mesh lines
14 C -- Modified by John Glick - 11/29/88
15 C -- Written by Amy Gilkey - revised 03/29/88
16 C -- D. P. Flanagan, 07/02/82
17 C --
18 C --MESHUP plots a mesh as a set of lines. The lines have been divided
19 C --into parts as follows:
20 C -- -1) Mesh boundary
21 C -- 0) Element block boundary
22 C -- n) Interior within element block 'n'
23 C --
24 C --The line type and the display options are used to select the line color
25 C --and the line width.
26 C --
27 C --For a 3D mesh with interior faces requested, the interior
28 C --faces are drawn before the surface lines.
29 C --
30 C --Parameters:
31 C -- WIDLIN - IN - true iff mesh lines should be wide versus narrow
32 C -- MSHLIN - IN - the mesh lines to display (as in /MSHOPT/)
33 C -- MLNTYP - IN - the line type of lines (as in /MSHOPT/)
34 C -- IELBST - IN - the element block status (>0 if selected)
35 C -- LENL - IN - the cumulative line counts by element block
36 C -- LINSET - IN - the sorted line set
37 C -- BLKCOL - IN/OUT - the user selected colors of the element blocks.
38 C -- BLKCOL(0) = 1 if the user defined material
39 C -- colors should be used in mesh plots.
40 C -- = -1 if program selected colors should
41 C -- be used.
42 C -- BLKCOL(i) = the user selected color of element
43 C -- block i:
44 C -- -2 - no color selected by user.
45 C -- -1 - black
46 C -- 0 - white
47 C -- 1 - red
48 C -- 2 - green
49 C -- 3 - yellow
50 C -- 4 - blue
51 C -- 5 - cyan
52 C -- 6 - magenta
53 C -- XN, YN, ZN - IN - the nodal coordinates
54 C -- * - return statement if the cancel function is active
55 C --
56 C --Common Variables:
57 C -- Uses NELBLK of /DBNUMS/
58 C -- Uses IS3DIM, LLNSET of /D3NUMS/
59
60 PARAMETER (MSHNON=0, MSHBOR=1, MSHDIV=2, MSHSEL=3, MSHALL=4)
61
62 include 'dbnums.blk'
63 include 'd3nums.blk'
64 include 'debug.blk'
65
66 LOGICAL WIDLIN
67 INTEGER MLNTYP(-1:1)
68 INTEGER IELBST(NELBLK)
69 INTEGER LENL(-2:NELBLK), LINSET(LLNSET,*)
70 INTEGER BLKCOL(0:NELBLK)
71 REAL XN(*), YN(*), ZN(*)
72 INTEGER IDELB(*)
73
74 LOGICAL GRABRT
75 LOGICAL SELONL
76 LOGICAL DRAWIT
77 LOGICAL LDUM
78 INTEGER IDUM(1)
79
80 C --Set mesh display parameters
81
82 IF (MSHLIN .GE. MSHSEL) THEN
83 NELB = NELBLK
84 ELSE IF (MSHLIN .GE. MSHDIV) THEN
85 NELB = 0
86 ELSE IF (MSHLIN .GE. MSHBOR) THEN
87 NELB = -1
88 ELSE
89 NELB = -2
90 END IF
91 SELONL = (MSHLIN .LE. MSHSEL)
92
93 C --Draw the boundary determined by the hidden line removal
94
95 IF (IS3DIM) THEN
96 DO 110 IELB = NELBLK, MIN (1, NELB+1), -1
97
98 C --If element block selected, line will be drawn later
99 IF ((NELB .GE. IELB) .AND. SELONL .AND. (IELB .GE. 1)) THEN
100 DRAWIT = (IELBST(IELB) .LE. 0)
101 ELSE
102 DRAWIT = .TRUE.
103 END IF
104
105 IF (DRAWIT) THEN
106
107 C --Get line color and set line size
108 CALL MSHCOL ('BOUNDARY', IELB, MLNTYP, .TRUE., BLKCOL,
109 & IDELB)
110
111 C --Draw all lines marked with LINSET(3,x) < 0
112
113 DO 100 IL = LENL(IELB-1)+1, LENL(IELB)
114 IF (LINSET(3,IL) .LT. 0) THEN
115 N1 = LINSET(1,IL)
116 IF (LINSET(3,IL) .EQ. -1) THEN
117 N2 = LINSET(2,IL)
118 ELSE
119 N2 = -LINSET(3,IL)
120 END IF
121 IF (GRABRT ()) GOTO 160
122 CALL MPD2VC (1, XN(N1), YN(N1), XN(N2), YN(N2))
123 END IF
124 100 CONTINUE
125
126 CALL PLTFLU
127 END IF
128 110 CONTINUE
129 END IF
130
131 C --Draw the selected lines
132
133 DO 130 IELB = NELB, -1, -1
134
135 IF (SELONL .AND. (IELB .GE. 1)) THEN
136 DRAWIT = (IELBST(IELB) .GT. 0)
137 ELSE
138 DRAWIT = .TRUE.
139 END IF
140
141 IF (DRAWIT) THEN
142
143 C --Get line color and set line size
144 CALL MSHCOL ('LINE', IELB, MLNTYP, WIDLIN, BLKCOL, IDELB)
145
146 C --Draw all lines of the appropriate type
147
148 DO 120 IL = LENL(IELB-1)+1, LENL(IELB)
149 IF (IS3DIM) THEN
150 C --Skip invisible lines
151 IF (LINSET(3,IL) .EQ. 0) GOTO 120
152 END IF
153 N1 = LINSET(1,IL)
154 N2 = LINSET(2,IL)
155 C write (*,*) 'line: ', n1, n2, linset(3,il)
156 IF (IS3DIM) THEN
157 C --Replace invisible node with partial line node
158 IF (ABS (LINSET(3,IL)) .GT. 1) N2 = ABS (LINSET(3,IL))
159 END IF
160
161 IF (GRABRT ()) GOTO 160
162 CALL MPD2VC (1, XN(N1), YN(N1), XN(N2), YN(N2))
163 120 CONTINUE
164
165 CALL PLTFLU
166 END IF
167 130 CONTINUE
168
169 if ((cdebug .eq. 'HIDDEN') .and. (idebug .ge. 1)
170 & .and. is3dim) then
171 do 150 ielb = nelblk, -1, -1
172 call mshcol ('DEBUG', ielb, mlntyp, widlin, blkcol,
173 & idelb)
174 do 140 il = lenl(ielb-1)+1, lenl(ielb)
175 if (linset(3,il) .lt. 0) then
176 n1 = linset(1,il)
177 if (linset(3,il) .eq. -1) then
178 n2 = linset(2,il)
179 else
180 n2 = -linset(3,il)
181 end if
182 if (grabrt ()) goto 160
183 call mpd2vc (1, xn(n1), yn(n1), xn(n2), yn(n2))
184 end if
185 140 continue
186 call pltflu
187 150 continue
188 end if
189
190 C --Reset line type and size
191 CALL MSHCOL ('RESET', -999, IDUM, LDUM, BLKCOL, IDELB)
192
193 RETURN
194
195 160 CONTINUE
196 C --Reset line type and size
197 CALL MSHCOL ('RESET', -999, IDUM, LDUM, BLKCOL, IDELB)
198 RETURN 1
199 END