Debian Codegraph @

packages/seacas/applications/blot/msmain.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 MSMAIN (A, NAMECO, NAMES,
9 & LENF, NLNKE, NLNKF, KLINKF, LENL, KLNSET,
10 & NEWELB, IELBST,
11 & KNPSUR,
12 & ISSNPS, IDNPS, ISSESS, IDESS,
13 & NENUM, LIDSP, BLKCOL, IDELB, NAMELB, MAPEL, MAPND)
14 C=======================================================================
15
16 C --*** MSMAIN *** (MESH) MESH main plot routine
17 C -- Modified by John Glick - 11/29/88
18 C -- Written by Amy Gilkey - revised 06/01/88
19 C -- D. P. Flanagan, 11/17/82
20 C -- Modified version 1.1a November 1990 - R.J. Meyers
21 C -- added color coded sphere capability
22 C --
23 C --MSMAIN first determines the new face array, if it has changed.
24 C --It then plots a single mesh plot. Nodes and elements may be selected.
25 C --
26 C --For 3D, elements are divided into faces and sorted as follows:
27 C -- -1) Surface face
28 C -- 0) Interior element block boundary
29 C -- n) Interior within element block 'n'
30 C --
31 C --Mesh lines are sorted as follows:
32 C -- -1) Mesh boundary
33 C -- 0) Element block boundary
34 C -- n) Interior within element block 'n'
35 C --
36 C --Dynamic memory arrays:
37 C -- IN2ELB - the element block for each node;
38 C -- <0 if not in any selected element block
39 C -- =0 if in more than one selected element block
40 C -- IDN2B - the element block for each dead node; dead if >= 0
41 C -- IF2EL - the element number of each face
42 C -- XN, YN, ZN - the nodal coordinates (ZN for 3D only)
43 C -- HZ, VT, PD - the undeformed nodal coordinates
44 C -- (rotated for 3D, PD for 3D only)
45 C -- XF, YF, ZF - the undeformed face center coordinates
46 C -- (rotated for 3D, ZF for 3D only)
47 C -- HIDENP(i) - true iff node i is hidden (3D only)
48 C -- HIDEF(i) - true iff face i is hidden (3D only)
49 C --
50 C --Parameters:
51 C -- A - IN - the dynamic memory base array
52 C -- NAMECO - IN - the coordinates names
53 C -- NAMES - IN - the variable names
54 C -- LENF - IN/OUT - the cumulative face counts by element block
55 C -- LENF(0) is always 0
56 C -- LENF(1..NELBLK) is the end of the surface faces of element block (i)
57 C -- LENF(NELBLK+1) is the end of the interior faces
58 C -- LENF(NELBLK+2) is the end of the faces that are dead
59 C -- LENF(NELBLK+3) is the end of the faces outside a cut
60 C -- LENF(NELBLK+4) is the end of the faces in a non-selected element
61 C -- block
62 C -- NLNKE - IN - the number of nodes per element
63 C -- NLNKF - IN - the number of nodes per face
64 C -- KLINKF - IN/OUT - the dynamic memory index of the connectivity
65 C -- for all faces
66 C -- LENL - IN/OUT - the cumulative line counts by element block
67 C -- KLNSET - IN/OUT - the dynamic memory index of the sorted line set
68 C -- NEWELB - IN/OUT - the new element blocks flag:
69 C -- 0 = no new element blocks
70 C -- 1 = new selected element blocks
71 C -- 2 = new displayed element blocks (implies new selected blocks)
72 C -- IELBST - IN - the element block status:
73 C -- -1 = OFF, 0 = ON, but not selected, 1 = selected
74 C -- KNPSUR - IN/OUT - the index of NPSURF -
75 C -- the node numbers of the surface nodes or mesh boundary nodes (2D)
76 C -- ISSNPS - IN - the indices of the selected node sets
77 C -- IDNPS - IN - the node set ID for each set
78 C -- ISSESS - IN - the indices of the selected side sets
79 C -- IDESS - IN - the side set ID for each set
80 C -- NENUM - IN - the selected node/element numbers
81 C -- LIDSP(0:*) - IN - the indices of the selected variables
82 C -- whose values will be displayed on the plot legend.
83 C -- LIDSP(0) = the number of variables in the list.
84 C -- LIDSP(i) identifies the ith variable in the list.
85 C -- If LIDSP(i) > 0, LIDSP(i) is the id of a history variable.
86 C -- If LIDSP(i) < 0, -LIDSP(i) is the id of a global variable.
87 C -- If LIDSP(i) = 0, TIME is to be displayed on the plot legend.
88 C -- BLKCOL - IN/OUT - the user selected colors of the element blocks.
89 C -- BLKCOL(0) = 1 if the user defined material
90 C -- colors should be used in mesh plots.
91 C -- = -1 if program selected colors should
92 C -- be used.
93 C -- BLKCOL(i) = the user selected color of element
94 C -- block i:
95 C -- -2 - no color selected by user.
96 C -- -1 - black
97 C -- 0 - white
98 C -- 1 - red
99 C -- 2 - green
100 C -- 3 - yellow
101 C -- 4 - blue
102 C -- 5 - cyan
103 C -- 6 - magenta
104 C --
105 C --Common Variables:
106 C -- Uses NDIM, NUMEL, NELBLK, NVARNP, NVAREL of /DBNUMS/
107 C -- Uses IS3DIM, NNPSUR, NUMNPF, LLNSET of /D3NUMS/
108 C -- Uses MSHDEF, MSHNUM, MSHLIN, MLNTYP, IHIDOP, NALVAR, DEADNP of /MSHOPT/
109 C -- Sets and uses ZMMESH of /MSHLIM/
110
111 PARAMETER (MSHNON=0, MSHBOR=1, MSHDIV=2, MSHSEL=3, MSHALL=4)
112
113 PARAMETER (KLFT=1, KRGT=2, KBOT=3, KTOP=4, KNEA=5, KFAR=6)
114
115 include 'params.blk'
116 include 'dbnums.blk'
117 include 'dbnumgq.blk'
118 include 'd3nums.blk'
119 include 'mshopt.blk'
120 include 'mshlim.blk'
121 include 'selne.blk'
122
123 DIMENSION A(*)
124 CHARACTER*(*) NAMECO(*)
125 CHARACTER*(*) NAMES(*)
126 INTEGER LENF(0:NELBLK+4)
127 INTEGER NLNKE(NELBLK), NLNKF(NELBLK)
128 INTEGER LENL(-2:NELBLK)
129 INTEGER NEWELB
130 INTEGER IELBST(NELBLK)
131 INTEGER ISSNPS(NUMNPS,4)
132 INTEGER ISSESS(NUMESS,4)
133 INTEGER IDNPS(*)
134 INTEGER IDESS(*)
135 INTEGER NENUM(*)
136 INTEGER LIDSP(0:*)
137 INTEGER BLKCOL(0:NELBLK)
138 INTEGER IDELB(*)
139 INTEGER NDEFVW, IXVW
140 CHARACTER*8 MSCTMP
141 LOGICAL NEWSET, NEWFAC, FIXFAC
142 LOGICAL ANYDEF, ANYUND
143 LOGICAL DOIXF, DON2B, DOELED, DOELEU, DODEAD, DONPS, DOESS, DOSCAL
144 REAL RDUM4(4)
145 INTEGER MAPEL(*), MAPND(*)
146
147 CHARACTER*(MXSTLN) CDUM
148 CHARACTER*(MXSTLN) NAMELB(*)
149
150 ************************************************************************
151 *** Prepare for new plot set ***
152 ************************************************************************
153
154 C --Initialize flags
155
156 CALL MSFLAG (ANYDEF, ANYUND,
157 & DOIXF, DON2B, DOELED, DOELEU, DODEAD, DONPS, DOESS, DOSCAL,
158 & MINMSH, MAXMSH, MAXHID)
159
160 IF (MSCTYP .EQ. 'SELECTED') DOSCAL = .TRUE.
161
162 NEWSET = .TRUE.
163
164 C --Reserve memory for plot set
165
166 CALL MSMEMY (A, ANYDEF, ANYUND,
167 & DOIXF, DON2B, DOELED, DOELEU, DODEAD, DONPS, DOESS,
168 & LENF(NELBLK), KN2ELB, KDN2B, KIF2EL,
169 & KXN, KYN, KZN, KHZ, KVT, KPD, KDHZ, KDVT, KDPD,
170 & KXF, KYF, KZF, KDXF, KDYF, KDZF, KHIDEN, KHIDEF, KIXFAC,
171 & KSNPS, KSESS)
172 CALL MDSTAT (NERR, MEM)
173 IF (NERR .GT. 0) GOTO 120
174
175 IF (MSCTYP .EQ. 'SELECTED') THEN
176 CALL MDRSRV ('NPSEL', KNPSEL, 0)
177 END IF
178
179 CALL MDSTAT (NERR, MEM)
180 IF (NERR .GT. 0) GOTO 130
181
182 ************************************************************************
183 *** Plot sequence loop ***
184 ************************************************************************
185
186 C --Set the number of non-empty views for single time plot
187 NVWPLT = NDEFVW (.FALSE.)
188
189 ISTEP = 0
190
191 C --Wipe out the mesh plot pick
192 CALL INPICK ('NONE')
193
194 C --Set up the faces for the new plot set
195
196 CALL MSGEOM (A, 'MESH', ISTEP,
197 & LENF, NLNKF, KLINKF, KXN, KYN, KZN,
198 & KIF2EL, NEWELB, IELBST, NEWFAC, FIXFAC)
199 IF (LENF(NELBLK) .LE. 0) GOTO 120
200 CALL MDSTAT (NERR, MEM)
201 IF (NERR .GT. 0) GOTO 120
202
203 CALL MSSTEP (A, ISTEP, NEWSET, NEWFAC, ANYDEF, ANYUND,
204 & DOIXF, DON2B, DOELED, DOELEU, DODEAD, DONPS, DOESS,
205 & LENF, NLNKF, A(KLINKF), LENL, KLNSET,
206 & KHIDEN, KHIDEF, KIXFAC,
207 & KXN, KYN, KZN, KHZ, KVT, KPD, KDHZ, KDVT, KDPD,
208 & KXF, KYF, KZF, KDXF, KDYF, KDZF,
209 & NEWELB, IELBST, KN2ELB, KDN2B, A(KIF2EL), KNPSUR)
210 CALL MDSTAT (NERR, MEM)
211 IF (NERR .GT. 0) GOTO 120
212
213 C --Compute the selected nodes, if needed
214
215 MSCTMP = MSCTYP
216 IF (MSCTYP .EQ. 'SELECTED') THEN
217 CALL MDLONG ('NPSEL', KNPSEL, NUMNPF)
218 CALL MDFIND ('IX2NP', KIX2NP, IDUM)
219 CALL MDSTAT (NERR, MEM)
220 IF (NERR .GT. 0) GOTO 120
221
222 CALL FNDSEL (NODVAR, NNENUM, NENUM,
223 & LENF, NLNKF, A(KLINKF), A(KIF2EL), A(KIX2NP),
224 & A(KNPSUR), NSEL, A(KNPSEL))
225
226 CALL MDLONG ('NPSEL', KNPSEL, NSEL)
227
228 IF (NSEL .LE. 0) THEN
229 CALL PRTERR ('WARNING', 'No surface nodes are selected')
230 MSCTMP = 'EACH'
231 END IF
232 END IF
233
234 C --Calculate the axis limits and set up graphics, if limits changed
235
236 IF (MSCTMP .EQ. 'SELECTED') THEN
237 CALL MSSCAL (DOSCAL, NSEL, A(KNPSEL),
238 & A(KHZ), A(KVT), A(KPD))
239
240 ELSE
241 IF (DOSCAL) THEN
242
243 C --Compute NPSURF nodes that determine the mesh limits
244
245 IF ((.NOT. IS3DIM) .AND. (NNPSUR .LT. 0)) THEN
246 CALL MDLONG ('NPSURF', KNPSUR, 0)
247 CALL MDLONG ('NPSURF', KNPSUR, NUMNPF)
248 CALL MDSTAT (NERR, MEM)
249 IF (NERR .GT. 0) GOTO 120
250
251 CALL MAKSU2 (LENL, A(KLNSET), MSHBOR,
252 & DODEAD, A(KDN2B), A(KNPSUR))
253
254 CALL MDLONG ('NPSURF', KNPSUR, NNPSUR)
255 END IF
256 END IF
257
258 CALL MSSCAL (DOSCAL, NNPSUR, A(KNPSUR),
259 & A(KHZ), A(KVT), A(KPD))
260 END IF
261
262 C --Set the number of selected nodes/elements
263 IF (MSCTYP .EQ. 'SELECTED') THEN
264 NNUM = NNENUM
265 ELSE
266 NNUM = 0
267 END IF
268
269 C --Label plot frame
270
271 100 CONTINUE
272 CALL MSLAB (A, NEWSET, 0, IDUM, RDUM,
273 & NAMECO, NAMES, IELBST,
274 & ISSNPS, IDNPS, ISSESS, IDESS, A(KSNPS), A(KSESS),
275 & RDUM4, LIDSP, BLKCOL, *120)
276 CALL OUTLIN (BLKCOL, *120)
277
278 DO 110 IVW = 1, NVWPLT
279 IVIEW = IXVW (.FALSE., IVW)
280
281 KTXN = KHZ
282 KTYN = KVT
283 KTZN = KPD
284 KTXF = KXF
285 KTYF = KYF
286 KTZF = KZF
287
288 C --Identify the hidden faces and nodes on the surface
289
290 IF (IS3DIM .AND. (NEWSET .OR. NEWFAC)) THEN
291 C --NOTE: coordinates may be mangled by HIDDEN
292 CALL HIDDEN (A, MAXHID, LENF, NLNKE, NLNKF, A(KLINKF),
293 & A(KTXN), A(KTYN), A(KTZN),
294 & LENL, A(KLNSET), MSCTYP, ZMMESH,
295 & MINMSH, MAXMSH, IELBST,
296 & DODEAD, A(KDN2B), A(KHIDEF), A(KHIDEN),
297 & A(KTZF), DOIXF, NXFAC, A(KIXFAC), NAMELB)
298
299 CALL MDSTAT (NERR, MEM)
300 IF (NERR .GT. 0) GOTO 120
301 END IF
302
303 C --Set up to plot view
304
305 CALL SETVW (IVIEW, *120)
306
307 C --Plot undeformed mesh
308
309 C --Set up the mesh plot pick
310 CALL INPICK ('UNDEFORM')
311
312 CDUM = ' '
313 CALL MSPLT1 (A, .FALSE.,
314 & MSHNUM(IVIEW), MSHLIN(IVIEW), MLNTYP(-1,IVIEW),
315 & LENF, NLNKF, A(KLINKF), LENL, A(KLNSET),
316 & A(KHIDEN), A(KHIDEF),
317 & A(KTXN), A(KTYN), A(KTZN), A(KTXF), A(KTYF), A(KTZF),
318 & IELBST, A(KN2ELB), DODEAD, A(KDN2B),
319 & NODVAR, NNUM, NENUM,
320 & NNPSET(IVIEW), ISSNPS(1,IVIEW),
321 & NESSET(IVIEW), ISSESS(1,IVIEW), BLKCOL,
322 & IDELB, VARNP, CDUM, IHIDOP, MAPEL, MAPND, *120)
323
324 NEWSET = .FALSE.
325 NEWFAC = .FALSE.
326 FIXFAC = .FALSE.
327 DOSCAL = .FALSE.
328 110 CONTINUE
329
330 C --Check if user wants to quit or get hardcopy of single-time plot
331
332 C --Set color in case text is requested
333 CALL UGRCOL (0, BLKCOL)
334 N = 1
335 CALL GRPEND (.TRUE., .TRUE., N, N, .FALSE., *100, *120)
336
337 120 CONTINUE
338
339 C --Release the memory reserved for plot set
340
341 CALL MSDONE (ANYDEF, ANYUND,
342 & DOIXF, DON2B, DOELED, DOELEU, DODEAD, DONPS, DOESS)
343
344 IF (MSCTYP .EQ. 'SELECTED') THEN
345 CALL MDDEL ('NPSEL')
346 END IF
347
348 130 CONTINUE
349 RETURN
350 END