mt02aa.f

Go to the documentation of this file.
00001 C:\opentelemac\v7p0\sources\utils\bief\mt02aa.f
00002 !
00063                      SUBROUTINE MT02AA
00064 !                    *****************
00065 !
00066      &( A11 , A12 , A13 ,
00067      &        A22 , A23 ,
00068      &              A33 ,
00069      &  XMUL,SU,U,SV,V,
00070      &  XEL,YEL,SURFAC,IKLE1,IKLE2,IKLE3,NELEM,NELMAX,FORMUL)
00071 !
00072 !***********************************************************************
00073 ! BIEF   V6P1                                   21/08/2010
00074 !***********************************************************************
00075 !
00076 !
00077 !
00078 !
00079 !
00080 !
00081 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00082 !| A11            |<--| ELEMENTS OF MATRIX
00083 !| A12            |<--| ELEMENTS OF MATRIX
00084 !| A13            |<--| ELEMENTS OF MATRIX
00085 !| A22            |<--| ELEMENTS OF MATRIX
00086 !| A23            |<--| ELEMENTS OF MATRIX
00087 !| A33            |<--| ELEMENTS OF MATRIX
00088 !| FORMUL         |-->| FORMULA DESCRIBING THE MATRIX
00089 !| IKLE1          |-->| FIRST POINTS OF TRIANGLES
00090 !| IKLE2          |-->| SECOND POINTS OF TRIANGLES
00091 !| IKLE3          |-->| THIRD POINTS OF TRIANGLES
00092 !| NELEM          |-->| NUMBER OF ELEMENTS
00093 !| NELMAX         |-->| MAXIMUM NUMBER OF ELEMENTS
00094 !| SU             |-->| BIEF_OBJ STRUCTURE OF U
00095 !| SURFAC         |-->| AREA OF TRIANGLES
00096 !| SV             |-->| BIEF_OBJ STRUCTURE OF V
00097 !| U              |-->| FUNCTION U USED IN THE FORMULA
00098 !| V              |-->| FUNCTION V USED IN THE FORMULA
00099 !| XEL            |-->| ABSCISSAE OF POINTS IN THE MESH, PER ELEMENT
00100 !| YEL            |-->| ORDINATES OF POINTS IN THE MESH, PER ELEMENT
00101 !| XMUL           |-->| MULTIPLICATION FACTOR
00102 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00103 !
00104       USE BIEF, EX_MT02AA => MT02AA
00105 !
00106       IMPLICIT NONE
00107       INTEGER LNG,LU
00108       COMMON/INFO/LNG,LU
00109 !
00110 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
00111 !
00112       INTEGER, INTENT(IN) :: NELEM,NELMAX
00113       INTEGER, INTENT(IN) :: IKLE1(NELMAX),IKLE2(NELMAX),IKLE3(NELMAX)
00114 !
00115       DOUBLE PRECISION, INTENT(INOUT) :: A11(*),A12(*),A13(*)
00116       DOUBLE PRECISION, INTENT(INOUT) ::        A22(*),A23(*)
00117       DOUBLE PRECISION, INTENT(INOUT) ::               A33(*)
00118       DOUBLE PRECISION, INTENT(IN)    :: XMUL
00119       DOUBLE PRECISION, INTENT(IN)    :: U(*),V(*)
00120 !     STRUCTURE OF U
00121       TYPE(BIEF_OBJ), INTENT(IN)      :: SU,SV
00122       DOUBLE PRECISION, INTENT(IN)    :: XEL(NELMAX,3),YEL(NELMAX,3)
00123       DOUBLE PRECISION, INTENT(IN)    :: SURFAC(NELMAX)
00124       CHARACTER(LEN=16), INTENT(IN)   :: FORMUL
00125 !
00126 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
00127 !
00128 !     DECLARATIONS SPECIFIC TO THIS SUBROUTINE
00129 !
00130       INTEGER IELMNU,IELMNV,IELEM,ISO,IAD2,IAD3,I1,I2,I3
00131 !
00132       DOUBLE PRECISION X2,X3,Y2,Y3,S2D,VISC1,VISC2,VISC3,BPE,CPF,APD
00133       DOUBLE PRECISION AUX,X2X3,Y2Y3,X2AUX,Y2AUX,X3AUX,Y3AUX,X2MX3,Y2MY3
00134       DOUBLE PRECISION SOMVX,SOMVY,SOMVZ,XSUR12,XSUR48
00135       DOUBLE PRECISION G1,G2,G3,COEF1,COEF2,G123
00136 !
00137 !=======================================================================
00138 !
00139       XSUR12 = XMUL / 12.D0
00140       XSUR48 = XMUL / 48.D0
00141 !
00142 !     EXTRACTS THE TYPE OF ELEMENT FOR VISCOSITY
00143 !
00144       IELMNU=SU%ELM
00145       IELMNV=SV%ELM
00146       ISO = SU%DIM2
00147 !
00148       IF(IELMNU.EQ.10.AND.ISO.EQ.1) THEN
00149 !
00150 !-----------------------------------------------------------------------
00151 !
00152 !  P0 DISCRETISATION FOR ISOTROPIC VISCOSITY:
00153 !
00154       DO IELEM = 1 , NELEM
00155 !
00156 !   INITIALISES THE GEOMETRICAL VARIABLES
00157 !
00158         X2  =  XEL(IELEM,2)
00159         X3  =  XEL(IELEM,3)
00160 !
00161         Y2  =  YEL(IELEM,2)
00162         Y3  =  YEL(IELEM,3)
00163 !
00164 !   INITIALISES THE INTERMEDIATE VARIABLES
00165 !
00166         S2D   = XMUL*0.25D0/SURFAC(IELEM)
00167         VISC1 = U(IELEM)*S2D
00168         BPE   = VISC1*(Y3**2 + X3**2)
00169         CPF   = VISC1*(Y2*Y3 + X2*X3)
00170         APD   = VISC1*(Y2**2 + X2**2)
00171 !
00172 !  DIAGONAL TERMS
00173 !
00174         A11(IELEM)= APD+BPE-2*CPF
00175         A22(IELEM)= BPE
00176         A33(IELEM)= APD
00177 !
00178 !  EXTRADIAGONAL TERMS
00179 !
00180         A12(IELEM)= CPF-BPE
00181         A13(IELEM)= CPF-APD
00182         A23(IELEM)=-CPF
00183 !
00184 !   END OF THE LOOP ON THE ELEMENTS
00185 !
00186       ENDDO ! IELEM
00187 !
00188 !-----------------------------------------------------------------------
00189 !
00190 !  P0 DISCRETISATIO FOR NONISOTROPIC VISCOSITY
00191 !
00192       ELSEIF(IELMNU.EQ.10.AND.ISO.EQ.3) THEN
00193 !
00194 !-----------------------------------------------------------------------
00195 !
00196 !  P0 DISCRETISATION FOR ISOTROPIC VISCOSITY:
00197 !
00198       DO IELEM = 1 , NELEM
00199 !
00200 !   INITIALISES THE GEOMETRICAL VARIABLES
00201 !
00202         X2  =  XEL(IELEM,2)
00203         X3  =  XEL(IELEM,3)
00204 !
00205         Y2  =  YEL(IELEM,2)
00206         Y3  =  YEL(IELEM,3)
00207 !
00208 !  INITIALISES THE INTERMEDIATE VARIABLES
00209 !
00210         S2D   = XMUL*0.25D0/SURFAC(IELEM)
00211         VISC1 = U(         IELEM)*S2D
00212         VISC2 = U(  NELMAX+IELEM)*S2D
00213         VISC3 = U(2*NELMAX+IELEM)*S2D
00214         BPE   = VISC1*Y3**2 + VISC2*X3**2
00215         CPF   = VISC1*Y2*Y3 + VISC2*X2*X3
00216         APD   = VISC1*Y2**2 + VISC2*X2**2
00217         X2MX3  = X2-X3
00218         Y2MY3  = Y2-Y3
00219 !
00220 !  EXTRADIAGONAL TERMS
00221 !
00222         A12(IELEM)= CPF-BPE   - ( Y2MY3*X3 + X2MX3*Y3 ) * VISC3
00223         A13(IELEM)= CPF-APD   + ( Y2MY3*X2 + X2MX3*Y2 ) * VISC3
00224         A23(IELEM)= -CPF      + ( X2*Y3    + X3*Y2    ) * VISC3
00225 !
00226 !  DIAGONAL TERMS
00227 !
00228         A11(IELEM) = - A12(IELEM) - A13(IELEM)
00229         A22(IELEM) = - A12(IELEM) - A23(IELEM)
00230         A33(IELEM) = - A13(IELEM) - A23(IELEM)
00231 !
00232 !   END OF THE LOOP ON THE ELEMENTS
00233 !
00234       ENDDO ! IELEM
00235 !
00236 !-----------------------------------------------------------------------
00237 !
00238       ELSEIF(IELMNU.EQ.11.AND.ISO.EQ.1) THEN
00239 !
00240 !-----------------------------------------------------------------------
00241 !
00242       IF(FORMUL(7:8).EQ.'UV'.AND.
00243      &   IELMNU.EQ.11.AND.IELMNV.EQ.11) THEN
00244 !
00245 !-----------------------------------------------------------------------
00246 !
00247       DO IELEM = 1 , NELEM
00248 !
00249 !   INITIALISES THE GEOMETRICAL VARIABLES
00250 !
00251         X2  =  XEL(IELEM,2)
00252         X3  =  XEL(IELEM,3)
00253 !
00254         Y2  =  YEL(IELEM,2)
00255         Y3  =  YEL(IELEM,3)
00256 !
00257 !   INITIALISES THE INTERMEDIATE VARIABLES
00258 !
00259         I1=IKLE1(IELEM)
00260         I2=IKLE2(IELEM)
00261         I3=IKLE3(IELEM)
00262 !
00263         G1=V(I1)
00264         G2=V(I2)
00265         G3=V(I3)
00266 !
00267         COEF1=XSUR48/SURFAC(IELEM)
00268         G123=G1+G2+G3
00269         COEF2=U(I1)*(G1+G123)+U(I2)*(G2+G123)+U(I3)*(G3+G123)
00270 !
00271 !  EXTRADIAGONAL TERMS
00272 !
00273         A12(IELEM)= (Y3*(Y2-Y3)+X3*(X2-X3))*COEF2*COEF1
00274         A13(IELEM)=-(Y2*(Y2-Y3)+X2*(X2-X3))*COEF2*COEF1
00275         A23(IELEM)=-(Y2*    Y3 +X2*    X3 )*COEF2*COEF1
00276 !
00277 !  DIAGONAL TERMS
00278 !
00279         A11(IELEM) = - A12(IELEM) - A13(IELEM)
00280         A22(IELEM) = - A12(IELEM) - A23(IELEM)
00281         A33(IELEM) = - A13(IELEM) - A23(IELEM)
00282 !
00283       ENDDO
00284 !
00285 !   END OF THE LOOP ON THE ELEMENTS
00286 !
00287       ELSE
00288 !
00289 !  P1 DISCRETISATION FOR VISCOSITY:
00290 !
00291       DO IELEM = 1 , NELEM
00292 !
00293 !   INITIALISES THE GEOMETRICAL VARIABLES
00294 !
00295         X2  =  XEL(IELEM,2)
00296         X3  =  XEL(IELEM,3)
00297 !
00298         Y2  =  YEL(IELEM,2)
00299         Y3  =  YEL(IELEM,3)
00300 !
00301 !   INITIALISES THE INTERMEDIATE VARIABLES
00302 !
00303         SOMVX = ( U(IKLE1(IELEM))
00304      &           +U(IKLE2(IELEM))
00305      &           +U(IKLE3(IELEM)) ) * XSUR12 / SURFAC(IELEM)
00306         X2X3  = X2 * X3  + Y2 * Y3
00307         X2AUX = X2*(-X2+X3)+Y2*(-Y2+Y3)
00308         X3AUX = X3*(-X2+X3)+Y3*(-Y2+Y3)
00309 !
00310 !  EXTRADIAGONAL TERMS
00311 !
00312         A12(IELEM) = - SOMVX * X3AUX
00313         A13(IELEM) =   SOMVX * X2AUX
00314         A23(IELEM) = - SOMVX * X2X3
00315 !
00316 !  DIAGONAL TERMS
00317 !
00318         A11(IELEM) = - A12(IELEM) - A13(IELEM)
00319         A22(IELEM) = - A12(IELEM) - A23(IELEM)
00320         A33(IELEM) = - A13(IELEM) - A23(IELEM)
00321 !
00322       ENDDO ! IELEM
00323 !
00324       ENDIF
00325 !
00326 !-----------------------------------------------------------------------
00327 !
00328 !  LINEAR DISCRETISATION FOR NONISOTROPIC VISCOSITY
00329 !
00330       ELSEIF(IELMNU.EQ.11.AND.ISO.EQ.3) THEN
00331 !
00332 !-----------------------------------------------------------------------
00333 !
00334 !  P1 DISCRETISATION FOR VISCOSITY:
00335 !
00336       IAD2 = SU%MAXDIM1
00337       IAD3 = 2*IAD2
00338 !
00339       DO IELEM = 1 , NELEM
00340 !
00341 !  INITIALISES THE GEOMETRICAL VARIABLES
00342 !
00343         X2  =  XEL(IELEM,2)
00344         X3  =  XEL(IELEM,3)
00345 !
00346         Y2  =  YEL(IELEM,2)
00347         Y3  =  YEL(IELEM,3)
00348 !
00349 !  INITIALISES THE INTERMEDIATE VARIABLES
00350 !
00351         SOMVX = U(IKLE1(IELEM)     )
00352      &        + U(IKLE2(IELEM)     )
00353      &        + U(IKLE3(IELEM)     )
00354         SOMVY = U(IKLE1(IELEM)+IAD2)
00355      &        + U(IKLE2(IELEM)+IAD2)
00356      &        + U(IKLE3(IELEM)+IAD2)
00357         SOMVZ = U(IKLE1(IELEM)+IAD3)
00358      &        + U(IKLE2(IELEM)+IAD3)
00359      &        + U(IKLE3(IELEM)+IAD3)
00360 !
00361 !   INITIALISES THE INTERMEDIATE VARIABLES
00362 !
00363         AUX = XSUR12 / SURFAC(IELEM)
00364         X2X3 = X2 * X3
00365         Y2Y3 = Y2 * Y3
00366         X2AUX = X2*(-X2+X3)
00367         Y2AUX = Y2*(-Y2+Y3)
00368         X3AUX = X3*(-X2+X3)
00369         Y3AUX = Y3*(-Y2+Y3)
00370         X2MX3 = X2-X3
00371         Y2MY3 = Y2-Y3
00372 !
00373 !  EXTRADIAGONAL TERMS
00374 !
00375         A12(IELEM) = (   - SOMVX * Y3AUX
00376      &                   - SOMVY * X3AUX
00377      &                   - Y2MY3*X3*SOMVZ
00378      &                   - X2MX3*Y3*SOMVZ ) * AUX
00379 !
00380         A13(IELEM) = (     SOMVX * Y2AUX
00381      &                   + SOMVY * X2AUX
00382      &                   + Y2MY3*X2*SOMVZ
00383      &                   + X2MX3*Y2*SOMVZ ) * AUX
00384 !
00385         A23(IELEM) = (   - SOMVX * Y2Y3
00386      &                   - SOMVY * X2X3
00387      &                   + SOMVZ*X3*Y2+SOMVZ*X2*Y3 ) * AUX
00388 !
00389 !  DIAGONAL TERMS
00390 !
00391         A11(IELEM) = - A12(IELEM) - A13(IELEM)
00392         A22(IELEM) = - A12(IELEM) - A23(IELEM)
00393         A33(IELEM) = - A13(IELEM) - A23(IELEM)
00394 !
00395       ENDDO ! IELEM
00396 !
00397 !-----------------------------------------------------------------------
00398 !
00399       ELSE
00400 !
00401         IF (LNG.EQ.1) WRITE(LU,10) IELMNU,ISO
00402         IF (LNG.EQ.2) WRITE(LU,11) IELMNU,ISO
00403 10      FORMAT(1X,'MT02AA (BIEF) : TYPE DE VISCOSITE NON PREVU : ',2I6)
00404 11      FORMAT(1X,
00405      &  'MT02AA (BIEF) : TYPE OF VISCOSITY NOT AVAILABLE : ',2I6)
00406         CALL PLANTE(1)
00407         STOP
00408 !
00409       ENDIF
00410 !
00411 !-----------------------------------------------------------------------
00412 !
00413       IF(FORMUL(14:16).EQ.'MON') THEN
00414         IF(XMUL.GT.0.D0) THEN
00415           DO IELEM=1,NELEM
00416             A12(IELEM)=MIN(A12(IELEM),0.D0)
00417             A13(IELEM)=MIN(A13(IELEM),0.D0)
00418             A23(IELEM)=MIN(A23(IELEM),0.D0)
00419 !           DIAGONAL TERMS REDONE
00420             A11(IELEM) = - A12(IELEM) - A13(IELEM)
00421             A22(IELEM) = - A12(IELEM) - A23(IELEM)
00422             A33(IELEM) = - A13(IELEM) - A23(IELEM)
00423           ENDDO
00424         ELSE
00425           DO IELEM=1,NELEM
00426             A12(IELEM)=MAX(A12(IELEM),0.D0)
00427             A13(IELEM)=MAX(A13(IELEM),0.D0)
00428             A23(IELEM)=MAX(A23(IELEM),0.D0)
00429 !           DIAGONAL TERMS REDONE
00430             A11(IELEM) = - A12(IELEM) - A13(IELEM)
00431             A22(IELEM) = - A12(IELEM) - A23(IELEM)
00432             A33(IELEM) = - A13(IELEM) - A23(IELEM)
00433           ENDDO
00434         ENDIF
00435       ENDIF
00436 !
00437 !-----------------------------------------------------------------------
00438 !
00439       RETURN
00440       END

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