| 1 |
C Copyright(C) 1999-2020, 2024 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 |
INTEGER FUNCTION MATFAC (LINKF1, MAXNPF, NPFS, iel, numnp, IERR) |
| 9 |
C======================================================================= |
| 10 |
|
| 11 |
C --*** MATFAC *** (MESH) Match face with existing faces |
| 12 |
C -- Written by Amy Gilkey - revised 02/19/88 |
| 13 |
C -- Revised by John Glick - 10/20/88 |
| 14 |
C -- Sam Key, 06/01/85 |
| 15 |
C -- |
| 16 |
C --MATFAC searches for the given face in the list of previously |
| 17 |
C --identified faces. If a match is found, a pointer to the |
| 18 |
C --matching face is returned. |
| 19 |
C -- |
| 20 |
C --The search is done by looking at the list of the faces which |
| 21 |
C --contain each node (the NPFS array). The lists of two diagonally |
| 22 |
C --opposite nodes in the given face are searched for a reference |
| 23 |
C --to a common face, which is a "match". The references to the |
| 24 |
C --common face are deleted for all nodes in the face. |
| 25 |
C -- |
| 26 |
C --Parameters: |
| 27 |
C -- LINKF1 - IN - the nodes of the face |
| 28 |
C -- MAXNPF - IN - the maximum length of the NPFS entry |
| 29 |
C -- NPFS - IN/OUT - the list of unmatched faces containing a node; |
| 30 |
C -- (0,i) = the length of the list |
| 31 |
C -- IEL - IN - the element containing the face (for error message) |
| 32 |
C -- IERR - OUT - = 0 if routine executes with no errors |
| 33 |
C -- = 1 if an error was detected. |
| 34 |
|
| 35 |
include 'minmax.blk' |
| 36 |
INTEGER LINKF1(4) |
| 37 |
INTEGER NPFS(NUMNP, 0:MAXNPF) |
| 38 |
|
| 39 |
MATFAC = 0 |
| 40 |
IERR = 0 |
| 41 |
|
| 42 |
IF ((NPFS(LINKF1(1),0) .GT. 0) |
| 43 |
& .AND. (NPFS(LINKF1(2),0) .GT. 0) |
| 44 |
& .AND. (NPFS(LINKF1(3),0) .GT. 0) |
| 45 |
& .AND. (NPFS(LINKF1(4),0) .GT. 0)) THEN |
| 46 |
|
| 47 |
C --Check all prior faces using this node, by looking for the |
| 48 |
C --diagonally opposite node of this face |
| 49 |
|
| 50 |
INF1 = LINKF1(1) |
| 51 |
INF3 = LINKF1(3) |
| 52 |
DO 150 I1 = 1, NPFS(INF1,0) |
| 53 |
IOLDF = NPFS(INF1,i1) |
| 54 |
DO 140 I3 = 1, NPFS(INF3,0) |
| 55 |
IF (IOLDF .EQ. NPFS(INF3,i3)) THEN |
| 56 |
|
| 57 |
C --Diagonal matches so check other nodes |
| 58 |
|
| 59 |
INF2 = LINKF1(2) |
| 60 |
DO 100 I2 = 1, NPFS(INF2,0) |
| 61 |
IF (IOLDF .EQ. NPFS(INF2,i2)) GOTO 110 |
| 62 |
100 CONTINUE |
| 63 |
WRITE (*, 10000) IEL, LINKF1 |
| 64 |
IERR = 1 |
| 65 |
GOTO 140 |
| 66 |
110 CONTINUE |
| 67 |
|
| 68 |
INF4 = LINKF1(4) |
| 69 |
DO 120 I4 = 1, NPFS(INF4,0) |
| 70 |
IF (IOLDF .EQ. NPFS(INF4,i4)) GOTO 130 |
| 71 |
120 CONTINUE |
| 72 |
WRITE (*, 10000) IEL, LINKF1 |
| 73 |
IERR = 1 |
| 74 |
GOTO 140 |
| 75 |
130 CONTINUE |
| 76 |
|
| 77 |
C --Matching faces so point to face and zero out |
| 78 |
C --nodal references to face |
| 79 |
|
| 80 |
L = NPFS(INF1,0) |
| 81 |
IF (L .GT. I1) NPFS(INF1,i1) = NPFS(INF1,l) |
| 82 |
NPFS(INF1,0) = L - 1 |
| 83 |
L = NPFS(INF3,0) |
| 84 |
IF (L .GT. I3) NPFS(INF3,i3) = NPFS(INF3,l) |
| 85 |
NPFS(INF3,0) = L - 1 |
| 86 |
L = NPFS(INF2,0) |
| 87 |
IF (L .GT. I2) NPFS(INF2,i2) = NPFS(INF2,l) |
| 88 |
NPFS(INF2,0) = L - 1 |
| 89 |
L = NPFS(INF4,0) |
| 90 |
IF (L .GT. I4) NPFS(INF4,i4) = NPFS(INF4,l) |
| 91 |
NPFS(INF4,0) = L - 1 |
| 92 |
|
| 93 |
MATFAC = IOLDF |
| 94 |
maxnod = max(maxnod, inf1, inf2, inf3, inf4) |
| 95 |
minnod = min(minnod, inf1, inf2, inf3, inf4) |
| 96 |
GO TO 160 |
| 97 |
END IF |
| 98 |
140 CONTINUE |
| 99 |
150 CONTINUE |
| 100 |
END IF |
| 101 |
|
| 102 |
160 CONTINUE |
| 103 |
RETURN |
| 104 |
10000 FORMAT (' Poss. Contiguity Prob. at Hex ', I11, |
| 105 |
* ', Nodes ', 4(I11,1X), 10(I11,1X)) |
| 106 |
END |