| 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 |
*DECK,TRUTBL |
| 9 |
SUBROUTINE TRUTBL(MP,IMP,IDA,IDB,ITRTA,ITRTB) |
| 10 |
|
| 11 |
C ****************************************************************** |
| 12 |
|
| 13 |
C SUBROUTINE TO BUILD THE TRUTH TABLE FOR THE RECIPIENT MESH |
| 14 |
C THIS IMPROVES (SPEEDS-UP) THE PROCESS OF WRITING ELEMENT |
| 15 |
C VARIABLES |
| 16 |
|
| 17 |
C Called by MAPVAR |
| 18 |
|
| 19 |
C ****************************************************************** |
| 20 |
|
| 21 |
C MP INT Array of element block mapping from donor |
| 22 |
C mesh to recipient mesh (1:2,1:IMP) |
| 23 |
C IMP INT Number of entries in MP |
| 24 |
C IDA INT Donor mesh element block I.D. (1:nblksa) |
| 25 |
C IDB INT Recipient mesh element block I.D. (1:nblksa) |
| 26 |
C ITRTA INT Donor mesh truth table (1:nvarel,1:nblksa) |
| 27 |
C ITRTB INT Recipient mesh truth table (1:nvarel,1:nblksb) |
| 28 |
|
| 29 |
C ****************************************************************** |
| 30 |
|
| 31 |
include 'aexds1.blk' |
| 32 |
include 'amesh.blk' |
| 33 |
include 'bmesh.blk' |
| 34 |
include 'ex2tp.blk' |
| 35 |
include 'tapes.blk' |
| 36 |
|
| 37 |
DIMENSION MP(3,*),IDA(*),IDB(*),ITRTA(NVAREL,*),ITRTB(NVAREL,*) |
| 38 |
|
| 39 |
C ****************************************************************** |
| 40 |
|
| 41 |
C ... For later sanity check |
| 42 |
do 2 iblkb = 1, nblksb |
| 43 |
do 1 ivar = 1, nvarel |
| 44 |
itrtb(ivar,iblkb) = -999 |
| 45 |
1 continue |
| 46 |
2 continue |
| 47 |
|
| 48 |
CALL EXGVTT (NTP2EX,NBLKSA,NVAREL,ITRTA,IERR) |
| 49 |
|
| 50 |
C Match element block I.D.'s from donor and recipient mesh |
| 51 |
|
| 52 |
DO 10 IBLKB = 1, NBLKSB |
| 53 |
IDBLKB = IDB(IBLKB) |
| 54 |
DO 20 IBLKA = 1, NBLKSA |
| 55 |
IDBLKA = IDA(IBLKA) |
| 56 |
DO 30 IM = 1, IMP |
| 57 |
IF (IDBLKB .EQ. MP(2,IM) .AND. IDBLKA .EQ. MP(1,IM))THEN |
| 58 |
DO 40 IVAR = 1, NVAREL |
| 59 |
ITRTB(IVAR,IBLKB) = ITRTA(IVAR,IBLKA) |
| 60 |
40 CONTINUE |
| 61 |
GO TO 20 |
| 62 |
END IF |
| 63 |
30 CONTINUE |
| 64 |
20 CONTINUE |
| 65 |
10 CONTINUE |
| 66 |
|
| 67 |
C Do some error checking - write a warning |
| 68 |
|
| 69 |
DO 50 IBLKB = 1, NBLKSB |
| 70 |
IFND = 0 |
| 71 |
IDBLKB = IDB(IBLKB) |
| 72 |
DO 60 IM = 1, IMP |
| 73 |
IF (IDBLKB .EQ. MP(2,IM))THEN |
| 74 |
IFND = 1 |
| 75 |
END IF |
| 76 |
60 CONTINUE |
| 77 |
IF (IFND .EQ. 0)THEN |
| 78 |
DO 70 IVAR = 1, NVAREL |
| 79 |
ITRTB(IVAR,IBLKB) = 0 |
| 80 |
70 CONTINUE |
| 81 |
WRITE(NOUT,1000)IBLKB,IDBLKB |
| 82 |
WRITE(NTPOUT,1000)IBLKB,IDBLKB |
| 83 |
END IF |
| 84 |
50 CONTINUE |
| 85 |
|
| 86 |
C ... Sanity check |
| 87 |
do 90 iblkb = 1, nblksb |
| 88 |
do 80 ivar = 1, nvarel |
| 89 |
if (itrtb(ivar,iblkb) .eq. -999) then |
| 90 |
idblkb = idb(iblkb) |
| 91 |
write(nout, 1010) iblkb, idblkb, ivar |
| 92 |
write(ntpout, 1010) iblkb, idblkb, ivar |
| 93 |
end if |
| 94 |
80 continue |
| 95 |
90 continue |
| 96 |
|
| 97 |
CALL EXPVTT(NTP4EX,NBLKSB,NVAREL,ITRTB,IERR) |
| 98 |
|
| 99 |
1000 FORMAT(5X,'MAPPING BACK INTO DONOR MESH FOR',/, |
| 100 |
1' RECIPIENT MESH ELEMENT BLOCK NUMBER',I7,/, |
| 101 |
2' ELEMENT BLOCK I. D.',I7,/, |
| 102 |
3' WAS NOT FOUND. THIS ELEMENT BLOCK WILL',/, |
| 103 |
4' NOT BE MAPPED.') |
| 104 |
1010 FORMAT(5X,'Block Number ', i7, /, |
| 105 |
1 'Element Block ID ', i7,/, |
| 106 |
2 'Has unset truth table entry for variable ',i7) |
| 107 |
RETURN |
| 108 |
END |