1 subroutine utvgan ( nhvois, nhnoeu, nharet,
4 > 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 UTilitaire - VoisinaGe Aretes-Noeuds
28 c ______________________________________________________________________
30 c . nom . e/s . taille . description .
31 c .____________________________________________________________________.
32 c . nhvois . e . char8 . nom de l'objet voisinage .
33 c . nhnoeu . e . char8 . nom de l'objet decrivant les noeuds .
34 c . nharet . e . char8 . nom de l'objet decrivant les aretes .
35 c . option . e . 1 . pilotage des voisins des noeuds : .
36 c . . . . -1 : on detruit la table. .
37 c . . . . 0 : on ne fait rien. .
38 c . . . . 1 : on construit la table. .
39 c . . . . 2 : on construit la table et on controle .
40 c . ppovos . s . 1 . adresse du pointeur des vois. des sommets .
41 c . pvoiso . s . 1 . adresse des voisins des sommets .
42 c . ulsort . e . 1 . numero d'unite logique de la liste standard.
43 c . langue . e . 1 . langue des messages .
44 c . . . . 1 : francais, 2 : anglais .
45 c . codret . es . 1 . code de retour des modules .
46 c . . . . 0 : pas de probleme .
47 c . . . . 2 : probleme .
48 c ______________________________________________________________________
51 c 0. declarations et dimensionnement
54 c 0.1. ==> generalites
60 parameter ( nompro = 'UTVGAN' )
75 character*8 nhvois, nhnoeu, nharet
78 integer ppovos, pvoiso
80 integer ulsort, langue, codret
82 c 0.4. ==> variables locales
85 integer codre1, codre2, codre3
92 parameter ( nbmess = 10 )
93 character*80 texte(nblang,nbmess)
95 c 0.5. ==> initialisations
96 c ______________________________________________________________________
104 #ifdef _DEBUG_HOMARD_
105 write (ulsort,texte(langue,1)) 'Entree', nompro
109 texte(1,4) = '(''Voisinage aretes-noeuds.'')'
110 texte(1,5) = '(''Demande : '',i6)'
111 texte(1,6) = '(''Mauvaise demande.'')'
112 texte(1,7) = '(''. Objet '',a,'' : '',a)'
114 texte(2,4) = '(''Neighbourhood edges-nodes.'')'
115 texte(2,5) = '(''Request : '',i6)'
116 texte(2,6) = '(''Bad request.'')'
117 texte(2,7) = '(''. Objet '',a,'' : '',a)'
119 #ifdef _DEBUG_HOMARD_
120 write (ulsort,texte(langue,4))
121 write (ulsort,texte(langue,5)) option
122 write (ulsort,texte(langue,7)) 'nhnoeu', nhnoeu
123 call gmprsx (nompro, nhnoeu )
124 write (ulsort,texte(langue,7)) 'nharet', nharet
125 call gmprsx (nompro, nharet )
126 call gmprot (nompro, nharet//'.ConnDesc', 1, min(2*nbarto,50) )
127 write (ulsort,texte(langue,7)) 'nhvois', nhvois
128 call gmprsx (nompro, nhvois )
129 call gmprsx (nompro, nhvois//'.0D/1D' )
135 c 2. Controle de l'option
138 #ifdef _DEBUG_HOMARD_
139 write (ulsort,*) '2. Controle option ; codret =',codret
141 if ( codret.eq.0 ) then
143 if ( option.lt.-1 .or. option.gt.2 ) then
145 write (ulsort,texte(langue,5)) option
146 write (ulsort,texte(langue,6))
154 c 3. recuperation des donnees du maillage d'entree
155 c remarque : on relit les nombres d'entites car les communs ne
156 c sont pas forcement remplis
158 #ifdef _DEBUG_HOMARD_
159 write (ulsort,*) '3. recuperation ; codret =',codret
162 if ( option.eq.1 .or. option.eq.2 ) then
164 if ( codret.eq.0 ) then
166 call gmliat ( nhnoeu, 1, nbnoto, codre1 )
167 call gmliat ( nharet, 1, nbarto, codre2 )
168 call gmadoj ( nharet//'.ConnDesc', psomar, iaux, codre3 )
170 codre0 = min ( codre1, codre2, codre3 )
171 codret = max ( abs(codre0), codret,
172 > codre1, codre2, codre3 )
179 c 4. Si on cree ou si on detruit, on commence par supprimer le graphe
182 #ifdef _DEBUG_HOMARD_
183 write (ulsort,*) '4. suppression ; codret =',codret
186 if ( option.eq.-1 .or. option.eq.1 .or. option.eq.2 ) then
188 if ( codret.eq.0 ) then
190 call gmobal ( nhvois//'.0D/1D', codre1 )
192 if ( codre1.eq.0 ) then
195 elseif ( codre1.eq.1 ) then
196 #ifdef _DEBUG_HOMARD_
197 write (ulsort,*) '.... Suppression de nhvois.0D/1D'
199 call gmsgoj ( nhvois//'.0D/1D', codret )
214 #ifdef _DEBUG_HOMARD_
215 write (ulsort,*) '5. Creation ; codret =',codret
218 if ( option.eq.1 .or. option.eq.2 ) then
220 c 5.1. ==> Allocation de la tete
222 if ( codret.eq.0 ) then
224 #ifdef _DEBUG_HOMARD_
225 write (ulsort,*) '.... Allocation de nhvois.0D/1D'
228 call gmaloj ( nhvois//'.0D/1D' , ' ', 0, iaux, codret )
232 c 5.2. ==> determination des aretes voisines des noeuds
234 #ifdef _DEBUG_HOMARD_
235 write (ulsort,*) '5.2. ==> determination ... ; codret =',codret
238 c 5.2.1. ==> comptage du nombre d'aretes pour chaque noeud
240 if ( codret.eq.0 ) then
243 call gmecat ( nhvois//'.0D/1D', 1, iaux, codre1 )
244 call gmaloj ( nhvois//'.0D/1D.Pointeur',
245 > ' ', iaux, ppovos, codre2 )
246 codre0 = min ( codre1, codre2 )
247 codret = max ( abs(codre0), codret,
252 if ( codret.eq.0 ) then
254 #ifdef _DEBUG_HOMARD_
255 write (ulsort,texte(langue,3)) 'UTVGA1', nompro
258 call utvga1 ( nbnoto, nbarto, nvosom,
259 > imem(psomar), imem(ppovos) )
263 c 5.2.2. ==> allocation du tableau des voisines a une taille
264 c egale au nombre cumule de voisines des noeuds,
265 c puis reperage des aretes voisines
267 if ( codret.eq.0 ) then
269 call gmecat ( nhvois//'.0D/1D', 2, nvosom, codre1 )
270 call gmaloj ( nhvois//'.0D/1D.Table',
271 > ' ', nvosom, pvoiso, codre2 )
272 codre0 = min ( codre1, codre2 )
273 codret = max ( abs(codre0), codret,
278 if ( codret.eq.0 ) then
280 #ifdef _DEBUG_HOMARD_
281 cgn call gmprsx (nompro, nhvois//'.0D/1D' )
282 cgn call gmprot (nompro, nhvois//'.0D/1D.Pointeur', 1, 50 )
283 write (ulsort,texte(langue,3)) 'UTVGA2', nompro
286 call utvga2 ( nbnoto, nbarto, nvosom,
287 > imem(psomar), imem(ppovos), imem(pvoiso) )
289 #ifdef _DEBUG_HOMARD_
290 call gmprsx (nompro, nhvois//'.0D/1D' )
291 call gmprot (nompro, nhvois//'.0D/1D.Pointeur', 1, 50 )
292 call gmprot (nompro, nhvois//'.0D/1D.Table', 1, 50 )
303 if ( codret.ne.0 ) then
307 write (ulsort,texte(langue,1)) 'Sortie', nompro
308 write (ulsort,texte(langue,2)) codret
312 #ifdef _DEBUG_HOMARD_
313 write (ulsort,texte(langue,1)) 'Sortie', nompro