elebd.f

Go to the documentation of this file.
00001 C:\opentelemac\v7p0\sources\utils\bief\elebd.f
00002 !
00088                      SUBROUTINE ELEBD
00089 !                    ****************
00090 !
00091      &(NELBOR,NULONE,KP1BOR,IFABOR,NBOR,IKLE,SIZIKL,IKLBOR,NELEM,NELMAX,
00092      & NPOIN,NPTFR,IELM,LIHBOR,KLOG,IFANUM,OPTASS,ISEG,T1,T2,T3,NELEBX,
00093      & NELEB)
00094 !
00095 !***********************************************************************
00096 ! BIEF   V7P0                                   21/08/2010
00097 !***********************************************************************
00098 !
00099 !
00100 !
00101 !
00102 !
00103 !
00104 !
00105 !
00106 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00107 !| IELM           |-->| TYPE D'ELEMENT.
00108 !|                |   | 11 : TRIANGLES.
00109 !|                |   | 21 : QUADRILATERES.
00110 !| IFABOR         |-->| TABLEAU DES VOISINS DES FACES.
00111 !| IFANUM         |---|
00112 !| IKLBOR         |<--| CONNECTIVITY TABLE OF BOUNDARY ELEMENTS
00113 !| IKLE           |-->| NUMEROS GLOBAUX DES POINTS DE CHAQUE ELEMENT.
00114 !| ISEG           |---|
00115 !| KLOG           |-->| CONVENTION POUR LA CONDITION LIMITE DE PAROI
00116 !| KP1BOR         |<--| NUMERO DU POINT SUIVANT LE POINT DE BORD K.
00117 !| LIHBOR         |-->| TYPES DE CONDITIONS AUX LIMITES SUR H
00118 !| NBOR           |-->| NUMERO GLOBAL DU POINT DE BORD K.
00119 !| NELBOR         |<--| NUMERO DE L'ELEMENT ADJACENT AU KIEME SEGMENT
00120 !| NELEM          |-->| NOMBRE TOTAL D'ELEMENTS DANS LE MAILLAGE.
00121 !| NELMAX         |-->| MAXIMUM NUMBER OF ELEMENTS
00122 !| NPOIN          |-->| NOMBRE TOTAL DE POINTS DU DOMAINE.
00123 !| NPTFR          |-->| NOMBRE DE POINTS FRONTIERES.
00124 !| NULONE         |<--| NUMERO LOCAL D'UN POINT DE BORD DANS
00125 !|                |   | L'ELEMENT ADJACENT DONNE PAR NELBOR
00126 !| OPTASS         |-->| OPTION FOR MATRIX STORAGE
00127 !|                |   | 1: EBE  3:EDGE-BASED
00128 !| SIZIKL         |-->| FIRST DIMENSION OF IKLE
00129 !| T2             |---|
00130 !| T3             |---|
00131 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00132 !
00133       USE BIEF, EX_ELEBD => ELEBD
00134 !
00135       IMPLICIT NONE
00136       INTEGER LNG,LU
00137       COMMON/INFO/LNG,LU
00138 !
00139 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
00140 !
00141       INTEGER, INTENT(IN)    :: KLOG,NELMAX,NELEM,SIZIKL,NELEBX
00142       INTEGER, INTENT(INOUT) :: NELEB
00143       INTEGER, INTENT(IN)    :: NPOIN,NPTFR,IELM,OPTASS
00144       INTEGER, INTENT(INOUT) :: NELBOR(NELEBX),NULONE(NELEBX,2)
00145       INTEGER, INTENT(INOUT) :: KP1BOR(NPTFR,2)
00146       INTEGER, INTENT(INOUT) :: NBOR(*)
00147       INTEGER, INTENT(INOUT) :: IFABOR(NELMAX,*)
00148       INTEGER, INTENT(IN)    :: IKLE(SIZIKL,*)
00149       INTEGER, INTENT(IN)    :: LIHBOR(NPTFR)
00150       INTEGER, INTENT(INOUT) :: IKLBOR(NELEBX,2)
00151       INTEGER, INTENT(INOUT) :: IFANUM(NELMAX,*)
00152       INTEGER, INTENT(IN)    :: ISEG(NPTFR)
00153       INTEGER, INTENT(INOUT) :: T1(NPOIN),T2(NPOIN),T3(NPOIN)
00154 !
00155 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
00156 !
00157       INTEGER IELEM,NFACE,NPT,KEL,IPOIN
00158       INTEGER K,IFACE,I1,I2,N1,N2,IPT,IEL,I,K1,K2
00159 !
00160       INTEGER SOMFAC(2,4,2)
00161 !
00162       DATA SOMFAC / 1,2 , 2,3 , 3,1 , 0,0   ,  1,2 , 2,3 , 3,4 , 4,1 /
00163 !
00164 !-----------------------------------------------------------------------
00165 !
00166       IF(IELM.EQ.11.OR.IELM.EQ.41.OR.IELM.EQ.51) THEN
00167 !       TRIANGLES
00168         NFACE = 3
00169         NPT = 3
00170         KEL = 1
00171       ELSE
00172         IF(LNG.EQ.1) WRITE(LU,900) IELM
00173         IF(LNG.EQ.2) WRITE(LU,901) IELM
00174 900     FORMAT(1X,'ELEBD : IELM=',1I6,' TYPE D''ELEMENT INCONNU')
00175 901     FORMAT(1X,'ELEBD: IELM=',1I6,' UNKNOWN TYPE OF ELEMENT')
00176         CALL PLANTE(1)
00177         STOP
00178       ENDIF
00179 !
00180 !  INITIALISES T1,2,3 TO 0
00181 !
00182       DO IPOIN=1,NPOIN
00183         T1(IPOIN) = 0
00184         T2(IPOIN) = 0
00185         T3(IPOIN) = 0
00186       ENDDO
00187 !
00188 !  STORES K IN TRAV(*,3), ADDRESS NBOR(K)
00189 !  GIVES CORRESPONDENCE GLOBAL --> BOUNDARY NUMBER
00190 !
00191       DO K = 1, NPTFR
00192         T3(NBOR(K)) = K
00193       ENDDO
00194 !
00195 !  LOOP ON ALL THE FACES OF ALL THE ELEMENTS:
00196 !
00197       DO IFACE = 1 , NFACE
00198         DO IELEM = 1 , NELEM
00199           IF(IFABOR(IELEM,IFACE).EQ.-1) THEN
00200 !           THIS IS A TRUE BOUNDARY FACE
00201 !           INTERNAL FACES ARE MARKED WITH -2 IN PARALLELE MODE
00202 !           GLOBAL NUMBERS OF THE FACE POINTS :
00203             I1 = IKLE( IELEM , SOMFAC(1,IFACE,KEL) )
00204             I2 = IKLE( IELEM , SOMFAC(2,IFACE,KEL) )
00205 !           STORES IN T1 AND T2 (ADDRESS I1) : I2 AND IELEM
00206             T1(I1) = I2
00207             T2(I1) = IELEM
00208 !           A LIQUID FACE IS RECOGNIZED BY THE BOUNDARY CONDITION ON H
00209             IF(NPTFR.GT.0) THEN
00210               IF(T3(I1).NE.0.AND.T3(I2).NE.0) THEN
00211                 IF(LIHBOR(T3(I1)).NE.KLOG.AND.
00212      &             LIHBOR(T3(I2)).NE.KLOG) THEN
00213 !                 LIQUID FACE : IFABOR=0  SOLID FACE : IFABOR=-1
00214                   IFABOR(IELEM,IFACE)=0
00215                 ENDIF
00216               ELSE
00217                 IF(LNG.EQ.1) THEN
00218                   IF(T3(I1).EQ.0) THEN
00219                     WRITE(LU,*) 'LE POINT ',I1,' EST SUR UN BORD'
00220                   ENDIF
00221                   IF(T3(I2).EQ.0) THEN
00222                     WRITE(LU,*) 'LE POINT ',I2,' EST SUR UN BORD'
00223                   ENDIF
00224                   WRITE(LU,*) 'MAIS PAS DANS LA LISTE DES POINTS DE'
00225                   WRITE(LU,*) 'BORD OU BIEN LE NOMBRE DE LIGNES DU'
00226                   WRITE(LU,*) 'FICHIER DES CONDITIONS AUX LIMITES'
00227                   WRITE(LU,*) 'EST PLUS GRAND QUE :',NPTFR
00228                   WRITE(LU,*) 'TROUVE DANS LE FICHIER DE GEOMETRIE'
00229                 ELSEIF(LNG.EQ.2) THEN
00230                   IF(T3(I1).EQ.0) THEN
00231                     WRITE(LU,*) 'POINT ',I1,' IS ON A BOUNDARY'
00232                   ENDIF
00233                   IF(T3(I2).EQ.0) THEN
00234                     WRITE(LU,*) 'POINT ',I2,' IS ON A BOUNDARY'
00235                   ENDIF
00236                   WRITE(LU,*) 'BUT NOT IN THE LIST OF BOUNDARY POINTS'
00237                   WRITE(LU,*) 'OR THE NUMBER OF LINES IN THE BOUNDARY'
00238                   WRITE(LU,*) 'CONDITIONS FILE IS GREATER THAN:',NPTFR
00239                   WRITE(LU,*) 'NUMBER TAKEN IN THE GEOMETRY FILE'
00240                 ENDIF
00241                 CALL PLANTE(1)
00242                 STOP
00243               ENDIF
00244             ENDIF
00245 !
00246           ENDIF
00247         ENDDO ! IELEM
00248       ENDDO ! IFACE
00249 !
00250 !     LOOP ON ALL THE POINTS:
00251 !
00252       IF(NPTFR.GT.0) THEN
00253         DO I = 1 , NPOIN
00254           IF(T1(I).NE.0) THEN
00255 !           FOLLOWING POINT
00256             KP1BOR(T3(I),1)=T3(T1(I))
00257 !           PRECEDING POINT
00258             KP1BOR(T3(T1(I)),2)=T3(I)
00259             NELBOR(T3(I))=T2(I)
00260           ENDIF
00261         ENDDO
00262       ENDIF
00263 !
00264 !     DUMMY VALUES IN KP1BOR WHEN THE FOLLOWING POINT IS IN ANOTHER SUB-DOMAIN
00265 !     NELBOR AND NULONE SET TO 0
00266 !
00267       IF(NCSIZE.GT.1) THEN
00268         DO K1=1,NPTFR
00269           IF(ISEG(K1).GT.0) THEN
00270             KP1BOR(K1,1)=K1
00271             NELBOR(K1)=0
00272             NULONE(K1,1)=0
00273             NULONE(K1,2)=0
00274           ELSEIF(ISEG(K1).EQ.-9999) THEN
00275             KP1BOR(K1,1)=K1
00276             KP1BOR(K1,2)=K1
00277             NELBOR(K1)  =0
00278             NULONE(K1,1)=0
00279             NULONE(K1,2)=0
00280           ELSEIF(ISEG(K1).LT.0) THEN
00281             KP1BOR(K1,2)=K1
00282           ENDIF
00283         ENDDO
00284       ENDIF
00285 !
00286 ! COMPUTES ARRAY NULONE
00287 !
00288       DO K1=1,NPTFR
00289 !
00290       IF(NCSIZE.GT.1) THEN
00291         IF(ISEG(K1).GT.0.OR.ISEG(K1).EQ.-9999) CYCLE
00292       ENDIF
00293 !
00294       K2=KP1BOR(K1,1)
00295       IEL = NELBOR(K1)
00296       N1  = NBOR(K1)
00297       N2  = NBOR(K2)
00298 !
00299       I1 = 0
00300       I2 = 0
00301 !
00302       DO IPT=1,NPT
00303         IF(IKLE(IEL,IPT).EQ.N1) THEN
00304           NULONE(K1,1) = IPT
00305           I1 = 1
00306         ENDIF
00307         IF(IKLE(IEL,IPT).EQ.N2) THEN
00308           NULONE(K1,2) = IPT
00309           I2 = 1
00310         ENDIF
00311       ENDDO
00312 !
00313       IF(I1.EQ.0.OR.I2.EQ.0) THEN
00314         IF(LNG.EQ.1) WRITE(LU,810) IPT,K1,IEL
00315         IF(LNG.EQ.2) WRITE(LU,811) IPT,K1,IEL
00316 810     FORMAT(1X,'ELEBD: ERREUR AU POINT : ',I10                    ,/,
00317      &         1X,'       LE POINT DE BORD :',I10                    ,/,
00318      &         1X,'       N''APPARTIENT PAS A L''ELEMENT : ',I10     ,/,
00319      &         1X,'       CAUSES POSSIBLES :  '                      ,/,
00320      &         1X,'       LE FICHIER DES CONDITIONS AUX LIMITES NE'  ,/,
00321      &         1X,'       CORRESPOND PAS AU FICHIER DE GEOMETRIE  '  ,/,
00322      &         1X,'       OU LE MAILLAGE A UNE TOPOLOGIE DEFECTUEUSE')
00323 811     FORMAT(1X,'ELEBD: ERROR AT POINT:',    I10                   ,/,
00324      &         1X,'       THE BOUNDARY POINT:',I10                   ,/,
00325      &         1X,'       DOES NOT BELONG TO ELEMENT : ',I10         ,/,
00326      &         1X,'       POSSIBLE REASONS:'                         ,/,
00327      &         1X,'       THE BOUNDARY CONDITION FILE IS NOT      '  ,/,
00328      &         1X,'       RELEVANT TO THE GEOMETRY FILE           '  ,/,
00329      &         1X,'       OR THE MESH HAS A WRONG TOPOLOGY')
00330         CALL PLANTE(1)
00331         STOP
00332       ENDIF
00333 !
00334       ENDDO ! K1
00335 !
00336 !     COMPUTES IKLBOR : LIKE IKLE FOR BOUNDARY POINTS, WITH BOUNDARY
00337 !                       POINTS NUMBERING
00338 !
00339 !                       IN 3D WILL BE REDONE IN OTHER ELEB.. ROUTINES
00340 !
00341 !     IF(IELM.NE.41.AND.IELM.NE.51) THEN
00342       DO K=1,NPTFR
00343         IKLBOR(K,1) = K
00344         IKLBOR(K,2) = KP1BOR(K,1)
00345       ENDDO
00346 !     ENDIF
00347 !
00348 !-----------------------------------------------------------------------
00349 !
00350 !     VERSION 7.0: NOW RENUMBERING IN PARALLEL TO AVOID HOLES IN SEGMENT
00351 !                  NUMBERING. NELEB BECOMES THE REAL NUMBER OF BOUNDARY
00352 !                  ELEMENTS
00353 !
00354       IF(NCSIZE.GT.1) THEN
00355         NELEB=0
00356         DO K=1,NPTFR
00357           IF(KP1BOR(K,1).NE.K) THEN
00358             NELEB=NELEB+1
00359             NELBOR(NELEB)  =NELBOR(K)
00360             NULONE(NELEB,1)=NULONE(K,1)
00361             NULONE(NELEB,2)=NULONE(K,2)
00362             IKLBOR(NELEB,1)=IKLBOR(K,1)
00363             IKLBOR(NELEB,2)=IKLBOR(K,2)
00364           ENDIF
00365         ENDDO
00366       ELSE
00367         NELEB=NPTFR
00368       ENDIF
00369 !
00370 !-----------------------------------------------------------------------
00371 !
00372       RETURN
00373       END

Generated on Fri Aug 31 2013 18:12:58 by S.E.Bourban (HRW) using doxygen 1.7.0