The TELEMAC-MASCARET system  trunk
diraux.f
Go to the documentation of this file.
1 ! *****************
2  SUBROUTINE diraux
3 ! *****************
4 !
5  & ( x , y , z , w , f , indic , criter , mesh )
6 !
7 !***********************************************************************
8 ! BIEF V6P1 21/08/2010
9 !***********************************************************************
10 !
11 !brief HELPS PREPARE A LINEAR SYSTEM WITH DIRICHLET CONDITIONS.
12 !code
13 !+ X, Y AND Z MUST BE STRUCTURES.
14 !+
15 !+ HERE X IS A VECTOR DEFINED ON THE DOMAIN
16 !+ Y IS A VECTOR DEFINED ON THE DOMAIN
17 !+ Z IS A VECTOR DEFINED ON THE DOMAIN OR BOUNDARY
18 !+
19 !+ INDIC IS AN ARRAY, NOT A STRUCTURE ||||||||||
20 !+
21 !+ |||||||| : THE OPERATION IS ONLY PERFORMED IF INDIC(K)=CRITER
22 !+ FOR A GLOBAL OR BOUNDARY NUMBER K.
23 !+
24 !+ OPERATIONS :
25 !+
26 !+ W SET TO 0.D0 FOR POINTS WHERE INDIC(K) = CRITER
27 !+ TO 1.D0 OTHERWISE
28 !+
29 !+ X = Y MULTIPLIED BY Z IF INDIC(K) = CRITER
30 !+
31 !+ F = Z IF INDIC(K) = CRITER
32 !+
33 !+ THESE OPERATIONS ARE USED TO TREAT THE POINTS OF TYPE DIRICHLET.
34 !+
35 !+ X IS THE SECOND MEMBER (WILL BE EQUAL TO THE DIAGONAL
36 !+ MULTIPLIED BY THE DIRICHLET VALUE Z)
37 !+
38 !+ F IS THE UNKNOWN (SET TO ITS DIRICHLET VALUE)
39 !+
40 !+ W IS A WORKING ARRAY USED TO CANCEL THE MATRICES
41 !+ TERMS TOUCHING DIRICHLET POINTS
42 !
43 !history J-M HERVOUET (LNH)
44 !+ 06/12/94
45 !+ V5P1
46 !+
47 !
48 !history N.DURAND (HRW), S.E.BOURBAN (HRW)
49 !+ 13/07/2010
50 !+ V6P0
51 !+ Translation of French comments within the FORTRAN sources into
53 !
54 !history N.DURAND (HRW), S.E.BOURBAN (HRW)
55 !+ 21/08/2010
56 !+ V6P0
57 !+ Creation of DOXYGEN tags for automated documentation and
58 !+ cross-referencing of the FORTRAN sources
59 !
60 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
61 !| CRITER |-->| INTEGER, CONVENTION FOR DIRICHLET
62 !| F |-->| VARIABLE THAT WILL BE GIVEN ITS DIRICHLET VALUE
63 !| | | TAKEN IN Z
64 !| INDIC |-->| BOUNDARY CONDITIONS AT VALUE CRITER OR NOT
65 !| MESH |-->| MESH STRUCTURE
66 !| W |<->| WORK ARRAY
67 !| X |<--| Y MULTIPLIED BY Z IF INDIC(K) = CRITER
68 !| Y |-->| VECTOR, A DATA
69 !| Z |-->| DIRICHLET VALUES
70 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
71 !
72  USE bief, ex_diraux => diraux
73 !
75  IMPLICIT NONE
76 !
77 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
78 !
79  TYPE(bief_obj) , INTENT(INOUT) :: X,W,F
80  TYPE(bief_obj) , INTENT(IN) :: Y,Z
81  INTEGER , INTENT(IN) :: INDIC(*),CRITER
82  TYPE(bief_mesh), INTENT(IN) :: MESH
83 !
84 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
85 !
86  INTEGER K,NPOIN,IELMX,IELMZ,N
87 !
88 !-----------------------------------------------------------------------
89 !
90  npoin = z%DIM1
91 !
92 !-----------------------------------------------------------------------
93 !
94 ! W SET TO 1
95 !
96  CALL os( 'X=C ' , x=w , c=1.d0 )
97 !
98 !-----------------------------------------------------------------------
99 !
100  ielmx=x%ELM
101  ielmz=z%ELM
102 !
103  IF(ielmx.NE.ielmz) THEN
104 !
105  DO k=1,npoin
106  IF(indic(k).EQ.criter) THEN
107  n = mesh%NBOR%I(k)
108  x%R(n) = y%R(n) * z%R(k)
109  w%R(n) = 0.d0
110  f%R(n) = z%R(k)
111  ENDIF
112  ENDDO
113 !
114  ELSE
115 !
116  DO k=1,npoin
117  IF(indic(k).EQ.criter) THEN
118  x%R(k) = y%R(k) * z%R(k)
119  w%R(k) = 0.d0
120  f%R(k) = z%R(k)
121  ENDIF
122  ENDDO
123 !
124  ENDIF
125 !
126 !-----------------------------------------------------------------------
127 !
128  RETURN
129  END
subroutine diraux(X, Y, Z, W, F, INDIC, CRITER, MESH)
Definition: diraux.f:7
subroutine os(OP, X, Y, Z, C, IOPT, INFINI, ZERO)
Definition: os.f:7
Definition: bief.f:3