1 subroutine cmconf ( nomail,
4 > indtet, indpyr, indhex,
5 > lgopti, taopti, lgopts, taopts,
7 > ulsort, langue, codret )
8 c ______________________________________________________________________
12 c Outil de Maillage Adaptatif par Raffinement et Deraffinement d'EDF R&D
14 c Version originale enregistree le 18 juin 1996 sous le numero 96036
15 c aupres des huissiers de justice Simart et Lavoir a Clamart
16 c Version 11.2 enregistree le 13 fevrier 2015 sous le numero 2015/014
17 c aupres des huissiers de justice
18 c Lavoir, Silinski & Cherqui-Abrahmi a Clamart
20 c HOMARD est une marque deposee d'Electricite de France
26 c ______________________________________________________________________
28 c Creation du Maillage - mise en CONFormite
30 c ______________________________________________________________________
32 c but : mise en conformite du maillage :
33 c - decoupage des triangles en 2
34 c - decoupage des quadrangles en 3 triangles,
35 c en 2 ou 3 quadrangles
36 c - decoupage des tetraedres en 2 ou en 4
37 c - decoupage des hexaedres en hexaedres, pyramides et tetraedres
38 c - decoupage des pentaedres en pyramides et tetraedres
39 c ______________________________________________________________________
41 c . nom . e/s . taille . description .
42 c .____________________________________________________________________.
43 c . nomail . e . ch8 . nom de l'objet contenant le maillage .
44 c . indnoe . es . 1 . indice du dernier noeud cree .
45 c . indare . es . 1 . indice de la derniere arete creee .
46 c . indtri . es . 1 . indice du dernier triangle cree .
47 c . indqua . es . 1 . indice du dernier quadrangle cree .
48 c . indtet . es . 1 . indice du dernier tetraedre cree .
49 c . indpyr . es . 1 . indice de la derniere pyramide creee .
50 c . indhex . es . 1 . indice du dernier hexaedre cree .
51 c . lgopti . e . 1 . longueur du tableau des options entieres .
52 c . taopti . e . lgopti . tableau des options .
53 c . lgopts . e . 1 . longueur du tableau des options caracteres .
54 c . taopts . e . lgopts . tableau des options caracteres .
55 c . lgetco . e . 1 . longueur du tableau de l'etat courant .
56 c . taetco . e . lgetco . tableau de l'etat courant .
57 c . ulsort . e . 1 . numero d'unite logique de la liste standard.
58 c . langue . e . 1 . langue des messages .
59 c . . . . 1 : francais, 2 : anglais .
60 c . codret . es . 1 . code de retour des modules .
61 c . . . . 0 : pas de probleme .
62 c ______________________________________________________________________
65 c 0. declarations et dimensionnement
68 c 0.1. ==> generalites
74 parameter ( nompro = 'CMCONF' )
100 integer indnoe, indare, indtri, indqua
101 integer indtet, indpyr, indhex
104 integer taopti(lgopti)
107 character*8 taopts(lgopts)
110 integer taetco(lgetco)
112 integer ulsort, langue, codret
114 c 0.4. ==> variables locales
117 integer nretap, nrsset
122 integer phetno, pcoono, pareno
123 integer phetar, psomar, pfilar, pmerar
124 integer phettr, paretr, pfiltr, ppertr, pnivtr
125 integer phetqu, parequ, pfilqu, pperqu, pnivqu, adnmqu
126 integer phette, ptrite, pcotrt, pfilte, pperte, adtes2, parete
127 integer phetpe, pfacpe, pcofap, pfilpe, pperpe, adpes2, parepe
128 integer phetpy, pfacpy, pcofay, pfilpy, pperpy, adpys2, parepy
129 integer pquahe, pcoquh, phethe, pfilhe, pperhe, adhes2, parehe
130 integer pfamno, pcfano
132 integer pfamtr, pcfatr
134 integer pfamqu, pcfaqu
135 integer pfamhe, pcfahe
136 integer pfampe, pcfape
139 integer indtea, indpya, indhea
143 character*8 nhnoeu, nhmapo, nharet, nhtria, nhquad
144 character*8 nhtetr, nhhexa, nhpyra, nhpent
146 character*8 nhvois, nhsupe, nhsups
150 parameter ( nbmess = 10 )
151 character*80 texte(nblang,nbmess)
153 c 0.5. ==> initialisations
154 c ______________________________________________________________________
162 c=======================================================================
163 if ( codava.eq.0 ) then
164 c=======================================================================
166 c 1.3. ==> les messages
170 #ifdef _DEBUG_HOMARD_
171 write (ulsort,texte(langue,1)) 'Entree', nompro
176 > '(/,a6,'' MISE EN CONFORMITE DU MAILLAGE'')'
177 texte(1,5) = '(37(''=''),/)'
179 >'(5x,''Nombre de '',a,'' crees :'',i10)'
181 > '(5x,''Ce nombre est incorrect. On en attendait'',i10)'
184 > '(/,a6,'' MESH CONFORMITY'')'
185 texte(2,5) = '(22(''=''),/)'
186 texte(2,6) = '(5x,''Number of new '',a,'':'',i10)'
188 > '(5x,''Wrong number.'',i10,'' were expected.'')'
192 c 1.4. ==> le numero de sous-etape
195 nrsset = taetco(2) + 1
198 call utcvne ( nretap, nrsset, saux, iaux, codret )
202 write ( ulsort,texte(langue,4)) saux
203 write ( ulsort,texte(langue,5))
205 #ifdef _DEBUG_HOMARD_
206 write (ulsort,90006) 'nouvar =', nouvar, 'provar =', provar
207 write (ulsort,90006) 'nouvtr =', nouvtr, 'provtr =', provtr
208 write (ulsort,90006) 'nouvqu =', nouvqu, 'provqu =', provqu
209 write (ulsort,90006) 'nouvte =', nouvte, 'provte =', provte,
210 > 'provtf =', provtf, 'provta =', provta
211 write (ulsort,90006) 'nouvhe =', nouvhe, 'provhe =', provhe,
212 > 'provhf =', provhf, 'provha =', provha,
214 write (ulsort,90006) 'nouvpe =', nouvpe, 'provpe =', provpe,
216 write (ulsort,90006) 'nouvpy =', nouvpy, 'provpy =', provpy,
217 > 'provyf =', provyf, 'provya =', provya
221 c 2. recuperation des pointeurs
224 c 2.1. ==> structure generale
226 if ( codret.eq.0 ) then
228 #ifdef _DEBUG_HOMARD_
229 write (ulsort,texte(langue,3)) 'UTNOMH', nompro
232 call utnomh ( nomail,
234 > degre, maconf, homolo, hierar,
235 > rafdef, nbmane, typcca, typsfr, maextr,
238 > nhnoeu, nhmapo, nharet,
240 > nhtetr, nhhexa, nhpyra, nhpent,
242 > nhvois, nhsupe, nhsups,
243 > ulsort, langue, codret)
249 if ( codret.eq.0 ) then
251 if ( nouvno.eq.nbnoto ) then
256 #ifdef _DEBUG_HOMARD_
257 write (ulsort,texte(langue,3)) 'UTAD01', nompro
259 call utad01 ( iaux, nhnoeu,
261 > pfamno, pcfano, jaux,
262 > pcoono, pareno, jaux, jaux,
263 > ulsort, langue, codret )
266 #ifdef _DEBUG_HOMARD_
267 write (ulsort,texte(langue,3)) 'UTAD02_ar', nompro
269 call utad02 ( iaux, nharet,
270 > phetar, psomar, pfilar, pmerar,
271 > pfamar, jaux, jaux,
274 > ulsort, langue, codret )
276 if ( nouvtr.ne.0 ) then
279 #ifdef _DEBUG_HOMARD_
280 write (ulsort,texte(langue,3)) 'UTAD02_tr', nompro
282 call utad02 ( iaux, nhtria,
283 > phettr, paretr, pfiltr, ppertr,
284 > pfamtr, pcfatr, jaux,
285 > pnivtr, jaux, jaux,
287 > ulsort, langue, codret )
291 if ( nbquto.ne.0 ) then
294 if ( mod(mailet,3).eq.0 ) then
297 #ifdef _DEBUG_HOMARD_
298 write (ulsort,texte(langue,3)) 'UTAD02_qu', nompro
300 call utad02 ( iaux, nhquad,
301 > phetqu, parequ, pfilqu, pperqu,
302 > pfamqu, pcfaqu, jaux,
303 > pnivqu, jaux, jaux,
304 > adnmqu, jaux, jaux,
305 > ulsort, langue, codret )
309 if ( provte.ne.0 ) then
312 if ( nbheco.ne.0 .or. nbpeco.ne.0 ) then
315 if ( taopti(30).ge.0 .and. nbteca.gt.0 ) then
318 #ifdef _DEBUG_HOMARD_
319 write (ulsort,texte(langue,3)) 'UTAD02_te', nompro
321 call utad02 ( iaux, nhtetr,
322 > phette, ptrite, pfilte, pperte,
323 > pfamte, jaux, jaux,
324 > jaux, pcotrt, adtes2,
325 > jaux, jaux, parete,
326 > ulsort, langue, codret )
330 if ( nbheto.ne.0 ) then
333 if ( nbheco.ne.0 ) then
336 if ( taopti(30).ge.0 .and. nbheca.gt.0 ) then
339 #ifdef _DEBUG_HOMARD_
340 write (ulsort,texte(langue,3)) 'UTAD02_he', nompro
342 call utad02 ( iaux, nhhexa,
343 > phethe, pquahe, pfilhe, pperhe,
344 > pfamhe, pcfahe, jaux,
345 > jaux, pcoquh, adhes2,
346 > jaux, jaux, parehe,
347 > ulsort, langue, codret )
351 if ( nbpeto.ne.0 ) then
354 if ( nbpeco.ne.0 ) then
357 if ( taopti(30).ge.0 .and. nbpeca.gt.0 ) then
360 #ifdef _DEBUG_HOMARD_
361 write (ulsort,texte(langue,3)) 'UTAD02_pe', nompro
363 call utad02 ( iaux, nhpent,
364 > phetpe, pfacpe, pfilpe, pperpe,
365 > pfampe, pcfape, jaux,
366 > jaux, pcofap, adpes2,
367 > jaux, jaux, parepe,
368 > ulsort, langue, codret )
372 if ( provpy.ne.0 ) then
375 if ( nbheco.ne.0 .or. nbpeco.ne.0 ) then
378 if ( taopti(30).ge.0 .and. nbpyca.gt.0 ) then
381 #ifdef _DEBUG_HOMARD_
382 write (ulsort,texte(langue,3)) 'UTAD02_py', nompro
384 call utad02 ( iaux, nhpyra,
385 > phetpy, pfacpy, pfilpy, pperpy,
386 > pfampy, jaux, jaux,
387 > jaux, pcofay, adpys2,
388 > jaux, jaux, parepy,
389 > ulsort, langue, codret )
395 if ( codret.eq.0 ) then
398 call gmadoj ( ntrav1, pdecfa, iaux, codre0 )
399 codret = max ( abs(codre0), codret )
403 c 2.3. ==> indice de depart des volumes decrits par aretes
405 if ( codret.eq.0 ) then
410 #ifdef _DEBUG_HOMARD_
411 write (ulsort,90002) 'indtet, indtea', indtet, indtea
417 c 3. decoupage des triangles en 2
419 #ifdef _DEBUG_HOMARD_
420 write (ulsort,90002) '3. triangles ; codret', codret
423 if ( codret.eq.0 ) then
425 if ( nbtrto.ne.0 .and. provtr.gt.0 ) then
427 #ifdef _DEBUG_HOMARD_
428 write (ulsort,texte(langue,3)) 'CMCDTR', nompro
431 call cmcdtr ( indare, indtri, imem(pdecfa),
432 > imem(phetar), imem(psomar),
433 > imem(pfilar), imem(pmerar), imem(pfamar),
434 > imem(phettr), imem(paretr),
435 > imem(pfiltr), imem(ppertr), imem(pfamtr),
438 > ulsort, langue, codret )
445 c 4. decoupage des quadrangles en 3 triangles, en 2 ou 3 quadrangles
447 #ifdef _DEBUG_HOMARD_
448 write (ulsort,90002) '4. quadrangles ; codret', codret
451 if ( codret.eq.0 ) then
453 if ( nbquto.ne.0 .and. ( provtr.gt.0 .or. provqu.gt.0 ) ) then
455 #ifdef _DEBUG_HOMARD_
456 write (ulsort,texte(langue,3)) 'CMCDQU', nompro
459 call cmcdqu ( indnoe, indare, indtri, indqua, imem(pdecfa),
460 > rmem(pcoono), imem(phetno), imem(pareno),
462 > imem(phetar), imem(psomar),
463 > imem(pfilar), imem(pmerar), imem(pfamar),
464 > imem(phettr), imem(paretr),
465 > imem(pfiltr), imem(ppertr), imem(pfamtr),
467 > imem(phetqu), imem(parequ),
468 > imem(pfilqu), imem(pperqu), imem(pfamqu),
469 > imem(pnivqu), imem(adnmqu),
471 > ulsort, langue, codret )
478 c 5. decoupage des tetraedres en 2 ou 4 tetraedres
480 #ifdef _DEBUG_HOMARD_
481 write (ulsort,90002) '5. tetraedres ; codret', codret
484 if ( codret.eq.0 ) then
486 if ( nbteto.ne.0 .and. provte.gt.0 ) then
488 #ifdef _DEBUG_HOMARD_
489 write (ulsort,texte(langue,3)) 'CMCDTE', nompro
492 call cmcdte ( indare, indtri, indtet,
493 > imem(phetar), imem(psomar),
494 > imem(pfilar), imem(pmerar), imem(pfamar),
495 > imem(phettr), imem(paretr),
496 > imem(pfiltr), imem(ppertr), imem(pfamtr),
498 > imem(phette), imem(ptrite), imem(pcotrt),
499 > imem(pfilte), imem(pperte), imem(pfamte),
500 > ulsort, langue, codret )
507 c 6. decoupage des hexaedres en pyramides, tetraedres, hexaedres
509 #ifdef _DEBUG_HOMARD_
510 write (ulsort,90002) '6. hexaedres ; codret', codret
513 if ( codret.eq.0 ) then
515 if ( nbheto.ne.0 .and.
516 > ( provte.gt.0 .or. provpy.gt.0 .or. provhe.gt.0 ) ) then
518 c 6.1. ==> conforme, avec des boites pour les hexaedres
520 if ( taopti(30).eq.-1 ) then
521 #ifdef _DEBUG_HOMARD_
522 write (ulsort,*) 'conforme, avec des boites pour les hexaedres'
524 #ifdef _DEBUG_HOMARD_
525 write (ulsort,texte(langue,3)) 'CMCDHB', nompro
528 call cmcdhb ( indnoe, indare, indtri, indtet, indpyr,
529 > rmem(pcoono), imem(phetno), imem(pareno),
531 > imem(phetar), imem(psomar),
532 > imem(pfilar), imem(pmerar), imem(pfamar),
533 > imem(phettr), imem(paretr),
534 > imem(pfiltr), imem(ppertr), imem(pfamtr),
536 > imem(phetqu), imem(parequ),
538 > imem(phette), imem(ptrite), imem(pcotrt),
539 > imem(pfilte), imem(pperte), imem(pfamte),
541 > imem(phetpy), imem(pfacpy), imem(pcofay),
542 > imem(pfilpy), imem(pperpy), imem(pfampy),
544 > imem(pquahe), imem(pcoquh), imem(phethe),
545 > imem(pfilhe), imem(adhes2),
546 > imem(pfamhe), imem(pcfahe),
547 > ulsort, langue, codret )
549 c 6.2. ==> conforme general
552 #ifdef _DEBUG_HOMARD_
553 write (ulsort,*) nompro, ' - conforme'
555 #ifdef _DEBUG_HOMARD_
556 write (ulsort,texte(langue,3)) 'CMCDHE', nompro
559 call cmcdhe ( indnoe, indare, indtea, indpya, indhea,
560 > rmem(pcoono), imem(phetno), imem(pareno),
562 > imem(phetar), imem(psomar),
563 > imem(pfilar), imem(pmerar), imem(pfamar),
567 > imem(phette), imem(parete),
568 > imem(pfilte), imem(pperte), imem(pfamte),
570 > imem(phetpy), imem(parepy),
571 > imem(pfilpy), imem(pperpy), imem(pfampy),
573 > imem(phethe), imem(parehe),
574 > imem(pfilhe), imem(adhes2), imem(pperhe),
575 > imem(pfamhe), imem(pcfahe),
576 > imem(pquahe), imem(pcoquh),
577 > ulsort, langue, codret )
584 cgn call gmprsx (nompro,nhhexa//'.ConnDesc')
585 cgn call gmprsx (nompro,nhhexa//'.ConnAret')
586 cgn call gmprsx (nompro,nhhexa//'.InfoSupp')
587 cgn call gmprsx (nompro,nhpyra//'.ConnAret')
588 cgn call gmprsx (nompro,nhpyra//'.ConnDesc')
589 cgn call gmprsx (nompro,nhpyra//'.InfoSup2')
590 cgn call gmprsx (nompro,nhhexa//'.InfoSup2')
591 cgn call gmprsx (nompro,nhvois)
592 cgn call gmprsx (nompro,nhvois//'.Vol/Tri')
593 cgn call gmprsx (nompro,nhvois//'.Vol/Qua')
594 cgn call gmprsx (nompro,nhvois//'.PyPe/Tri')
595 cgn call gmprsx (nompro,nhvois//'.PyPe/Qua')
598 c 7. decoupage des pentaedres en pyramides et tetraedres
600 #ifdef _DEBUG_HOMARD_
601 write (ulsort,90002) '7. pentaedres ; codret', codret
604 if ( codret.eq.0 ) then
606 if ( nbpeto.ne.0 .and. ( provte.gt.0 .or. provpy.gt.0 ) ) then
608 #ifdef _DEBUG_HOMARD_
609 write (ulsort,texte(langue,3)) 'CMCDPE', nompro
612 call cmcdpe ( indnoe, indare, indtri, indtet, indpyr,
613 > rmem(pcoono), imem(phetno), imem(pareno),
615 > imem(phetar), imem(psomar),
616 > imem(pfilar), imem(pmerar), imem(pfamar),
617 > imem(phettr), imem(paretr),
618 > imem(pfiltr), imem(ppertr), imem(pfamtr),
620 > imem(phetqu), imem(parequ),
622 > imem(phette), imem(ptrite), imem(pcotrt),
623 > imem(pfilte), imem(pperte), imem(pfamte),
625 > imem(phetpy), imem(pfacpy), imem(pcofay),
626 > imem(pfilpy), imem(pperpy), imem(pfampy),
628 > imem(pfacpe), imem(pcofap), imem(phetpe),
629 > imem(pfilpe), imem(adpes2),
630 > imem(pfampe), imem(pcfape),
631 > ulsort, langue, codret )
636 cgn call gmprsx (nompro,nhpyra//'.ConnDesc')
637 cgn call gmprsx (nompro,nhhexa//'.InfoSup2')
638 cgn call gmprsx (nompro,nhvois)
639 cgn call gmprsx (nompro,nhvois//'.Vol/Tri')
640 cgn call gmprsx (nompro,nhvois//'.Vol/Qua')
641 cgn call gmprsx (nompro,nhvois//'.PyPe/Tri')
642 cgn call gmprsx (nompro,nhvois//'.PyPe/Qua')
645 c 8. verifications des nombres d'entites crees et impressions
647 #ifdef _DEBUG_HOMARD_
648 write (ulsort,90002) '8. verifications ; codret', codret
651 if ( codret.eq.0 ) then
659 c attention : on ne sait pas verifier avec des noeuds P2
661 if ( degre.eq.1 ) then
662 if ( provp1.ne.0 ) then
663 write (ulsort,texte(langue,6)) mess14(langue,3,-1),
665 if ( indnoe.ne.nouvno ) then
666 write (ulsort,texte(langue,7)) provp1
672 if ( provar.ne.0 ) then
673 write (ulsort,texte(langue,6)) mess14(langue,3,1),
675 if ( indare.ne.nouvar ) then
676 write (ulsort,texte(langue,7)) provar
681 if ( provtr.ne.0 ) then
682 write (ulsort,texte(langue,6)) mess14(langue,3,2),
684 if ( indtri.ne.nouvtr ) then
685 write (ulsort,texte(langue,7)) provtr
690 if ( provqu.ne.0 ) then
691 write (ulsort,texte(langue,6)) mess14(langue,3,4),
693 if ( indqua.ne.nouvqu ) then
694 write (ulsort,texte(langue,7)) provqu
699 if ( provte.ne.0 ) then
700 write (ulsort,texte(langue,6)) mess14(langue,3,3),
702 if ( indtet.ne.nouvte ) then
703 write (ulsort,texte(langue,7)) provte
708 if ( provpy.ne.0 ) then
709 write (ulsort,texte(langue,6)) mess14(langue,3,5),
711 if ( indpyr.ne.nouvpy ) then
712 write (ulsort,texte(langue,7)) provpy
717 if ( iaux.gt.0 ) then
727 if ( codret.ne.0 ) then
731 write (ulsort,texte(langue,1)) 'Sortie', nompro
732 write (ulsort,texte(langue,2)) codret
736 #ifdef _DEBUG_HOMARD_
737 write (ulsort,texte(langue,1)) 'Sortie', nompro
741 c=======================================================================
743 c=======================================================================