| 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 WRESS (A, IA, IDFRO, IDBCK, |
| 9 |
& ISSFRO, ISSBCK, NSSUR, NESUR, NSSFRO, NSSBCK, |
| 10 |
& IDESS, NEES3, NNES3, IXEES3, IXNES3, LTEES3, LTSES3, |
| 11 |
& LTNES3, FACES3, *) |
| 12 |
C======================================================================= |
| 13 |
|
| 14 |
C --*** WRESS *** (GEN3D) Write 3D node sets |
| 15 |
C -- Written by Amy Gilkey - revised 05/05/86 |
| 16 |
C -- |
| 17 |
C --WRESS writes the side set information for the 3D database. |
| 18 |
C --Calculations have been done elsewhere. |
| 19 |
C -- |
| 20 |
C --Parameters: |
| 21 |
C -- IDFRO - IN - ids for front surface side sets; (0) = length |
| 22 |
C -- IDBCK - IN - ids for back surface side sets; (0) = length |
| 23 |
C -- ISSFRO - IN - the elements in the front surface side set |
| 24 |
C -- ISSBCK - IN - the elements in the back surface side set |
| 25 |
C -- NSSUR - IN - the number of nodes in the surface side set |
| 26 |
C -- NESUR - IN - the number of elements in the surface side set |
| 27 |
C -- NSSFRO - IN - the nodes in the front surface side set |
| 28 |
C -- NSSBCK - IN - the nodes in the back surface side set |
| 29 |
C -- IDESS - IN - the ids for each 2D set |
| 30 |
C -- NEES3 - IN - the number of elements for each 3D set |
| 31 |
C -- NNES3 - IN - the number of nodes for each 3D set |
| 32 |
C -- IXEES3 - IN - the index of the first element for each 3D set |
| 33 |
C -- IXNES3 - IN - the index of the first node for each 3D set |
| 34 |
C -- LTEES3 - IN - the elements for all 3D sets |
| 35 |
C -- LTSES3 - IN - the element sides for all 3D sets |
| 36 |
C -- LTNES3 - IN - the nodes for all 3D sets |
| 37 |
C -- FACES3 - IN - the distribution factors for all 3D sets |
| 38 |
C -- |
| 39 |
C --Common Variables: |
| 40 |
C -- Uses NDBOUT of /DBASE/ |
| 41 |
C -- Uses NUMESS, LESSEL, LESSNL of /DBNUMS/ |
| 42 |
C -- Uses LESSEO, LESSNO of /DBNUM3/ |
| 43 |
C -- Uses NNREPL, NEREPL of /PARAMS/ |
| 44 |
|
| 45 |
INCLUDE 'exodusII.inc' |
| 46 |
INCLUDE 'g3_dbase.blk' |
| 47 |
INCLUDE 'g3_dbnums.blk' |
| 48 |
INCLUDE 'g3_dbnum3.blk' |
| 49 |
|
| 50 |
REAL A(*) |
| 51 |
INTEGER IA(*) |
| 52 |
INTEGER IDFRO(0:*) |
| 53 |
INTEGER IDBCK(0:*) |
| 54 |
INTEGER ISSFRO(NESUR), ISSBCK(NESUR) |
| 55 |
INTEGER NSSFRO(*), NSSBCK(*) |
| 56 |
INTEGER IDESS(*) |
| 57 |
INTEGER NEES3(*) |
| 58 |
INTEGER NNES3(*) |
| 59 |
INTEGER IXEES3(*) |
| 60 |
INTEGER IXNES3(*) |
| 61 |
INTEGER LTEES3(*) |
| 62 |
INTEGER LTSES3(*) |
| 63 |
INTEGER LTNES3(*) |
| 64 |
REAL FACES3(*) |
| 65 |
|
| 66 |
LOGICAL ANYESS |
| 67 |
|
| 68 |
NFRO = IDFRO(0) |
| 69 |
NBCK = IDBCK(0) |
| 70 |
ANYESS = (NFRO .GT. 0) .OR. (NBCK .GT. 0) .OR. (NUMESS .GT. 0) |
| 71 |
|
| 72 |
C --Write 3D |
| 73 |
iend = 0 |
| 74 |
do 10 iss = 1, numess |
| 75 |
istart = iend + 1 |
| 76 |
iend = istart + nnes3(iss) - 1 |
| 77 |
call expsp (ndbout, idess(iss), nees3(iss), nnes3(iss), ierr) |
| 78 |
if (ierr .lt. 0) then |
| 79 |
call exerr('gen3d2', 'Error from expsp', exlmsg) |
| 80 |
go to 40 |
| 81 |
endif |
| 82 |
call expss (ndbout, idess(iss), ltees3(ixees3(iss)), |
| 83 |
& ltses3(ixees3(iss)), ierr) |
| 84 |
if (ierr .lt. 0) then |
| 85 |
call exerr('gen3d2', 'Error from expss', exlmsg) |
| 86 |
go to 40 |
| 87 |
endif |
| 88 |
call expssd(ndbout, idess(iss), faces3(istart), ierr) |
| 89 |
if (ierr .lt. 0) then |
| 90 |
call exerr('gen3d2', 'Error from expssd', exlmsg) |
| 91 |
go to 40 |
| 92 |
endif |
| 93 |
10 continue |
| 94 |
|
| 95 |
C ... Assume distribution factors are 1.0 for all front and back sidesets |
| 96 |
C Need to build a temporary array to hold the '1.0's |
| 97 |
C The size of the array is MAX(NSSFRO, NSSBCK) |
| 98 |
if (nfro .gt. 0 .or. nbck .gt. 0) then |
| 99 |
call mdrsrv('TDIST', ktdist, nssur) |
| 100 |
call mdrsrv('ISIDE', kiside, nesur) |
| 101 |
CALL MDSTAT (NERR, MEM) |
| 102 |
IF (NERR .GT. 0) GOTO 40 |
| 103 |
call inirea(nssur, 1.0, a(ktdist)) |
| 104 |
C ... Front sidesets are surface 6 |
| 105 |
call iniint(nesur, 6, ia(kiside)) |
| 106 |
C ... If the element number is negative, then we use surface 5 |
| 107 |
C See newess for the code that sets the element number negative |
| 108 |
if (nfro .gt. 0) then |
| 109 |
do i = 1, nesur |
| 110 |
if (issfro(i) .lt. 0) then |
| 111 |
ia(kiside+i-1) = 5 |
| 112 |
issfro(i) = -issfro(i) |
| 113 |
end if |
| 114 |
end do |
| 115 |
|
| 116 |
end if |
| 117 |
do iss = 1, nfro |
| 118 |
call expsp (ndbout, idfro(iss), nesur, nssur, ierr) |
| 119 |
if (ierr .lt. 0) then |
| 120 |
call exerr('gen3d2', 'Error from expsp', exlmsg) |
| 121 |
go to 40 |
| 122 |
endif |
| 123 |
call expss (ndbout, idfro(iss), issfro, ia(kiside), ierr) |
| 124 |
if (ierr .lt. 0) then |
| 125 |
call exerr('gen3d2', 'Error from expss', exlmsg) |
| 126 |
go to 40 |
| 127 |
endif |
| 128 |
call expssd(ndbout, idfro(iss), a(ktdist), ierr) |
| 129 |
if (ierr .lt. 0) then |
| 130 |
call exerr('gen3d2', 'Error from expssd', exlmsg) |
| 131 |
go to 40 |
| 132 |
endif |
| 133 |
end do |
| 134 |
|
| 135 |
C ... Back sidesets are surface 5 |
| 136 |
call iniint(nesur, 5, ia(kiside)) |
| 137 |
C ... If the element number is negative, then we use surface 4 |
| 138 |
C See newess for the code that sets the element number negative |
| 139 |
if (nbck .gt. 0) then |
| 140 |
do i = 1, nesur |
| 141 |
if (issbck(i) .lt. 0) then |
| 142 |
ia(kiside+i-1) = 4 |
| 143 |
issbck(i) = -issbck(i) |
| 144 |
end if |
| 145 |
end do |
| 146 |
end if |
| 147 |
|
| 148 |
do iss = 1, nbck |
| 149 |
call expsp (ndbout, idbck(iss), nesur, nssur, ierr) |
| 150 |
if (ierr .lt. 0) then |
| 151 |
call exerr('gen3d2', 'Error from expsp', exlmsg) |
| 152 |
go to 40 |
| 153 |
endif |
| 154 |
call expss (ndbout, idbck(iss), issbck, ia(kiside), ierr) |
| 155 |
if (ierr .lt. 0) then |
| 156 |
call exerr('gen3d2', 'Error from expss', exlmsg) |
| 157 |
go to 40 |
| 158 |
endif |
| 159 |
call expssd(ndbout, idbck(iss), a(ktdist), ierr) |
| 160 |
if (ierr .lt. 0) then |
| 161 |
call exerr('gen3d2', 'Error from expssd', exlmsg) |
| 162 |
go to 40 |
| 163 |
endif |
| 164 |
end do |
| 165 |
call mddel('TDIST') |
| 166 |
call mddel('ISIDE') |
| 167 |
end if |
| 168 |
|
| 169 |
RETURN |
| 170 |
C ... Control passes here if any memory or other errors |
| 171 |
40 continue |
| 172 |
return 1 |
| 173 |
END |