Debian Codegraph @

packages/seacas/applications/blot/mscomd.f

raw
1 C Copyright(C) 1999-2020, 2022 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 MSCOMD (A, CURPRO, MSHTYP, INLINE, INVERB, IFLD,
9 & INTYP, CFIELD, IFIELD, RFIELD, NAMECO, NAMES,
10 & IDELB, NEWELB, IELBST, NEWMOD, IDNPS, ISSNPS,
11 & IDESS, ISSESS, BLKCOL, SHDCOL, ISHDCL)
12 C=======================================================================
13
14 C --*** MSCOMD *** (MESH) Process mesh commands
15 C -- Modified by John Glick - 1/13/89
16 C -- Written by Amy Gilkey - revised 05/31/88
17 C -- Dennis Flanagan, 11/18/82
18 C --
19 C --MSCOMD interprets mesh commands.
20 C --
21 C --The commands are listed below with their parameters and their
22 C --function.
23 C --
24 C --Display mode control
25 C -- EMPTY Set empty window
26 C -- DEFORM {ON/OFF} Set deformed versus undeformed mesh
27 C -- NUMBER {NODES/ELEMENTS/ALL} Set to number nodes or elements
28 C -- MLINES {ON/OFF} Set on/off mesh overlay option
29 C -- BOUNDARY {ON/OFF} Set on/off mesh and element block boundary
30 C -- option
31 C -- NSETS {id1,...} Select node sets
32 C -- SSETS {id1,...} Select side sets
33 C --
34 C --Active element control
35 C -- VISIBLE {element blocks} Set ON (displayed) element blocks (3D)
36 C -- BLOCKS {element blocks} Set selected element blocks
37 C -- DEATH {ON,variable} Enable element birth/death
38 C -- DEATH {OFF} Disable element birth/death
39 C --
40 C --Element block color control
41 C -- BLKCOL string1 string2 ... stringi
42 C -- where
43 C -- stringi = block_id1 block_id2 ... block_idj block_coli
44 C -- Sets the color of the element blocks
45 C -- specified. block_idi is the integer
46 C -- identifier of a block. block_coli
47 C -- identifies the color to be given
48 C -- to the element blocks specified in
49 C -- stingi. The color must be identified
50 C -- by its name, although it may be
51 C -- abbreviated to uniqueness within the
52 C -- list of colors. The available colors
53 C -- are black, white, red, green, yellow,
54 C -- blue, cyan, and magenta.
55 C -- MATCOL string1 string2 ... stringi
56 C -- Performs the same function as the
57 C -- BLKCOL command.
58 C --
59 C --Multiple views control
60 C -- VIEW {IVIEW,command} Set view-dependent parameter mode for view
61 C -- XSYM {LEFT/RIGHT,xaxsym} Define vertical symmetry axis
62 C -- XSYM {OFF} Delete vertically divided views
63 C -- XVIEW Define vertical non-symmetric views
64 C -- XVIEW {OFF} Same as XSYM OFF
65 C -- YSYM {BOTTOM/TOP,yaxsym} Define horizontal symmetry axis
66 C -- YSYM {OFF} Delete horizontally divided views
67 C -- YVIEW Define horizontal non-symmetric views
68 C -- YVIEW {OFF} Same as YSYM OFF
69 C -- MULTTIME {ON/OFF} Define multiple time views
70 C --
71 C --Mesh control
72 C -- MAGNIFY {dfac} Set displacement magnification factor
73 C -- HIDDEN {0/1/2/3} Set hidden line removal option (3D)
74 C -- ZOOM {left,right,bottom,top} Set output window min/max
75 C -- ZOOM {EACH/SET} Set window scaling
76 C -- SQUARE {ON/OFF} Set square/non-square window scaling
77 C -- TICK {ticmsh} Set mesh axis tick interval
78 C -- ROTATE {X/Y/Z/RESET,value} Rotate the mesh (cumulative) (3D)
79 C -- EYE {x,y,z} Rotate the mesh to given position (3D)
80 C -- CENTER {x,y,z} Change the center of rotation (3D)
81 C -- CENTER {RESET} Reset the center of rotation (3D)
82 C -- CUT {x1,y1,x2,y2,x3,y3} Specify a cutting plane (3D)
83 C -- CUT {OFF} Delete the cutting plane (3D)
84 C -- LINETHICKNESS Specify thickness for for mesh lines.
85 C -- SPHERE or FSPHERE {ON/OFF}
86 C -- Display elements as spheres, taking
87 C -- their radius from the first
88 C -- element attribute.
89 C --
90 C --Display control
91 C -- DEADNODE {ON/OFF} Enable/Disable dead node display
92 C -- color Set number of colors
93 C -- spectrum Set number of spectrum colors
94 C --
95 C --Display
96 C -- reset Reset default conditions
97 C -- postmesh Initialize after a mesh plot
98 C -- postplot Initialize after plot
99 C -- initprog Initialize for program change
100 C -- initres Initialize for program change and reset
101 C -- PLOT Exit to plot the plot set
102 C -- HARDCOPY Exit to plot the plot set on hardcopy device
103 C -- mesh Exit to plot the mesh
104 C --
105 C --Information
106 C -- show {option} Display program information (based on type)
107 C -- help {option} Display system dependent HELP
108 C --
109 C --Parameters:
110 C -- A - IN - the dynamic memory base array
111 C -- CURPRO - IN - the current program name
112 C -- MSHTYP - IN - true iff the current program is a mesh program
113 C -- INLINE - I/O - the parsed input lines for the log file
114 C -- INVERB - I/O - the command verb
115 C -- IFLD, - I/O - the free-field reader index and fields
116 C -- INTYP, - I/O - the free-field reader index and fields
117 C -- CFIELD,- I/O - the free-field reader index and fields
118 C -- IFIELD,- I/O - the free-field reader index and fields
119 C -- RFIELD - I/O - the free-field reader index and fields
120 C -- NAMECO - IN - the coordinate names
121 C -- NAMES - IN - the variable names
122 C -- IDELB - IN - the element block ID array
123 C -- NEWELB - I/O - the new element blocks flag:
124 C -- 0 = no new element blocks (set elsewhere)
125 C -- 1 = new selected element blocks
126 C -- 2 = new displayed element blocks
127 C -- (implies new selected blocks)
128 C -- IELBST - I/O - the element block status:
129 C -- -1 = OFF, 0 = ON, but not selected, 1 = selected
130 C -- NEWMOD - OUT - the mode status of each view:
131 C -- -1 = unchanged
132 C -- 0 = changed to default
133 C -- n = changed to be like view n
134 C -- IDNPS - IN - the node set ID for each set
135 C -- ISSNPS - I/O - the indices of the selected node sets
136 C -- IDESS - IN - the side set ID for each set
137 C -- ISSESS - I/O - the indices of the selected side sets
138 C -- BLKCOL - I/O - the user selected colors of the element blocks.
139 C -- BLKCOL(0) = 1 if the user defined material
140 C -- colors should be used in mesh plots.
141 C -- = -1 if program selected colors should
142 C -- be used.
143 C -- BLKCOL(i) = the user selected color of element
144 C -- block i:
145 C -- -2 - no color selected by user.
146 C -- -1 - black
147 C -- 0 - white
148 C -- 1 - red
149 C -- 2 - green
150 C -- 3 - yellow
151 C -- 4 - blue
152 C -- 5 - cyan
153 C -- 6 - magenta
154 C --
155 C --Common Variables:
156 C -- Uses NELBLK, NVARNP, NVAREL of /DBNUMS/
157 C -- Uses IS3DIM of /D3NUMS/
158 C -- Sets DEFPRO, DFAC, DDFAC of /DEFORM/
159 C -- Uses DEFOK, DEFFAC of /DEFORM/
160 C -- Sets and uses MSHDEF, MSHNUM, MSHLIN, MLNTYP, IHIDOP, NALVAR, DEADNP
161 C -- of /MSHOPT/
162 C -- Sets and uses MULTIM, XISSYM, YISSYM, XAXSYM, YAXSYM, LFTSYM, BOTSYM
163 C -- of /VIEWS/
164 C -- Uses ALMESH of /MSHLIM/
165 C -- Sets ZMMESH, RDMESH, TICMSH, MSCTYP, SQMESH of /MSHLIM/
166 C -- Sets and uses NEWROT, ROTMAT, ROTCEN, EYE of /ROTOPT/
167 C -- Sets NEWCUT, ISCUT, CUTPT, CUTNRM of /CUTOPT/
168
169 PARAMETER (MSHNON=0, MSHBOR=1, MSHDIV=2, MSHSEL=3, MSHALL=4)
170
171 PARAMETER (KLFT=1, KRGT=2, KBOT=3, KTOP=4, KNEA=5, KFAR=6)
172
173 include 'params.blk'
174 include 'dbnums.blk'
175 include 'dbnumgq.blk'
176 include 'd3nums.blk'
177 include 'deform.blk'
178 include 'mshopt.blk'
179 include 'views.blk'
180 include 'mshlim.blk'
181 include 'rotopt.blk'
182 include 'cutopt.blk'
183 include 'selne.blk'
184 include 'sphele.blk'
185 include 'light.blk'
186 include 'debug.blk'
187
188 DIMENSION A(*)
189 CHARACTER*(*) CURPRO
190 LOGICAL MSHTYP
191 CHARACTER*(*) INLINE(*)
192 CHARACTER*(*) INVERB
193 INTEGER INTYP(*)
194 CHARACTER*(*) CFIELD(*)
195 INTEGER IFIELD(*)
196 REAL RFIELD(*)
197 CHARACTER*(*) NAMECO(*)
198 CHARACTER*(*) NAMES(*)
199 INTEGER IDELB(NELBLK)
200 INTEGER NEWELB
201 INTEGER IELBST(NELBLK)
202 INTEGER NEWMOD(4)
203 INTEGER IDNPS(*)
204 INTEGER ISSNPS(NUMNPS,4)
205 INTEGER ISSESS(NUMESS,4)
206 INTEGER IDESS(*)
207 INTEGER BLKCOL(0:NELBLK)
208 REAL SHDCOL(7,NELBLK)
209 INTEGER ISHDCL(3,NELBLK)
210
211 LOGICAL FFMATC, FFEXST, MATSTR
212 INTEGER NDEFVW, IXVW
213 CHARACTER*(MXNAME) WORD
214 CHARACTER CDUM
215 LOGICAL LDUM1, LDUM2
216 LOGICAL HELP
217 LOGICAL VWCMD
218 LOGICAL ISON
219 INTEGER LTYP(-1:1)
220 LOGICAL MESHOK
221
222 CHARACTER*(MXNAME) VERB, VERB2
223 CHARACTER*(MXNAME) SAVERB
224 C --VERB - the command verb used in the SHOW
225 C --VERB2 - the secondary SHOW command verb
226
227 LOGICAL FIRST
228 SAVE FIRST
229 C --FIRST - true iff first time through routine
230
231 CHARACTER*(MXSTLN) OLDPRO
232 SAVE OLDPRO
233 C --OLDPRO - the name of the program that set the defaults for
234 C -- the current parameters
235 CHARACTER*8 MSCSV
236 SAVE MSCSV
237 C --MSCSV - the old MSCTYP if set to 'SELECTED'
238
239 LOGICAL NEWZM, SETTIC
240 SAVE NEWZM, SETTIC
241 C --NEWZM - true iff a new zoom window has been specified
242 C --SETTIC - true iff the axis tick interval has been specified by the user
243 REAL DFRMAT(3,3), DFRCEN(3)
244 SAVE DFRMAT, DFRCEN
245 C --DFRMAT - the default rotation matrix, saved on first entry
246 C --DFRCEN - the default rotation center, saved on first entry
247
248 CHARACTER*(MXSTLN) CMDTBL(41)
249 INTEGER IVWTBL, NVWTBL
250 SAVE CMDTBL, IVWTBL, NVWTBL
251 C --CMDTBL - the command table
252 C --IVWTBL - the VIEW command table starting index
253 C --NVWTBL - the number of entries in the VIEW command table
254
255 DATA FIRST / .TRUE. /
256
257 DATA IVWTBL, NVWTBL / 1, 0 /
258
259 C --Command table follows. The "VIEW" entry starts the VIEW
260 C --command table, and all VIEW commands (and only these commands)
261 C --must follow this entry. The table is ended by a blank entry.
262 C --Remember to change the dimensioned size when changing the table.
263 C --Lowercase entries are for obsolete commands; they are converted to
264 C --uppercase before use.
265 DATA (CMDTBL(I),I=1,10) /
266 1 'VISIBLE ',
267 * 'BLOCKS ',
268 * 'MATERIAL ',
269 * 'DEATH ',
270 2 'XSYM ',
271 * 'YSYM ',
272 * 'XVIEW ',
273 * 'YVIEW ',
274 * 'MULTTIME ',
275 3 'MAGNIFY '/
276 DATA (CMDTBL(I),I=11,20) /
277 * 'HIDDEN ',
278 4 'ZOOM ',
279 * 'scale ',
280 * 'SQUARE ',
281 * 'TICK ',
282 5 'ROTATE ',
283 * 'EYE ',
284 * 'CENTER ',
285 * 'CUT ',
286 * 'LIGHTS '/
287 DATA (CMDTBL(I),I=21,30) /
288 6 'DEADNODE ',
289 * 'SHDCOLOR ',
290 * 'AMBIENT ',
291 7 'PLOT ',
292 * 'HARDCOPY ',
293 * 'BLKCOLOR ',
294 * 'MATCOLOR ',
295 * 'LINETHICKNESS ',
296 8 'SPHERE ',
297 * 'FSPHERE '/
298 DATA (CMDTBL(I),I=31,41) /
299 * 'VIEW ',
300 * 'EMPTY ',
301 * 'DEFORM ',
302 9 'undeform ',
303 * 'NUMBER ',
304 * 'MLINES ',
305 * 'overlay ',
306 * 'BOUNDARY ',
307 1 'NSETS ',
308 * 'SSETS ',
309 * ' ' /
310
311 C --Find the command verb, which may be a variable name
312
313 WORD = INVERB
314 CALL ABRSTR (VERB, WORD, CMDTBL)
315 IF (VERB .NE. ' ') THEN
316 VWCMD = (LOCSTR (VERB, NVWTBL, CMDTBL(IVWTBL)) .GT. 0)
317 ELSE
318 VERB = WORD
319 VWCMD = .FALSE.
320 END IF
321
322 VERB2 = ' '
323
324 C --Reset NEWMOD
325
326 CALL INIINT (4, -999, NEWMOD)
327
328 C *** Initialization ***
329
330 IF ((VERB .EQ. 'postmesh')
331 & .OR. (VERB .EQ. 'postplot') .OR. (VERB .EQ. 'initprog')
332 & .OR. (VERB .EQ. 'initres') .OR. (VERB .EQ. 'reset')) THEN
333 INVERB = VERB
334
335 C --Initialize parameters first time through, then reset
336
337 IF (FIRST) THEN
338
339 C --Change the command table to upper case
340
341 L = LOCSTR (' ', 999, CMDTBL) - 1
342 DO 100 I = 1, L
343 CALL EXUPCS (CMDTBL(I))
344 100 CONTINUE
345
346 C --Find the starting entry in the VIEW table
347
348 IVWTBL = LOCSTR ('VIEW', 999, CMDTBL)
349 NVWTBL = LOCSTR (' ', 999, CMDTBL(IVWTBL)) - 1
350
351 DDFAC = DEFFAC
352 IF (DDFAC .LT. 0.0) DDFAC = 0.0
353
354 C --Set up the default rotation matrix and rotation center
355
356 IF (IS3DIM) THEN
357 CALL INIREA (3*3, 0.0, DFRMAT)
358 DO 110 I = 1, 3
359 DFRMAT(I,I) = 1.0
360 110 CONTINUE
361
362 DFRCEN(1) = 0.5 * (UNMESH(KRGT)-UNMESH(KLFT))
363 DFRCEN(2) = 0.5 * (UNMESH(KTOP)-UNMESH(KBOT))
364 DFRCEN(3) = 0.5 * (UNMESH(KFAR)-UNMESH(KNEA))
365 END IF
366
367 C --Set values that do not change when reset
368
369 LFTSYM = .TRUE.
370 XAXSYM = UNMESH(KLFT)
371 BOTSYM = .TRUE.
372 YAXSYM = UNMESH(KBOT)
373
374 C --Initialize MSCTYP (so SCALAX can be called)
375
376 IF (.NOT. IS3DIM) THEN
377 MSCTYP = 'MESH'
378 ELSE
379 MSCTYP = 'EACH'
380 END IF
381
382 VERB = 'initres'
383
384 C --Initialize color map
385 CALL STCLST('DETOUR')
386 END IF
387
388 C --Initialize for program change
389
390 IF (VERB .EQ. 'initprog') THEN
391
392 C --Mesh is undeformed (may be changed)
393
394 DEFPRO = .FALSE.
395 DFAC = 0.0
396 CALL SCALAX
397
398 IF ((.NOT. MSHTYP) .OR. (OLDPRO .NE. CURPRO)) THEN
399
400 C --Set mode for all views
401
402 CALL INIINT (3, 1, LTYP)
403 CALL SETMSH (2, 'UNDEFORM', 'NONE', MSHSEL, LTYP,
404 & 0, IDUM, 0, IDUM, 'WIREFRAM', ' ', ISSNPS, ISSESS)
405
406 C --Set axis scale type and set axis scale
407
408 IF (MSCTYP .EQ. 'SELECTED') THEN
409 SETTIC = .FALSE.
410 TICMSH = 0.0
411 NEWZM = .TRUE.
412 IF (.NOT. IS3DIM) THEN
413 MSCTYP = 'MESH'
414 ELSE
415 MSCTYP = 'EACH'
416 END IF
417
418 CALL SCALAX
419 END IF
420 END IF
421
422 OLDPRO = CURPRO
423 END IF
424
425 C --Reset parameters
426
427 IF ((VERB .EQ. 'reset') .OR. (VERB .EQ. 'initres')) THEN
428
429 C --Set active element control to all element blocks, no birth/death
430
431 IF (FIRST) NEWELB = 0
432 NEWELB = MAX (NEWELB, 1)
433 DO 120 IELB = 1, NELBLK
434 IF ((.NOT. FIRST) .AND. (IELBST(IELB) .LT. 0)) NEWELB = 2
435 IELBST(IELB) = 1
436 120 CONTINUE
437
438 NALVAR = 0
439
440 C --Mesh is undeformed (may be changed)
441
442 DEFPRO = .FALSE.
443 DFAC = 0.0
444 CALL SCALAX
445
446 C --Set rotation matrix and center and cutting plane
447
448 IF (IS3DIM) THEN
449 NEWROT = .TRUE.
450 CALL CPYREA (3*3, DFRMAT, ROTMAT)
451 CALL CPYREA (3, DFRCEN, ROTCEN)
452 Z = UNMESH(KFAR) - UNMESH(KNEA)
453 CALL UNROT (1, 1, ROTMAT, ROTCEN,
454 & 0.0, 0.0, Z, EYE(1), EYE(2), EYE(3))
455
456 ISCUT = .FALSE.
457 CALL INIREA (3, 0.0, CUTPT)
458 CALL INIREA (3, 0.0, CUTNRM)
459 END IF
460
461 C --Set wireframe mode on 1 view
462
463 MULTIM = .FALSE.
464 XISSYM = .FALSE.
465 YISSYM = .FALSE.
466
467 IF (.NOT. IS3DIM) THEN
468 IHIDOP = 0
469 ELSE
470 if (nshl .gt. 100000) then
471 ihidop = 2
472 CALL PRTERR ('CMDREQ',
473 & 'Setting "hidden 2" for faster shell plotting')
474 CALL PRTERR ('CMDREQ',
475 & 'Reset via "hidden 3" when zoomed')
476 else
477 IHIDOP = 3
478 end if
479 END IF
480 CALL SETMSH (0, 'NONE', CDUM, IDUM, LTYP,
481 & IDUM, IDUM, IDUM, IDUM, 'NONE', CDUM, ISSNPS, ISSESS)
482 CALL INIINT (3, 1, LTYP)
483 CALL SETMSH (2, 'UNDEFORM', 'NONE', MSHSEL, LTYP,
484 & 0, IDUM, 0, IDUM, 'WIREFRAM', ' ', ISSNPS, ISSESS)
485 C ... NOTE: Since the `init` argument is `.true.`, all other fields are ignored except ishdcl
486 CALL SCOLOR (.TRUE., INLINE, IFLD, INTYP,
487 & RFIELD, IFIELD, CFIELD, SHDCOL, ISHDCL, IDELB)
488
489 C --Set display options
490
491 DEADNP = .FALSE.
492
493 C --Set axis scale type and set axis scale
494
495 TICMSH = 0.0
496 SETTIC = .FALSE.
497 NEWZM = .TRUE.
498 SQMESH = .TRUE.
499 IF (.NOT. IS3DIM) THEN
500 MSCTYP = 'MESH'
501 ELSE
502 MSCTYP = 'EACH'
503 END IF
504
505 CALL SCALAX
506
507 OLDPRO = CURPRO
508
509 FIRST = .FALSE.
510
511 C reset line thicknesses
512 CALL LINTHK (INLINE, IFLD, INTYP, IFIELD, RFIELD,
513 & CFIELD, .TRUE.)
514
515 C reset whether to plot elements as spheres
516
517 SPHPLT = 0
518 END IF
519
520 C --Initialize after mesh plot
521
522 IF (VERB .EQ. 'postmesh') THEN
523
524 C --Reset mesh scaling factor if selected
525
526 IF (MSCTYP .EQ. 'SELECTED') MSCTYP = MSCSV
527 END IF
528
529 C --Initialize for new plot set
530
531 IF (((VERB .EQ. 'postplot') .AND. MSHTYP)
532 & .OR. (VERB .EQ. 'postmesh')) THEN
533 CALL QNPICK ('QUERY', ISON, LDUM2,
534 & A, IDUM, IDUM, IDUM, IDUM, IDUM)
535 IF (ISON) THEN
536 NEWZM = .FALSE.
537 SETTIC = .FALSE.
538 END IF
539 END IF
540
541 OLDPRO = CURPRO
542 VERB = ' '
543
544 C *** Display Mode control ***
545
546 ELSE IF (VWCMD) THEN
547 SAVERB = INVERB
548 INVERB = ' '
549 IF ((VERB .EQ. 'DEFORM') .or. (verb .eq. 'UNDEFORM')) THEN
550 IF (.NOT. DEFPRO) THEN
551 CALL PRTERR ('CMDERR',
552 & 'Command not allowed in this subprogram')
553 GOTO 140
554 END IF
555 END IF
556
557 C --Set up the view number
558 CALL CMDVWC (VERB, INLINE(1),
559 & IFLD, INTYP, CFIELD, IFIELD, RFIELD,
560 & IVIEW, JVIEW, *140)
561
562 WORD = VERB
563 CALL ABRSTR (VERB, WORD, CMDTBL(IVWTBL))
564 IF (VERB .EQ. ' ') THEN
565 INVERB = SAVERB
566 GOTO 140
567 END IF
568
569 CALL CMDMSH (VERB, INLINE(1),
570 & IFLD, INTYP, CFIELD, IFIELD, RFIELD,
571 & IVIEW, JVIEW, NEWMOD,
572 & IDNPS, ISSNPS, IDESS, ISSESS, *140)
573
574 INVERB = 'newmod'
575
576 C *** Active element control ***
577
578 ELSE IF ((VERB .EQ. 'VISIBLE')
579 & .OR. (VERB .EQ. 'BLOCKS') .OR. (VERB .EQ. 'MATERIAL')
580 & .OR. (VERB .EQ. 'DEATH')) THEN
581 INVERB = ' '
582
583 IF ((VERB .EQ. 'VISIBLE')
584 & .OR. (VERB .EQ. 'BLOCKS') .OR. (VERB .EQ. 'MATERIAL')) THEN
585 if ((verb .eq. 'BLOCKS') .or. (verb .eq. 'MATERIAL')) then
586 if (ffmatc (ifld, intyp, cfield, 'DISPLAY', 1)) then
587 call prterr ('CMDREQ',
588 & 'Please use the VISIBLE command')
589 verb = 'VISIBLE'
590 end if
591 end if
592
593 CALL CMDELB (VERB, INLINE(1), IFLD, INTYP, CFIELD,
594 & IFIELD, IDELB, IELBST, NEWELB, *140)
595
596 ELSE IF (VERB .EQ. 'DEATH') THEN
597 IF (.NOT. DEFPRO) THEN
598 CALL PRTERR ('CMDERR',
599 & 'Command not allowed in this subprogram')
600 GOTO 140
601 END IF
602 CALL DBVIX_BL ('E', 1, IEV)
603 CALL CMDDEA (VERB, INLINE(1), IFLD, INTYP, CFIELD,
604 & RFIELD, NAMES(IEV), NALVAR, ALIVAL, *140)
605
606 IF (NALVAR .GT. 0) VERB2 = 'DEADNODE'
607 END IF
608
609 INVERB = 'newele'
610
611 C *** Multiple views control ***
612
613 ELSE IF ((VERB .EQ. 'XSYM') .OR. (VERB .EQ. 'XVIEW')
614 & .OR. (VERB .EQ. 'YSYM') .OR. (VERB .EQ. 'YVIEW')) THEN
615 INVERB = ' '
616
617 CALL CMDMVW (VERB, INLINE(1),
618 & IFLD, INTYP, CFIELD, IFIELD, RFIELD,
619 & UNMESH, NEWMOD, ISSNPS, ISSESS, *140)
620 VERB2 = 'VIEW'
621
622 CALL SCALAX
623
624 INVERB = 'newmod'
625
626 ELSE IF (VERB .EQ. 'MULTTIME') THEN
627 CALL FFADDC (VERB, INLINE(1))
628 INVERB = ' '
629 IF (.NOT. DEFPRO) THEN
630 CALL PRTERR ('CMDERR',
631 & 'Command not allowed in this subprogram')
632 GOTO 140
633 END IF
634
635 CALL FFONOF (IFLD, INTYP, CFIELD, MULTIM, *140)
636 CALL FFADDO (MULTIM, INLINE(1))
637
638 C *** Mesh control ***
639
640 ELSE IF (VERB .EQ. 'MAGNIFY') THEN
641 CALL FFADDC (VERB, INLINE(1))
642 INVERB = ' '
643 IF (.NOT. DEFPRO) THEN
644 CALL PRTERR ('CMDERR',
645 & 'Command not allowed in this subprogram')
646 GOTO 140
647 END IF
648 IF (.NOT. DEFOK) GOTO 140
649 IF (DEFFAC .LT. 0.0) THEN
650 CALL PRTERR ('CMDERR',
651 & 'Magnification is not initialized - Call DETOUR')
652 GOTO 140
653 END IF
654
655 CALL FFREAL (IFLD, INTYP, RFIELD,
656 & 'magnification factor', DEFFAC, DFAC, *140)
657 CALL FFADDR (DFAC, INLINE(1))
658 IF (DFAC .NE. 0.0) DDFAC = DFAC
659
660 CALL SCALAX
661
662 ELSE IF (VERB .EQ. 'HIDDEN') THEN
663 CALL FFADDC (VERB, INLINE(1))
664 INVERB = ' '
665 IF (.NOT. IS3DIM) THEN
666 CALL PRTERR ('CMDERR', 'Command allowed in 3D only')
667 GOTO 140
668 END IF
669
670 CALL FFINTG (IFLD, INTYP, IFIELD,
671 & 'hidden line removal level', IHIDOP, IHID, *140)
672 IHIDOP = MAX (0, IHID)
673 CALL FFADDI (IHIDOP, INLINE(1))
674
675 ELSE IF ((VERB .EQ. 'ZOOM') .OR. (VERB .EQ. 'TICK')
676 & .or. (verb .eq. 'SCALE') .OR. (VERB .EQ. 'SQUARE')) THEN
677 INVERB = ' '
678
679 CALL MDFIND ('MAPND', KMAPND, LDUM)
680
681 CALL CMDZM (VERB, INLINE(1),
682 & IFLD, INTYP, CFIELD, IFIELD, RFIELD,
683 & NEWZM, SETTIC, A(KMAPND), A, *140)
684
685 CALL SCALAX
686
687 ELSE IF ((VERB .EQ. 'ROTATE') .OR. (VERB .EQ. 'EYE')
688 & .OR. (VERB .EQ. 'CENTER')) THEN
689 INVERB = ' '
690
691 CALL CMDROT (VERB, INLINE(1),
692 & IFLD, INTYP, CFIELD, IFIELD, RFIELD,
693 & DFRMAT, DFRCEN,
694 & NEWZM, A, *140)
695
696 CALL SCALAX
697
698 ELSE IF (VERB .EQ. 'LIGHTS') THEN
699 INVERB = ' '
700 CALL FFADDC (VERB, INLINE(1))
701 if (FFMATC (IFLD, INTYP, CFIELD, 'ADD', 3)) THEN
702 NLIT = NLIT + 1
703 if (NLIT .GT. MAXLIT) THEN
704 call prterr('WARNING',
705 * 'Too many lights defined, overwriting last defined light')
706 NLIT = MAXLIT
707 end if
708 CALL FFADDC ('ADD', INLINE(1))
709 else if (FFMATC (IFLD, INTYP, CFIELD, 'DELETE', 3)) THEN
710 CALL FFADDC ('DELETE', INLINE(1))
711 IF (FFEXST (IFLD, INTYP)) THEN
712 CALL FFINTG (IFLD, INTYP, IFIELD,
713 & 'light number', 0, LITN, *125)
714 IF (litn .gt. 0 .and. litn .le. nlit) then
715 do 122 i = litn+1, nlit
716 do 121 j = 1, 4
717 lite(j,i-1) = lite(j,i)
718 121 continue
719 122 continue
720 nlit = nlit - 1
721 ELSE
722 call prterr ('WARNING', 'Undefined Light')
723 END IF
724 ELSE
725 NLIT = 0
726 END IF
727 go to 125
728 else
729 nlit = 1
730 end if
731
732 CALL FFREAL (IFLD, INTYP, RFIELD,
733 * 'X Component', 1.0, LITE(1,NLIT), *140)
734 CALL FFADDR (LITE(1,NLIT), INLINE(1))
735 CALL FFREAL (IFLD, INTYP, RFIELD,
736 * 'Y Component', 1.0, LITE(2,NLIT), *140)
737 CALL FFADDR (LITE(2,NLIT), INLINE(1))
738 CALL FFREAL (IFLD, INTYP, RFIELD,
739 * 'Z Component', 1.0, LITE(3,NLIT), *140)
740 CALL FFADDR (LITE(3,NLIT), INLINE(1))
741 CALL FFREAL (IFLD, INTYP, RFIELD,
742 * 'Light Intensity', 1.0, LITE(4,NLIT), *140)
743 CALL FFADDR (LITE(4,NLIT), INLINE(1))
744 125 continue
745 C ... Normalize light vectors.
746 do 127 i = 1, nlit
747 vmag = sqrt(lite(1,i)**2 + lite(2,i)**2 + lite(3,i)**2)
748 lite(5,i) = lite(1,i) / vmag
749 lite(6,i) = lite(2,i) / vmag
750 lite(7,i) = lite(3,i) / vmag
751 lite(8,i) = lite(4,i)
752 127 continue
753
754 ELSE IF (VERB .EQ. 'AMBIENT') THEN
755 INVERB = ' '
756 CALL FFADDC (VERB, INLINE(1))
757 CALL FFREAL (IFLD, INTYP, RFIELD,
758 * 'Ambient Intensity', 0.2, AMBIENT, *140)
759 CALL FFADDR (AMBIENT, INLINE(1))
760
761 ELSE IF ((VERB .EQ. 'CUT') .OR. (VERB .EQ. 'CUT3')) THEN
762 INVERB = ' '
763
764 CALL CMDCUT (VERB, INLINE(1), IFLD, INTYP, CFIELD,
765 & RFIELD, A, *140)
766
767 ELSE IF ((VERB .EQ. 'WHAT') .OR. (VERB .EQ. 'WHAT3')
768 & .OR. (VERB .EQ. 'WHERE')) THEN
769 INVERB = ' '
770
771 CALL QNPICK ('ORIGINAL', LDUM1, LDUM2,
772 & A, KXN, KYN, KZN, IDUM, IDUM)
773 CALL QNPICK ('DISPLAYED', LDUM1, LDUM2,
774 & A, KXNN, KYNN, KZNN, KHIDEN, KNPSUR)
775 CALL MDFIND ('XE', KXE, KLEN)
776 CALL MDFIND ('YE', KYE, KLEN)
777 IF (IS3DIM) THEN
778 CALL MDFIND ('ZE', KZE, KLEN)
779 ELSE
780 KZE = 1
781 END IF
782 CALL MDFIND ('MAPEL', KMAPEL, LDUM)
783 CALL MDFIND ('MAPND', KMAPND, LDUM)
784
785 CALL CMDWHE (VERB, INLINE(1),
786 & IFLD, INTYP, CFIELD, IFIELD, RFIELD,
787 & A(KXN), A(KYN), A(KZN),
788 & A(KXNN), A(KYNN), A(KZNN), A(KHIDEN),
789 * A(KXE), A(KYE), A(KZE), A(KMAPEL), A(KMAPND), *140)
790
791 ELSE IF (VERB .EQ. 'LINETHICKNESS') THEN
792
793 CALL MSCHK (.FALSE., MESHOK)
794 IF (MESHOK) THEN
795 CALL FFADDC (VERB, INLINE(1))
796 CALL LINTHK (INLINE, IFLD, INTYP, IFIELD, RFIELD,
797 & CFIELD, .FALSE.)
798 IF (INLINE(1) .EQ. ' ') VERB = ' '
799 ELSE
800 WRITE (*, 10010)
801 VERB = ' '
802 ENDIF
803 INVERB = ' '
804
805 ELSE IF (VERB .EQ. 'SPHERE' .OR. VERB .EQ. 'FSPHERE') THEN
806 CALL FFADDC (VERB, INLINE(1))
807 ISPHER = 0
808 DEFRAD = 1.0
809 IF (FFEXST (IFLD, INTYP)) THEN
810 C Check that next field has characters in it.
811 IF (INTYP(IFLD) .GE. 0) THEN
812 C Check for 'ON' or 'OFF'
813 IF (CFIELD(IFLD) .EQ. 'ON') THEN
814 IF (VERB .EQ. 'SPHERE') THEN
815 SPHPLT = 1
816 ELSE
817 SPHPLT = -1
818 ENDIF
819 CALL FFADDC ('ON', INLINE(1))
820 ISPHER = 1
821 IFLD = IFLD + 1
822 ELSE IF (CFIELD(IFLD) .EQ. 'OFF') THEN
823 SPHPLT = 0
824 CALL FFADDC ('OFF', INLINE(1))
825 ISPHER = 1
826 IFLD = IFLD + 1
827 ELSE
828 WRITE (*, 10000)
829 10000 FORMAT (1X, 'EXPECTED "ON" OR "OFF" AS',
830 & ' PARAMETER TO SPHERE/FSPHERE COMMAND'/)
831 ENDIF
832 ELSE
833 WRITE (*, 10000)
834 ENDIF
835 ENDIF
836 IF (ISPHER .EQ. 0) THEN
837 IF (SPHPLT .EQ. 0) THEN
838 IF (VERB .EQ. 'SPHERE') THEN
839 SPHPLT = 1
840 ELSE
841 SPHPLT = -1
842 ENDIF
843 ELSE IF (SPHPLT .GE. 1) THEN
844 IF (VERB .EQ. 'SPHERE') THEN
845 SPHPLT = 0
846 ELSE
847 SPHPLT = -1
848 ENDIF
849 ELSE
850 IF (VERB .EQ. 'SPHERE') THEN
851 SPHPLT = 1
852 ELSE
853 SPHPLT = 0
854 ENDIF
855 ENDIF
856 ENDIF
857 C ... Optional "RADIUS default_radius" option
858 IF (FFEXST (IFLD, INTYP)) THEN
859 C Check that next field has characters in it.
860 IF (INTYP(IFLD) .GE. 0) THEN
861 IF (MATSTR (CFIELD(IFLD), 'RADIUS', 1)) THEN
862 IFLD = IFLD + 1
863 CALL FFADDC ('RADIUS', INLINE)
864 CALL FFREAL (IFLD, INTYP, RFIELD,
865 & 'default sphere radius multiplier', 1.0, DEFRAD, *140)
866 END IF
867 END IF
868 END IF
869 C ... Optional integer specifying number of sphere segments
870 CALL FFINTG (IFLD, INTYP, IFIELD,
871 & 'segments used to draw spheres', 12, ISMULT, *140)
872 ISMULT = MIN(ISMULT, NPTSPX)
873 SPHPLT = SPHPLT * ISMULT
874
875 INVERB = ' '
876
877 C *** Display control ***
878
879 ELSE IF (VERB .EQ. 'DEADNODE') THEN
880 CALL FFADDC (VERB, INLINE(1))
881 INVERB = ' '
882 IF (.NOT. DEFPRO) THEN
883 CALL PRTERR ('CMDERR',
884 & 'Command not allowed in this subprogram')
885 GOTO 140
886 END IF
887
888 CALL FFONOF (IFLD, INTYP, CFIELD, DEADNP, *140)
889 CALL FFADDO (DEADNP, INLINE(1))
890
891 VERB2 = 'DEATH'
892
893 ELSE IF ((VERB .EQ. 'PLOT') .OR. (VERB .EQ. 'HARDCOPY') .OR.
894 & (VERB .EQ. 'mesh')) THEN
895 IF (VERB .NE. 'mesh') CALL FFADDC (VERB, INLINE(1))
896 INVERB = ' '
897
898 IF (NDEFVW (.FALSE.) .LE. 0) THEN
899 CALL PRTERR ('CMDERR', 'No views are defined')
900 VERB = 'PLOT'
901 GOTO 140
902 END IF
903
904 C --Check if nodes/element selected for mesh plot
905
906 IF (VERB .EQ. 'mesh') THEN
907
908 C --Save mesh scaling type
909 MSCSV = MSCTYP
910
911 IF (SELOK) THEN
912
913 C --Set MSCTYP to 'SELECTED' if nodes/element selected for mesh plot
914 MSCTYP = 'SELECTED'
915
916 C --Set selected numbering if nodes/element selected for mesh plot
917 DO 130 IVW = 1, NDEFVW (.FALSE.)
918 IVIEW = IXVW (.FALSE., IVW)
919 IF (MSHNUM(IVIEW) .EQ. 'NONE')
920 & MSHNUM(IVIEW) = 'SELECTED'
921 130 CONTINUE
922 END IF
923 END IF
924
925 C --PLOT and HARDCOPY are to be passed as lower-case commands
926 CALL LOWSTR (INVERB, VERB)
927 VERB = ' '
928
929 ELSE IF (VERB .EQ. 'BLKCOLOR' .OR. VERB .EQ. 'MATCOLOR') THEN
930 CALL FFADDC (VERB, INLINE(1))
931 CALL MSCHK (.FALSE., MESHOK)
932 VERB = 'BLKCOLOR'
933 IF (MESHOK) THEN
934 CALL BCOLOR (.FALSE., INLINE, IFLD, INTYP,
935 & IFIELD, CFIELD, BLKCOL)
936 ELSE
937 WRITE (*, 10010)
938 10010 FORMAT (1X, 'Command not valid unless valid mesh is',
939 & ' defined')
940 VERB = ' '
941 ENDIF
942 INVERB = ' '
943
944 ELSE IF (VERB .EQ. 'SHDCOLOR') THEN
945 CALL FFADDC (VERB, INLINE(1))
946 CALL MSCHK (.FALSE., MESHOK)
947 VERB = 'SHDCOLOR'
948 IF (MESHOK) THEN
949 CALL SCOLOR (.FALSE., INLINE, IFLD, INTYP,
950 & RFIELD, IFIELD, CFIELD, SHDCOL, ISHDCL, IDELB)
951 ELSE
952 WRITE (*, 10010)
953 VERB = ' '
954 ENDIF
955 INVERB = ' '
956
957 C *** Information ***
958
959 ELSE IF (VERB .EQ. 'show') THEN
960
961 CALL FFCHAR (IFLD, INTYP, CFIELD, ' ', WORD)
962 CALL ABRSTR (VERB, WORD, CMDTBL)
963 IF (VERB .NE. ' ') THEN
964 IF (.NOT. MSHTYP) THEN
965 IF ((VERB .NE. 'PLOT') .AND. (VERB .NE. 'HARDCOPY')) THEN
966 CALL MSSHOW (VERB, NAMECO, NAMES, IDELB, IELBST,
967 & IDNPS, ISSNPS, IDESS, ISSESS, BLKCOL)
968 INVERB = ' '
969 END IF
970 ELSE
971 CALL MSSHOW (VERB, NAMECO, NAMES, IDELB, IELBST,
972 & IDNPS, ISSNPS, IDESS, ISSESS, BLKCOL)
973 IF ((VERB .NE. 'PLOT') .AND. (VERB .NE. 'HARDCOPY')
974 & .AND. (VERB .NE. 'VIEW')) THEN
975 INVERB = ' '
976 ELSE
977 CFIELD(IFLD-1) = VERB
978 END IF
979 END IF
980 END IF
981 VERB = ' '
982
983 ELSE IF (VERB .EQ. 'help') THEN
984
985 ISON = HELP ('BLOT', 'COMMANDS', CFIELD(IFLD))
986 IF (.NOT. ISON) THEN
987 CALL SHOCMD ('Mesh Commands', CMDTBL)
988 END IF
989 VERB = ' '
990
991 ELSE
992 VERB = ' '
993 END IF
994
995 GOTO 150
996
997 140 CONTINUE
998 INLINE(1) = ' '
999
1000 150 CONTINUE
1001
1002 IF (VERB .NE. ' ') THEN
1003 CALL MSSHOW (VERB, NAMECO, NAMES, IDELB, IELBST,
1004 & IDNPS, ISSNPS, IDESS, ISSESS, BLKCOL)
1005 ELSE
1006 VERB2 = ' '
1007 END IF
1008
1009 IF (VERB2 .NE. ' ') THEN
1010 CALL MSSHOW (VERB2, NAMECO, NAMES, IDELB, IELBST,
1011 & IDNPS, ISSNPS, IDESS, ISSESS, BLKCOL)
1012 END IF
1013
1014 RETURN
1015 END