| 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 SORLNX (NSETS, NEWELB, IE2ELB, |
| 9 |
& NLNKF, LENSC, LINKSC, IF2ESC, IF22SC, |
| 10 |
& LENF, LINKF, IF2EL, IF2EL2) |
| 11 |
C======================================================================= |
| 12 |
|
| 13 |
C --*** SORLNX *** (MESH) Sort faces |
| 14 |
C -- Written by Amy Gilkey - revised 03/04/88 |
| 15 |
C -- |
| 16 |
C --SORLNX resorts all the faces into new element block sets. |
| 17 |
C -- |
| 18 |
C --Parameters: |
| 19 |
C -- NSETS - IN - the number of element block sets in LINKF |
| 20 |
C -- NEWELB - IN - the new element block set for each face |
| 21 |
C -- IE2ELB - IN - the element for each element block |
| 22 |
C -- NLNKF - IN - the number of nodes for each element block |
| 23 |
C -- LENSC - IN - the cumulative face counts by element block for LINKSC |
| 24 |
C -- LINKSC - IN - the unsorted connectivity for all faces |
| 25 |
C -- IF2ESC - IN - the element number of each face in LINKSC |
| 26 |
C -- IF22SC - IN - the secondary element number of each face in LINKSC |
| 27 |
C -- LENF - OUT - the cumulative face counts by element block |
| 28 |
C -- LINKF - OUT - the connectivity for all faces |
| 29 |
C -- IF2EL - OUT - the element number of each face |
| 30 |
C -- IF2EL2 - OUT - the secondary element number of each face |
| 31 |
C -- |
| 32 |
C --Common Variables: |
| 33 |
C -- Uses NELBLK of /DBNUMS/ |
| 34 |
|
| 35 |
common /debugc/ cdebug |
| 36 |
common /debugn/ idebug |
| 37 |
character*8 cdebug |
| 38 |
|
| 39 |
include 'dbnums.blk' |
| 40 |
include 'd3nums.blk' |
| 41 |
|
| 42 |
INTEGER NEWELB(*) |
| 43 |
INTEGER IE2ELB(*) |
| 44 |
INTEGER NLNKF(NELBLK) |
| 45 |
INTEGER LENSC(0:NSETS) |
| 46 |
INTEGER LINKSC(*) |
| 47 |
INTEGER IF2ESC(*), IF22SC(*) |
| 48 |
INTEGER LENF(0:NSETS) |
| 49 |
INTEGER LINKF(*) |
| 50 |
INTEGER IF2EL(*), IF2EL2(*) |
| 51 |
|
| 52 |
C --Move faces into appropriate element block |
| 53 |
|
| 54 |
IX = 0 |
| 55 |
IXL0 = 0 |
| 56 |
DO 120 NELB = 1, NSETS |
| 57 |
|
| 58 |
IXLSC0 = 0 |
| 59 |
DO 110 IELB = 1, NSETS |
| 60 |
IF (IELB .LE. NELBLK) NL = NLNKF(IELB) |
| 61 |
|
| 62 |
DO 100 IFAC = LENSC(IELB-1)+1, LENSC(IELB) |
| 63 |
IF (IELB .GT. NELBLK) NL = NLNKF(IE2ELB(IF2ESC(IFAC))) |
| 64 |
|
| 65 |
IF (NELB .EQ. IABS (NEWELB(IFAC))) THEN |
| 66 |
|
| 67 |
IF (NEWELB(IFAC) .LT. 0) THEN |
| 68 |
|
| 69 |
C --IF2ESC(IFAC) holds the "live" element number |
| 70 |
I = IF2ESC(IFAC) |
| 71 |
IF2ESC(IFAC) = IF22SC(IFAC) |
| 72 |
IF22SC(IFAC) = I |
| 73 |
|
| 74 |
C --Swap nodes to simulate surface being defined |
| 75 |
C --by facing element |
| 76 |
IF (NL .EQ. 4) THEN |
| 77 |
I = LINKSC(IXLSC0+2) |
| 78 |
LINKSC(IXLSC0+2) = LINKSC(IXLSC0+4) |
| 79 |
LINKSC(IXLSC0+4) = I |
| 80 |
END IF |
| 81 |
END IF |
| 82 |
|
| 83 |
IX = IX + 1 |
| 84 |
CALL CPYINT (NL, LINKSC(IXLSC0+1), LINKF(IXL0+1)) |
| 85 |
IXL0 = IXL0 + NL |
| 86 |
IF2EL(IX) = IF2ESC(IFAC) |
| 87 |
IF (IS3DIM) IF2EL2(IX) = IF22SC(IFAC) |
| 88 |
END IF |
| 89 |
|
| 90 |
IXLSC0 = IXLSC0 + NL |
| 91 |
100 CONTINUE |
| 92 |
|
| 93 |
110 CONTINUE |
| 94 |
LENF(NELB) = IX |
| 95 |
120 CONTINUE |
| 96 |
RETURN |
| 97 |
END |