gradnod.f

Go to the documentation of this file.
00001 C:\opentelemac\v7p0\sources\telemac2d\gradnod.f
00002 !
00066                      SUBROUTINE GRADNOD
00067 !                    ******************
00068 !
00069      &(NS,NT,NU,AIRT,AIRS,UA,DPX,DPY,DJX,DJY,DX,DY,IVIS,CVIS,CE,ZF,
00070      & MESH)
00071 !
00072 !***********************************************************************
00073 ! TELEMAC2D   V6P1                                   21/08/2010
00074 !***********************************************************************
00075 !
00076 !
00077 !
00078 !
00079 !
00080 !
00081 !
00082 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00083 !| AIRS           |-->| CELL'S AREAS
00084 !| AIRT           |-->| TRIANGLES' AREAS
00085 !| CE             |<--| DIFFUSION TERM
00086 !| CVIS           |-->| COEFFICIENT OF DIFFUSION
00087 !| DJX,DJY        |<--| GRADIENTS PER TRIANGLE
00088 !| IVIS           |-->| OPTION FOR DIFFUSION OF VELOCITY
00089 !| DX,DY          |<--| GRADIENTS AT NODES
00090 !| NS             |-->| TOTAL NUMER OF NODES IN THE MESH
00091 !| NT             |-->| TOTAL NUMBER OF ELEMENTS IN THE MESH
00092 !| NU             |-->| NUMBERING OF NODES IN THE TRIANGLE
00093 !| UA             |-->| UA(1,IS) = H,  UA(2,IS)=U  ,UA(3,IS)=V
00094 !| T              |-->| TRACERS
00095 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00096 !
00097       USE BIEF
00098       USE BIEF_DEF, ONLY: NCSIZE
00099       USE INTERFACE_TELEMAC2D, EX_GRADNOD => GRADNOD
00100       IMPLICIT NONE
00101 !
00102 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
00103 !
00104       INTEGER, INTENT(IN)             :: NS,NT,IVIS
00105       INTEGER, INTENT(IN)             :: NU(NT,3)
00106       DOUBLE PRECISION, INTENT(IN)    :: AIRT(NT),AIRS(NS),CVIS
00107       DOUBLE PRECISION, INTENT(INOUT) :: DJX(3,NT),DJY(3,NT)
00108       DOUBLE PRECISION, INTENT(INOUT) :: DX(3,NS),DY(3,NS)
00109       DOUBLE PRECISION, INTENT(INOUT) :: CE(NS,3)
00110       DOUBLE PRECISION, INTENT(IN)    :: UA(3,NS),ZF(NS)
00111       DOUBLE PRECISION, INTENT(IN)    :: DPX(3,NT),DPY(3,NT)
00112       TYPE(BIEF_MESH), INTENT(INOUT)  :: MESH
00113 !
00114 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
00115 !
00116       INTEGER IS,JT,NUBO1,NUBO2,NUBO3,IVAR
00117       DOUBLE PRECISION AIRJ,UA1,UA2,UA3,AIS,HTT,AUX,TIERS,TEMPOR
00118 !
00119       TIERS = 1.0D0/3.0D0
00120 !
00121 !-----------------------------------------------------------------------
00122 !
00123 !     INITIALISES THE HERMITIAN NODAL GRADIENTS
00124 !
00125       DO IS=1,NS
00126         DO IVAR=1,3
00127           DX(IVAR,IS) = 0.D0
00128           DY(IVAR,IS) = 0.D0
00129         ENDDO
00130       ENDDO
00131 !
00132 !     LOOP ON GLOBAL LIST OF TRIANGLES
00133 !
00134       DO JT=1,NT
00135 !
00136         NUBO1 = NU(JT,1)
00137         NUBO2 = NU(JT,2)
00138         NUBO3 = NU(JT,3)
00139 !
00140         AIRJ=   AIRT(JT)
00141 !
00142 !       COMPUTES THE P1-GRADIENTS
00143 !
00144 !   COMPUTES THE H+Z GRADIENT
00145 !
00146         IVAR=1
00147         UA1=UA(IVAR,NUBO1) + ZF(NUBO1)
00148         UA2=UA(IVAR,NUBO2) + ZF(NUBO2)
00149         UA3=UA(IVAR,NUBO3) + ZF(NUBO3)
00150 !
00151         DJX(IVAR,JT) = UA1*DPX(1,JT)+UA2*DPX(2,JT)+UA3*DPX(3,JT) ! GRAD_X(H+Z)|_Tk
00152         DJY(IVAR,JT) = UA1*DPY(1,JT)+UA2*DPY(2,JT)+UA3*DPY(3,JT) ! GRAD_Y(H+Z)|_Tk
00153 !
00154         TEMPOR = AIRJ*DJX(IVAR,JT)
00155         DX(IVAR,NUBO1) = DX(IVAR,NUBO1) + TEMPOR ! SUM( |C_k|*GRAD_X(H+Z)|_Tk )
00156         DX(IVAR,NUBO2) = DX(IVAR,NUBO2) + TEMPOR ! SAME AS FOR NUBO1
00157         DX(IVAR,NUBO3) = DX(IVAR,NUBO3) + TEMPOR ! SAME AS FOR NUBO1
00158 !
00159         TEMPOR = AIRJ*DJY(IVAR,JT)
00160         DY(IVAR,NUBO1) = DY(IVAR,NUBO1) + TEMPOR ! SUM( |C_k|*GRAD_Y(H+Z)|_Tk )
00161         DY(IVAR,NUBO2) = DY(IVAR,NUBO2) + TEMPOR ! SAME AS FOR NUBO1
00162         DY(IVAR,NUBO3) = DY(IVAR,NUBO3) + TEMPOR ! SAME AS FOR NUBO2
00163 !
00164 !    COMPUTES THE VELOCITY GRADIENTS
00165 !
00166         DO IVAR=2,3
00167 !
00168           UA1=UA(IVAR,NUBO1) ! U OR V
00169           UA2=UA(IVAR,NUBO2)
00170           UA3=UA(IVAR,NUBO3)
00171 !
00172           DJX(IVAR,JT) = UA1*DPX(1,JT)+UA2*DPX(2,JT)+UA3*DPX(3,JT)! GRAD_X(U)|_Tk
00173           DJY(IVAR,JT) = UA1*DPY(1,JT)+UA2*DPY(2,JT)+UA3*DPY(3,JT)! GRAD_Y(U)|_Tk
00174 !
00175           TEMPOR = AIRJ*DJX(IVAR,JT)
00176           DX(IVAR,NUBO1) = DX(IVAR,NUBO1) + TEMPOR ! SUM( |C_k|*GRAD_Y(U)|_Tk )
00177           DX(IVAR,NUBO2) = DX(IVAR,NUBO2) + TEMPOR ! SAME AS FOR NUBO1
00178           DX(IVAR,NUBO3) = DX(IVAR,NUBO3) + TEMPOR ! SAME AS FOR NUBO1
00179 !
00180           TEMPOR = AIRJ*DJY(IVAR,JT)
00181           DY(IVAR,NUBO1) = DY(IVAR,NUBO1) + TEMPOR ! SUM( |C_k|*GRAD_Y(U)|_Tk )
00182           DY(IVAR,NUBO2) = DY(IVAR,NUBO2) + TEMPOR ! SAME AS FOR NUBO1
00183           DY(IVAR,NUBO3) = DY(IVAR,NUBO3) + TEMPOR ! SAME AS FOR NUBO1
00184         ENDDO
00185       ENDDO ! RA: SEPARATION OF LOOPS TO EXECUTE PARCOMS
00186 
00187 !     FOR PARALLELILSM
00188       IF(NCSIZE.GT.1)THEN                 ! NPON,NPLAN,ICOM,IAN
00189         CALL PARCOM2(DX(1,:),DX(2,:),DX(3,:),NS,1,2,3,MESH )
00190         CALL PARCOM2(DY(1,:),DY(2,:),DY(3,:),NS,1,2,3,MESH )
00191       ENDIF
00192 !
00193       IF(IVIS.EQ.0.OR.CVIS.EQ.0.) GOTO 10 ! IF THERE IS NO VISCOSITY OR NO VELOCITY DIFFUSISION
00194 !
00195 !     INITIALISES CE (WAS NOT DONE BEFORE)
00196       CALL OV( 'X=0     ' ,CE(:,1)   ,CE(:,1)  ,CE(:,1),0.D0 ,NS)
00197       CALL OV( 'X=0     ' ,CE(:,2)   ,CE(:,2)  ,CE(:,2),0.D0 ,NS)
00198       CALL OV( 'X=0     ' ,CE(:,3)   ,CE(:,3)  ,CE(:,3),0.D0 ,NS)
00199 !
00200       DO JT=1,NT
00201 !
00202         NUBO1 = NU(JT,1)
00203         NUBO2 = NU(JT,2)
00204         NUBO3 = NU(JT,3)
00205 !
00206         AIRJ=   AIRT(JT)
00207         HTT = UA(1,NUBO1)+UA(1,NUBO2)+UA(1,NUBO3)
00208         AUX = CVIS*AIRJ*HTT/3.D0
00209 !
00210 !  COMPUTES THE VELOCITY DIFFUSION TERMS
00211 !
00212         CE(NUBO1,2)       = CE(NUBO1,2) -AUX*
00213      &  (DJX(2,JT)*DPX(1,JT)+DJY(2,JT)*DPY(1,JT))
00214         CE(NUBO2,2)       = CE(NUBO2,2) -AUX*
00215      &  (DJX(2,JT)*DPX(2,JT)+DJY(2,JT)*DPY(2,JT))
00216         CE(NUBO3,2)       = CE(NUBO3,2) -AUX*
00217      &  (DJX(2,JT)*DPX(3,JT)+DJY(2,JT)*DPY(3,JT))
00218 !
00219         CE(NUBO1,3)       = CE(NUBO1,3) -AUX*
00220      &  (DJX(3,JT)*DPX(1,JT)+DJY(3,JT)*DPY(1,JT))
00221         CE(NUBO2,3)       = CE(NUBO2,3) -AUX*
00222      &  (DJX(3,JT)*DPX(2,JT)+DJY(3,JT)*DPY(2,JT))
00223         CE(NUBO3,3)       = CE(NUBO3,3) -AUX*
00224      &  (DJX(3,JT)*DPX(3,JT)+DJY(3,JT)*DPY(3,JT))
00225       ENDDO
00226 !     FOR PARALLELILSM
00227       IF(NCSIZE.GT.1)THEN                 ! NPON,NPLAN,ICOM,IAN
00228         CALL PARCOM2(CE(:,1),CE(:,2),CE(:,3),NS,1,2,3,MESH )
00229       ENDIF
00230 !
00231 10       CONTINUE
00232 !
00233 !     COMPLETES THE COMPUTATION OF THE NODAL GRADIENTS
00234 !
00235       DO IS=1,NS
00236 !
00237         AIS = TIERS/AIRS(IS)
00238 !
00239         DO IVAR=1,3
00240           DX(IVAR,IS) = DX(IVAR,IS)*AIS
00241           DY(IVAR,IS) = DY(IVAR,IS)*AIS
00242         ENDDO
00243 !
00244       ENDDO
00245 !
00246 !-----------------------------------------------------------------------
00247 !
00248       RETURN
00249       END

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