Debian Codegraph @

packages/seacas/applications/gen3d/g3_ixlink.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 IXLINK (NCEN, IELROW, LINK, XN, YN, IROT)
9 C=======================================================================
10
11 C --*** IXLINK *** (GEN3D) Get connectivity indices
12 C -- Written by Amy Gilkey - revised 08/16/88
13 C --
14 C --IXLINK sets the connectivity indices IX1..4 for center elements.
15 C --The indices are set so that:
16 C -- LINK(IX1,i) holds the leftmost column, bottom row
17 C -- LINK(IX2,i) holds the rightmost column, bottom row
18 C -- LINK(IX3,i) holds the rightmost column, top row
19 C -- LINK(IX4,i) holds the leftmost column, top row
20 C --
21 C --Parameters:
22 C -- NCEN - IN - the number of center block elements
23 C -- IELROW - IN - the indices of the center block elements
24 C -- LINK - IN - the connectivity for the 2D elements, always 4 nodes
25 C -- XN, YN - IN - the coordinates, needed to find node ordering
26 C -- IROT - OUT - track link rotation for sset face update
27 C --
28 C --Common Variables:
29 C -- Sets IX1, IX2, IX3, IX4 of /CENPAR/
30
31 INCLUDE 'g3_cenpar.blk'
32
33 INTEGER IELROW(*)
34 INTEGER LINK(4,*)
35 REAL XN(*), YN(*)
36 INTEGER IROT(*)
37
38 INTEGER LSV(4)
39
40 C --Get the connectivity indices so that LINK(IX1,i) and LINK(IX4,i)
41 C --are on the same column and LINK(IX2,i) and LINK(IX3,i) are on the
42 C --next column
43
44 DO 40 IXEL = 1, NCEN
45 IEL = IELROW(IXEL)
46
47 IX1 = 1
48 DIFMAX = 0.0
49 L2 = LINK(2,IEL)
50 L3 = LINK(3,IEL)
51 L4 = LINK(4,IEL)
52 DO 10 ILINK = 1, 4
53 L1 = LINK(ILINK,IEL)
54 IF ((MAX (XN(L1), XN(L4)) .LT. MAX (XN(L2), XN(L3))) .AND.
55 & (MAX (YN(L1), YN(L2)) .LT. MAX (YN(L3), YN(L4)))) THEN
56 DIF = (MAX (XN(L2), XN(L3)) - MAX (XN(L1), XN(L4)))
57 & + (MAX (YN(L3), YN(L4)) - MAX (YN(L1), YN(L2)))
58 IF (DIF .GT. DIFMAX) THEN
59 IX1 = ILINK
60 DIFMAX = DIF
61 END IF
62 END IF
63 L2 = L3
64 L3 = L4
65 L4 = LINK(ILINK,IEL)
66 10 CONTINUE
67
68 IROT(IEL) = IX1
69 IF (IX1 .NE. 1) THEN
70 DO 20 ILINK = 1, 4
71 LSV(ILINK) = LINK(ILINK,IEL)
72 20 CONTINUE
73 IX = IX1
74 DO 30 ILINK = 1, 4
75 LINK(ILINK,IEL) = LSV(IX)
76 IX = IX + 1
77 IF (IX .GT. 4) IX = IX - 4
78 30 CONTINUE
79 END IF
80 40 CONTINUE
81
82 IX1 = 1
83 IX2 = 2
84 IX3 = 3
85 IX4 = 4
86
87 RETURN
88 END