OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
w_mad.F File Reference
#include "implicit_f.inc"
#include "com04_c.inc"

Go to the source code of this file.

Functions/Subroutines

subroutine w_mad (iexmad, nmadsh4_l, nmadsh3_l, nmadsol_l, nmadnod_l, madcl_nmadnod_l, cep, proc, nodlocal, cel, numels_l, numelc_l, numeltg_l, len_ia)

Function/Subroutine Documentation

◆ w_mad()

subroutine w_mad ( integer, dimension(*) iexmad,
integer nmadsh4_l,
integer nmadsh3_l,
integer nmadsol_l,
integer nmadnod_l,
integer madcl_nmadnod_l,
integer, dimension(*) cep,
integer proc,
integer, dimension(*) nodlocal,
integer, dimension(*) cel,
integer numels_l,
integer numelc_l,
integer numeltg_l,
integer len_ia )

Definition at line 69 of file w_mad.F.

72C-----------------------------------------------
73C M o d u l e s
74C-----------------------------------------------
75
76C-----------------------------------------------
77C I m p l i c i t T y p e s
78C-----------------------------------------------
79#include "implicit_f.inc"
80C-----------------------------------------------
81C C o m m o n B l o c k s
82C-----------------------------------------------
83#include "com04_c.inc"
84C-----------------------------------------------
85C D u m m y A r g u m e n t s
86C-----------------------------------------------
87 INTEGER PROC, NMADSH4_L, NMADSH3_L, NMADSOL_L, NMADNOD_L,
88 . LEN_IA, NUMELS_L, NUMELC_L, NUMELTG_L,MADCL_NMADNOD_L,
89 . IEXMAD(*), CEP(*), NODLOCAL(*),CEL(*)
90C-----------------------------------------------
91C F u n c t i o n
92C-----------------------------------------------
93 INTEGER NLOCAL
94 EXTERNAL nlocal
95C-----------------------------------------------
96C L o c a l V a r i a b l e s
97C-----------------------------------------------
98 INTEGER I, IDEB, K, ESHIFT, NMAD_L, P
99 INTEGER, DIMENSION(:),ALLOCATABLE :: MADCL_TMPNOD,TMPSH3,TMPSH4,TMPSOL,
100 . TMPNOD,FAILSH4,FAILSH3,FAILSOL,ICONX_L
101C-----------------------------------------------
102! allocate 1d arrays
103 ALLOCATE(madcl_tmpnod(madcl_nmadnod_l))
104 ALLOCATE( tmpsh3(nmadsh3_l),tmpsh4(nmadsh4_l) )
105 ALLOCATE( tmpsol(nmadsol_l),tmpnod(nmadnod_l) )
106 ALLOCATE( iconx_l(7*nconx) )
107! -------------------------------
108C
109C Couplage etendu
110C
111 IF(nexmad/=0) THEN
112C
113C ELEM shell4
114C
115 ideb = 1 + 7*nconx + nmadprt
116 eshift = numels+numelq
117 nmad_l = 0
118 DO i = 1, nmadsh4
119 k = iexmad(ideb+i-1)
120 IF(cep(k+eshift)==proc) THEN
121 nmad_l = nmad_l+1
122 tmpsh4(nmad_l) = cel(k+eshift)
123 END IF
124 END DO
125C
126C Elem shell3
127C
128 ideb = ideb + nmadsh4
129 eshift = numels+numelq+numelc+numelt+numelp+numelr
130 nmad_l = 0
131 DO i = 1, nmadsh3
132 k = iexmad(ideb+i-1)
133 IF(cep(k+eshift)==proc) THEN
134 nmad_l = nmad_l+1
135 tmpsh3(nmad_l) = cel(k+eshift)
136 END IF
137 END DO
138C
139C Elem solides
140C
141 ideb = ideb + nmadsh3
142 eshift = 0
143 nmad_l = 0
144 DO i = 1, nmadsol
145 k = iexmad(ideb+i-1)
146 IF(cep(k+eshift)==proc) THEN
147 nmad_l = nmad_l+1
148 tmpsol(nmad_l) = cel(k+eshift)
149 END IF
150 END DO
151C
152C Noeuds
153C
154 ideb = ideb + nmadsol
155 nmad_l = 0
156 DO i = 1, nmadnod
157 k = iexmad(ideb+i-1)
158 IF(nlocal(k,proc+1)==1) THEN
159 DO p = 1, proc
160 IF(nlocal(k,p)==1) GOTO 100
161 END DO
162 nmad_l = nmad_l+1
163 tmpnod(nmad_l) = nodlocal(k)
164 END IF
165 100 CONTINUE
166 END DO
167C
168C Noeuds MADCL
169C
170 nmad_l = 0
171 DO i = 1, nmadnod
172 k = iexmad(ideb+i-1)
173 IF(nlocal(k,proc+1)==1) THEN
174 nmad_l = nmad_l+1
175 madcl_tmpnod(nmad_l) = nodlocal(k)
176 END IF
177 END DO
178C
179 END IF
180C
181 IF(proc==0) THEN
182 DO i=1,7*nconx
183 iconx_l(i) = iexmad(i)
184 END DO
185 DO i=1,nconx
186 iconx_l(7*(i-1)+4) = nodlocal(iexmad(7*(i-1)+4))
187 END DO
188 CALL write_i_c(iconx_l,7*nconx)
189 len_ia = len_ia + 7*nconx
190 END IF
191 IF(nexmad/=0) THEN
192 IF(proc==0) THEN
193 CALL write_i_c(iexmad(7*nconx+1),nmadprt)
194 len_ia = len_ia + nmadprt
195 END IF
196 CALL write_i_c(tmpsh4,nmadsh4_l)
197 len_ia = len_ia + nmadsh4_l
198 CALL write_i_c(tmpsh3,nmadsh3_l)
199 len_ia = len_ia + nmadsh3_l
200 CALL write_i_c(tmpsol,nmadsol_l)
201 len_ia = len_ia + nmadsol_l
202 CALL write_i_c(tmpnod,nmadnod_l)
203 len_ia = len_ia + nmadnod_l
204 CALL write_i_c(madcl_tmpnod,madcl_nmadnod_l)
205 len_ia = len_ia + madcl_nmadnod_l
206 IF(proc==0)THEN
207 ideb = 7*nconx+nmadprt+nmadsh4+nmadsh3+nmadsol+nmadnod
208 + + numelc+numeltg+numels + 1
209 CALL write_i_c(iexmad(ideb),2*nmadnod+nmadsh4+nmadsh3+nmadsol)
210 len_ia = len_ia + 2*nmadnod+nmadsh4+nmadsh3+nmadsol
211 END IF
212 END IF
213C
214! -------------------------------
215! deallocate 1d arrays
216 DEALLOCATE(madcl_tmpnod)
217 DEALLOCATE( tmpsh3,tmpsh4 )
218 DEALLOCATE( tmpsol,tmpnod )
219 DEALLOCATE( iconx_l )
220! -------------------------------
221 RETURN
integer function nlocal(n, p)
Definition ddtools.F:349
void write_i_c(int *w, int *len)