1 subroutine utvgva ( nhvois, nharet, 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 : VoisinaGes Volumes / Aretes
27 c ______________________________________________________________________
29 c . nom . e/s . taille . description .
30 c .____________________________________________________________________.
31 c . nhvois . e . char8 . nom de l'objet voisinage .
32 c . nharet . e . char8 . nom de l'objet decrivant les aretes .
33 c . nhtria . e . char8 . nom de l'objet decrivant les triangles .
34 c . nhquad . e . char8 . nom de l'objet decrivant les quadrangles .
35 c . nhtetr . e . char8 . nom de l'objet decrivant les tetraedres .
36 c . nhhexa . e . char8 . nom de l'objet decrivant les hexaedres .
37 c . nhpyra . e . char8 . nom de l'objet decrivant les pyramides .
38 c . nhpent . e . char8 . nom de l'objet decrivant les pentaedres .
39 c . option . e . 1 . pilotage des volumes voisins des faces : .
40 c . . . . -1 : on detruit la table. .
41 c . . . . 0 : on ne fait rien. .
42 c . . . . 1 : on construit la table. .
43 c . . . . 2 : on construit la table et on controle .
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 . . . . non nul : probleme .
50 c ______________________________________________________________________
53 c 0. declarations et dimensionnement
56 c 0.1. ==> generalites
62 parameter ( nompro = 'UTVGVA' )
75 character*8 nhvois, nharet, nhtria, nhquad
76 character*8 nhtetr, nhhexa, nhpyra, nhpent
80 integer ulsort, langue, codret
82 c 0.4. ==> variables locales
84 integer iaux, jaux, kaux
86 integer codre1, codre2, codre3
91 integer nbteto, nbtecf, nbteca
92 integer nbheto, nbhecf, nbheca
93 integer nbpyto, nbpycf, nbpyca
94 integer nbpeto, nbpecf, nbpeca
95 integer phettr, paretr
96 integer phetqu, parequ
97 integer phette, ptrite, pcotrt, parete
98 integer phethe, pquahe, pcoquh, parehe
99 integer phetpy, pfacpe, pcofay, parepy
100 integer phetpe, pfacpy, pcofap, parepe
101 integer adptte, adpthe, adptpy, adptpe
102 integer adtate, adtahe, adtapy, adtape
103 integer nbtear, nbhear, nbpyar, nbpear
108 parameter ( nbmess = 10 )
109 character*80 texte(nblang,nbmess)
110 c ______________________________________________________________________
120 #ifdef _DEBUG_HOMARD_
121 write (ulsort,texte(langue,1)) 'Entree', nompro
125 texte(1,4) = '(''Voisinage volumes-aretes.'')'
126 texte(1,5) = '(''Demande : '',i6)'
127 texte(1,6) = '(''Mauvaise demande.'')'
129 texte(2,4) = '(''Neighbourhood volumes-edges.'')'
130 texte(2,5) = '(''Request : '',i6)'
131 texte(2,6) = '(''Bad request.'')'
135 #ifdef _DEBUG_HOMARD_
136 write (ulsort,texte(langue,4))
137 write (ulsort,texte(langue,5)) option
143 c 2. Controle de l'option
146 #ifdef _DEBUG_HOMARD_
147 write (ulsort,*) '2. Controle option ; codret =',codret
149 if ( codret.eq.0 ) then
151 if ( option.lt.-1 .or. option.gt.2 ) then
153 write (ulsort,texte(langue,5)) option
154 write (ulsort,texte(langue,6))
162 c 3. recuperation des donnees du maillage d'entree
163 c remarque : on relit les nombres d'entites car les communs ne
164 c sont pas forcement remplis
166 #ifdef _DEBUG_HOMARD_
167 write (ulsort,*) '3. recuperation ; codret =',codret
170 if ( option.eq.1 .or. option.eq.2 ) then
172 c 3.1. ==> Les tetraedres
174 if ( codret.eq.0 ) then
176 call gmliat ( nhtetr, 1, nbteto, codre1 )
177 call gmliat ( nhtetr, 2, nbteca, codre2 )
179 codre0 = min ( codre1, codre2 )
180 codret = max ( abs(codre0), codret,
183 #ifdef _DEBUG_HOMARD_
184 write (ulsort,90002) 'nbteto, nbteca', nbteto, nbteca
187 if ( nbteto.gt.0 ) then
190 if ( nbteca.gt.0 ) then
193 #ifdef _DEBUG_HOMARD_
194 write (ulsort,texte(langue,3)) 'UTAD02_te', nompro
196 call utad02 ( iaux, nhtetr,
197 > phette, ptrite, jaux, jaux,
199 > jaux, pcotrt, jaux,
200 > jaux, jaux, parete,
201 > ulsort, langue, codret )
207 c 3.2. ==> Les hexaedres
209 if ( codret.eq.0 ) then
211 call gmliat ( nhhexa, 1, nbheto, codre1 )
212 call gmliat ( nhhexa, 2, nbheca, codre2 )
214 codre0 = min ( codre1, codre2 )
215 codret = max ( abs(codre0), codret,
218 #ifdef _DEBUG_HOMARD_
219 write (ulsort,90002) 'nbheto, nbheca', nbheto, nbheca
222 if ( nbheto.gt.0 ) then
225 if ( nbheca.gt.0 ) then
228 #ifdef _DEBUG_HOMARD_
229 write (ulsort,texte(langue,3)) 'UTAD02_he', nompro
231 call utad02 ( iaux, nhhexa,
232 > phethe, pquahe, jaux, jaux,
234 > jaux, pcoquh, jaux,
235 > jaux, jaux, parehe,
236 > ulsort, langue, codret )
242 c 3.3. ==> Les pyramides
244 if ( codret.eq.0 ) then
246 call gmliat ( nhpyra, 1, nbpyto, codre1 )
247 call gmliat ( nhpyra, 2, nbpyca, codre2 )
249 codre0 = min ( codre1, codre2 )
250 codret = max ( abs(codre0), codret,
253 #ifdef _DEBUG_HOMARD_
254 write (ulsort,90002) 'nbpyto, nbpyca', nbpyto, nbpyca
257 if ( nbpyto.gt.0 ) then
260 if ( nbpyca.gt.0 ) then
263 #ifdef _DEBUG_HOMARD_
264 write (ulsort,texte(langue,3)) 'UTAD02_py', nompro
266 call utad02 ( iaux, nhpyra,
267 > phetpy, pfacpy, jaux, jaux,
269 > jaux, pcofay, jaux,
270 > jaux, jaux, parepy,
271 > ulsort, langue, codret )
277 c 3.4. ==> Les pentaedres
279 if ( codret.eq.0 ) then
281 call gmliat ( nhpent, 1, nbpeto, codre1 )
282 call gmliat ( nhpent, 2, nbpeca, codre2 )
284 codre0 = min ( codre1, codre2 )
285 codret = max ( abs(codre0), codret,
288 #ifdef _DEBUG_HOMARD_
289 write (ulsort,90002) 'nbpeto, nbpeca', nbpeto, nbpeca
292 if ( nbpeto.gt.0 ) then
295 if ( nbpeca.gt.0 ) then
298 #ifdef _DEBUG_HOMARD_
299 write (ulsort,texte(langue,3)) 'UTAD02_pe', nompro
301 call utad02 ( iaux, nhpent,
302 > phetpe, pfacpe, jaux, jaux,
304 > jaux, pcofap, jaux,
305 > jaux, jaux, parepe,
306 > ulsort, langue, codret )
314 if ( codret.eq.0 ) then
316 nbtecf = nbteto - nbteca
317 nbhecf = nbheto - nbheca
318 nbpycf = nbpyto - nbpyca
319 nbpecf = nbpeto - nbpeca
323 c 3.6. ==> Les triangles si besoin
325 if ( codret.eq.0 ) then
327 if ( nbteto.gt.0 .or. nbpycf.gt.0 ) then
329 call gmliat ( nhtria, 1, nbtrto, codre0 )
334 #ifdef _DEBUG_HOMARD_
335 write (ulsort,texte(langue,3)) 'UTAD02_tr', nompro
337 call utad02 ( iaux, nhtria,
338 > phettr, paretr, jaux, jaux,
342 > ulsort, langue, codret )
348 c 3.7. ==> Les quadangles si besoin
350 if ( codret.eq.0 ) then
352 if ( nbheto.gt.0 .or. nbpecf.gt.0 ) then
354 call gmliat ( nhquad, 1, nbquto, codre0 )
359 #ifdef _DEBUG_HOMARD_
360 write (ulsort,texte(langue,3)) 'UTAD02_qu', nompro
362 call utad02 ( iaux, nhquad,
363 > phetqu, parequ, jaux, jaux,
367 > ulsort, langue, codret )
373 c 3.8. ==> Nombre d'aretes
375 if ( codret.eq.0 ) then
377 call gmliat ( nharet, 1, nbarto, codre0 )
386 c 4. Si on cree ou si on detruit, on commence par supprimer les graphes
389 #ifdef _DEBUG_HOMARD_
390 write (ulsort,*) '4. suppression ; codret =',codret
393 if ( option.eq.-1 .or. option.eq.1 .or. option.eq.2 ) then
397 if ( codret.eq.0 ) then
400 if ( iaux.eq.1 ) then
402 elseif ( iaux.eq.2 ) then
404 elseif ( iaux.eq.3 ) then
410 call gmobal ( nhvois//saux08, codre1 )
412 if ( codre1.eq.0 ) then
415 elseif ( codre1.eq.1 ) then
416 #ifdef _DEBUG_HOMARD_
417 write (ulsort,*) '.... Suppression de nhvois'//saux08
419 call gmsgoj ( nhvois//saux08, codret )
436 #ifdef _DEBUG_HOMARD_
437 write (ulsort,*) '5. Creation ; codret =',codret
440 if ( option.eq.1 .or. option.eq.2 ) then
442 c 5.1. ==> Allocation de la tete
446 if ( codret.eq.0 ) then
449 if ( iaux.eq.1 ) then
452 elseif ( iaux.eq.2 ) then
455 elseif ( iaux.eq.3 ) then
463 if ( jaux.gt.0 ) then
464 #ifdef _DEBUG_HOMARD_
465 write (ulsort,*) '.... Allocation de nhvois'//saux08
468 call gmaloj ( nhvois//saux08 , ' ', 0, kaux, codre1 )
470 call gmecat ( nhvois//saux08, 1, kaux, codre2 )
471 call gmaloj ( nhvois//saux08//'.Pointeur',
472 > ' ', kaux, adaux, codre3 )
474 codre0 = min ( codre1, codre2, codre3 )
475 codret = max ( abs(codre0), codret,
476 > codre1, codre2, codre3 )
478 if ( iaux.eq.1 ) then
480 elseif ( iaux.eq.2 ) then
482 elseif ( iaux.eq.3 ) then
494 c 5.2. ==> Longueur des tableaux de voisinages
495 #ifdef _DEBUG_HOMARD_
496 write (ulsort,*) '5.2. Longueur ; codret =',codret
499 if ( codret.eq.0 ) then
501 #ifdef _DEBUG_HOMARD_
502 write (ulsort,texte(langue,3)) 'UTVGV2', nompro
504 call utvgv2 ( nbarto, nbtrto, nbquto,
505 > nbteto, nbtecf, nbteca,
506 > nbheto, nbhecf, nbheca,
507 > nbpyto, nbpycf, nbpyca,
508 > nbpeto, nbpecf, nbpeca,
511 > imem(ptrite), imem(pcotrt), imem(parete),
512 > imem(pquahe), imem(pcoquh), imem(parehe),
513 > imem(pfacpy), imem(pcofay), imem(parepy),
514 > imem(pfacpe), imem(pcofap), imem(parepe),
515 > nbtear, imem(adptte),
516 > nbhear, imem(adpthe),
517 > nbpyar, imem(adptpy),
518 > nbpear, imem(adptpe),
519 > ulsort, langue, codret )
523 c 5.3. ==> Allocations
524 #ifdef _DEBUG_HOMARD_
525 write (ulsort,*) '5.3. Allocations ; codret =',codret
528 if ( codret.eq.0 ) then
532 if ( codret.eq.0 ) then
535 if ( iaux.eq.1 ) then
538 elseif ( iaux.eq.2 ) then
541 elseif ( iaux.eq.3 ) then
549 if ( jaux.gt.0 ) then
550 #ifdef _DEBUG_HOMARD_
551 write (ulsort,*) '.... Allocation de nhvois'//saux08
554 call gmecat ( nhvois//saux08, 2, jaux, codre1 )
555 call gmaloj ( nhvois//saux08//'.Table',
556 > ' ', jaux, adaux, codre2 )
558 codre0 = min ( codre1, codre2 )
559 codret = max ( abs(codre0), codret,
562 if ( iaux.eq.1 ) then
564 elseif ( iaux.eq.2 ) then
566 elseif ( iaux.eq.3 ) then
580 c 5.4. ==> Determination des voisinages
581 #ifdef _DEBUG_HOMARD_
582 write (ulsort,*) '5.4. Determination ; codret =',codret
585 if ( codret.eq.0 ) then
587 #ifdef _DEBUG_HOMARD_
588 write (ulsort,texte(langue,3)) 'UTVGV3', nompro
590 call utvgv3 ( nbarto, nbtrto, nbquto,
591 > nbteto, nbtecf, nbteca,
592 > nbheto, nbhecf, nbheca,
593 > nbpyto, nbpycf, nbpyca,
594 > nbpeto, nbpecf, nbpeca,
597 > imem(ptrite), imem(pcotrt), imem(parete),
598 > imem(pquahe), imem(pcoquh), imem(parehe),
599 > imem(pfacpy), imem(pcofay), imem(parepy),
600 > imem(pfacpe), imem(pcofap), imem(parepe),
601 > nbtear, imem(adptte), imem(adtate),
602 > nbhear, imem(adpthe), imem(adtahe),
603 > nbpyar, imem(adptpy), imem(adtapy),
604 > nbpear, imem(adptpe), imem(adtape),
605 > ulsort, langue, codret )
607 #ifdef _DEBUG_HOMARD_
609 if ( nbteto.gt.0 ) then
611 call gmprsx(nompro//saux08//' - pt',
612 > nhvois//saux08//'.Pointeur')
613 call gmprsx(nompro//saux08//' - ta', nhvois//saux08//'.Table')
615 if ( nbheto.gt.0 ) then
617 call gmprsx(nompro//saux08//' - pt',
618 > nhvois//saux08//'.Pointeur')
619 call gmprsx(nompro//saux08//' - ta', nhvois//saux08//'.Table')
621 if ( nbpyto.gt.0 ) then
623 call gmprsx(nompro//saux08//' - pt',
624 > nhvois//saux08//'.Pointeur')
625 call gmprsx(nompro//saux08//' - ta', nhvois//saux08//'.Table')
627 if ( nbpeto.gt.0 ) then
629 call gmprsx(nompro//saux08//' - pt',
630 > nhvois//saux08//'.Pointeur')
631 call gmprsx(nompro//saux08//' - ta', nhvois//saux08//'.Table')
642 if ( codret.ne.0 ) then
646 write (ulsort,texte(langue,1)) 'Sortie', nompro
647 write (ulsort,texte(langue,2)) codret
651 #ifdef _DEBUG_HOMARD_
652 write (ulsort,texte(langue,1)) 'Sortie', nompro