1 subroutine vcfia0 ( lgopti, taopti, lgoptr, taoptr,
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 aVant adaptation - FIltrage de l'ADaptation
27 c ______________________________________________________________________
29 c . nom . e/s . taille . description .
30 c .____________________________________________________________________.
31 c . lgopti . e . 1 . longueur du tableau des options entieres .
32 c . taopti . e . lgopti . tableau des options entieres .
33 c . lgoptr . e . 1 . longueur du tableau des options reelles .
34 c . taoptr . es . lgoptr . tableau des options .
35 c . lgopts . e . 1 . longueur du tableau des options caracteres .
36 c . taopts . e . lgopts . tableau des options caracteres .
37 c . option . e . 1 . option de filtrage .
38 c . . . . 1 : par des groupes .
39 c . . . . 2 : par un diametre minimal .
40 c . ulsort . e . 1 . numero d'unite logique de la liste standard.
41 c . langue . e . 1 . langue des messages .
42 c . . . . 1 : francais, 2 : anglais .
43 c . codret . es . 1 . code de retour des modules .
44 c . . . . 0 : pas de probleme .
45 c . . . . 5 : mauvais type de code de calcul associe .
46 c ______________________________________________________________________
49 c 0. declarations et dimensionnement
52 c 0.1. ==> generalites
58 parameter ( nompro = 'VCFIA0' )
88 integer taopti(lgopti)
91 double precision taoptr(lgoptr)
94 character*8 taopts(lgopts)
98 integer ulsort, langue, codret
100 c 0.4. ==> variables locales
104 integer ngrofi, adgfpt, adgftb
105 integer nbfmed, pnumfa, pgrpo, pgrtab
107 integer pcoono, psomar
108 integer paretr, parequ
109 integer ptrite, pcotrt, parete
110 integer pquahe, pcoquh, parehe
111 integer pfacpy, pcofay, parepy
112 integer pfacpe, pcofap, parepe
113 integer adhist, adcode, adcoar
114 integer adfami, adcofa
116 integer advotr, advoqu
118 integer typenh, nbento, nbencf, nbenca, nctfen, nbfenm
120 integer admemo, admema, admemt, admemq
121 integer adtra1, adtra2
123 integer codre1, codre2
125 integer iaux, jaux, kaux
130 double precision diammi
134 character*8 typobs, obfiad, nomail
136 character*8 nhnoeu, nhmapo, nharet, nhtria, nhquad
137 character*8 nhtetr, nhhexa, nhpyra, nhpent
139 character*8 nhvois, nhsupe, nhsups
140 character*8 ntrav1, ntrav2
143 parameter ( nbmess = 10 )
144 character*80 texte(nblang,nbmess)
146 c 0.5. ==> initialisations
147 c ______________________________________________________________________
151 c=======================================================================
152 if ( codava.eq.0 ) then
153 c=======================================================================
161 #ifdef _DEBUG_HOMARD_
162 write (ulsort,texte(langue,1)) 'Entree', nompro
166 texte(1,4) = '(''Filtrage par des groupes'',/,24(''-''))'
167 texte(1,5) = '(''Filtrage par un diametre minimal'',/,32(''-''))'
168 texte(1,6) = '(/,''Influence sur les'',i10,1x,a)'
169 texte(1,7) = '('' Diametre minimal :'',g15.6)'
171 > '(/,''Aucun groupe n''''est present dans le maillage.'')'
172 texte(1,9) = '(''L''''adaptation est supprimee.'')'
173 texte(1,10) = '(''Nombre de '',a,'' filtres :'',i10,'' sur'',i10)'
175 texte(2,4) = '(''Filtering among groups'',/,22(''-''))'
177 > '(''Filtering with a minimal diameter'',/,33(''-''))'
178 texte(2,6) = '(/,''Influence over the'',i10,1x,a)'
179 texte(2,7) = '('' Minimal diameter:'',g15.6)'
180 texte(2,8) = '(/,''No group is present in the mesh.'')'
181 texte(2,9) = '(''Adaptation is cancelled.'')'
183 > '(''Number of filtered '',a,'':'',i10,'' over'',i10)'
185 if ( option.ge.1 .and. option.le.2 ) then
186 write (ulsort,texte(langue,3+option))
194 c 2. les structures de base
197 c 2.1. ==> le maillage homard a l'iteration n
199 if ( codret.eq.0 ) then
203 call utosno ( typobs, nomail, iaux, ulsort, langue, codret )
207 c 2.2. ==> structure generale
209 if ( codret.eq.0 ) then
211 #ifdef _DEBUG_HOMARD_
212 write (ulsort,texte(langue,3)) 'UTNOMH', nompro
214 call utnomh ( nomail,
216 > degre, maconf, homolo, hierar,
217 > rafdef, nbmane, typcca, typsfr, maextr,
220 > nhnoeu, nhmapo, nharet,
222 > nhtetr, nhhexa, nhpyra, nhpent,
224 > nhvois, nhsupe, nhsups,
225 > ulsort, langue, codret)
229 c 2.3. ==> voisinages
231 if ( codret.eq.0 ) then
233 #ifdef _DEBUG_HOMARD_
234 write (ulsort,texte(langue,3)) 'UTAD04', nompro
237 if ( nbteto.ne.0 .or. nbpyto.ne.0 .or. nbpeto.ne.0 ) then
240 if ( nbheto.ne.0 .or. nbpyto.ne.0 .or. nbpeto.ne.0 ) then
244 call utad04 ( iaux, nhvois,
245 > jaux, jaux, jaux, jaux,
247 > jaux, jaux, jaux, jaux,
252 > ulsort, langue, codret )
256 cgn call gmprsx (nompro,obfiad)
257 cgn call gmprsx (nompro,obfiad//'.Pointeur')
258 cgn call gmprsx (nompro,obfiad//'.Taille')
259 cgn call gmprsx (nompro,obfiad//'.Table')
264 #ifdef _DEBUG_HOMARD_
265 write (ulsort,90002) '3. Prealables ; codret', codret
268 if ( codret.eq.0 ) then
272 c 3.1. ==> Prealable pour le filtrage par des groupes
274 if ( option.eq.1 ) then
276 c 3.1. ==> Decodage des adresses des groupes de filtrage
278 if ( codret.eq.0 ) then
282 #ifdef _DEBUG_HOMARD_
283 write (ulsort,texte(langue,3)) 'VCFIA1', nompro
285 call vcfia1 ( obfiad, nhsupe, nhsups,
286 > ngrofi, adgfpt, adgftb,
287 > nbfmed, pnumfa, pgrpo, pgrtab,
288 > ntrav1, adtra1, ntrav2, adtra2,
289 > ulsort, langue, codret )
293 c 3.2. ==> Reperage des numeros de familles MED concernees
295 if ( codret.eq.0 ) then
297 #ifdef _DEBUG_HOMARD_
298 write (ulsort,texte(langue,3)) 'VCFIA2', nompro
300 call vcfia2 ( ngrofi, imem(adgfpt), smem(adgftb),
301 > nbfmed, imem(pnumfa),
302 > imem(pgrpo), smem(pgrtab),
304 > imem(adtra1), imem(adtra2),
305 > ulsort, langue, codret )
309 c 3.3. ==> Si aucun groupe n'est present, on ne fait plus ni
310 c raffinement ni deraffinement car aucune entite n'appartient
312 #ifdef _DEBUG_HOMARD_
313 write (ulsort,90002) '3.3. Suppression ; codret', codret
316 if ( codret.eq.0 ) then
318 if ( nbfamd.eq.0 ) then
322 write (ulsort,texte(langue,8))
323 write (ulsort,texte(langue,9))
331 if ( codret.eq.0 ) then
333 call gmsgoj ( obfiad, codre1 )
334 call gmlboj ( ntrav1, codre2 )
336 codre0 = min ( codre1, codre2 )
337 codret = max ( abs(codre0), codret,
342 c 3.2. ==> Prealable pour le filtrage par le diametre minimal
344 elseif ( option.eq.2 ) then
347 write (ulsort,texte(langue,7)) diammi
354 c 4. Allocation du tableau de memorisation
355 c Par defaut, il est vide.
357 #ifdef _DEBUG_HOMARD_
358 write (ulsort,90002) '4. Allocation ; codret', codret
363 if ( codret.eq.0 ) then
365 call gmalot ( obfiad, '10TabEnt', 0, iaux, codret )
367 taopts(iaux) = obfiad
368 cgn write (ulsort,90002) nompro, ', obfiad = ', obfiad,', iaux =', iaux
372 if ( codret.eq.0 ) then
375 do 41 , iaux = 1 , 10
376 if ( codret.eq.0 ) then
377 call gmecat ( obfiad, iaux, jaux, codret )
386 c 5. Boucle sur tous les types d'entites
388 #ifdef _DEBUG_HOMARD_
389 write (ulsort,90002) '5. Boucle ; codret', codret
394 c 5.1. ==> Type d'entites concernees
395 c . Pour les groupes : toutes
396 c . Pour le diametres : au moins des aretes
398 if ( codret.eq.0 ) then
400 if ( option.eq.1 ) then
406 do 51 , typenh = typend , 7
407 #ifdef _DEBUG_HOMARD_
408 write (ulsort,*) '6. Boucle pour les ', mess14(langue,3,typenh)
411 c 5.2. ==> Nombre d'entites concernees
413 if ( codret.eq.0 ) then
418 if ( typenh.eq.-1 ) then
423 elseif ( typenh.eq.0 ) then
428 elseif ( typenh.eq.1 ) then
433 elseif ( typenh.eq.2 ) then
438 elseif ( typenh.eq.3 ) then
445 elseif ( typenh.eq.4 ) then
450 elseif ( typenh.eq.5 ) then
457 elseif ( typenh.eq.6 ) then
464 elseif ( typenh.eq.7 ) then
473 if ( nbento.ne.0 ) then
475 c 5.3. ==> Allocation de la branche de memorisation
476 c Pour les aretes, triangles, quadrangles, on s'en souvient
478 if ( codret.eq.0 ) then
480 #ifdef _DEBUG_HOMARD_
481 write (ulsort,texte(langue,6)) nbento, mess14(langue,3,typenh)
485 call utench ( iaux, 'g', jaux, saux,
486 > ulsort, langue, codret )
490 if ( codret.eq.0 ) then
492 saux = '.Tab'//saux(1:1)
494 call gmecat ( obfiad, iaux, nbento, codre1 )
495 call gmaloj ( obfiad//saux, ' ', nbento, admemo, codre2 )
497 codre0 = min ( codre1, codre2 )
498 codret = max ( abs(codre0), codret,
501 if ( typenh.eq.1 ) then
503 elseif ( typenh.eq.2 ) then
505 elseif ( typenh.eq.4 ) then
511 c 5.4. ==> Adresses des caracteristiques des entites
512 c On prend les adresses de l'entite courante et ce qu'il faut
513 c pour calculer le diametre dans l'option 2
515 c 5.4.1. ==> Les noeuds
517 if ( codret.eq.0 ) then
520 if ( typenh.eq.-1 ) then
523 elseif ( option.eq.2 ) then
528 if ( iaux.ne.1 ) then
530 #ifdef _DEBUG_HOMARD_
531 write (ulsort,90002) 'iaux', iaux
532 write (ulsort,texte(langue,3)) 'UTAD01', nompro
534 call utad01 ( iaux, nhnoeu,
536 > adfami, adcofa, jaux,
537 > pcoono, jaux, jaux, jaux,
538 > ulsort, langue, codret )
544 c 5.4.2. ==> Entite courante, si ce n'est pas un noeud :
545 c . 2*7*37 : famille et l'historique
546 c . 13 : codes pour les volumes (182 au final)
547 c . 31 : eventuelle connectivite par aretes (5462 au final)
549 if ( typenh.ne.-1 ) then
551 if ( codret.eq.0 ) then
554 if ( typenh.eq.3 .or. typenh.ge.5 ) then
557 if ( nbenca.gt.0 ) then
560 #ifdef _DEBUG_HOMARD_
561 write (ulsort,90002) 'iaux', iaux
562 write (ulsort,texte(langue,3)) 'UTAD02-courant', nompro
564 call utad02 ( iaux, nhenti,
565 > adhist, adcode, jaux, jaux,
566 > adfami, adcofa, jaux,
567 > jaux , adinsu, jaux,
568 > jaux, jaux, adcoar,
569 > ulsort, langue, codret )
573 if ( codret.eq.0 ) then
575 if ( typenh.eq.1 ) then
577 elseif ( typenh.eq.2 ) then
579 elseif ( typenh.eq.3 ) then
583 elseif ( typenh.eq.4 ) then
585 elseif ( typenh.eq.5 ) then
589 elseif ( typenh.eq.6 ) then
593 elseif ( typenh.eq.7 ) then
603 c 5.4.3. ==> Complements pour les diametres
605 if ( option.eq.2 ) then
607 c 5.4.3.1. ==> Les aretes : toujours
609 if ( codret.eq.0 ) then
611 if ( typenh.ne.1 ) then
614 #ifdef _DEBUG_HOMARD_
615 write (ulsort,texte(langue,3)) 'UTAD02-arete', nompro
617 call utad02 ( iaux, nharet,
618 > kaux , psomar, jaux, jaux,
622 > ulsort, langue, codret )
628 c 5.4.3.2. ==> Les triangles : pour les tetraedres ou les pyramides
630 if ( typenh.eq.3 .or. typenh.eq.5 ) then
632 if ( codret.eq.0 ) then
635 #ifdef _DEBUG_HOMARD_
636 write (ulsort,texte(langue,3)) 'UTAD02-triangles', nompro
638 call utad02 ( iaux, nhtria,
639 > kaux , paretr, jaux, jaux,
643 > ulsort, langue, codret )
649 c 5.4.3.3. ==> Les quadrangles : pour les hexaedres ou les pentaedres
651 if ( typenh.ge.6 ) then
653 if ( codret.eq.0 ) then
656 #ifdef _DEBUG_HOMARD_
657 write (ulsort,texte(langue,3)) 'UTAD02-quadrangles', nompro
659 call utad02 ( iaux, nhquad,
660 > kaux , parequ, jaux, jaux,
664 > ulsort, langue, codret )
670 c 5.4.3.4. ==> Les voisinages : pour les faces ou les aretes
672 if ( codret.eq.0 ) then
674 if ( typenh.eq.2 ) then
678 elseif ( typenh.eq.4 ) then
688 c 5.5. ==> Traitement
689 c 5.5.1. ==> Traitement pour le filtrage par des groupes
691 if ( option.eq.1 ) then
693 if ( codret.eq.0 ) then
695 #ifdef _DEBUG_HOMARD_
696 write (ulsort,texte(langue,3)) 'VCFIA3', nompro
698 call vcfia3 ( nbfamd, imem(adtra2),
699 > typenh, nbento, nctfen, nbfenm,
700 > imem(adfami), imem(adcofa),
702 > ulsort, langue, codret )
706 c 5.5.2. ==> Traitement pour le diametre minimal
708 elseif ( option.eq.2 ) then
710 if ( codret.eq.0 ) then
712 #ifdef _DEBUG_HOMARD_
713 write (ulsort,texte(langue,3)) 'VCFIA4', nompro
715 call vcfia4 ( diammi,
716 > typenh, nbento, nctfen, nbfenm,
717 > imem(adfami), imem(adcofa),
718 > rmem(pcoono), imem(psomar),
719 > imem(paretr), imem(parequ),
720 > imem(ptrite), imem(pcotrt), imem(parete),
721 > imem(pquahe), imem(pcoquh), imem(parehe),
722 > imem(pfacpy), imem(pcofay), imem(parepy),
723 > imem(pfacpe), imem(pcofap), imem(parepe),
726 > imem(admema), imem(admemt), imem(admemq),
727 > ulsort, langue, codret )
741 cgn if ( codret.eq.0 ) then
742 cgn if ( option.eq.2 ) then
743 cgn call gmprsx (nompro,obfiad)
744 cgn call gmprot (nompro,obfiad//'.Tab3', 1, nbarto)
745 cgn call gmprot (nompro,obfiad//'.Tab4', 1, nbtrto)
746 cgn call gmprot (nompro,obfiad//'.Tab5', 1, nbteto)
752 if ( option.eq.1 ) then
754 if ( codret.eq.0 ) then
756 call gmlboj ( ntrav2, codre0 )
758 codret = max ( abs(codre0), codret )
765 c 6. Si toutes les entites sont retenues, on inhibe le filtrage
768 do 61 , typenh = -1 , 7
770 c 6.1. ==> Nombre de valeurs
772 if ( codret.eq.0 ) then
775 call gmliat ( obfiad, iaux, nbento, codret )
779 c 6.2. ==> Adresse des valeurs s'il y en a
781 if ( codret.eq.0 ) then
783 if ( nbento.gt.0 ) then
785 #ifdef _DEBUG_HOMARD_
786 write (ulsort,texte(langue,6)) nbento, mess14(langue,3,typenh)
789 if ( codret.eq.0 ) then
792 call utench ( iaux, 'g', jaux, saux,
793 > ulsort, langue, codret )
797 if ( codret.eq.0 ) then
799 saux = '.Tab'//saux(1:1)
800 call gmadoj ( obfiad//saux, admemo, iaux, codret )
804 c 6.3. ==> Si toutes les entites sont retenues, on inhibe le filtrage
806 if ( codret.eq.0 ) then
809 ifin = ideb + nbento - 1
811 do 63 , iaux = ideb, ifin
812 if ( imem(iaux).ne.0 ) then
817 #ifdef _DEBUG_HOMARD_
818 write (ulsort,texte(langue,10)) mess14(langue,3,typenh),
822 if ( jaux.eq.0 ) then
826 call gmecat ( obfiad, iaux, jaux, codre0 )
827 codret = max ( abs(codre0), codret )
843 if ( codret.ne.0 ) then
847 write (ulsort,texte(langue,1)) 'Sortie', nompro
848 write (ulsort,texte(langue,2)) codret
852 #ifdef _DEBUG_HOMARD_
853 write (ulsort,texte(langue,1)) 'Sortie', nompro
857 c=======================================================================
859 c=======================================================================