The TELEMAC-MASCARET system  trunk
maskto.f
Go to the documentation of this file.
1 ! *****************
2  SUBROUTINE maskto
3 ! *****************
4 !
5  &(maskel,maskpt,ifamas,ikle,ifabor,eltseg,nseg,
6  & nelem,ielm,mesh)
7 !
8 !***********************************************************************
9 ! BIEF V6P1 21/08/2010
10 !***********************************************************************
11 !
12 !brief CALLED AFTER MASKEL HAS BEEN FILLED IN.
13 !+
14 !+ - FILLS IN MASKPT (A POINT IS MASKED IF SURROUNDED BY
15 !+ MASKED ELEMENTS).
16 !+
17 !+ - FILLS IN IFAMAS (SIMILAR ARRAY TO IFABOR, BUT
18 !+ CONSIDERS ANY FACE SEPARATING A MASKED FROM A
19 !+ NON-MASKED ELEMENT SUCH AS A SOLID BOUNDARY).
20 !+
21 !+ - COMPUTES THE NEW COMPATIBLE NORMALS XNEBOR AND
22 !+ YNEBOR FOR PRISMS.
23 !
24 !history J-M HERVOUET (LNHE)
25 !+ 21/10/08
26 !+ V5P9
27 !+
28 !
29 !history N.DURAND (HRW), S.E.BOURBAN (HRW)
30 !+ 13/07/2010
31 !+ V6P0
32 !+ Translation of French comments within the FORTRAN sources into
33 !+ English comments
34 !
35 !history N.DURAND (HRW), S.E.BOURBAN (HRW)
36 !+ 21/08/2010
37 !+ V6P0
38 !+ Creation of DOXYGEN tags for automated documentation and
39 !+ cross-referencing of the FORTRAN sources
40 !
41 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
42 !| ELTSEG |-->| SEGMENTS GIVEN PER ELEMENT
43 !| IELM |-->| TYPE OF ELEMENT.
44 !| IFABOR |-->| ELEMENTS BEHIND THE EDGES OF A TRIANGLE
45 !| | | IF NEGATIVE OR ZERO, THE EDGE IS A LIQUID
46 !| | | BOUNDARY
47 !| IFAMAS |<--| LIKE IFABOR BUT WITH MASK
48 !| IKLE |-->| CONNECTIVITY TABLE.
49 !| MASKEL |-->| MASKING OF ELEMENTS
50 !| | | =1. : NORMAL =0. : MASKED ELEMENT
51 !| MASKPT |-->| MASKING PER POINT.
52 !| | | =1. : NORMAL =0. : MASKED
53 !| MESH |-->| MESH STRUCTURE
54 !| NELEM |-->| NUMBER OF ELEMENTS
55 !| NSEG |-->| NUMBER OF SEGMENTS
56 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
57 !
58  USE bief, ex_maskto => maskto
59 !
61  IMPLICIT NONE
62 !
63 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
64 !
65  INTEGER, INTENT(IN) :: NELEM,IELM,NSEG
66  INTEGER, INTENT(IN) :: IKLE(nelem,3),IFABOR(nelem,3)
67  INTEGER, INTENT(IN) :: ELTSEG(nelem,3)
68  INTEGER, INTENT(INOUT) :: IFAMAS(nelem,3)
69 !
70  DOUBLE PRECISION, INTENT(IN) :: MASKEL(nelem)
71  TYPE(bief_obj), INTENT(INOUT) :: MASKPT
72  TYPE(bief_mesh), INTENT(INOUT) :: MESH
73 !
74 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
75 !
76  INTEGER IELEM,N,I1,I2,I3
77  DOUBLE PRECISION, POINTER, DIMENSION(:) :: WSEG
78 !
79  INTRINSIC max
80 !
81 !-----------------------------------------------------------------------
82 !
83  wseg => mesh%MSEG%X%R
84 !
85  CALL os('X=0 ',x=maskpt)
86 !
87  IF(ielm.EQ.11.OR.ielm.EQ.41) THEN
88 !
89 ! 1) MASKS THE POINTS WHICH DO NOT BELONG TO NON-FROZEN ELEMENTS
90 ! (THOSE WHICH BELONG TO A 'NORMAL' ELEMENT ARE SET BACK TO 1)
91 !
92  DO ielem = 1,nelem
93  i1 = ikle(ielem,1)
94  i2 = ikle(ielem,2)
95  i3 = ikle(ielem,3)
96  maskpt%R(i1) = max(maskpt%R(i1),maskel(ielem))
97  maskpt%R(i2) = max(maskpt%R(i2),maskel(ielem))
98  maskpt%R(i3) = max(maskpt%R(i3),maskel(ielem))
99  ENDDO
100 !
101 ! IN PARALLEL MODE FOR INTERFACE POINTS, MAXIMUM RETAINED
102 !
103  IF(ncsize.GT.1) CALL parcom(maskpt,3,mesh)
104 !
105 ! 2) COPIES IFABOR IN IFAMAS
106 !
107  DO ielem = 1,nelem
108  ifamas(ielem,1) = ifabor(ielem,1)
109  ifamas(ielem,2) = ifabor(ielem,2)
110  ifamas(ielem,3) = ifabor(ielem,3)
111  ENDDO
112 !
113 ! 3) IDENTIFIES THE EDGES OF FROZEN ELEMENTS WITH 0 (LIQUID BOUNDARY)
114 ! TO STOP THE CHARACTERISTIC CURVES
115 !
116 ! USES AN ARRAY DEFINED BY SEGMENT TO COMMUNICATE IN PARALLEL MODE
117 !
118 ! WSEG SET TO 1
119 !
120  DO n=1,nseg
121  wseg(n)=1.d0
122  ENDDO
123 !
124 ! THEN WSEG PUT TO 0 FOR DRY ELEMENTS
125 !
126  DO ielem=1,nelem
127  IF(maskel(ielem).LT.0.5d0) THEN
128  wseg(eltseg(ielem,1))=0.d0
129  wseg(eltseg(ielem,2))=0.d0
130  wseg(eltseg(ielem,3))=0.d0
131  ENDIF
132  ENDDO
133 !
134 ! IN PARALLEL MODE FOR INTERFACE EDGES, MINIMUM RETAINED
135 !
136  IF(ncsize.GT.1) THEN
137  CALL parcom2_seg(wseg,wseg,wseg,nseg,1,4,1,mesh,1,11)
138  ENDIF
139 !
140 ! WSEG = 0.D0 TRANSLATED INTO IFAMAS = 0
141 !
142  DO ielem=1,nelem
143  IF(wseg(eltseg(ielem,1)).LT.0.5d0) ifamas(ielem,1)=0
144  IF(wseg(eltseg(ielem,2)).LT.0.5d0) ifamas(ielem,2)=0
145  IF(wseg(eltseg(ielem,3)).LT.0.5d0) ifamas(ielem,3)=0
146  ENDDO
147 !
148  ELSE
149 !
150  WRITE(lu,1100) ielm
151 1100 FORMAT(1x,'MASKTO: UNKNOWN TYPE OF ELEMENT :',1i6)
152  CALL plante(1)
153  stop
154 !
155  ENDIF
156 !
157 !-----------------------------------------------------------------------
158 !
159  RETURN
160  END
subroutine maskto(MASKEL, MASKPT, IFAMAS, IKLE, IFABOR, ELTSEG, NSEG, NELEM, IELM, MESH)
Definition: maskto.f:8
subroutine parcom2_seg(X1, X2, X3, NSEG, NPLAN, ICOM, IAN, MESH, OPT, IELM)
Definition: parcom2_seg.f:7
subroutine os(OP, X, Y, Z, C, IOPT, INFINI, ZERO)
Definition: os.f:7
subroutine parcom(X, ICOM, MESH)
Definition: parcom.f:7
Definition: bief.f:3