1 subroutine cmraff ( nomail,
2 > indnoe, indare, indtri, indqua,
3 > indtet, indhex, indpen,
4 > lgopts, taopts, lgetco, taetco,
5 > ulsort, langue, codret )
6 c ______________________________________________________________________
10 c Outil de Maillage Adaptatif par Raffinement et Deraffinement d'EDF R&D
12 c Version originale enregistree le 18 juin 1996 sous le numero 96036
13 c aupres des huissiers de justice Simart et Lavoir a Clamart
14 c Version 11.2 enregistree le 13 fevrier 2015 sous le numero 2015/014
15 c aupres des huissiers de justice
16 c Lavoir, Silinski & Cherqui-Abrahmi a Clamart
18 c HOMARD est une marque deposee d'Electricite de France
24 c ______________________________________________________________________
26 c Creation du Maillage - RAFFinement
28 c ______________________________________________________________________
30 c . nom . e/s . taille . description .
31 c .____________________________________________________________________.
32 c . nomail . e . ch8 . nom de l'objet contenant le maillage .
33 c . indnoe . es . 1 . indice du dernier noeud cree .
34 c . indare . es . 1 . indice de la derniere arete creee .
35 c . indtri . es . 1 . indice du dernier triangle cree .
36 c . indqua . es . 1 . indice du dernier quadrangle cree .
37 c . indtet . es . 1 . indice du dernier tetraedre cree .
38 c . indhex . es . 1 . indice du dernier hexaedre cree .
39 c . indpen . es . 1 . indice du dernier pentaedre cree .
40 c . lgopts . e . 1 . longueur du tableau des options caracteres .
41 c . taopts . e . lgopts . tableau des options caracteres .
42 c . lgetco . e . 1 . longueur du tableau de l'etat courant .
43 c . taetco . e . lgetco . tableau de l'etat courant .
44 c . ulsort . e . 1 . numero d'unite logique de la liste standard.
45 c . langue . e . 1 . langue des messages .
46 c . . . . 1 : francais, 2 : anglais .
47 c . codret . es . 1 . code de retour des modules .
48 c . . . . 0 : pas de probleme .
49 c ______________________________________________________________________
52 c 0. declarations et dimensionnement
55 c 0.1. ==> generalites
61 parameter ( nompro = 'CMRAFF' )
87 integer indnoe, indare, indtri, indqua
88 integer indtet, indhex, indpen
91 character*8 taopts(lgopts)
94 integer taetco(lgetco)
96 integer ulsort, langue, codret
98 c 0.4. ==> variables locales
101 integer nretap, nrsset
104 integer codre0, codre1, codre2
105 integer pdecar, pdecfa
106 integer phetno, pcoono, pareno
107 integer phetar, psomar, pfilar, pmerar, pnp2ar
108 integer phettr, paretr, pfiltr, ppertr, pnivtr, adnmtr
109 integer phetqu, parequ, pfilqu, pperqu, pnivqu, adnmqu
110 integer phette, ptrite, pcotrt, pfilte, pperte
111 integer phethe, pquahe, pcoquh, pfilhe, pperhe, adnmhe
112 integer phetpe, pfacpe, pcofap, pfilpe, pperpe
113 integer pfamno, pcfano
114 integer pfamar, pcfaar
115 integer pfamtr, pcfatr
116 integer pfamqu, pcfaqu
123 character*8 nhnoeu, nhmapo, nharet, nhtria, nhquad
124 character*8 nhtetr, nhhexa, nhpyra, nhpent
126 character*8 nhvois, nhsupe, nhsups
127 character*8 ntrav1, ntrav2
130 parameter ( nbmess = 10 )
131 character*80 texte(nblang,nbmess)
133 c 0.5. ==> initialisations
134 c ______________________________________________________________________
142 c=======================================================================
143 if ( codava.eq.0 ) then
144 c=======================================================================
146 c 1.3. ==> les messages
150 #ifdef _DEBUG_HOMARD_
151 write (ulsort,texte(langue,1)) 'Entree', nompro
155 texte(1,4) = '(/,a6,'' RAFFINEMENT STANDARD DU MAILLAGE'')'
156 texte(1,5) = '(39(''=''),/)'
158 > '(5x,''Nombre de '',a,'' crees :'',i10,'' ; total : '',i10)'
160 texte(2,4) = '(/,a6,'' STANDARD REFINEMENT OF MESH'')'
161 texte(2,5) = '(34(''=''),/)'
163 > '(5x,''Number of new '',a,'' :'',i10,'' ; total : '',i10)'
165 c 1.4. ==> le numero de sous-etape
168 nrsset = taetco(2) + 1
171 call utcvne ( nretap, nrsset, saux, iaux, codret )
175 write (ulsort,texte(langue,4)) saux
176 write (ulsort,texte(langue,5))
181 c 2. recuperation des pointeurs
184 c 2.1. ==> structure generale
186 if ( codret.eq.0 ) then
188 #ifdef _DEBUG_HOMARD_
189 write (ulsort,texte(langue,3)) 'UTNOMH', nompro
191 call utnomh ( nomail,
193 > degre, maconf, homolo, hierar,
194 > rafdef, nbmane, typcca, typsfr, maextr,
197 > nhnoeu, nhmapo, nharet,
199 > nhtetr, nhhexa, nhpyra, nhpent,
201 > nhvois, nhsupe, nhsups,
202 > ulsort, langue, codret)
205 cgn call gmprot(nompro//' -0',nharet//'.Famille.EntiFamm',1,26)
206 cgn call gmprot(nompro//' -0', nharet//'.Famille.EntiFamm',27,118)
210 if ( codret.eq.0 ) then
212 #ifdef _DEBUG_HOMARD_
213 write (ulsort,texte(langue,3)) 'UTAD01', nompro
216 call utad01 ( iaux, nhnoeu,
218 > pfamno, pcfano, jaux,
219 > pcoono, pareno, jaux, jaux,
220 > ulsort, langue, codret )
222 #ifdef _DEBUG_HOMARD_
223 write (ulsort,texte(langue,3)) 'UTAD02_ar', nompro
226 if ( degre.eq.2 ) then
229 call utad02 ( iaux, nharet,
230 > phetar, psomar, pfilar, pmerar,
231 > pfamar, pcfaar, jaux,
232 > jaux , pnp2ar, jaux,
234 > ulsort, langue, codret )
236 if ( nbtrto.ne.0 ) then
238 #ifdef _DEBUG_HOMARD_
239 write (ulsort,texte(langue,3)) 'UTAD02_tr', nompro
242 if ( mod(mailet,2).eq.0 ) then
245 call utad02 ( iaux, nhtria,
246 > phettr, paretr, pfiltr, ppertr,
247 > pfamtr, pcfatr, jaux,
248 > pnivtr, jaux, jaux,
249 > adnmtr, jaux, jaux,
250 > ulsort, langue, codret )
254 if ( nbquto.ne.0 ) then
256 #ifdef _DEBUG_HOMARD_
257 write (ulsort,texte(langue,3)) 'UTAD02_qu', nompro
260 if ( mod(mailet,3).eq.0 ) then
263 call utad02 ( iaux, nhquad,
264 > phetqu, parequ, pfilqu, pperqu,
265 > pfamqu, pcfaqu, jaux,
266 > pnivqu, jaux, jaux,
267 > adnmqu, jaux, jaux,
268 > ulsort, langue, codret )
272 if ( nbteto.ne.0 ) then
274 #ifdef _DEBUG_HOMARD_
275 write (ulsort,texte(langue,3)) 'UTAD02_te', nompro
278 call utad02 ( iaux, nhtetr,
279 > phette, ptrite, pfilte, pperte,
280 > pfamte, jaux, jaux,
281 > jaux , pcotrt, jaux,
283 > ulsort, langue, codret )
287 if ( nbheto.ne.0 ) then
289 #ifdef _DEBUG_HOMARD_
290 write (ulsort,texte(langue,3)) 'UTAD02_he', nompro
293 if ( mod(mailet,5).eq.0 ) then
296 call utad02 ( iaux, nhhexa,
297 > phethe, pquahe, pfilhe, pperhe,
298 > pfamhe, jaux, jaux,
299 > jaux , pcoquh, jaux,
300 > adnmhe, jaux, jaux,
301 > ulsort, langue, codret )
305 if ( nbpeto.ne.0 ) then
307 #ifdef _DEBUG_HOMARD_
308 write (ulsort,texte(langue,3)) 'UTAD02_pe', nompro
311 call utad02 ( iaux, nhpent,
312 > phetpe, pfacpe, pfilpe, pperpe,
313 > pfampe, jaux, jaux,
314 > jaux , pcofap, jaux,
316 > ulsort, langue, codret )
322 if ( codret.eq.0 ) then
325 call gmadoj ( ntrav1, pdecar, iaux, codre1 )
327 call gmadoj ( ntrav2, pdecfa, iaux, codre2 )
329 codre0 = min ( codre1, codre2 )
330 codret = max ( abs(codre0), codret,
332 cgn call gmprsx (nompro,ntrav1)
333 cgn call gmprsx (nompro,ntrav2)
338 c 3. decoupage des aretes en degre 1 et degre 2
341 #ifdef _DEBUG_HOMARD_
342 write (ulsort,90002) '3. aretes ; codret', codret
343 write (ulsort,90002) 'indare', indare
346 #ifdef _DEBUG_HOMARD_
347 do 3011 , iaux = 1 , nbarto
348 if ( iaux.eq.-1661 ) then
349 write (ulsort,9001) 'arete', iaux,
350 > imem(psomar+2*iaux-2), imem(psomar+2*iaux-1),
351 > imem(pfilar+iaux-1),imem(phetar+iaux-1),imem(pdecar+iaux)
354 9001 format(a,i8,', som :',2i8,', fille',i8,', e/d',i3,3i2)
357 if ( codret.eq.0 ) then
359 if ( degre.eq.1 ) then
361 #ifdef _DEBUG_HOMARD_
362 write (ulsort,texte(langue,3)) 'CMRDA1', nompro
365 > ( rmem(pcoono), imem(phetno), imem(pareno), imem(psomar),
366 > imem(phetar), imem(pfilar), imem(pmerar), imem(pdecar),
367 > imem(pcfaar), imem(pfamar), imem(pfamno),
369 > ulsort, langue, codret )
371 elseif ( degre.eq.2 ) then
373 #ifdef _DEBUG_HOMARD_
374 write (ulsort,texte(langue,3)) 'CMRDA2', nompro
377 > ( imem(phetno), imem(psomar), imem(phetar), imem(pfilar),
378 > imem(pmerar), imem(pdecar), imem(pnp2ar),
379 > imem(pcfaar), imem(pfamar),
381 > ulsort, langue, codret )
384 write(ulsort,90050) degre
389 #ifdef _DEBUG_HOMARD_
390 cgn do 30012 , iaux = 1 , nbarto
391 cgn if ( iaux.eq.478 ) then
392 cgn write (ulsort,9001) 'arete', iaux,
393 cgn > imem(psomar+2*iaux-2), imem(psomar+2*iaux-1),
394 cgn > imem(pfilar+iaux-1),imem(phetar+iaux-1),imem(pdecar+iaux)
398 cgn write(ulsort,90002) 'indare', indare
399 cgn call gmprot(nompro//' -1',nharet//'.Famille.EntiFamm',1,26)
400 cgn call gmprot(nompro//' -1', nharet//'.Famille.EntiFamm',27,118)
403 c 4. decoupage des triangles
406 #ifdef _DEBUG_HOMARD_
407 write (ulsort,90002) '4. triangles ; codret', codret
410 if ( codret.eq.0 ) then
412 if ( nbtrto.ne.0 ) then
414 #ifdef _DEBUG_HOMARD_
415 write (ulsort,texte(langue,3)) 'CMRDTR', nompro
418 > ( imem(psomar), imem(phetar), imem(pfilar), imem(pmerar),
419 > imem(paretr), imem(phettr), imem(pfiltr), imem(ppertr),
420 > imem(pnivtr), imem(pdecfa),
421 > imem(pfamar), imem(pfamtr),
424 > ulsort, langue, codret )
431 c 5. decoupage des quadrangles
434 #ifdef _DEBUG_HOMARD_
435 write (ulsort,90002) '5. quadrangles ; codret', codret
438 if ( codret.eq.0 ) then
440 if ( nbquto.ne.0 ) then
442 #ifdef _DEBUG_HOMARD_
443 write (ulsort,texte(langue,3)) 'CMRDQU', nompro
446 > ( rmem(pcoono), imem(phetno), imem(pareno),
447 > imem(psomar), imem(phetar), imem(pfilar), imem(pmerar),
448 > imem(parequ), imem(phetqu), imem(pfilqu), imem(pperqu),
449 > imem(pnivqu), imem(adnmqu), imem(pdecfa),
450 > imem(pfamno), imem(pfamar), imem(pfamqu),
451 > indnoe, indare, indqua,
453 > ulsort, langue, codret )
460 c 6. decoupage des tetraedres
463 #ifdef _DEBUG_HOMARD_
464 write (ulsort,90002) '6. tetraedres ; codret', codret
467 if ( codret.eq.0 ) then
469 if ( nbteto.ne.0 ) then
471 #ifdef _DEBUG_HOMARD_
472 write (ulsort,texte(langue,3)) 'CMRDTE', nompro
476 > imem(psomar), imem(phetar), imem(pfilar), imem(pmerar),
477 > imem(paretr), imem(phettr),
478 > imem(pfiltr), imem(ppertr), imem(pnivtr),
479 > imem(ptrite), imem(pcotrt), imem(phette), imem(pfilte),
481 > imem(pfamar), imem(pfamtr), imem(pfamte),
482 > indare, indtri, indtet,
483 > ulsort, langue, codret )
490 c 7. decoupage des hexaedres
493 #ifdef _DEBUG_HOMARD_
494 write (ulsort,90002) '7. hexaedres ; codret', codret
497 if ( codret.eq.0 ) then
499 if ( nbheto.ne.0 ) then
501 #ifdef _DEBUG_HOMARD_
502 write (ulsort,texte(langue,3)) 'CMRDHE', nompro
505 > ( rmem(pcoono), imem(phetno), imem(pareno),
506 > imem(psomar), imem(phetar), imem(pfilar), imem(pmerar),
507 > imem(parequ), imem(phetqu),
508 > imem(pfilqu), imem(pperqu), imem(pnivqu),
509 > imem(pquahe), imem(pcoquh), imem(phethe),
510 > imem(pfilhe), imem(pperhe), imem(adnmhe),
511 > imem(pfamno), imem(pfamar), imem(pfamqu), imem(pfamhe),
512 > indnoe, indare, indqua, indhex,
513 > ulsort, langue, codret )
520 c 8 decoupage des pentaedres
523 #ifdef _DEBUG_HOMARD_
524 write (ulsort,90002) '8. pentaedres ; codret', codret
527 if ( codret.eq.0 ) then
529 if ( nbpeto.ne.0 ) then
531 #ifdef _DEBUG_HOMARD_
532 write (ulsort,texte(langue,3)) 'CMRDPE', nompro
535 > ( imem(psomar), imem(phetar), imem(pfilar), imem(pmerar),
536 > imem(paretr), imem(phettr),
537 > imem(pfiltr), imem(ppertr), imem(pnivtr),
538 > imem(parequ), imem(phetqu),
539 > imem(pfilqu), imem(pperqu), imem(pnivqu),
540 > imem(pfacpe), imem(pcofap), imem(phetpe),
541 > imem(pfilpe), imem(pperpe),
542 > imem(pfamar), imem(pfamtr), imem(pfamqu), imem(pfampe),
543 > indare, indtri, indqua, indpen,
544 > ulsort, langue, codret )
551 c 9. verifications des nombres d'entites crees et impressions
554 #ifdef _DEBUG_HOMARD_
555 write (ulsort,90002) '9. verifications ; codret', codret
558 if ( codret.eq.0 ) then
560 write(ulsort,texte(langue,6)) mess14(langue,3,-1),
561 > indnoe-nbnoto, indnoe
562 write(ulsort,texte(langue,6)) mess14(langue,3,1),
563 > indare-nbarto, indare
564 if ( nbtrto.ne.0 ) then
565 write(ulsort,texte(langue,6)) mess14(langue,3,2),
566 > indtri-nbtrto, indtri
568 if ( nbquto.ne.0 ) then
569 write(ulsort,texte(langue,6)) mess14(langue,3,4),
570 > indqua-nbquto, indqua
572 if ( nbteto.ne.0 ) then
573 write(ulsort,texte(langue,6)) mess14(langue,3,3),
574 > indtet-nbteto, indtet
576 if ( nbheto.ne.0 ) then
577 write(ulsort,texte(langue,6)) mess14(langue,3,6),
578 > indhex-nbheto, indhex
580 if ( nbpeto.ne.0 ) then
581 write(ulsort,texte(langue,6)) mess14(langue,3,7),
582 > indpen-nbpeto, indpen
586 if ( degre.eq.1 ) then
587 if ( indnoe.ne.nouvno ) then
588 write(ulsort,90100) mess14(langue,3,-1), permno-nbnoto
592 if ( indare.ne.permar ) then
593 write(ulsort,90100) mess14(langue,3,1), permar-nbarto
596 if ( nbtrto.ne.0 .and. indtri.ne.permtr ) then
597 write(ulsort,90100) mess14(langue,3,2), permtr-nbtrto
600 if ( nbquto.ne.0 .and. indqua.ne.permqu ) then
601 write(ulsort,90100) mess14(langue,3,4), permqu-nbquto
604 if ( nbteto.ne.0 .and. indtet.ne.permte ) then
605 write(ulsort,90100) mess14(langue,3,3), permte-nbteto
608 if ( nbheto.ne.0 .and. indhex.ne.permhe ) then
609 write(ulsort,90100) mess14(langue,3,6), permhe-nbheto
612 if ( nbpeto.ne.0 .and. indpen.ne.permpe ) then
613 write(ulsort,90100) mess14(langue,3,7), permpe-nbpeto
617 if ( iaux.ne.0 ) then
622 cgn call gmprsx(nompro,nhnoeu)
624 90050 format(/,5x,'Le degre d''interpolation est : ',i1,
625 > /,5x,'Seules les discretisations de degres 1 et 2 sont ',
627 90100 format(/,5x,'Nombre de ',a,' crees incorrect, ',
628 > /,5x,'On en attendait ',i10,' nouveaux.')
634 if ( codret.ne.0 ) then
638 write (ulsort,texte(langue,1)) 'Sortie', nompro
639 write (ulsort,texte(langue,2)) codret
643 #ifdef _DEBUG_HOMARD_
644 write (ulsort,texte(langue,1)) 'Sortie', nompro
648 c=======================================================================
650 c=======================================================================