1 subroutine utvgvf ( nhvois, nhtria, nhquad,
2 > nhtetr, nhhexa, nhpyra, nhpent,
4 > ulsort, langue, codret )
5 c ______________________________________________________________________
9 c Outil de Maillage Adaptatif par Raffinement et Deraffinement d'EDF R&D
11 c Version originale enregistree le 18 juin 1996 sous le numero 96036
12 c aupres des huissiers de justice Simart et Lavoir a Clamart
13 c Version 11.2 enregistree le 13 fevrier 2015 sous le numero 2015/014
14 c aupres des huissiers de justice
15 c Lavoir, Silinski & Cherqui-Abrahmi a Clamart
17 c HOMARD est une marque deposee d'Electricite de France
23 c ______________________________________________________________________
25 c UTilitaire - VoisinaGe Volumes-Face
27 c ______________________________________________________________________
29 c . nom . e/s . taille . description .
30 c .____________________________________________________________________.
31 c . nhvois . e . char8 . nom de l'objet voisinage .
32 c . nhtria . e . char8 . nom de l'objet decrivant les triangles .
33 c . nhquad . e . char8 . nom de l'objet decrivant les quadrangles .
34 c . nhtetr . e . char8 . nom de l'objet decrivant les tetraedres .
35 c . nhhexa . e . char8 . nom de l'objet decrivant les hexaedres .
36 c . nhpyra . e . char8 . nom de l'objet decrivant les pyramides .
37 c . nhpent . e . char8 . nom de l'objet decrivant les pentaedres .
38 c . option . e . 1 . pilotage des volumes voisins des faces : .
39 c . . . . -1 : on detruit la table. .
40 c . . . . 0 : on ne fait rien. .
41 c . . . . 1 : on construit la table. .
42 c . . . . 2 : on construit la table et on controle .
43 c . ulsort . e . 1 . numero d'unite logique de la liste standard.
44 c . langue . e . 1 . langue des messages .
45 c . . . . 1 : francais, 2 : anglais .
46 c . codret . es . 1 . code de retour des modules .
47 c . . . . 0 : pas de probleme .
48 c . . . . 1 : probleme .
49 c ______________________________________________________________________
52 c 0. declarations et dimensionnement
55 c 0.1. ==> generalites
61 parameter ( nompro = 'UTVGVF' )
74 character*8 nhvois, nhtria, nhquad
75 character*8 nhtetr, nhhexa, nhpyra, nhpent
79 integer ulsort, langue, codret
81 c 0.4. ==> variables locales
83 integer iaux, jaux, kaux
86 integer codre1, codre2, codre3, codre4
88 integer nbtrto, nbquto
89 integer nbteto, nbheto, nbpyto, nbpeto
90 integer nbteca, nbheca, nbpyca, nbpeca
91 integer nbtecf, nbhecf, nbpycf, nbpecf
92 integer ptrite, phette, parete, pfilte
93 integer pquahe, phethe, parehe, pfilhe, adhes2
94 integer pfacpy, phetpy, parepy, pfilpy
95 integer pfacpe, phetpe, parepe, pfilpe, adpes2
96 integer advotq, advotr, advoqu
97 integer lgpptq, adpptq
98 integer lgpptr, adpptr, nupptr
99 integer lgppqu, adppqu, nuppqu
104 parameter ( nbmess = 10 )
105 character*80 texte(nblang,nbmess)
107 c 0.5. ==> initialisations
108 c ______________________________________________________________________
116 #ifdef _DEBUG_HOMARD_
117 write (ulsort,texte(langue,1)) 'Entree', nompro
123 texte(1,4) = '(''Voisinage volumes-faces.'')'
124 texte(1,5) = '(''Demande : '',i6)'
125 texte(1,6) = '(''Mauvaise demande.'')'
126 texte(1,7) = '(''Nombre de '',a,'' : '',i10)'
127 texte(1,8) = '(''Voisinage '',a,''/ '',a)'
129 texte(2,4) = '(''Neighbourhood volumes-faces.'')'
130 texte(2,5) = '(''Request : '',i6)'
131 texte(2,6) = '(''Bad request.'')'
132 texte(2,7) = '(''Number of '',a,'' : '',i10)'
133 texte(2,8) = '(''Neighbourhood '',a,''/ '',a)'
137 #ifdef _DEBUG_HOMARD_
138 write (ulsort,texte(langue,4))
139 write (ulsort,texte(langue,5)) option
142 c 1.2. ==> initialisations
146 suff(3) = '.PyPe/Tri'
147 suff(4) = '.PyPe/Qua'
152 c 2. Controle de l'option
155 #ifdef _DEBUG_HOMARD_
156 write (ulsort,90002) '2. Controle option ; codret', codret
158 if ( codret.eq.0 ) then
160 if ( option.lt.-1 .or. option.gt.2 ) then
162 write (ulsort,texte(langue,5)) option
163 write (ulsort,texte(langue,6))
171 c 3. recuperation des donnees du maillage d'entree
172 c remarque : on relit les nombres d'entites car les communs ne
173 c sont pas forcement remplis
175 #ifdef _DEBUG_HOMARD_
176 write (ulsort,90002) '3. recuperation ; codret', codret
179 if ( option.eq.1 .or. option.eq.2 ) then
181 c 3.1. ==> nombre d'entites volumiques
183 if ( codret.eq.0 ) then
185 call gmliat ( nhtetr, 1, nbteto, codre1 )
186 call gmliat ( nhpyra, 1, nbpyto, codre2 )
187 call gmliat ( nhhexa, 1, nbheto, codre3 )
188 call gmliat ( nhpent, 1, nbpeto, codre4 )
190 codre0 = min ( codre1, codre2, codre3, codre4 )
191 codret = max ( abs(codre0), codret,
192 > codre1, codre2, codre3, codre4 )
194 call gmliat ( nhtetr, 2, nbteca, codre1 )
195 call gmliat ( nhpyra, 2, nbpyca, codre2 )
196 call gmliat ( nhhexa, 2, nbheca, codre3 )
197 call gmliat ( nhpent, 2, nbpeca, codre4 )
199 codre0 = min ( codre1, codre2, codre3, codre4 )
200 codret = max ( abs(codre0), codret,
201 > codre1, codre2, codre3, codre4 )
203 nbtecf = nbteto - nbteca
204 nbpycf = nbpyto - nbpyca
205 nbhecf = nbheto - nbheca
206 nbpecf = nbpeto - nbpeca
210 #ifdef _DEBUG_HOMARD_
211 write (ulsort,texte(langue,7)) mess14(langue,3,3), nbteto
212 write (ulsort,texte(langue,7)) mess14(langue,3,5), nbpyto
213 write (ulsort,texte(langue,7)) mess14(langue,3,6), nbheto
214 write (ulsort,texte(langue,7)) mess14(langue,3,7), nbpeto
217 c 3.2. ==> nombre de triangles/quadrangles
219 #ifdef _DEBUG_HOMARD_
220 write (ulsort,90002) 'Etape 2.2 ; codret', codret
223 if ( codret.eq.0 ) then
225 call gmliat ( nhtria, 1, nbtrto, codre1 )
226 call gmliat ( nhquad, 1, nbquto, codre2 )
228 codre0 = min ( codre1, codre2 )
229 codret = max ( abs(codre0), codret,
234 #ifdef _DEBUG_HOMARD_
235 write (ulsort,texte(langue,7)) mess14(langue,3,2), nbtrto
236 write (ulsort,texte(langue,7)) mess14(langue,3,4), nbquto
239 c 3.3. ==> adresses liees aux volumes
241 #ifdef _DEBUG_HOMARD_
242 write (ulsort,90002) 'Etape 2.3 ; codret', codret
245 if ( nbteto.ne.0 ) then
247 if ( codret.eq.0 ) then
250 if ( nbteca.gt.0 ) then
253 #ifdef _DEBUG_HOMARD_
254 write (ulsort,texte(langue,3)) 'UTAD02_te', nompro
256 call utad02 ( iaux, nhtetr,
257 > phette, ptrite, pfilte, jaux,
260 > jaux, jaux, parete,
261 > ulsort, langue, codret )
267 if ( nbpyto.ne.0 ) then
269 if ( codret.eq.0 ) then
271 ccc call gmprsx ('nhpyra dans '//nompro,nhpyra)
273 if ( nbpyca.gt.0 ) then
276 #ifdef _DEBUG_HOMARD_
277 write (ulsort,texte(langue,3)) 'UTAD02_py', nompro
279 call utad02 ( iaux, nhpyra,
280 > phetpy, pfacpy, pfilpy, jaux,
283 > jaux, jaux, parepy,
284 > ulsort, langue, codret )
290 if ( nbheto.ne.0 ) then
292 if ( codret.eq.0 ) then
294 cgn call gmprsx ('nhhexa dans '//nompro,nhhexa)
296 if ( nbheca.gt.0 ) then
299 if ( nbpyto.ne.0 ) then
300 call gmobal ( nhhexa//'.InfoSup2', codre1 )
301 if ( codre1.eq.2 ) then
303 elseif ( codre1.ne.0 ) then
310 if ( codret.eq.0 ) then
312 #ifdef _DEBUG_HOMARD_
313 write (ulsort,texte(langue,3)) 'UTAD02_he', nompro
315 call utad02 ( iaux, nhhexa,
316 > phethe, pquahe, pfilhe, jaux,
318 > jaux, jaux, adhes2,
319 > jaux, jaux, parehe,
320 > ulsort, langue, codret )
326 if ( nbpeto.ne.0 ) then
328 if ( codret.eq.0 ) then
330 cgn call gmprsx ('nhpent dans '//nompro,nhpent)
332 if ( nbpeca.gt.0 ) then
335 if ( nbpyto.ne.0 ) then
336 call gmobal ( nhpent//'.InfoSup2', codre1 )
337 if ( codre1.eq.2 ) then
339 elseif ( codre1.ne.0 ) then
346 if ( codret.eq.0 ) then
348 #ifdef _DEBUG_HOMARD_
349 write (ulsort,texte(langue,3)) 'UTAD02_pe', nompro
351 call utad02 ( iaux, nhpent,
352 > phetpe, pfacpe, pfilpe, jaux,
354 > jaux, jaux, adpes2,
355 > jaux, jaux, parepe,
356 > ulsort, langue, codret )
365 c 4. Si on cree ou si on detruit, on commence par supprimer le graphe
368 #ifdef _DEBUG_HOMARD_
369 write (ulsort,90002) '4. suppression ; codret', codret
372 if ( option.eq.-1 .or. option.eq.1 .or. option.eq.2 ) then
374 c 4.1. ==> Destruction des anciennes structures
378 #ifdef _DEBUG_HOMARD_
379 write (ulsort,*) 'Destruction eventuelle de ',suff(iaux)
381 if ( codret.eq.0 ) then
383 call gmobal ( nhvois//suff(iaux), codre1 )
385 if ( codre1.eq.0 ) then
388 elseif ( codre1.eq.1 ) then
389 call gmsgoj ( nhvois//suff(iaux), codret )
391 elseif ( codre1.eq.2 ) then
392 call gmlboj ( nhvois//suff(iaux), codret )
405 if ( codret.eq.0 ) then
408 call gmecat ( nhvois , 1, iaux, codre1 )
409 call gmecat ( nhvois , 2, iaux, codre2 )
411 codre0 = min ( codre1, codre2 )
412 codret = max ( abs(codre0), codret,
420 c 5. Allocation des voisinages Vol/Tri et Vol/Qua
423 #ifdef _DEBUG_HOMARD_
424 write (ulsort,90002) 'Etape 5 ; codret', codret
427 if ( option.eq.1 .or. option.eq.2 ) then
434 #ifdef _DEBUG_HOMARD_
435 write (ulsort,*) 'Creation de ',suff(iaux)
438 c 5.1. ==> Allocation de la structure
440 if ( codret.eq.0 ) then
443 call gmaloj ( nhvois//suff(iaux) , ' ',
444 > jaux, advotq, codret )
446 if ( iaux.eq.1 ) then
454 c 5.2. ==> A priori aucun voisin
456 if ( codret.eq.0 ) then
458 kaux = advotq + jaux - 1
459 do 52 , jaux = advotq , kaux
470 c 6. Allocation des voisinages PyPe/Tri et PyPe/Qua
473 #ifdef _DEBUG_HOMARD_
474 write (ulsort,90002) 'Etape 6 ; codret', codret
477 if ( option.eq.1 .or. option.eq.2 ) then
481 #ifdef _DEBUG_HOMARD_
482 write (ulsort,*) 'Creation de ',suff(iaux+2)
485 c 6.1. ==> Allocation de la structure
487 if ( codret.eq.0 ) then
489 if ( iaux.eq.1 ) then
490 lgpptq = 4*nbpyto + 2*nbpeto
492 lgpptq = nbpyto + 3*nbpeto
495 call gmecat ( nhvois , 1, jaux, codre1 )
496 call gmaloj ( nhvois//suff(iaux+2), ' ',
497 > jaux, adpptq, codre2 )
499 codre0 = min ( codre1, codre2 )
500 codret = max ( abs(codre0), codret,
503 if ( iaux.eq.1 ) then
513 c 6.2. ==> A priori aucun voisin
515 if ( codret.eq.0 ) then
517 kaux = adpptq + jaux - 1
518 do 62 , jaux = adpptq , kaux
529 c 7. Creation des voisinages Tet/Tri et Hex/Qua
532 #ifdef _DEBUG_HOMARD_
533 write (ulsort,90002) 'Etape 7 ; codret', codret
536 if ( option.eq.1 .or. option.eq.2 ) then
538 c 7.1. ==> determination des tetraedres voisins des triangles
540 if ( nbteto.ne.0 ) then
542 if ( codret.eq.0 ) then
544 #ifdef _DEBUG_HOMARD_
545 write (ulsort,texte(langue,8)) mess14(langue,3,2),
547 write (ulsort,*) 'Creation de ',suff(1)
550 #ifdef _DEBUG_HOMARD_
551 write (ulsort,texte(langue,3)) 'UTTETR', nompro
553 call uttetr ( option,
554 > nbtrto, nbteto, nbtecf,
555 > imem(ptrite), imem(phette), imem(pfilte),
557 > ulsort, langue, codret )
559 #ifdef _DEBUG_HOMARD_
560 cgn call gmprsx (nompro,nhvois//suff(1))
561 cgn call gmprot (nompro, nhvois//suff(1), 1, nbtrto*2 )
562 call gmprot (nompro, nhvois//suff(1), 1, min(10,nbtrto*2) )
569 c 7.2. ==> determination des hexaedres voisins des quadrangles
571 if ( nbheto.ne.0 ) then
573 if ( codret.eq.0 ) then
575 #ifdef _DEBUG_HOMARD_
576 write (ulsort,texte(langue,8)) mess14(langue,3,4),
578 write (ulsort,*) 'Creation de ',suff(2)
581 #ifdef _DEBUG_HOMARD_
582 write (ulsort,texte(langue,3)) 'UTHEQU', nompro
584 call uthequ ( option,
585 > nbquto, nbheto, nbhecf, nbpyto, nbpycf,
586 > imem(pquahe), imem(phethe), imem(pfilhe),
590 > ulsort, langue, codret )
592 #ifdef _DEBUG_HOMARD_
593 cgn call gmprsx (nompro, nhvois//suff(2) )
594 cgn call gmprot (nompro, nhvois//suff(2), 1, nbquto*2 )
595 call gmprot (nompro, nhvois//suff(2), 1, min(20,nbquto*2) )
605 c 8. Creation des voisinages PyPe/Tri et PyPe/Qua
608 #ifdef _DEBUG_HOMARD_
609 write (ulsort,90002) 'Etape 8 ; codret', codret
610 write (ulsort,90002) 'nbpyto', nbpyto
611 write (ulsort,90002) 'nbpyca', nbpyca
612 write (ulsort,90002) 'nbpeto', nbpeto
613 write (ulsort,90002) 'nbpeca', nbpeca
619 if ( option.eq.1 .or. option.eq.2 ) then
621 c 8.1. ==> Determination des pyramides voisines
623 if ( nbpyto.ne.0 ) then
625 c 8.1.1. ==> Determination des pyramides voisines des triangles
627 if ( codret.eq.0 ) then
628 #ifdef _DEBUG_HOMARD_
629 write (ulsort,texte(langue,8)) mess14(langue,3,2),
635 #ifdef _DEBUG_HOMARD_
636 write (ulsort,texte(langue,3)) 'UTPPQT-PY_TR', nompro
638 call utppqt ( option, nbtrto, nbpyto, nbpycf,
640 > imem(pfacpy), imem(phetpy),
641 > imem(advotr), lgpptr, imem(adpptr), nupptr,
642 > ulsort, langue, codret )
645 #ifdef _DEBUG_HOMARD_
646 cgn call gmprsx (nompro,'MaVo000h.Vol/Qua')
647 cgn call gmprsx (nompro,'MaVo000h.Vol/Qua', 1, 30)
648 cc call gmprsx (nompro,nhvois//'.PyPe/Qua')
651 c 8.1.2. ==> Determination des pyramides voisines des quadrangles
653 if ( codret.eq.0 ) then
654 #ifdef _DEBUG_HOMARD_
655 write (ulsort,texte(langue,8)) mess14(langue,3,4),
661 #ifdef _DEBUG_HOMARD_
662 write (ulsort,texte(langue,3)) 'UTPPQT-PY_QU', nompro
664 call utppqt ( option, nbquto, nbpyto, nbpycf,
666 > imem(pfacpy), imem(phetpy),
667 > imem(advoqu), lgppqu, imem(adppqu), nuppqu,
668 > ulsort, langue, codret )
671 #ifdef _DEBUG_HOMARD_
672 cgn call gmprsx (nompro,nhvois//'.Vol/Qua')
673 call gmprot (nompro,nhvois//'.Vol/Qua', 1, 30)
674 cgn call gmprsx (nompro,nhvois//'.PyPe/Qua')
675 call gmprot (nompro,nhvois//'.PyPe/Qua', 1, 30)
680 c 8.2. ==> Determination des pentaedres voisins
682 if ( nbpeto.ne.0 ) then
684 c 8.2.1. ==> Determination des pentaedres voisins des triangles
686 if ( codret.eq.0 ) then
687 #ifdef _DEBUG_HOMARD_
688 write (ulsort,texte(langue,8)) mess14(langue,3,2),
694 #ifdef _DEBUG_HOMARD_
695 write (ulsort,texte(langue,3)) 'UTPPQT-PE_TR', nompro
697 call utppqt ( option, nbtrto, nbpeto, nbpecf,
699 > imem(pfacpe), imem(phetpe),
700 > imem(advotr), lgpptr, imem(adpptr), nupptr,
701 > ulsort, langue, codret )
705 c 8.2.2. ==> Determination des pentaedres voisins des quadrangles
707 if ( codret.eq.0 ) then
708 #ifdef _DEBUG_HOMARD_
709 write (ulsort,texte(langue,8)) mess14(langue,3,4),
715 #ifdef _DEBUG_HOMARD_
716 write (ulsort,texte(langue,3)) 'UTPPQT-PE_QU', nompro
718 call utppqt ( option, nbquto, nbpeto, nbpecf,
720 > imem(pfacpe), imem(phetpe),
721 > imem(advoqu), lgppqu, imem(adppqu), nuppqu,
722 > ulsort, langue, codret )
734 #ifdef _DEBUG_HOMARD_
735 cgn call gmprsx (nompro,nhvois)
736 if ( codret.eq.0 ) then
737 cgn call gmprsx (nompro,nhvois//'.Vol/Tri')
738 cgn call gmprsx (nompro,nhvois//'.PyPe/Tri')
739 cgn call gmprsx (nompro,nhvois//'.Vol/Qua')
740 call gmprot (nompro,nhvois//'.Vol/Qua', 1, 30)
741 cgn call gmprsx (nompro,nhvois//'.PyPe/Qua')
742 call gmprot (nompro,nhvois//'.PyPe/Qua', 1, 30)
746 if ( codret.ne.0 ) then
750 write (ulsort,texte(langue,1)) 'Sortie', nompro
751 write (ulsort,texte(langue,2)) codret
755 #ifdef _DEBUG_HOMARD_
756 write (ulsort,texte(langue,1)) 'Sortie', nompro