Debian Codegraph @

packages/seacas/applications/blot/hidcor.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 HIDCOR (LINSET, IPSET, NPART, IEDSET, NEDGES,
9 & LENF, NLNKF, LINKF, XN, YN, ZN,
10 * MREF, LREF)
11 C=======================================================================
12
13 C --*** HIDCOR *** (MESH) Hide partial lines by face
14 C -- Written by Amy Gilkey - revised 10/22/87
15 C --
16 C --HIDCOR deletes partial lines that have a visible node as a corner
17 C --of a quarilateral and the hidden node is within the area defined
18 C --by the vectors from the corner to the two adjacent nodes. Such
19 C --a face totally hides the partial line.
20 C --
21 C --Parameters:
22 C -- LINSET - IN - the sorted line set
23 C -- IPSET - I/O - the indices of the partial line set
24 C -- NPART - I/O - the number of lines in the partial line set
25 C -- IEDSET - I/O - the edge line set;
26 C -- (0) = face defining edge; 0 to delete edge
27 C -- NEDGES - I/O - the number of lines in the edge set
28 C -- LENF - IN - the cumulative face counts by element block
29 C -- NLNKF - IN - the number of nodes per face
30 C -- LINKF - IN - the connectivity for all faces
31 C -- XN,YN,ZN - IN - the nodal coordinates
32 C --
33 C --Common Variables:
34 C -- Uses LLNSET of /D3NUMS/
35
36 include 'debug.blk'
37 include 'dbnums.blk'
38 include 'd3nums.blk'
39
40 INTEGER LINSET(LLNSET,*)
41 INTEGER IPSET(*)
42 INTEGER IEDSET(0:2,*)
43 INTEGER LENF(0:NELBLK)
44 INTEGER NLNKF(NELBLK)
45 INTEGER LINKF(*)
46 REAL XN(*), YN(*), ZN(*)
47 INTEGER MREF(*), LREF(*)
48
49 LOGICAL CKCROS
50
51 C --Check each edge line against each partial line for overlap
52
53 NOLDPT = NPART
54
55 call iniint(numnpf, 0, mref)
56 call iniint(numnpf, 0, lref)
57
58 do ip=1,npart
59 lref(LINSET(1,IPSET(IP))) = ip
60 lref(LINSET(2,IPSET(IP))) = ip
61 end do
62
63 do ip=npart,1,-1
64 mref(LINSET(1,IPSET(IP))) = ip
65 mref(LINSET(2,IPSET(IP))) = ip
66 end do
67
68 nhid = 0
69 DO 120 IEDG = 1, NEDGES
70 IFAC = IEDSET(0,IEDG)
71 N1 = IEDSET(1,IEDG)
72 N2 = IEDSET(2,IEDG)
73
74 imin = max(1, mref(n1), mref(n2))
75 imax = min(npart, lref(n1), lref(n2))
76 do ip = imin, imax
77 if (ipset(ip) .gt. 0) then
78 C --Process only if visible node is corner node of face
79 IV = LINSET(1,IPSET(IP))
80 IF ((N1 .EQ. IV) .OR. (N2 .EQ. IV)) THEN
81 IH = LINSET(2,IPSET(IP))
82 IF (N2 .EQ. IH) GOTO 110
83
84 C --Check if face hides the visible part of the line
85 IELB = 0
86 IXL = IDBLNK (IELB, IFAC, LENF, NLNKF)
87 IF (CKCROS (IV, IH, NLNKF(IELB), LINKF(IXL),
88 & XN, YN, ZN)) THEN
89
90 C --Move totally hidden lines from partial set to totally
91 C --hidden lines
92 ipset(ip) = -ipset(ip)
93 nhid = nhid + 1
94
95 END IF
96 END IF
97 end if
98 110 CONTINUE
99 end do
100 120 CONTINUE
101 if ((cdebug .eq. 'HIDDEN') .and. (idebug .ge. 1))
102 & write (*, '(1x,a,i5)') 'partial lines hidden by face =', nhid
103
104 nhid = 0
105 ip = 1
106 100 continue
107 if (ip .le. npart) then
108 if (ipset(ip) .lt. 0) then
109 I = -IPSET(IP)
110 IPSET(IP) = IPSET(NPART)
111 IPSET(NPART) = I
112 NPART = NPART - 1
113 IP = IP - 1
114 nhid = nhid + 1
115 end if
116 ip = ip + 1
117 go to 100
118 end if
119 C --Delete the edges which are totally hidden lines
120
121 nhid = 0
122 DO 140 IP = NPART+1, NOLDPT
123 IV = LINSET(1,IPSET(IP))
124 IH = LINSET(2,IPSET(IP))
125 DO 130 IEDG = 1, NEDGES
126 IF (IEDSET(1,IEDG) .EQ. IV) THEN
127 IF (IEDSET(2,IEDG) .EQ. IH) THEN
128 IEDSET(0,IEDG) = 0
129 nhid = nhid + 1
130 GOTO 140
131 END IF
132 END IF
133 130 CONTINUE
134 140 CONTINUE
135 if ((cdebug .eq. 'HIDDEN') .and. (idebug .ge. 1))
136 & write (*, '(1x,a,i5)') 'edges hidden by face =', nhid
137
138 RETURN
139 END