1 subroutine mmdeg0 ( nomail,
2 > ulsort, langue, codret )
3 c ______________________________________________________________________
7 c Outil de Maillage Adaptatif par Raffinement et Deraffinement d'EDF R&D
9 c Version originale enregistree le 18 juin 1996 sous le numero 96036
10 c aupres des huissiers de justice Simart et Lavoir a Clamart
11 c Version 11.2 enregistree le 13 fevrier 2015 sous le numero 2015/014
12 c aupres des huissiers de justice
13 c Lavoir, Silinski & Cherqui-Abrahmi a Clamart
15 c HOMARD est une marque deposee d'Electricite de France
21 c ______________________________________________________________________
23 c Modification de Maillage - DEGre - phase 0
25 c ______________________________________________________________________
27 c . nom . e/s . taille . description .
28 c .____________________________________________________________________.
29 c . nomail . e . char8 . nom de l'objet maillage homard iter. n .
30 c . ulsort . e . 1 . numero d'unite logique de la liste standard.
31 c . langue . e . 1 . langue des messages .
32 c . . . . 1 : francais, 2 : anglais .
33 c . codret . es . 1 . code de retour des modules .
34 c . . . . 0 : pas de probleme .
35 c . . . . 1 : probleme .
36 c ______________________________________________________________________
39 c 0. declarations et dimensionnement
42 c 0.1. ==> generalites
48 parameter ( nompro = 'MMDEG0' )
68 integer ulsort, langue, codret
70 c 0.4. ==> variables locales
73 integer codre1, codre2, codre3, codre4, codre5
74 integer codre6, codre7
79 integer nbsegm, nbtria, nbquad, nbtetr, nbhexa, nbpyra, nbpent
80 integer nbfare, pcfaar
81 integer nbftri, pcfatr
82 integer nbfqua, pcfaqu
83 integer nbftet, pcfate
84 integer nbfhex, pcfahe
85 integer nbfpyr, pcfapy
86 integer nbfpen, pcfape
90 character*8 nhnoeu, nhmapo, nharet, nhtria, nhquad
91 character*8 nhtetr, nhhexa, nhpyra, nhpent
93 character*8 nhvois, nhsupe, nhsups
94 character*8 nharfa, nhtrfa, nhqufa
95 character*8 nhtefa, nhhefa, nhpyfa, nhpefa
98 parameter ( nbmess = 10 )
99 character*80 texte(nblang,nbmess)
101 c 0.5. ==> initialisations
102 c ______________________________________________________________________
108 c 1.1. ==> les messages
112 #ifdef _DEBUG_HOMARD_
113 write (ulsort,texte(langue,1)) 'Entree', nompro
117 texte(1,4) = '(5x,''Passage du degre '',i1,'' au degre '',i1,/)'
119 texte(2,4) = '(5x,''From degree '',i1,'' to '',i1,/)'
122 c 2. structure de donnees
125 c 2.1. ==> structure generale
127 if ( codret.eq.0 ) then
129 #ifdef _DEBUG_HOMARD_
130 write (ulsort,texte(langue,3)) 'UTNOMH', nompro
133 call utnomh ( nomail,
135 > degre, maconf, homolo, hierar,
136 > rafdef, nbmane, typcca, typsfr, maextr,
139 > nhnoeu, nhmapo, nharet,
141 > nhtetr, nhhexa, nhpyra, nhpent,
143 > nhvois, nhsupe, nhsups,
144 > ulsort, langue, codret)
147 cgn call gmprsx (nompro, nomail )
148 cgn call gmprsx (nompro, nomail//'.Volume' )
149 cgn call gmprsx (nompro, nomail//'.Volume.HOM_Te04' )
150 cgn call gmprsx (nompro, nharet//'.Famille' )
151 cgn call gmprsx (nompro, nhtria//'.Famille' )
152 cgn call gmprsx (nompro, nhquad//'.Famille' )
153 cgn call gmprsx (nompro, nhtetr//'.Famille' )
154 cgn call gmprsx(nompro,nhtetr//'.Famille')
158 if ( codret.eq.0 ) then
160 if ( degre.eq.1 ) then
164 nouvno = nbnoto + nbarto
174 write (ulsort,texte(langue,4)) degre, degnou
179 c 3. changement de degre pour les noeuds
181 #ifdef _DEBUG_HOMARD_
182 write (ulsort,*) '3. chang. de degre noeuds; codret = ', codret
185 if ( codret.eq.0 ) then
187 c 3.1. ==> Creation des noeuds P2
189 if ( degre.eq.1 ) then
191 #ifdef _DEBUG_HOMARD_
192 write (ulsort,texte(langue,3)) 'MMCNP2', nompro
195 call mmcnp2 ( nomail, nhnoeu, nharet,
197 > ulsort, langue, codret )
199 c 3.2. ==> Suppression des noeuds P2
203 #ifdef _DEBUG_HOMARD_
204 write (ulsort,texte(langue,3)) 'MMSNP2', nompro
207 call mmsnp2 ( nomail,
209 > ulsort, langue, codret )
216 c 4. changement de degre pour les elements
217 c les elements etant decrits par connectivite descendante, celle-ci
218 c est invariante par un changement de degre. Il suffit de changer la
219 c localisation de la branche.
221 #ifdef _DEBUG_HOMARD_
222 write (ulsort,*) '4. chang. de degre elem ; codret = ', codret
225 if ( codret.eq.0 ) then
227 if ( degre.eq.1 ) then
229 call gmcpgp ( nharet, nomail//'.Arete.HOM_Se03' , codre1 )
230 call gmcpgp ( nhtria, nomail//'.Face.HOM_Tr06' , codre2 )
231 call gmcpgp ( nhquad, nomail//'.Face.HOM_Qu08' , codre3 )
232 call gmcpgp ( nhtetr, nomail//'.Volume.HOM_Te10', codre4 )
233 call gmcpgp ( nhpyra, nomail//'.Volume.HOM_Py13', codre5 )
234 call gmcpgp ( nhhexa, nomail//'.Volume.HOM_He20', codre6 )
235 call gmcpgp ( nhpent, nomail//'.Volume.HOM_Pe15', codre7 )
239 call gmcpgp ( nharet, nomail//'.Arete.HOM_Se02' , codre1 )
240 call gmcpgp ( nhtria, nomail//'.Face.HOM_Tr03' , codre2 )
241 call gmcpgp ( nhquad, nomail//'.Face.HOM_Qu04' , codre3 )
242 call gmcpgp ( nhtetr, nomail//'.Volume.HOM_Te04', codre4 )
243 call gmcpgp ( nhpyra, nomail//'.Volume.HOM_Py05', codre5 )
244 call gmcpgp ( nhhexa, nomail//'.Volume.HOM_He08', codre6 )
245 call gmcpgp ( nhpent, nomail//'.Volume.HOM_Pe06', codre7 )
249 codre0 = min ( codre1, codre2, codre3, codre4, codre5,
251 codret = max ( abs(codre0), codret,
252 > codre1, codre2, codre3, codre4, codre5,
257 if ( codret.eq.0 ) then
259 call gmlboj ( nharet, codre1 )
260 call gmlboj ( nhtria, codre2 )
261 call gmlboj ( nhquad, codre3 )
262 call gmlboj ( nhtetr, codre4 )
263 call gmlboj ( nhpyra, codre5 )
264 call gmlboj ( nhhexa, codre6 )
265 call gmlboj ( nhpent, codre7 )
267 codre0 = min ( codre1, codre2, codre3, codre4, codre5,
269 codret = max ( abs(codre0), codret,
270 > codre1, codre2, codre3, codre4, codre5,
276 c 5. mise a jour des grandeurs caracteristiques
278 #ifdef _DEBUG_HOMARD_
279 write (ulsort,*) '5. mise a jour ; codret = ', codret
282 c 5.1. ==> nbmane : nombre maximal de noeud par element
284 if ( codret.eq.0 ) then
286 call gmadoj ( norenu//'.Nombres', adnbrn, iaux, codret )
290 if ( codret.eq.0 ) then
292 #ifdef _DEBUG_HOMARD_
293 write (ulsort,texte(langue,3)) 'UTNBMH', nompro
295 call utnbmh ( imem(adnbrn),
299 > iaux, iaux, iaux, iaux,
300 > iaux, nbsegm, nbtria, nbtetr,
301 > nbquad, nbhexa, nbpent, nbpyra,
304 > ulsort, langue, codret )
306 cgn print *, nbsegm, nbtria, nbquad, nbtetr, nbhexa, nbpent
308 if ( degnou.eq.1 ) then
310 if ( nbhexa.gt.0 ) then
312 elseif ( nbpent.gt.0 ) then
314 elseif ( nbpyra.gt.0 ) then
316 elseif ( nbtetr.gt.0 .or. nbquad.gt.0 ) then
318 elseif ( nbtria.gt.0 ) then
320 elseif ( nbsegm.gt.0 ) then
328 if ( nbhexa.gt.0 ) then
330 elseif ( nbpent.gt.0 ) then
332 elseif ( nbpyra.gt.0 ) then
334 elseif ( nbtetr.gt.0 ) then
336 elseif ( nbquad.gt.0 ) then
338 elseif ( nbtria.gt.0 ) then
340 elseif ( nbsegm.gt.0 ) then
349 call gmecat ( nomail, 8, nbmane , codret )
353 c 5.2. ==> le nombres d'entites
354 #ifdef _DEBUG_HOMARD_
355 write (ulsort,*) '5.2. nombre entites ; codret = ', codret
358 if ( codret.eq.0 ) then
360 nbnop2 = nbarto - nbnop2
364 call gmecat ( nhnoeu, 1, nbnoto, codre1 )
365 call gmecat ( nomail, 3, degre , codre2 )
367 codre0 = min ( codre1, codre2 )
368 codret = max ( abs(codre0), codret,
373 c 5.3. ==> reperage des tableaux des types d'elements
374 c attention, il faut refaire un appel a utnomh, car les
375 c branches ont ete permutees entre degres ...
376 #ifdef _DEBUG_HOMARD_
377 write (ulsort,*) '5.3. reperage ; codret = ', codret
380 if ( codret.eq.0 ) then
382 c call gmprsx (nompro,nomail)
383 c call gmprsx (nompro,nomail//'.Volume')
385 #ifdef _DEBUG_HOMARD_
386 write (ulsort,texte(langue,3)) 'UTNOMH', nompro
388 call utnomh ( nomail,
390 > degre, maconf, homolo, hierar,
391 > rafdef, nbmane, typcca, typsfr, maextr,
394 > nhnoeu, nhmapo, nharet,
396 > nhtetr, nhhexa, nhpyra, nhpent,
398 > nhvois, nhsupe, nhsups,
399 > ulsort, langue, codret)
403 if ( codret.eq.0 ) then
405 call gmnomc ( nharet//'.Famille', nharfa, codre1 )
406 call gmnomc ( nhtria//'.Famille', nhtrfa, codre2 )
407 call gmnomc ( nhquad//'.Famille', nhqufa, codre3 )
408 call gmnomc ( nhtetr//'.Famille', nhtefa, codre4 )
409 call gmnomc ( nhhexa//'.Famille', nhhefa, codre5 )
410 call gmnomc ( nhpyra//'.Famille', nhpyfa, codre6 )
411 call gmnomc ( nhpent//'.Famille', nhpefa, codre7 )
413 codre0 = min ( codre1, codre2, codre3, codre4, codre5,
415 codret = max ( abs(codre0), codret,
416 > codre1, codre2, codre3, codre4, codre5,
421 if ( codret.eq.0 ) then
423 call gmliat ( nharfa, 1, nbfare, codre1 )
424 call gmliat ( nhtrfa, 1, nbftri, codre2 )
425 call gmliat ( nhqufa, 1, nbfqua, codre3 )
426 call gmliat ( nhtefa, 1, nbftet, codre4 )
427 call gmliat ( nhpyfa, 1, nbfpyr, codre5 )
428 call gmliat ( nhhefa, 1, nbfhex, codre6 )
429 call gmliat ( nhpefa, 1, nbfpen, codre7 )
431 codre0 = min ( codre1, codre2, codre3, codre4 , codre5,
433 codret = max ( abs(codre0), codret,
434 > codre1, codre2, codre3, codre4, codre5,
439 if ( codret.eq.0 ) then
441 call gmadoj ( nharfa//'.Codes' , pcfaar, iaux, codre1 )
442 call gmadoj ( nhtrfa//'.Codes' , pcfatr, iaux, codre2 )
443 call gmadoj ( nhqufa//'.Codes' , pcfaqu, iaux, codre3 )
444 call gmadoj ( nhtefa//'.Codes' , pcfate, iaux, codre4 )
445 call gmadoj ( nhpyfa//'.Codes' , pcfapy, iaux, codre5 )
446 call gmadoj ( nhhefa//'.Codes' , pcfahe, iaux, codre6 )
447 call gmadoj ( nhpefa//'.Codes' , pcfape, iaux, codre7 )
449 codre0 = min ( codre1, codre2, codre3, codre4, codre5,
451 codret = max ( abs(codre0), codret,
452 > codre1, codre2, codre3, codre4, codre5,
457 c 5.4. ==> on echange le code du second champ de la description des
458 c familles : c'est celui qui designe le type de l'element
459 #ifdef _DEBUG_HOMARD_
460 write (ulsort,*) '5.4. echange de code ; codret = ', codret
463 if ( codret.eq.0 ) then
465 #ifdef _DEBUG_HOMARD_
466 write (ulsort,*) 'Avant appel a mmelde, codes des familles : '
467 call gmprsx (nompro, nharfa//'.Codes' )
468 call gmprsx (nompro, nhtrfa//'.Codes' )
469 call gmprsx (nompro, nhqufa//'.Codes' )
470 call gmprsx (nompro, nhtefa//'.Codes' )
471 call gmprsx (nompro, nhpyfa//'.Codes' )
472 call gmprsx (nompro, nhhefa//'.Codes' )
473 call gmprsx (nompro, nhpefa//'.Codes' )
476 #ifdef _DEBUG_HOMARD_
477 write (ulsort,texte(langue,3)) 'MMELDE', nompro
479 call mmelde ( typcca,
480 > nbfare, imem(pcfaar),
481 > nbftri, imem(pcfatr),
482 > nbfqua, imem(pcfaqu),
483 > nbftet, imem(pcfate),
484 > nbfhex, imem(pcfahe),
485 > nbfpyr, imem(pcfapy),
486 > nbfpen, imem(pcfape),
487 > ulsort, langue, codret )
489 #ifdef _DEBUG_HOMARD_
490 write (ulsort,*) 'Apres appel a mmelde, codes des familles : '
491 call gmprsx (nompro, nharfa//'.Codes' )
492 call gmprsx (nompro, nhtrfa//'.Codes' )
493 call gmprsx (nompro, nhqufa//'.Codes' )
494 call gmprsx (nompro, nhtefa//'.Codes' )
495 call gmprsx (nompro, nhpyfa//'.Codes' )
496 call gmprsx (nompro, nhhefa//'.Codes' )
497 call gmprsx (nompro, nhpefa//'.Codes' )
503 c 6. suppression des voisins par noeuds s'ils existent
505 #ifdef _DEBUG_HOMARD_
506 write (ulsort,*) '6. voisins ; codret = ', codret
509 if ( codret.eq.0 ) then
511 call gmobal ( nhvois//'.0D/1D', codre0 )
513 if ( codre0.eq.1 ) then
515 call gmlboj ( nhvois//'.0D/1D', codret )
517 elseif ( codre0.ne.0 ) then
529 if ( codret.ne.0 ) then
533 write (ulsort,texte(langue,1)) 'Sortie', nompro
534 write (ulsort,texte(langue,2)) codret
538 #ifdef _DEBUG_HOMARD_
539 write (ulsort,texte(langue,1)) 'Sortie', nompro