Debian Codegraph @

packages/seacas/applications/blot/fndsel.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 FNDSEL (NODVAR, NNENUM, NENUM,
9 & LENF, NLNKF, LINKF, IF2EL, IX2NP,
10 & NPSURF, NSEL, NPSEL)
11 C=======================================================================
12
13 C --*** FNDSEL *** (MESH) Find selected nodes/elements
14 C -- Written by Amy Gilkey - revised 03/31/88
15 C --
16 C --FNDSEL constructs a logical array of the selected nodes and elements
17 C --that are on the surface of a 3D mesh.
18 C --
19 C --Parameters:
20 C -- NODVAR - IN - true if nodal versus element plot
21 C -- NNENUM - IN - the number of selected nodes/elements
22 C -- NENUM - IN - the selected nodes/elements
23 C -- LENF - IN - the cumulative face counts by element block (if element)
24 C -- NLNKF - IN - the number of nodes per face (if element)
25 C -- LINKF - IN - the connectivity for all faces (if element)
26 C -- IF2EL - IN - the element number of each face (if element)
27 C -- IX2NP - IN - the node number for each mesh index (if nodal)
28 C -- NPSURF - IN - the node numbers of the surface nodes (if nodal)
29 C -- NSEL - OUT - the number of selected nodes
30 C -- NPSEL - OUT - the node numbers of the selected nodes
31 C --
32 C --Common Variables:
33 C -- Uses NDIM of /DBNUMS/
34 C -- Uses NNPSUR, NUMNPF of /D3NUMS/
35
36 include 'dbnums.blk'
37 include 'd3nums.blk'
38
39 LOGICAL NODVAR
40 INTEGER NENUM(NNENUM)
41 INTEGER LENF(0:NELBLK)
42 INTEGER NLNKF(NELBLK)
43 INTEGER LINKF(*)
44 INTEGER IF2EL(*)
45 INTEGER IX2NP(NUMNPF)
46 INTEGER NPSURF(*)
47 INTEGER NPSEL(*)
48
49 INTEGER IFACES(10)
50
51 IF (NODVAR) THEN
52 IF (.NOT. IS3DIM) THEN
53 CALL INIINT (NUMNPF, 0, NPSEL)
54 DO 100 NNP = 1, NNENUM
55 INP = NENUM(NNP)
56 IF (INP .GT. 0) NPSEL(INP) = 1
57 100 CONTINUE
58
59 ELSE
60 CALL INIINT (NUMNPF, -1, NPSEL)
61 DO 110 IX = 1, NNPSUR
62 INP = NPSURF(IX)
63 NPSEL(INP) = 0
64 110 CONTINUE
65 DO 120 NNP = 1, NNENUM
66 INP = NENUM(NNP)
67 IF (INP .GT. 0) THEN
68 IF (NPSEL(INP) .EQ. 0) NPSEL(INP) = 1
69 END IF
70 120 CONTINUE
71 END IF
72
73 ELSE
74 CALL INIINT (NUMNPF, 0, NPSEL)
75
76 DO 150 NEL = 1, NNENUM
77 IEL = NENUM(NEL)
78 CALL FNDE2F (IEL, LENF, IF2EL, NFARY, IFACES, IELB)
79 DO 140 N = 1, NFARY
80 IFAC = IFACES(N)
81 IELB = 0
82 IXL0 = IDBLNK (IELB, IFAC, LENF, NLNKF) - 1
83 DO 130 K = 1, NLNKF(IELB)
84 INP = LINKF(IXL0+K)
85 NPSEL(INP) = 1
86 130 CONTINUE
87 140 CONTINUE
88 150 CONTINUE
89 END IF
90
91 C --Make up the list of selected nodes
92
93 NSEL = 0
94 DO 160 INP = 1, NUMNPF
95 IF (NPSEL(INP) .GT. 0) THEN
96 NSEL = NSEL + 1
97 NPSEL(NSEL) = INP
98 END IF
99 160 CONTINUE
100
101 RETURN
102 END