Debian Codegraph @

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