Debian Codegraph @

packages/seacas/applications/grepos/gp_move.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 MOVE(ndbin, A, IA, isnp, X, Y, Z, NDIM, numnp, numel,
9 * numess, idess, neess, ixeess, lteess,
10 * nelb, idelb, numelb, numlnk, link,
11 * issblk, iscrn, iscre)
12 C=======================================================================
13
14 REAL A(*)
15 INTEGER IA(*)
16 REAL X(*), Y(*), Z(*)
17 INTEGER NUMESS
18 INTEGER IDESS(*)
19 INTEGER NEESS(*)
20 INTEGER IXEESS(*)
21 INTEGER LTEESS(*)
22 INTEGER IDELB(NELB)
23 INTEGER NUMELB(NELB)
24 INTEGER NUMLNK(NELB)
25 INTEGER LINK(*)
26 INTEGER ISSBLK(NELB), ISCRN(*), ISCRE(*)
27
28 INCLUDE 'gp_snap.blk'
29
30 C -- X,Y,Z -- REAL - IN/OUT - Coordinates of nodes
31 C -- NDIM - IN - the number of dimensions
32 C -- NUMESS - IN - the number of side sets
33 C -- IDESS - IN - the side set ID for each set
34 C -- NEESS - IN - the number of elements for each set
35 C -- IXEESS - IN - the index of the first element for each set
36 C -- LTEESS - IN - the elements for all sets
37
38 call iniint(numel, 0, iscre)
39 call iniint(numnp, 0, iscrn)
40 call iniint(nelb, 0, issblk)
41
42 call mdrsrv('ISCR', KISCR, NUMNP)
43 call mdrsrv('VNORM', KVNORM, NUMNP*3)
44 call mdrsrv('PLANE', KPLANE, 0)
45
46 indma = 0
47 indsl = 0
48
49 C ... Find master index
50 do 100 i=1, numess
51 if (idess(i) .eq. idssma(isnp)) then
52 indma = i
53 go to 110
54 endif
55 100 continue
56 110 continue
57
58 C ... Find slave index
59 do 120 i=1, numess
60 if (idess(i) .eq. idsssl(isnp)) then
61 indsl = i
62 go to 130
63 endif
64 120 continue
65 130 continue
66
67 C------------------------------------------------------------------------
68 C ... Get the number of nodes on the slave surface
69 call exgsp(ndbin, idess(indsl), nssess, nsdess, ierr)
70 if (nsdess .eq. 0) then
71 C... Distribution factors not stored, estimate max size of node list
72 C based on maximum of 9 nodes/face.
73 nsdess = nssess * 9
74 end if
75 C... Allocate storage for sideset node and count list.
76 call mdrsrv('NODSLV', islvnd, nsdess)
77 call mdrsrv('NNDSLV', islvnn, nssess)
78 C... Get the sideset nodes...
79 call exgssn(ndbin, idess(indsl), ia(islvnn), ia(islvnd), ierr)
80
81 C ... Get the number of nodes on the master surface
82 call exgsp(ndbin, idess(indma), nmsess, nmdess, ierr)
83 if (nmdess .eq. 0) then
84 C... Distribution factors not stored, estimate max size of node list
85 C based on maximum of 9 nodes/face.
86 nmdess = nmsess * 9
87 end if
88 C... Allocate storage for sideset node and count list.
89 call mdrsrv('NODMAS', imasnd, nmdess)
90 call mdrsrv('NNDMAS', imasnn, nmsess)
91 C... Get the sideset nodes...
92 call exgssn(ndbin, idess(indma), ia(imasnn), ia(imasnd), ierr)
93 C------------------------------------------------------------------------
94
95 C ... Find element blocks containing elements in sideset 'indsl'
96 C ... First, use the scratch element storage to map element to block
97 ibeg = 1
98 do 140 iblk = 1, nelb
99 call iniint(numelb(iblk), iblk, iscre(ibeg))
100 ibeg = ibeg+numelb(iblk)
101 140 continue
102
103 C ... Now, for each element in the sideset, find which block it is in
104 C and set 'issblk' equal to 1.
105 ibeg = ixeess(indsl)
106 do 150 isse = ibeg, ibeg+neess(indsl)-1
107 iel = lteess(isse)
108 if (iscre(iel) .eq. 1) then
109 PRINT *, iel
110 end if
111 issblk(iscre(iel)) = 1
112 150 continue
113
114 C ... Now, for each block in the sideset, find the nodes contained in
115 C that block.
116 ielnk = 0
117 do 170 iblk = 1, nelb
118 ISLNK = IELNK + 1
119 IELNK = IELNK + NUMLNK(IBLK) * NUMELB(IBLK)
120 if (issblk(iblk) .eq. 1) then
121 call exfcon(1, numelb(iblk), numlnk(iblk), link(islnk),
122 * iscrn)
123 end if
124 170 continue
125 C ... At this point, iscrn(i) will be 1 if node in block, 0 otherwise
126
127 C ... Allocate temporary storage
128 nummaf = neess(indma)
129 call mdlong('PLANE', KPLANE, nummaf*4)
130
131 call inirea(3*numnp, 0.0, a(kvnorm))
132 call inirea(4*nummaf, 0.0, a(kplane))
133
134 C ... Calculate the slave surface normals
135 if (ndim .eq. 3) then
136 call setnor(.FALSE., numnp, x, y, z, 3, a(kvnorm),
137 * usnorm(isnp), vector(1, isnp),
138 * nssess, nsdess, ia(islvnd))
139
140 C ... Calculate the master surface planes
141 call setnor(.TRUE., numnp, x, y, z, 4, a(kplane),
142 * 0, vector(1, isnp),
143 * nmsess, nmdess, ia(imasnd))
144
145 call movnod(numnp, ndim, x, y, z,
146 * a(kvnorm), nssess, nsdess, ia(islvnd),
147 * a(kplane), nmsess, nmdess, ia(imasnd),
148 * snptol(isnp), delmax(isnp), iscrn, vector(1,isnp),
149 * gap(isnp))
150 else
151 call setnr2 (.FALSE., numnp, x, y, 3, a(kvnorm),
152 * usnorm(isnp), vector(1, isnp),
153 * nssess, nsdess, ia(islvnd))
154
155 call movnd2(numnp, ndim, x, y, a(kvnorm),
156 * nmsess, nmdess, ia(imasnd),
157 * snptol(isnp), delmax(isnp), iscrn, vector(1,isnp),
158 * gap(isnp))
159 end if
160
161 call mddel('NNDMAS')
162 call mddel('NODMAS')
163 call mddel('NNDSLV')
164 call mddel('NODSLV')
165
166 call mddel('PLANE')
167 call mddel('VNORM')
168 call mddel('ISCR')
169
170 RETURN
171 END