| 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 CONTOR (VARNP, LENF, NLNKF, LINKF, HIDEF, |
| 9 |
& XN, YN, ZN, XF, YF, ZF, LENL, LINSET, |
| 10 |
& IN2ELB, ISVOK, FMIN, FMAX, *) |
| 11 |
C======================================================================= |
| 12 |
|
| 13 |
C --*** CONTOR *** (DETOUR) Plot line contours |
| 14 |
C -- Written by Amy Gilkey - revised 10/29/87 |
| 15 |
C -- D. P. Flanagan, 03/30/83 |
| 16 |
C -- |
| 17 |
C --CONTOR draws contour lines with alphabetic tags in a color |
| 18 |
C --sequence. The contour algorithm assumes that the elements do not |
| 19 |
C --contain internal nodes. The element interpolation field is |
| 20 |
C --approximated by logically drawing lines from each node to the element |
| 21 |
C --center and, thusly, dividing the element into triangles. Contour |
| 22 |
C --lines are then drawn by connecting the intersection points of the |
| 23 |
C --sub-element edges and the contour plane. The contour letter is |
| 24 |
C --displayed at points where the contour plane intersects a mesh boundary |
| 25 |
C --or element block boundary line. Also, every "LABINC" interior mesh line |
| 26 |
C --which intersects the contour plane is labelled with the contour letter. |
| 27 |
C -- |
| 28 |
C --The element block status indicates which element blocks are active |
| 29 |
C --for contours. No contours are drawn in inactive elements. Mesh lines |
| 30 |
C --are inactive if either of its nodes is not connected to an active |
| 31 |
C --element. Inactive mesh lines are not labeled with contour letters. |
| 32 |
C -- |
| 33 |
C --Parameters: |
| 34 |
C -- VARNP - IN - the contour function values |
| 35 |
C -- LENF - IN - the cumulative face counts by element block |
| 36 |
C -- NLNKF - IN - the number of nodes per face |
| 37 |
C -- LINKF - IN - the connectivity for all faces |
| 38 |
C -- HIDEF(i) - IN - true iff face i is hidden (3D only) |
| 39 |
C -- XN, YN, ZN - IN - the nodal coordinates |
| 40 |
C -- XF, YF, ZF - IN - the face center coordinates |
| 41 |
C -- LENL - IN - the cumulative line counts by element block |
| 42 |
C -- LINSET - IN - the sorted line set |
| 43 |
C -- IN2ELB - IN - the element block for each node; |
| 44 |
C -- <0 if not in any selected element block |
| 45 |
C -- =0 if in more than one selected element block |
| 46 |
C -- ISVOK - IN - ISVOK(i) is true iff the contour variable is defined |
| 47 |
C -- for element block i |
| 48 |
C -- FMIN, FMAX - IN - the minimum and maximum function values |
| 49 |
C -- * - return statement if the cancel function is active |
| 50 |
C -- |
| 51 |
C --Common Variables: |
| 52 |
C -- Uses NELBLK of /DBNUMS/ |
| 53 |
C -- Uses IS3DIM, LLNSET of /D3NUMS/ |
| 54 |
C -- Uses NCNTR, LABINC, MAXMIN, MAXMAX of /CNTR/ |
| 55 |
|
| 56 |
include 'dbnums.blk' |
| 57 |
include 'd3nums.blk' |
| 58 |
include 'cntr.blk' |
| 59 |
|
| 60 |
REAL VARNP(*) |
| 61 |
INTEGER LENF(0:NELBLK) |
| 62 |
INTEGER NLNKF(NELBLK) |
| 63 |
INTEGER LINKF(*) |
| 64 |
LOGICAL HIDEF(*) |
| 65 |
REAL XN(*), YN(*), ZN(*) |
| 66 |
REAL XF(*), YF(*), ZF(*) |
| 67 |
INTEGER LENL(-2:NELBLK), LINSET(LLNSET,*) |
| 68 |
INTEGER IN2ELB(*) |
| 69 |
LOGICAL ISVOK(NELBLK) |
| 70 |
|
| 71 |
LOGICAL GRABRT |
| 72 |
|
| 73 |
DO 150 NC = 1, NCNTR |
| 74 |
CNTR = CNTRI (NC) |
| 75 |
|
| 76 |
C --Skip this contour if the values are outside the contour value |
| 77 |
IF ((FMIN .LE. CNTR) .AND. (FMAX .GE. CNTR)) THEN |
| 78 |
|
| 79 |
CALL GRCOLR (NC) |
| 80 |
|
| 81 |
DO 130 IELB = 1, NELBLK |
| 82 |
IF (ISVOK(IELB) .AND. (NLNKF(IELB) .GT. 2)) THEN |
| 83 |
|
| 84 |
DO 100 IFAC = LENF(IELB-1)+1, LENF(IELB) |
| 85 |
IF (IS3DIM) THEN |
| 86 |
IF (HIDEF(IFAC)) GOTO 100 |
| 87 |
END IF |
| 88 |
|
| 89 |
IF (GRABRT ()) RETURN 1 |
| 90 |
IXL = IDBLNK (IELB, IFAC, LENF, NLNKF) |
| 91 |
CALL CONTF (CNTR, VARNP, NLNKF(IELB), LINKF(IXL), |
| 92 |
& XN, YN, ZN, XF(IFAC), YF(IFAC), ZF(IFAC)) |
| 93 |
100 CONTINUE |
| 94 |
|
| 95 |
C --Label interior lines |
| 96 |
|
| 97 |
IF (LABINC .GT. 0) THEN |
| 98 |
NHIT = 0 |
| 99 |
DO 110 IL = LENL(IELB-1)+1, LENL(IELB) |
| 100 |
CALL CONLAB (NC, CNTR, NHIT, LABINC, |
| 101 |
& LINSET(1,IL), VARNP, XN, YN, ZN, IN2ELB, |
| 102 |
& *160) |
| 103 |
110 CONTINUE |
| 104 |
END IF |
| 105 |
|
| 106 |
C --Label interior lines which are on the edge |
| 107 |
|
| 108 |
IF (IS3DIM .AND. (LABINC .GE. 0)) THEN |
| 109 |
NHIT = 0 |
| 110 |
DO 120 IL = LENL(IELB-1)+1, LENL(IELB) |
| 111 |
C --Label edge line only |
| 112 |
IF (LINSET(3,IL) .LT. 0) THEN |
| 113 |
CALL CONLAB (NC, CNTR, NHIT, 1, LINSET(1,IL), |
| 114 |
& VARNP, XN, YN, ZN, IN2ELB, *160) |
| 115 |
END IF |
| 116 |
120 CONTINUE |
| 117 |
END IF |
| 118 |
|
| 119 |
END IF |
| 120 |
130 CONTINUE |
| 121 |
|
| 122 |
C --Label mesh boundary and element block boundary lines |
| 123 |
|
| 124 |
IF (LABINC .GE. 0) THEN |
| 125 |
NHIT = 0 |
| 126 |
DO 140 IL = 1, LENL(0) |
| 127 |
CALL CONLAB (NC, CNTR, NHIT, 1, LINSET(1,IL), |
| 128 |
& VARNP, XN, YN, ZN, IN2ELB, *160) |
| 129 |
140 CONTINUE |
| 130 |
END IF |
| 131 |
|
| 132 |
CALL PLTFLU |
| 133 |
END IF |
| 134 |
150 CONTINUE |
| 135 |
|
| 136 |
RETURN |
| 137 |
|
| 138 |
160 CONTINUE |
| 139 |
RETURN 1 |
| 140 |
END |