The TELEMAC-MASCARET system  trunk
parcom_comp.f
Go to the documentation of this file.
1 ! *****************
2  SUBROUTINE parcom_comp
3 ! *****************
4 !
5  &( x ,errx, icom , mesh)
6 !
7 !***********************************************************************
8 ! BIEF V6P2 24/02/2016
9 !***********************************************************************
10 !
11 !brief COMPLEMENTS A VECTOR AND ERROR 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 R.NHEILI (Univerte de Perpignan, DALI)
26 !+ 24/02/2016
27 !+ V7P3
28 !+
29 !
30 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
31 !| ICOM |-->| COMMUNICATION MODE
32 !| | | = 1 : VALUE WITH MAXIMUM ABSOLUTE VALUE TAKEN
33 !| | | = 2 : CONTRIBUTIONS ADDED
34 !| | | = 3 : MAXIMUM CONTRIBUTION RETAINED
35 !| | | = 4 : MINIMUM CONTRIBUTION RETAINED
36 !| MESH |-->| MESH STRUCTURE
37 !| X |<->| VECTOR OR BLOCK OF VECTORS
38 !| ERRX |<->| ERROR VECTOR
39 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
40 !
41  USE bief, ex_parcom_comp => parcom_comp
42 !
44  IMPLICIT NONE
45 !
46 !-----------------------------------------------------------------------
47 !
48  INTEGER, INTENT(IN) :: ICOM
49 !
50 ! STRUCTURES: VECTORS OR BLOCKS
51 !
52  TYPE(bief_mesh), INTENT(INOUT) :: MESH
53  TYPE(bief_obj), INTENT(INOUT) :: X
54  DOUBLE PRECISION, INTENT(INOUT) :: ERRX(*)
55 !
56 !-----------------------------------------------------------------------
57 !
58  TYPE(bief_obj), POINTER :: X2,X3
59  INTEGER NPOIN,NPLAN,IAN,NP11,NSEG
60 !
61 !***********************************************************************
62 !
63 ! OF NO USE IF A SUB-DOMAIN IS DISCONNECTED FROM THE OTHERS
64 !
65  IF(nptir.EQ.0) RETURN
66 !
67 !-----------------------------------------------------------------------
68 !
69  npoin = mesh%NPOIN
70  nplan = 1
71  IF(mesh%DIM1.EQ.3) THEN
72  npoin = bief_nbpts(11,mesh)
73  nplan = mesh%NPOIN/npoin
74  ENDIF
75 !
76 !-----------------------------------------------------------------------
77 !
78  IF(x%TYPE.EQ.2) THEN
79 !
80 ! VECTOR STRUCTURE
81 !
82  ian = 1
83  CALL parcom2_comp(x%R,x%R,x%R,errx,npoin,nplan,icom,ian
84  & ,mesh)
85 !
86  IF(x%ELM.EQ.13) THEN
87  np11=bief_nbpts(11,mesh)
88  nseg=mesh%NSEG
89  CALL parcom2_seg(x%R(np11+1:np11+nseg),
90  & x%R(np11+1:np11+nseg),
91  & x%R(np11+1:np11+nseg),
92  & nseg,1,icom,ian,mesh,1,11)
93  ENDIF
94 !
95  ELSEIF(x%TYPE.EQ.4) THEN
96 !
97 ! BLOCK STRUCTURE
98 !
99 ! BEWARE: NUMBER LIMITED TO 3 |||||||||||||||||||||||||
100  ian = x%N
101  IF(ian.EQ.1) THEN
102  x2 => x%ADR(1)%P
103  x3 => x%ADR(1)%P
104  ELSEIF(ian.EQ.2) THEN
105  x2 => x%ADR(2)%P
106  x3 => x%ADR(2)%P
107  ELSEIF(ian.EQ.3) THEN
108  x2 => x%ADR(2)%P
109  x3 => x%ADR(3)%P
110  ELSE
111  WRITE(lu,*) 'PARCOM: NO MORE THAN 3 VECTORS'
112  CALL plante(1)
113  stop
114  ENDIF
115 !
116  CALL parcom2_comp(x%ADR(1)%P%R,x2%R,x3%R,errx,npoin
117  & ,nplan,icom,ian,mesh)
118 !
119 ! PROVISIONNALY 1 BY 1, COULD BE OPTIMISED
120 !
121  IF(x%ADR(1)%P%ELM.EQ.13) THEN
122  np11=bief_nbpts(11,mesh)
123  nseg=mesh%NSEG
124  CALL parcom2_seg(x%ADR(1)%P%R(np11+1:np11+nseg),
125  & x%ADR(1)%P%R(np11+1:np11+nseg),
126  & x%ADR(1)%P%R(np11+1:np11+nseg),
127 ! * NSEG,1,ICOM,IAN,MESH)
128  & nseg,1,icom,1 ,mesh,1,11)
129  ENDIF
130  IF(ian.GE.2.AND.x2%ELM.EQ.13) THEN
131  np11=bief_nbpts(11,mesh)
132  nseg=mesh%NSEG
133  CALL parcom2_seg(x2%R(np11+1:np11+nseg),
134  & x2%R(np11+1:np11+nseg),
135  & x2%R(np11+1:np11+nseg),
136 ! * NSEG,1,ICOM,IAN,MESH)
137  & nseg,1,icom,1 ,mesh,1,11)
138  ENDIF
139  IF(ian.EQ.3.AND.x3%ELM.EQ.13) THEN
140  np11=bief_nbpts(11,mesh)
141  nseg=mesh%NSEG
142  CALL parcom2_seg(x3%R(np11+1:np11+nseg),
143  & x3%R(np11+1:np11+nseg),
144  & x3%R(np11+1:np11+nseg),
145 ! * NSEG,1,ICOM,IAN,MESH)
146  & nseg,1,icom,1 ,mesh,1,11)
147  ENDIF
148 !
149  ELSE
150 !
151 ! ERROR ON THE STRUCTURE
152 !
153  WRITE(lu,53)
154 53 FORMAT(1x,' CAS NON PREVU')
155  WRITE(lu,54)
156 54 FORMAT(1x,' UNEXPECTED CASE')
157  CALL plante(1)
158  stop
159 !
160  ENDIF
161 !
162 !-----------------------------------------------------------------------
163 !
164  RETURN
165  END
integer function bief_nbpts(IELM, MESH)
Definition: bief_nbpts.f:7
subroutine parcom2_comp(X1, X2, X3, ERRX, NPOIN, NPLAN, ICOM, IAN, MESH)
Definition: parcom2_comp.f:7
subroutine parcom2_seg(X1, X2, X3, NSEG, NPLAN, ICOM, IAN, MESH, OPT, IELM)
Definition: parcom2_seg.f:7
subroutine parcom_comp(X, ERRX, ICOM, MESH)
Definition: parcom_comp.f:7
Definition: bief.f:3