]> SALOME platform Git repositories - tools/eficas.git/blob - Aster/Cata/cataSTA9/Macro/creation_donnees_homard.py
Salome HOME
Modif V6_4_°
[tools/eficas.git] / Aster / Cata / cataSTA9 / Macro / creation_donnees_homard.py
1 #@ MODIF creation_donnees_homard Macro  DATE 06/10/2008   AUTEUR GNICOLAS G.NICOLAS 
2 # -*- coding: iso-8859-1 -*-
3 #            CONFIGURATION MANAGEMENT OF EDF VERSION
4 # ======================================================================
5 # COPYRIGHT (C) 1991 - 2006  EDF R&D                  WWW.CODE-ASTER.ORG
6 # THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY  
7 # IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY  
8 # THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR     
9 # (AT YOUR OPTION) ANY LATER VERSION.                                                  
10 #                                                                       
11 # THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT   
12 # WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF            
13 # MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU      
14 # GENERAL PUBLIC LICENSE FOR MORE DETAILS.                              
15 #                                                                       
16 # YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE     
17 # ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER,         
18 #    1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE.        
19 # ======================================================================
20 # RESPONSABLE GNICOLAS G.NICOLAS
21 """
22 Cette classe crée le fichier de configuration permettant de lancer HOMARD depuis Code_Aster.
23 """
24 __revision__ = "V1.4"
25 __all__ = [ ]
26  
27 import os
28 import os.path
29 from types import ListType, TupleType
30 EnumTypes = (ListType, TupleType)
31
32 try:
33   from Utilitai.Utmess import   UTMESS
34 except ImportError:
35   def UTMESS(code, idmess, valk=(), vali=(), valr=()):
36     """Clone de utmess si on ne reussit pas à le charger
37     """
38     fmt = '\n <%s> <%s> %s %s %s\n\n'
39     print fmt % (code, idmess, valk, vali, valr)
40
41 # ------------------------------------------------------------------------------
42 class creation_donnees_homard:
43   """Cette classe crée les données permettant de lancer HOMARD depuis Code_Aster.
44       Ce sont :
45       . le fichier de configuration
46       . le fichier des données dans le cas d'information
47    
48    Arguments (stockés en tant qu'attribut) :
49       . nom_macro : nom de la macro-commande qui appelle :
50                       'MACR_ADAP_MAIL' pour une adaptation
51                       'MACR_INFO_MAIL' pour une information sur un maillage
52       . mots_cles : mots-clés de la macro-commande
53       . dico_configuration : dictionnaire des options
54
55    Attributs :
56       . Nom_Fichier_Configuration : nom du fichier de configuration (immuable)
57       . Nom_Fichier_Donnees : nom du fichier de données (immuable)
58       . mode_homard : le mode pour filtrer ici ("ADAP" ou "INFO")
59       . ModeHOMA : le mode pour HOMARD (1 ou 2)
60       . mode_homard_texte : le mode d'utilisation, en francais ("ADAPTATION" ou "INFORMATION")
61       . elements_incompatibles : que faire des éléments incompatibles avec HOMARD
62    """
63 # ------------------------------------------------------------------------------
64   def __init__(self, nom_macro, mots_cles, dico_configuration ) :
65     """Construction + valeurs par défaut des attributs
66     """
67 #
68 # 1. Vérification de la macro qui appelle
69 #
70     d_aux = {}
71     d_aux["MACR_ADAP_MAIL"] = ( "ADAP", 1, "ADAPTATION" )
72     d_aux["MACR_INFO_MAIL"] = ( "INFO", 2, "INFORMATION" )
73     if d_aux.has_key(nom_macro) :
74       self.mode_homard = d_aux[nom_macro][0]
75       self.ModeHOMA = d_aux[nom_macro][1]
76       self.mode_homard_texte = d_aux[nom_macro][2]
77     else :
78       UTMESS("F",'HOMARD0_1')
79 #
80 # 2. Données générales de cette initialisation
81 #
82 #gn    for mot_cle in mots_cles.keys() :
83 #gn      print "mots_cles[", mot_cle, "] = ", mots_cles[mot_cle]
84 #gn    for mot_cle in dico_configuration.keys() :
85 #gn      print "dico_configuration[", mot_cle, "] = ", dico_configuration[mot_cle]
86 #
87     self.nom_macro = nom_macro
88     self.mots_cles = mots_cles
89     self.dico_configuration = dico_configuration
90 #
91 # 3. Quel type de traitement des elemenst incompatibles
92 #
93     if mots_cles.has_key("ELEMENTS_NON_HOMARD") :
94       d_aux = {}
95       d_aux["REFUSER"] = "TOUS"
96       d_aux["IGNORER"] = "IGNORE_QUAD"
97       self.elements_incompatibles = d_aux[mots_cles["ELEMENTS_NON_HOMARD"]]
98     else :
99       self.elements_incompatibles = None
100 #
101 # 4. Attributs immuables
102 #
103     self.Nom_Fichier_Configuration = "HOMARD.Configuration"
104     self.Nom_Fichier_Donnees = "HOMARD.Donnees"
105 #
106 # ------------------------------------------------------------------------------
107   def int_to_str2 (self, entier) :
108     """
109     Transforme un entier compris entre 0 et 99 en une chaine sur deux caractères
110     """
111 #    print "\nArguments a l'entree de", __name__, ":", entier
112 #
113     try:
114       la_chaine = '%02d' % entier
115     except TypeError:
116       la_chaine = None
117 #
118     return la_chaine
119 # ------------------------------------------------------------------------------
120   def quel_mode (self) :
121     """Informe sur le mode de lancement de HOMARD
122     """
123 ###    print self.mode_homard_texte
124     print "Lancement de creation_donnees_homard en mode", self.mode_homard_texte
125     return
126 # ------------------------------------------------------------------------------
127   def creation_configuration (self) :
128     """Crée les données nécessaires à la configuration
129     """
130 #
131     message_erreur = None
132 #
133     while message_erreur is None :
134 #
135 #     1. Les chaines liées aux numéros d'itération
136 #
137       if self.mode_homard == "ADAP" :
138         niter = self.dico_configuration["niter"]
139         self.str_niter = self.int_to_str2 (niter)
140         self.str_niterp1 = self.int_to_str2 (niter+1)
141         self.niter_vers_niterp1 = self.str_niter + ".vers." + self.str_niterp1
142 #
143 #     2. La liste standard
144 #
145       if self.mode_homard == "INFO" :
146         aux = "Liste.info"
147       else :
148         aux = "Liste." + self.niter_vers_niterp1
149       self.ListeStd = aux
150 #
151 #     3. Le type de bilan : il faut convertir la donnée textuelle en un entier,
152 #        produit de nombres premiers.
153 #        Si rien n'est demandé, on met 0.
154 #
155       aux = 1
156       dico_aux = {}
157       dico_aux["INTERPENETRATION"] = 3
158       dico_aux["NOMBRE"] = 7
159       dico_aux["QUALITE"] = 5
160       dico_aux["CONNEXITE"] = 11
161       dico_aux["TAILLE"] = 13
162       l_aux = dico_aux.keys()
163       for choix in l_aux :
164         if self.mots_cles.has_key(choix) :
165           if self.mots_cles[choix] == "OUI" :
166             aux = aux * dico_aux[choix]
167       if aux == 1 :
168         aux = 0
169       self.TypeBila = aux
170 #
171 #     4. Les entrées/sorties au format MED
172 #
173       self.CCNoMN__ = self.dico_configuration["NOM_MED_MAILLAGE_N"]
174       if self.mode_homard == "ADAP" :
175         self.CCNoMNP1 = self.dico_configuration["NOM_MED_MAILLAGE_NP1"]
176         if self.dico_configuration.has_key("NOM_MED_MAILLAGE_NP1_ANNEXE") :
177           self.CCMaiAnn = self.dico_configuration["NOM_MED_MAILLAGE_NP1_ANNEXE"]
178         else :
179           self.CCMaiAnn = None
180 #
181 #     5. Les entrées/sorties au format HOMARD
182 #
183       if self.mode_homard == "ADAP" :
184         self.fic_homard_niter   = "M_" + self.str_niter   + ".hom.med"
185         self.fic_homard_niterp1 = "M_" + self.str_niterp1 + ".hom.med"
186       else :
187         self.fic_homard_niter = None
188         self.fic_homard_niterp1 = None
189 #
190 #     6.1. Le pilotage de l'adaptation
191 #
192       if self.mode_homard == "ADAP" :
193 #
194 #     6.1. Le type d'adaptation
195 #
196         if self.mots_cles["ADAPTATION"] == "RAFFINEMENT" or self.mots_cles["ADAPTATION"] == "RAFFINEMENT_ZONE" :
197           self.TypeRaff = "libre"
198           self.TypeDera = "non"
199         elif self.mots_cles["ADAPTATION"] == "DERAFFINEMENT" :
200           self.TypeRaff = "non"
201           self.TypeDera = "libre"
202         elif self.mots_cles["ADAPTATION"] == "RAFF_DERA" :
203           self.TypeRaff = "libre"
204           self.TypeDera = "libre"
205         elif self.mots_cles["ADAPTATION"] == "RAFFINEMENT_UNIFORME" :
206           self.TypeRaff = "uniforme"
207           self.TypeDera = "non"
208         elif self.mots_cles["ADAPTATION"] == "DERAFFINEMENT_UNIFORME" :
209           self.TypeRaff = "non"
210           self.TypeDera = "uniforme"
211         elif self.mots_cles["ADAPTATION"] == "RIEN" :
212           self.TypeRaff = "non"
213           self.TypeDera = "non"
214 #gn        print "... self.TypeRaff = ",self.TypeRaff
215 #gn        print "... self.TypeDera = ",self.TypeDera
216 #
217 #     6.2. L'éventuel seuil de raffinement
218 #
219         if self.TypeRaff == "libre" and self.mots_cles["ADAPTATION"] != "RAFFINEMENT_ZONE" :
220           d_aux = {}
221           d_aux["CRIT_RAFF_ABS"] = ("SeuilHau",   1)
222           d_aux["CRIT_RAFF_REL"] = ("SeuilHRe", 100)
223           d_aux["CRIT_RAFF_PE" ] = ("SeuilHPE", 100)
224           l_aux = d_aux.keys()
225           for mot_cle in l_aux :
226             if self.mots_cles[mot_cle] is not None :
227               aux = self.mots_cles[mot_cle]*d_aux[mot_cle][1]
228               self.critere_raffinement = (d_aux[mot_cle][0], aux)
229         else :
230           self.critere_raffinement = None
231 #gn          print "... self.critere_raffinement = ", self.critere_raffinement
232 #
233 #       6.3. L'éventuel seuil de déraffinement
234 #
235         if self.TypeDera == "libre" :
236           d_aux = {}
237           d_aux["CRIT_DERA_ABS"] = ("SeuilBas",   1)
238           d_aux["CRIT_DERA_REL"] = ("SeuilBRe", 100)
239           d_aux["CRIT_DERA_PE" ] = ("SeuilBPE", 100)
240           l_aux = d_aux.keys()
241           for mot_cle in l_aux :
242             if self.mots_cles[mot_cle] is not None :
243               aux = self.mots_cles[mot_cle]*d_aux[mot_cle][1]
244               self.critere_deraffinement = (d_aux[mot_cle][0], aux)
245         else :
246           self.critere_deraffinement = None
247 #gn          print "... self.critere_deraffinement = ", self.critere_deraffinement
248 #
249 #       6.4. Les niveaux extremes
250 #
251         self.niveau = []
252         for mot_cle in [ "NIVE_MIN", "NIVE_MAX" ] :
253           if self.mots_cles.has_key(mot_cle) :
254             if self.mots_cles[mot_cle] is not None :
255               if mot_cle == "NIVE_MIN" :
256                 aux = "NiveauMi"
257               else :
258                 aux = "NiveauMa"
259               self.niveau.append((aux, self.mots_cles[mot_cle]))
260         if len(self.niveau) == 2 :
261 #gn          print self.mots_cles["NIVE_MIN"]
262 #gn          print self.mots_cles["NIVE_MAX"]
263           if self.mots_cles["NIVE_MIN"] >= self.mots_cles["NIVE_MAX"] :
264             message_erreur = "Le niveau mini ,"+str(self.mots_cles["NIVE_MIN"])+\
265                              ", doit etre < au niveau maxi, "+str(self.mots_cles["NIVE_MAX"])+"."
266             break
267 #
268 #       6.5. Les éventuelles zones de raffinement
269 #
270         if self.dico_configuration.has_key("Zones") :
271           iaux = 0
272           for zone in self.dico_configuration["Zones"] :
273             iaux = iaux + 1
274             s_aux_1 = "Zone numero "+str(iaux)+" : "
275             s_aux_2 = ", doit etre < au "
276             if zone.has_key("X_MINI") :
277               if zone["X_MINI"] > zone["X_MAXI"] :
278                 message_erreur = s_aux_1+"X mini ,"+str(zone["X_MINI"])+s_aux_2+"X maxi, "+str(zone["X_MAXI"])+"."
279               if zone["Y_MINI"] > zone["Y_MAXI"] :
280                 message_erreur = s_aux_1+"Y mini ,"+str(zone["Y_MINI"])+s_aux_2+"Y maxi, "+str(zone["Y_MAXI"])+"."
281             if zone.has_key("Z_MINI") :
282               if zone["Z_MINI"] > zone["Z_MAXI"] :
283                 message_erreur = s_aux_1+"Z mini ,"+str(zone["Z_MINI"])+s_aux_2+"Z maxi, "+str(zone["Z_MAXI"])+"."
284 #
285       break
286 #
287     if message_erreur is not None :
288       UTMESS("F",'HOMARD0_2',valk=message_erreur)
289 #
290     return self.fic_homard_niter, self.fic_homard_niterp1
291 # ------------------------------------------------------------------------------
292   def ouvre_fichier (self, nomfic_local) :
293     """Ouvre en écriture un fichier après l'avoir éventuellement détruit
294     """
295     codret_partiel = [0]
296 ###    print nomfic_local
297     Rep_Calc_HOMARD_global = self.dico_configuration["Rep_Calc_HOMARD_global"]
298     nomfic = os.path.join ( Rep_Calc_HOMARD_global , nomfic_local )
299 #
300     if os.path.isfile (nomfic) :
301       try :
302         os.remove (nomfic)
303       except os.error, codret_partiel :
304         print "Probleme au remove, erreur numéro ", codret_partiel[0], ":", codret_partiel[1]
305         UTMESS("F",'HOMARD0_3',valk=nomfic)
306 #
307     fichier = open (nomfic,"w")
308     self.fichier = fichier
309 #
310     return fichier, nomfic
311   def ecrire_ligne_configuration_0 (self, commentaire) :
312     """Ecrit une ligne de commentaires du fichier de configuration
313    Arguments :
314       . commentaire : le commentaire à écrire
315     """
316 #
317     ligne = "#\n"
318     ligne = ligne + "# " + commentaire + "\n"
319     ligne = ligne + "#\n"
320     self.fichier.write(ligne)
321 #
322     return
323 # ------------------------------------------------------------------------------
324   def ecrire_ligne_configuration_2 (self, motcle, valeur) :
325     """Ecrit une ligne du fichier de configuration dans le cas : motcle + valeur
326    Arguments :
327       . motcle : le mot-clé HOMARD à écrire
328       . valeur : la valeur associée
329     """
330 #
331     ligne = motcle + " " + str(valeur) + "\n"
332     self.fichier.write(ligne)
333 #
334     return
335 # ------------------------------------------------------------------------------
336   def ecrire_ligne_configuration_3 (self, motcle, valeur1, valeur2) :
337     """Ecrit une ligne du fichier de configuration dans le cas : motcle + valeur1 + valeur2
338    Arguments :
339       . motcle : le mot-clé HOMARD à écrire
340       . valeur : la valeur associée
341     """
342 #
343     ligne = motcle + " " + str(valeur1) + " " + str(valeur2) + "\n"
344     self.fichier.write(ligne)
345 #
346     return
347 # ------------------------------------------------------------------------------
348   def ecrire_fichier_configuration (self) :
349     """Ecrit le fichier de configuration
350     """
351     message_erreur = None
352 #
353     while message_erreur is None :
354 #
355 #     1. Ouverture du fichier
356 #
357       fichier, nomfic_global = self.ouvre_fichier(self.Nom_Fichier_Configuration)
358 #
359 #     2. Généralités
360 #
361       self.ecrire_ligne_configuration_0("Generalites")
362       self.ecrire_ligne_configuration_2("ModeHOMA", self.ModeHOMA)
363       self.ecrire_ligne_configuration_2("ListeStd", self.ListeStd)
364       self.ecrire_ligne_configuration_2("TypeBila", self.TypeBila)
365       self.ecrire_ligne_configuration_2("CCAssoci", "MED")
366       self.ecrire_ligne_configuration_2("NumeIter", self.dico_configuration["niter"])
367 #
368 #     3. Les fichiers externes
369 #
370       self.ecrire_ligne_configuration_0("Les fichiers de Code_Aster, au format MED")
371       self.ecrire_ligne_configuration_2("CCNoMN__", self.CCNoMN__)
372       self.ecrire_ligne_configuration_2("CCMaiN__", self.dico_configuration["Fichier_ASTER_vers_HOMARD"])
373       if self.mode_homard == "ADAP" :
374         self.ecrire_ligne_configuration_2("CCNoMNP1", self.CCNoMNP1)
375         self.ecrire_ligne_configuration_2("CCMaiNP1", self.dico_configuration["Fichier_HOMARD_vers_ASTER"])
376 #
377       self.ecrire_ligne_configuration_0("Le répertoire des fichiers de bilan")
378       self.ecrire_ligne_configuration_2("RepeInfo", self.dico_configuration["Rep_Calc_HOMARD_global"])
379 #
380 #     4. Les fichiers HOMARD
381 #
382       self.ecrire_ligne_configuration_0("Les fichiers de HOMARD, au format MED")
383       if self.mode_homard == "ADAP" :
384         self.ecrire_ligne_configuration_3("HOMaiN__", "M_"+self.str_niter  , self.fic_homard_niter )
385         self.ecrire_ligne_configuration_3("HOMaiNP1", "M_"+self.str_niterp1, self.fic_homard_niterp1)
386         aux = "oui"
387       else :
388         aux = "non"
389       self.ecrire_ligne_configuration_2("EcriFiHO", aux)
390 #
391 #     5. Le pilotage de l'adaptation
392 #
393       if self.mode_homard == "ADAP" :
394         self.ecrire_ligne_configuration_0("Le pilotage de l'adaptation")
395 #
396 #     5.1. Type d'adaptation
397 #
398         self.ecrire_ligne_configuration_2("TypeRaff", self.TypeRaff)
399         if self.critere_raffinement is not None :
400           self.ecrire_ligne_configuration_2(self.critere_raffinement[0], self.critere_raffinement[1])
401         self.ecrire_ligne_configuration_2("TypeDera", self.TypeDera)
402         if self.critere_deraffinement is not None :
403           self.ecrire_ligne_configuration_2(self.critere_deraffinement[0], self.critere_deraffinement[1])
404 #
405 #     5.2. L'eventuel indicateur d'erreur
406 #
407         if self.dico_configuration.has_key("Indicateur") :
408 #
409           self.ecrire_ligne_configuration_0("L'indicateur d'erreur")
410           self.ecrire_ligne_configuration_2("CCIndica", self.dico_configuration["Fichier_ASTER_vers_HOMARD"])
411           self.ecrire_ligne_configuration_2("CCNoChaI", self.dico_configuration["Indicateur"]["NOM_MED"])
412           self.ecrire_ligne_configuration_2("CCCoChaI", self.dico_configuration["Indicateur"]["COMPOSANTE"])
413           if self.dico_configuration["Indicateur"].has_key("NUME_ORDRE") :
414             self.ecrire_ligne_configuration_2("CCNumOrI", self.dico_configuration["Indicateur"]["NUME_ORDRE"])
415             self.ecrire_ligne_configuration_2("CCNumPTI", self.dico_configuration["Indicateur"]["NUME_ORDRE"])
416           if self.mots_cles.has_key("TYPE_VALEUR_INDICA") :
417             self.ecrire_ligne_configuration_2("CCTyVaIn", self.mots_cles["TYPE_VALEUR_INDICA"])
418 #
419 #     5.3. Les éventuelles zones de raffinement
420 #
421         if self.dico_configuration.has_key("Zones") :
422           iaux = 0
423           for zone in self.dico_configuration["Zones"] :
424             iaux = iaux + 1
425             self.ecrire_ligne_configuration_0("Zone de raffinement numéro "+str(iaux))
426             if zone.has_key("X_MINI") :
427               self.ecrire_ligne_configuration_3("ZoRaXmin", iaux, zone["X_MINI"])
428               self.ecrire_ligne_configuration_3("ZoRaXmax", iaux, zone["X_MAXI"])
429               self.ecrire_ligne_configuration_3("ZoRaYmin", iaux, zone["Y_MINI"])
430               self.ecrire_ligne_configuration_3("ZoRaYmax", iaux, zone["Y_MAXI"])
431             if zone.has_key("Z_MINI") :
432               self.ecrire_ligne_configuration_3("ZoRaZmin", iaux, zone["Z_MINI"])
433               self.ecrire_ligne_configuration_3("ZoRaZmax", iaux, zone["Z_MAXI"])
434             if zone.has_key("X_CENTRE") :
435               self.ecrire_ligne_configuration_3("ZoRaXCen", iaux, zone["X_CENTRE"])
436               self.ecrire_ligne_configuration_3("ZoRaYCen", iaux, zone["Y_CENTRE"])
437               self.ecrire_ligne_configuration_3("ZoRaRayo", iaux, zone["RAYON"])
438             if zone.has_key("Z_CENTRE") :
439               self.ecrire_ligne_configuration_3("ZoRaZCen", iaux, zone["Z_CENTRE"])
440 #
441 #     5.4. Les niveaux extremes
442 #
443         for aux in self.niveau :
444           self.ecrire_ligne_configuration_2(aux[0], aux[1])
445 #
446 #     5.5. L'usage de l'indicateur
447 #
448         if self.mots_cles.has_key("TYPE_OPER_INDICA") :
449           if self.mots_cles["TYPE_OPER_INDICA"] is not None :
450             self.ecrire_ligne_configuration_2("CCModeFI", self.mots_cles["TYPE_OPER_INDICA"])
451 #
452 #     5.6. Les éventuels groupes de filtrage du raffinement/deraffinement
453 #
454         for cle in ( "GROUP_MA", "GROUP_NO" ) :
455           if self.mots_cles.has_key(cle) :
456             if self.mots_cles[cle] is not None :
457               if not type(self.mots_cles[cle]) in EnumTypes :
458                 self.ecrire_ligne_configuration_2("CCGroAda", self.mots_cles[cle])
459               else :
460                 for group in self.mots_cles[cle] :
461                   self.ecrire_ligne_configuration_2("CCGroAda", group)
462 #
463 #     6. Les éventuels champs à mettre à jour
464 #
465       if self.dico_configuration.has_key("Champs") :
466         self.ecrire_ligne_configuration_0("Champs à mettre à jour")
467         self.ecrire_ligne_configuration_2("CCSolN__", self.dico_configuration["Fichier_ASTER_vers_HOMARD"])
468         self.ecrire_ligne_configuration_2("CCSolNP1", self.dico_configuration["Fichier_HOMARD_vers_ASTER"])
469         iaux = 0
470         for maj_champ in self.dico_configuration["Champs"] :
471           iaux = iaux + 1
472           self.ecrire_ligne_configuration_0("Mise à jour du champ numéro "+str(iaux))
473           self.ecrire_ligne_configuration_3("CCChaNom", iaux, maj_champ["NOM_MED"])
474           if maj_champ.has_key("NUME_ORDRE") :
475             self.ecrire_ligne_configuration_3("CCChaNuO", iaux, maj_champ["NUME_ORDRE"])
476             self.ecrire_ligne_configuration_3("CCChaPdT", iaux, maj_champ["NUME_ORDRE"])
477           elif maj_champ.has_key("INST") :
478             self.ecrire_ligne_configuration_3("CCChaIns", iaux, maj_champ["INST"])
479 #
480 #     7. L'éventuel maillage de frontière
481 #
482       if self.dico_configuration.has_key("NOM_MED_MAILLAGE_FRONTIERE") :
483         self.ecrire_ligne_configuration_0("Maillage de frontière")
484         self.ecrire_ligne_configuration_2("SuivFron", "oui")
485         self.ecrire_ligne_configuration_2("CCFronti", self.dico_configuration["Fichier_ASTER_vers_HOMARD"])
486         self.ecrire_ligne_configuration_2("CCNoMFro", self.dico_configuration["NOM_MED_MAILLAGE_FRONTIERE"])
487         if self.mots_cles.has_key("GROUP_MA_FRONT") :
488           if self.mots_cles["GROUP_MA_FRONT"] is not None :
489             if not type(self.mots_cles["GROUP_MA_FRONT"]) in EnumTypes :
490               self.ecrire_ligne_configuration_2("CCGroFro", self.mots_cles["GROUP_MA_FRONT"])
491             else :
492               for group_ma in self.mots_cles["GROUP_MA_FRONT"] :
493                 self.ecrire_ligne_configuration_2("CCGroFro", group_ma)
494 #
495 #     8. L'éventuel maillage annexe
496 #
497       if self.mode_homard == "ADAP" :
498         if self.CCMaiAnn is not None :
499           self.ecrire_ligne_configuration_0("Maillage d'autre degré")
500           self.ecrire_ligne_configuration_2("ModDegre", "oui")
501           self.ecrire_ligne_configuration_2("CCNoMAnn", self.CCMaiAnn)
502           self.ecrire_ligne_configuration_2("CCMaiAnn", self.dico_configuration["Fichier_HOMARD_vers_ASTER"])
503 #
504 #     9. Options particulières
505 #
506       self.ecrire_ligne_configuration_0("Autres options")
507       if self.mots_cles.has_key("LANGUE") :
508         self.ecrire_ligne_configuration_2("Langue", self.mots_cles["LANGUE"])
509       self.ecrire_ligne_configuration_2("MessInfo", self.dico_configuration["INFO"])
510       if self.dico_configuration["version_perso"] :
511         VERSION_HOMARD = self.dico_configuration["VERSION_HOMARD"]
512         self.ecrire_ligne_configuration_2("DicoOSGM", "$HOMARD_USER/"+VERSION_HOMARD+"/CONFIG/typobj.stu")
513 #
514 #     10. L'usage des éléments incompatibles avec HOMARD
515 #
516       if self.elements_incompatibles is not None :
517         self.ecrire_ligne_configuration_0("Les éléments incompatibles avec HOMARD")
518         self.ecrire_ligne_configuration_2("TypeElem", self.elements_incompatibles)
519 #
520 #     11. Fermeture du fichier
521 #
522       fichier.close()
523       break
524 #
525     if message_erreur is not None :
526       message_erreur = "Ecriture de "+nomfic_global+". "+message_erreur
527       UTMESS("F",'HOMARD0_2',valk=message_erreur)
528 #
529     return
530 # ------------------------------------------------------------------------------
531   def ecrire_fichier_donnees (self) :
532     """Ecrit le fichier des donnees dans le cas d'une demande d'information
533     """
534     message_erreur = None
535 #
536     while message_erreur is None :
537 #
538 #     1. Ouverture du fichier
539 #
540       fichier, nomfic_global = self.ouvre_fichier(self.Nom_Fichier_Donnees)
541 #
542 #     2. On ne demande rien pour le moment
543 #
544       fichier.write("0\n")
545       fichier.write("0\n")
546       fichier.write("0\n")
547       fichier.write("q\n")
548 #
549 #     n. Fermeture du fichier
550 #
551       fichier.close()
552       break
553 #
554     if message_erreur is not None :
555       UTMESS("F",'HOMARD0_2',valk=message_erreur)
556 #
557     return nomfic_global