| 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 CKELB (NELBLK, NUMEL, NUMNP, EBTYPE, |
| 8 |
& IDELB, NUMELB, NUMLNK, NUMATR, LINK, ATRIB, ATNAME, |
| 9 |
& NODUSE, MAPNO) |
| 10 |
C======================================================================= |
| 11 |
|
| 12 |
C --*** CKELB *** (EXPLORE) Check database element blocks |
| 13 |
C -- |
| 14 |
C --CKELB checks the element block information. |
| 15 |
C -- |
| 16 |
C --Parameters: |
| 17 |
C -- NELBLK - IN - the number of element blocks |
| 18 |
C -- NUMEL - IN - the number of elements in all blocks |
| 19 |
C -- NUMNP - IN - the number of nodes |
| 20 |
C -- IDELB - IN - the element block ID for each block |
| 21 |
C -- NUMELB - IN - the number of elements for each block |
| 22 |
C -- NUMLNK - IN - the number of nodes per element for each block |
| 23 |
C -- NUMATR - IN - the number of attributes for each block |
| 24 |
C -- LINK - IN - the connectivity array |
| 25 |
C -- ATRIB - IN - the attribute array |
| 26 |
|
| 27 |
include 'exp_errcnt.blk' |
| 28 |
include 'exodusII.inc' |
| 29 |
INTEGER IDELB(*) |
| 30 |
INTEGER NUMELB(*) |
| 31 |
INTEGER NUMLNK(*) |
| 32 |
INTEGER NUMATR(*) |
| 33 |
INTEGER LINK(*) |
| 34 |
REAL ATRIB(*) |
| 35 |
INTEGER NODUSE(*) |
| 36 |
INTEGER MAPNO(*) |
| 37 |
CHARACTER*(MXSTLN) EBTYPE(*) |
| 38 |
CHARACTER*(*) ATNAME(*) |
| 39 |
|
| 40 |
CHARACTER*99 STRA |
| 41 |
CHARACTER*99 STRB |
| 42 |
|
| 43 |
if (numel .eq. 0 .and. nelblk .eq. 0) return |
| 44 |
|
| 45 |
C --Check for unique identifier |
| 46 |
|
| 47 |
DO 100 IELB = 1, NELBLK |
| 48 |
IF (LOCINT (IDELB(IELB), IELB-1, IDELB) .GT. 0) THEN |
| 49 |
CALL INTSTR (1, 0, IDELB(IELB), STRA, LSTRA) |
| 50 |
CALL PRTERR ('CMDSPEC', |
| 51 |
& 'Element block ID ' // STRA(:LSTRA) // ' is not unique') |
| 52 |
END IF |
| 53 |
100 CONTINUE |
| 54 |
|
| 55 |
iatoff = 0 |
| 56 |
do ielb = 1, nelblk |
| 57 |
do natr = 1, numatr(ielb) |
| 58 |
if (atname(iatoff+natr)(1:1) .ne. ' ') then |
| 59 |
do jatr = natr+1, numatr(ielb) |
| 60 |
if (atname(iatoff+natr) .eq. atname(iatoff+jatr)) then |
| 61 |
CALL INTSTR (1, 0, IDELB(IELB), STRA, LSTRA) |
| 62 |
CALL PRTERR ('CMDSPEC', |
| 63 |
& 'Attribute name "'// |
| 64 |
* ATNAME(iatoff+NATR)(:LENSTR(ATNAME(iatoff+NATR))) // |
| 65 |
* '" in Element block ID ' // STRA(:LSTRA) |
| 66 |
* // ' is not unique') |
| 67 |
end if |
| 68 |
end do |
| 69 |
end if |
| 70 |
end do |
| 71 |
iatoff = iatoff + numatr(ielb) |
| 72 |
end do |
| 73 |
|
| 74 |
C --Check that the number of elements in element blocks is equal to the total |
| 75 |
C --number of elements |
| 76 |
|
| 77 |
NELB = INTADD (NELBLK, NUMELB) |
| 78 |
IF (NELB .NE. NUMEL) THEN |
| 79 |
CALL PRTERR ('CMDSPEC', |
| 80 |
* 'Sum of elements in all element blocks does not match total') |
| 81 |
END IF |
| 82 |
|
| 83 |
C --Check the connectivity for each element block |
| 84 |
|
| 85 |
C .. Initialize noduse array to 0. |
| 86 |
call iniint (numnp, 0, noduse) |
| 87 |
|
| 88 |
IEL0 = 0 |
| 89 |
ISLNK = 1 |
| 90 |
DO 110 IELB = 1, NELBLK |
| 91 |
if (ebtype(ielb) .eq. 'nsided' .or. |
| 92 |
* ebtype(ielb) .eq. 'NSIDED') THEN |
| 93 |
CALL CKEB1 (IEL0, |
| 94 |
& IELB, IDELB(IELB), 1, NUMLNK(IELB), NUMNP, |
| 95 |
& LINK(ISLNK), noduse) |
| 96 |
ISLNK = ISLNK + NUMLNK(IELB) |
| 97 |
else |
| 98 |
CALL CKEB1 (IEL0, |
| 99 |
& IELB, IDELB(IELB), NUMELB(IELB), NUMLNK(IELB), NUMNP, |
| 100 |
& LINK(ISLNK), noduse) |
| 101 |
ISLNK = ISLNK + NUMLNK(IELB) * NUMELB(IELB) |
| 102 |
end if |
| 103 |
IEL0 = IEL0 + NUMELB(IELB) |
| 104 |
110 CONTINUE |
| 105 |
|
| 106 |
C ... Check whether all nodes have been specified in an elements connectivity. |
| 107 |
nerr = 0 |
| 108 |
DO 120 I = 1, numnp |
| 109 |
if (noduse(i) .ne. 1) then |
| 110 |
if (nerr .lt. maxerrs .or. maxerrs .le. 0) then |
| 111 |
CALL INTSTR (1, 0, I, STRA, LSTRA) |
| 112 |
CALL INTSTR (1, 0, MAPNO(I), STRB, LSTRB) |
| 113 |
CALL PRTERR ('CMDSPEC', |
| 114 |
& 'Local Node ' // STRA(:LSTRA) // |
| 115 |
$ ' (Global Node ' // STRB(:LSTRB) // |
| 116 |
& ') is not connected to any elements') |
| 117 |
else if (nerr .eq. maxerrs .and. maxerrs .gt. 0) then |
| 118 |
call prterr('CMDSPEC', |
| 119 |
$ '...skipping additional errors...'// |
| 120 |
* ' (use command "maxerr #" to change)') |
| 121 |
end if |
| 122 |
nerr = nerr + 1 |
| 123 |
end if |
| 124 |
120 continue |
| 125 |
if (nerr .gt. 0) then |
| 126 |
write (stra, 10020) nerr |
| 127 |
call sqzstr(stra, lstra) |
| 128 |
CALL PRTERR ('CMDSPEC', STRA(:lstra)) |
| 129 |
end if |
| 130 |
10020 FORMAT('NODE USE ERROR: Found ',I12, |
| 131 |
$ ' nodes that are not connected to any elements.') |
| 132 |
RETURN |
| 133 |
END |