Debian Codegraph @

packages/seacas/applications/grepos/gp_snap.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 SNAP(ndbin, A, IA, isnp, X, Y, Z, NDIM, numnp,
9 * numess, idess, neess, ixeess,
10 * nelb, idelb, numelb, numlnk)
11 C=======================================================================
12
13 DIMENSION A(*), IA(*)
14 REAL X(*), Y(*), Z(*)
15 INTEGER NUMESS
16 INTEGER IDESS(*)
17 INTEGER NEESS(*)
18 INTEGER IXEESS(*)
19 INTEGER IDELB(NELB)
20 INTEGER NUMELB(NELB)
21 INTEGER NUMLNK(NELB)
22
23 include 'exodusII.inc'
24 INCLUDE 'gp_snap.blk'
25
26 C -- X,Y,Z -- REAL - IN/OUT - Coordinates of nodes
27 C -- NDIM - IN - the number of dimensions
28 C -- NUMESS - IN - the number of side sets
29 C -- IDESS - OUT - the side set ID for each set
30 C -- NEESS - OUT - the number of elements for each set
31 C -- IXEESS - OUT - the index of the first element for each set
32
33 call mdrsrv('ISCR', KISCR, NUMNP)
34 call mdrsrv('VNORM', KVNORM, NUMNP*3)
35 call mdrsrv('PLANE', KPLANE, 0)
36
37 indsl = 0
38 indma = 0
39
40 C ... Find master index
41 do 100 i=1, numess
42 if (idess(i) .eq. idssma(isnp)) then
43 indma = i
44 go to 110
45 endif
46 100 continue
47 110 continue
48
49 C ... Find slave index
50 do 120 i=1, numess
51 if (idess(i) .eq. idsssl(isnp)) then
52 indsl = i
53 go to 130
54 endif
55 120 continue
56 130 continue
57
58 C------------------------------------------------------------------------
59 C ... Get the number of nodes on the slave surface
60 call exgsp(ndbin, idess(indsl), nssess, nsdess, ierr)
61 if (nsdess .eq. 0) then
62 C... Distribution factors not stored, estimate max size of node list
63 C based on maximum of 9 nodes/face.
64 nsdess = nssess * 9
65 end if
66 C... Allocate storage for sideset node and count list.
67 call mdrsrv('NODSLV', islvnd, nsdess)
68 call mdrsrv('NNDSLV', islvnn, nssess)
69 C... Get the sideset nodes...
70 call exgssn(ndbin, idess(indsl), ia(islvnn), ia(islvnd), ierr)
71
72 C ... Get the number of nodes on the master surface
73 call exgsp(ndbin, idess(indma), nmsess, nmdess, ierr)
74 if (nmdess .eq. 0) then
75 C... Distribution factors not stored, estimate max size of node list
76 C based on maximum of 9 nodes/face.
77 nmdess = nmsess * 9
78 end if
79 C... Allocate storage for sideset node and count list.
80 call mdrsrv('NODMAS', imasnd, nmdess)
81 call mdrsrv('NNDMAS', imasnn, nmsess)
82 C... Get the sideset nodes...
83 call exgssn(ndbin, idess(indma), ia(imasnn), ia(imasnd), ierr)
84 C------------------------------------------------------------------------
85 C ... Allocate temporary storage
86 nummaf = nmsess
87 call mdlong('PLANE', KPLANE, nummaf*4)
88
89 call inirea(3*numnp, 0.0, a(kvnorm))
90 call inirea(4*nummaf, 0.0, a(kplane))
91
92 C ... Calculate the slave surface normals
93 if (ndim .eq. 3) then
94 call setnor(.FALSE., numnp, x, y, z, 3, a(kvnorm),
95 * usnorm(isnp), vector(1, isnp),
96 * nssess, nsdess, ia(islvnd))
97
98 C ... Calculate the master surface planes
99 call setnor(.TRUE., numnp, x, y, z, 4, a(kplane),
100 * 0, vector(1, isnp),
101 * nmsess, nmdess, ia(imasnd))
102
103 call snpnod(numnp, ndim, x, y, z,
104 * a(kvnorm), nssess, nsdess, ia(islvnd),
105 * a(kplane), nmsess, nmdess, ia(imasnd),
106 * snptol(isnp), delmax(isnp))
107 else
108 call setnr2 (.FALSE., numnp, x, y, 3, a(kvnorm),
109 * usnorm(isnp), vector(1, isnp),
110 * nssess, nsdess, ia(islvnd))
111
112 call snpnd2(numnp, ndim, x, y, a(kvnorm),
113 * nmsess, nmdess, ia(imasnd),
114 * snptol(isnp), delmax(isnp))
115 end if
116
117 call mddel('NNDMAS')
118 call mddel('NODMAS')
119 call mddel('NNDSLV')
120 call mddel('NODSLV')
121
122 call mddel('PLANE')
123 call mddel('VNORM')
124 call mddel('ISCR')
125
126 RETURN
127 END