| 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 |
C======================================================================= |
| 7 |
SUBROUTINE MIRSS (NUMESS, LESSEL, LESSDL, IDESS, NEESS, NEDSS, |
| 8 |
* IXEESS, IXEDSS, LTEESS, LTSSS, LTSNC, FAC, USESDF, NONQUAD, |
| 9 |
* COMTOP) |
| 10 |
C======================================================================= |
| 11 |
C --*** MIRSS *** (GJOIN) Mirror element side sets |
| 12 |
C -- |
| 13 |
C --MIRSS mirrors a side set and (if USESDF true) the distribution factors |
| 14 |
C --applied to the nodes. |
| 15 |
C -- |
| 16 |
C --Parameters: |
| 17 |
C -- |
| 18 |
C -- NUMESS - IN/OUT - the number of element side sets |
| 19 |
C -- LESSEL - IN/OUT - the length of the element side sets element list |
| 20 |
C -- IDESS - IN/OUT - the element side set ID for each set |
| 21 |
C -- NEESS - IN/OUT - the number of elements for each set |
| 22 |
C -- NEDSS - IN/OUT - the number of dist-fac for each set |
| 23 |
C -- IXEESS - IN/OUT - the index of the first element for each set |
| 24 |
C -- IXEDSS - IN/OUT - the index of the first dist-fac for each set |
| 25 |
C -- LTEESS - IN/OUT - the elements for all sets |
| 26 |
C -- LTSSS - IN/OUT - the sides for all sets |
| 27 |
C -- LTSNC - IN/OUT - the face count for each element/side in the list |
| 28 |
C -- FACESS - IN/OUT - the distribution factors for all sets???????????? |
| 29 |
C -- USESDF - IN - true if df are non-unity, false if all unity |
| 30 |
C -- NONQUAD - IN - true if model contains non-hex/non-quad elements |
| 31 |
|
| 32 |
INTEGER IDESS(*) ! NUMESS |
| 33 |
INTEGER NEESS(*) ! NUMESS |
| 34 |
INTEGER NEDSS(*) ! NUMESS |
| 35 |
INTEGER IXEESS(*) ! NUMESS |
| 36 |
INTEGER IXEDSS(*) ! NUMESS |
| 37 |
INTEGER LTEESS(*) ! LESSEL |
| 38 |
INTEGER LTSSS(*) ! LESSEL |
| 39 |
INTEGER LTSNC(*) ! LESSEL |
| 40 |
REAL FAC(*) ! LESSDL |
| 41 |
LOGICAL USESDF, NONQUAD, shells |
| 42 |
CHARACTER*(*) COMTOP |
| 43 |
|
| 44 |
C ... This routine was originally written to only handle quads, tris, and hexes. |
| 45 |
C There was no checking of this, it blindly went through the list |
| 46 |
C swapping nodes 1 and 2 (line) or nodes 4 and 2 (quad face). |
| 47 |
|
| 48 |
C The routine now provides more checking and will return with a warning |
| 49 |
C if applied to elements on other faces... |
| 50 |
|
| 51 |
IF (NONQUAD .AND. COMTOP(:3) .NE. 'TET' .and. |
| 52 |
* COMTOP(:5) .ne. 'SHELL') THEN |
| 53 |
CALL PRTERR ('PROGRAM', |
| 54 |
* 'Mirroring of sidesets on non-quad/line sides not supported') |
| 55 |
RETURN |
| 56 |
END IF |
| 57 |
|
| 58 |
IF (USESDF) THEN |
| 59 |
CALL PRTERR ('WARNING', |
| 60 |
* 'Mirroring of sideset distribution factors not supported') |
| 61 |
RETURN |
| 62 |
END IF |
| 63 |
|
| 64 |
C ... We have a quad/line face; do the mirroring. |
| 65 |
if (comtop(:5) .eq. 'SHELL') then |
| 66 |
shells = .true. |
| 67 |
else |
| 68 |
shells = .false. |
| 69 |
end if |
| 70 |
|
| 71 |
DO 10 NL = 1, NUMESS |
| 72 |
call mirs1(IDESS(NL), NEESS(NL), NEDSS(NL), LTEESS(IXEESS(NL)), |
| 73 |
* LTSSS(IXEESS(NL)), LTSNC(IXEESS(NL)), FAC(IXEDSS(NL)), |
| 74 |
* USESDF, shells) |
| 75 |
10 CONTINUE |
| 76 |
RETURN |
| 77 |
END |
| 78 |
|
| 79 |
subroutine mirs1(id, numsid, numdis, elem, side, dfcnt, facedf, |
| 80 |
* usesdf, shells) |
| 81 |
|
| 82 |
integer id, numsid, numdis |
| 83 |
integer elem(*), side(*), dfcnt(*) |
| 84 |
real facedf(*) |
| 85 |
logical usesdf |
| 86 |
logical shells |
| 87 |
CHARACTER*132 STRING |
| 88 |
|
| 89 |
idf = 0 |
| 90 |
do 10 i = 1, numsid |
| 91 |
icnt = dfcnt(i) |
| 92 |
|
| 93 |
C ... Bar topology side -- Base element is quad (or we wouldn't be here) |
| 94 |
if (icnt .eq. 2) then |
| 95 |
side(i) = 5 - side(i) |
| 96 |
|
| 97 |
C ... Quad topology side -- Base element is hex (or we wouldn't be here) |
| 98 |
else if (icnt .eq. 4) then |
| 99 |
if (shells) then |
| 100 |
side(i) = side(i) |
| 101 |
else |
| 102 |
if (side(i) .le. 4) then |
| 103 |
side(i) = 5 - side(i) |
| 104 |
else |
| 105 |
side(i) = side(i) |
| 106 |
end if |
| 107 |
end if |
| 108 |
else if (icnt .eq. 3) then |
| 109 |
C ... NOTE: This is a NONQUD, but COMTOP has been checked in calling code |
| 110 |
C so we know that these are all tets or shells... |
| 111 |
if (shells) then |
| 112 |
side(i) = side(i) |
| 113 |
else |
| 114 |
if (side(i) .eq. 3) then |
| 115 |
side(i) = 1 |
| 116 |
else if (side(i) .eq. 1) then |
| 117 |
side(i) = 3 |
| 118 |
end if |
| 119 |
end if |
| 120 |
else |
| 121 |
WRITE (STRING, 100) ID, ICNT |
| 122 |
100 FORMAT('Sideset ',I5,' contains ',I2,'-node ', |
| 123 |
* ' sides which are not supported for mirroring by gjoin2') |
| 124 |
CALL SQZSTR (STRING, LSTR) |
| 125 |
CALL PRTERR ('PROGRAM', STRING(:LSTR)) |
| 126 |
RETURN |
| 127 |
end if |
| 128 |
10 continue |
| 129 |
return |
| 130 |
end |