The TELEMAC-MASCARET system  trunk
parcom.f
Go to the documentation of this file.
1 ! *****************
2  SUBROUTINE parcom
3 ! *****************
4 !
5  &( x , icom , mesh )
6 !
7 !***********************************************************************
8 ! BIEF V6P2 21/08/2010
9 !***********************************************************************
10 !
11 !brief COMPLEMENTS A VECTOR AT THE INTERFACES BETWEEN
12 !+ SUB-DOMAINS.
13 !+
14 !+ X CAN BE A BLOCK OF VECTORS. IN THIS CASE, ALL THE
15 !+ VECTORS IN THE BLOCK ARE TREATED.
16 !
17 !note IMPORTANT : FROM RELEASE 5.9 ON, IDENTICAL VALUES ARE
18 !+ ENSURED AT INTERFACE POINTS SO THAT DIFFERENT
19 !+ PROCESSORS WILL ALWAYS MAKE THE SAME DECISION
20 !+ IN TESTS ON REAL NUMBERS.
21 !
22 !warning IF THE VECTORS HAVE A SECOND DIMENSION, IT IS
23 !+ IGNORED FOR THE TIME BEING
24 !
25 !history J-M HERVOUET (LNHE)
26 !+ 24/10/08
27 !+ V5P9
28 !+ AFTER REINHARD HINKELMANN (HANNOVER UNI.)
29 !
30 !history N.DURAND (HRW), S.E.BOURBAN (HRW)
31 !+ 13/07/2010
32 !+ V6P0
33 !+ Translation of French comments within the FORTRAN sources into
34 !+ English comments
35 !
36 !history N.DURAND (HRW), S.E.BOURBAN (HRW)
37 !+ 21/08/2010
38 !+ V6P0
39 !+ Creation of DOXYGEN tags for automated documentation and
40 !+ cross-referencing of the FORTRAN sources
41 !
42 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
43 !| ICOM |-->| COMMUNICATION MODE
44 !| | | = 1 : VALUE WITH MAXIMUM ABSOLUTE VALUE TAKEN
45 !| | | = 2 : CONTRIBUTIONS ADDED
46 !| | | = 3 : MAXIMUM CONTRIBUTION RETAINED
47 !| | | = 4 : MINIMUM CONTRIBUTION RETAINED
48 !| MESH |-->| MESH STRUCTURE
49 !| X |<->| VECTOR OR BLOCK OF VECTORS
50 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
51 !
52  USE bief, ex_parcom => parcom
53 !
55  IMPLICIT NONE
56 !
57 !-----------------------------------------------------------------------
58 !
59  INTEGER, INTENT(IN) :: ICOM
60 !
61 ! STRUCTURES: VECTORS OR BLOCKS
62 !
63  TYPE(bief_mesh), INTENT(INOUT) :: MESH
64  TYPE(bief_obj), INTENT(INOUT) :: X
65 !
66 !-----------------------------------------------------------------------
67 !
68  TYPE(bief_obj), POINTER :: X2,X3
69  INTEGER NPOIN,NPLAN,IAN,NP11,NSEG
70 !
71 !***********************************************************************
72 !
73 ! OF NO USE IF A SUB-DOMAIN IS DISCONNECTED FROM THE OTHERS
74 !
75  IF(nptir.EQ.0) RETURN
76 !
77 !-----------------------------------------------------------------------
78 !
79  npoin = mesh%NPOIN
80  nplan = 1
81  IF(mesh%DIM1.EQ.3) THEN
82  npoin = bief_nbpts(11,mesh)
83  nplan = mesh%NPOIN/npoin
84  ENDIF
85 !
86 !-----------------------------------------------------------------------
87 !
88  IF(x%TYPE.EQ.2) THEN
89 !
90 ! VECTOR STRUCTURE
91 !
92  ian = 1
93  CALL parcom2(x%R,x%R,x%R,npoin,nplan,icom,ian,mesh)
94 !
95  IF(x%ELM.EQ.13) THEN
96  np11=bief_nbpts(11,mesh)
97  nseg=mesh%NSEG
98  CALL parcom2_seg(x%R(np11+1:np11+nseg),
99  & x%R(np11+1:np11+nseg),
100  & x%R(np11+1:np11+nseg),
101  & nseg,1,icom,ian,mesh,1,11)
102  ENDIF
103 !
104  ELSEIF(x%TYPE.EQ.4) THEN
105 !
106 ! BLOCK STRUCTURE
107 !
108 ! BEWARE: NUMBER LIMITED TO 3 |||||||||||||||||||||||||
109  ian = x%N
110  IF(ian.EQ.1) THEN
111  x2 => x%ADR(1)%P
112  x3 => x%ADR(1)%P
113  ELSEIF(ian.EQ.2) THEN
114  x2 => x%ADR(2)%P
115  x3 => x%ADR(2)%P
116  ELSEIF(ian.EQ.3) THEN
117  x2 => x%ADR(2)%P
118  x3 => x%ADR(3)%P
119  ELSE
120  WRITE(lu,*) 'PARCOM: NO MORE THAN 3 VECTORS'
121  CALL plante(1)
122  stop
123  ENDIF
124 !
125  CALL parcom2(x%ADR(1)%P%R,x2%R,x3%R,npoin,nplan,icom,ian,mesh)
126 !
127 ! PROVISIONNALY 1 BY 1, COULD BE OPTIMISED
128 !
129  IF(x%ADR(1)%P%ELM.EQ.13) THEN
130  np11=bief_nbpts(11,mesh)
131  nseg=mesh%NSEG
132  CALL parcom2_seg(x%ADR(1)%P%R(np11+1:np11+nseg),
133  & x%ADR(1)%P%R(np11+1:np11+nseg),
134  & x%ADR(1)%P%R(np11+1:np11+nseg),
135 ! * NSEG,1,ICOM,IAN,MESH)
136  & nseg,1,icom,1 ,mesh,1,11)
137  ENDIF
138  IF(ian.GE.2.AND.x2%ELM.EQ.13) THEN
139  np11=bief_nbpts(11,mesh)
140  nseg=mesh%NSEG
141  CALL parcom2_seg(x2%R(np11+1:np11+nseg),
142  & x2%R(np11+1:np11+nseg),
143  & x2%R(np11+1:np11+nseg),
144 ! * NSEG,1,ICOM,IAN,MESH)
145  & nseg,1,icom,1 ,mesh,1,11)
146  ENDIF
147  IF(ian.EQ.3.AND.x3%ELM.EQ.13) THEN
148  np11=bief_nbpts(11,mesh)
149  nseg=mesh%NSEG
150  CALL parcom2_seg(x3%R(np11+1:np11+nseg),
151  & x3%R(np11+1:np11+nseg),
152  & x3%R(np11+1:np11+nseg),
153 ! * NSEG,1,ICOM,IAN,MESH)
154  & nseg,1,icom,1 ,mesh,1,11)
155  ENDIF
156 !
157  ELSE
158 !
159 ! ERROR ON THE STRUCTURE
160 !
161  WRITE(lu,54)
162 54 FORMAT(1x,' UNEXPECTED CASE')
163  CALL plante(1)
164  stop
165 !
166  ENDIF
167 !
168 !-----------------------------------------------------------------------
169 !
170  RETURN
171  END
integer function bief_nbpts(IELM, MESH)
Definition: bief_nbpts.f:7
subroutine parcom2_seg(X1, X2, X3, NSEG, NPLAN, ICOM, IAN, MESH, OPT, IELM)
Definition: parcom2_seg.f:7
subroutine parcom2(X1, X2, X3, NPOIN, NPLAN, ICOM, IAN, MESH)
Definition: parcom2.f:7
subroutine parcom(X, ICOM, MESH)
Definition: parcom.f:7
Definition: bief.f:3