| 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 |
INTEGER FUNCTION MATFAT (LINKF1, MAXNPF, NPFS, iel, numnp, IERR) |
| 9 |
C======================================================================= |
| 10 |
|
| 11 |
C --*** MATFAT *** (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 |
|
| 17 |
C .... MODIFIED FOR TRIANGULAR FACES OF TET ELEMENTS.... |
| 18 |
|
| 19 |
C --MATFAT searches for the given face in the list of previously |
| 20 |
C --identified faces. If a match is found, a pointer to the |
| 21 |
C --matching face is returned. |
| 22 |
C -- |
| 23 |
C --The search is done by looking at the list of the faces which |
| 24 |
C --contain each node (the NPFS array). The lists of two diagonally |
| 25 |
C --opposite nodes in the given face are searched for a reference |
| 26 |
C --to a common face, which is a "match". The references to the |
| 27 |
C --common face are deleted for all nodes in the face. |
| 28 |
C -- |
| 29 |
C --Parameters: |
| 30 |
C -- LINKF1 - IN - the nodes of the face |
| 31 |
C -- MAXNPF - IN - the maximum length of the NPFS entry |
| 32 |
C -- NPFS - IN/OUT - the list of unmatched faces containing a node; |
| 33 |
C -- (i,0) = the length of the list |
| 34 |
C -- IEL - IN - the element containing the face (for error message) |
| 35 |
C -- IERR - OUT - = 0 if routine executes with no errors |
| 36 |
C -- = 1 if an error was detected. |
| 37 |
|
| 38 |
include 'minmax.blk' |
| 39 |
INTEGER LINKF1(4) |
| 40 |
INTEGER NPFS(NUMNP, 0:MAXNPF) |
| 41 |
|
| 42 |
MATFAT = 0 |
| 43 |
IERR = 0 |
| 44 |
|
| 45 |
IF ((NPFS(LINKF1(1),0) .GT. 0) |
| 46 |
& .AND. (NPFS(LINKF1(2),0) .GT. 0) |
| 47 |
& .AND. (NPFS(LINKF1(3),0) .GT. 0)) THEN |
| 48 |
|
| 49 |
C --Check all prior faces using this node, by looking for the |
| 50 |
C --diagonally opposite node of this face |
| 51 |
|
| 52 |
INF1 = LINKF1(1) |
| 53 |
INF3 = LINKF1(3) |
| 54 |
DO 150 I1 = 1, NPFS(INF1,0) |
| 55 |
IOLDF = NPFS(INF1,I1) |
| 56 |
DO 140 I3 = 1, NPFS(INF3,0) |
| 57 |
IF (IOLDF .EQ. NPFS(INF3,I3)) THEN |
| 58 |
|
| 59 |
C --First two nodes matche so check other node |
| 60 |
|
| 61 |
INF2 = LINKF1(2) |
| 62 |
DO 100 I2 = 1, NPFS(INF2,0) |
| 63 |
IF (IOLDF .EQ. NPFS(INF2,I2)) GOTO 110 |
| 64 |
100 CONTINUE |
| 65 |
GOTO 140 |
| 66 |
|
| 67 |
110 CONTINUE |
| 68 |
|
| 69 |
C --Matching faces so point to face and zero out |
| 70 |
C --nodal references to face |
| 71 |
|
| 72 |
L = NPFS(INF1,0) |
| 73 |
IF (L .GT. I1) NPFS(INF1,I1) = NPFS(INF1,L) |
| 74 |
NPFS(INF1,0) = L - 1 |
| 75 |
|
| 76 |
L = NPFS(INF3,0) |
| 77 |
IF (L .GT. I3) NPFS(INF3,I3) = NPFS(INF3,L) |
| 78 |
NPFS(INF3,0) = L - 1 |
| 79 |
|
| 80 |
L = NPFS(INF2,0) |
| 81 |
IF (L .GT. I2) NPFS(INF2,I2) = NPFS(INF2,L) |
| 82 |
NPFS(INF2,0) = L - 1 |
| 83 |
|
| 84 |
MATFAT = IOLDF |
| 85 |
maxnod = max(maxnod, inf1, inf2, inf3) |
| 86 |
minnod = min(minnod, inf1, inf2, inf3) |
| 87 |
|
| 88 |
GO TO 160 |
| 89 |
END IF |
| 90 |
140 CONTINUE |
| 91 |
150 CONTINUE |
| 92 |
END IF |
| 93 |
|
| 94 |
160 CONTINUE |
| 95 |
RETURN |
| 96 |
END |