-#@ MODIF calc_miss_ops Macro DATE 16/02/2010 AUTEUR COURTOIS M.COURTOIS
+#@ AJOUT calc_miss_ops Macro
# -*- coding: iso-8859-1 -*-
-# CONFIGURATION MANAGEMENT OF EDF VERSION
-# ======================================================================
-# COPYRIGHT (C) 1991 - 2010 EDF R&D WWW.CODE-ASTER.ORG
-# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
-# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
-# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
-# (AT YOUR OPTION) ANY LATER VERSION.
-#
-# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT
-# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF
-# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU
-# GENERAL PUBLIC LICENSE FOR MORE DETAILS.
-#
-# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE
-# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER,
-# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE.
-# ======================================================================
# RESPONSABLE COURTOIS M.COURTOIS
import os
-#@ MODIF defi_sol_miss_ops Macro DATE 28/12/2009 AUTEUR COURTOIS M.COURTOIS
+#@ AJOUT defi_sol_miss_ops Macro
# -*- coding: iso-8859-1 -*-
-# CONFIGURATION MANAGEMENT OF EDF VERSION
-# ======================================================================
-# COPYRIGHT (C) 1991 - 2009 EDF R&D WWW.CODE-ASTER.ORG
-# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
-# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
-# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
-# (AT YOUR OPTION) ANY LATER VERSION.
-#
-# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT
-# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF
-# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU
-# GENERAL PUBLIC LICENSE FOR MORE DETAILS.
-#
-# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE
-# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER,
-# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE.
-# ======================================================================
# RESPONSABLE COURTOIS M.COURTOIS
import os
import glob
import numpy as NP
-from recal import *
debug = False
return obj
-# --------------------------------------------------------------------------------------------------
-def get_absolute_path(path):
- """Retourne le chemin absolu en suivant les liens éventuels.
- """
- if os.path.islink(path):
- path = os.path.realpath(path)
- res = os.path.normpath(os.path.abspath(path))
- return res
-
-
-
# --------------------------------------------------------------------------------------------------
def macr_recal_ops(self,UNITE_ESCL, RESU_EXP, POIDS, LIST_PARA, RESU_CALC, ITER_MAXI, ITER_FONC_MAXI, RESI_GLOB_RELA,UNITE_RESU,PARA_DIFF_FINI, GRAPHIQUE, METHODE, INFO, **args ):
""" Macro commande realisant le recalage de modeles Aster """
# Calcul de F et G
erreur, residu, A_nodim, A = CALCUL_ASTER.calcul_FG(val)
- E = CALC_ERROR(experience=RESU_EXP, X0=val, calcul=RESU_CALC, poids=POIDS)
+ E = recal.CALC_ERROR(experience=RESU_EXP, X0=val, calcul=RESU_CALC, poids=POIDS)
E.CalcError(CALCUL_ASTER.Lcalc)
E.CalcSensibilityMatrix(CALCUL_ASTER.Lcalc, val, dX=None, pas=PARA_DIFF_FINI)
import aster
import Macro
from Accas import _F
- from Cata import cata
- from Cata.cata import *
except ImportError:
pass
# faire que la division soit toujours réelle
from __future__ import division
-__version__ = "$Name: $"
-__Id__ = "$Id: cata_aster_v6.py,v 1.12 2001/01/16 15:55:05 iliade Exp $"
-
import Accas
from Accas import *
from Accas import _F
# RESPONSABLE ASSIRE A.ASSIRE
from Macro.calc_europlexus_ops import calc_europlexus_ops
-import types
-
def calc_europlexus_prod(self,COURBE=None,**args):
if COURBE is not None:
self.type_sdprod(args['TABLE_COURBE'],table_sdaster)
# RESPONSABLE COURTOIS M.COURTOIS
def extr_table_prod(TYPE_RESU,**args):
- from Cata import cata
+ defs = globals()
typ = TYPE_RESU.lower()
- if hasattr(cata, typ):
- return getattr(cata, typ)
+ if defs.get(typ) is not None:
+ return defs[typ]
raise AsException("type de concept resultat non prevu")
EXTR_TABLE=OPER(nom="EXTR_TABLE",op=173,sd_prod=extr_table_prod,reentrant='n',
def lire_champ_prod(TYPE_CHAM=None,**args):
# Remarque : si cette liste évolue, il faut penser à mettre à jour son
# homologue dans macr_adap_mail
- import string
-#
if TYPE_CHAM[0:5] == "NOEU_" : return cham_no_sdaster
if TYPE_CHAM[0:2] == "EL" : return cham_elem
raise AsException("type de concept resultat non prevu")
rep_mat_v10=os.path.join(rep_cata,'cataSTA10','materiau')
#
catalogues=(
+#('ASTER','v9.6',os.path.join(rep_cata,'cataSTA9'),'python'),
('ASTER','v10.0',os.path.join(rep_cata,'cataSTA10'),'python','defaut'),
-('ASTER','v9.6',os.path.join(rep_cata,'cataSTA9'),'python'),
)
self.listeCata=listeCata
self.readercata=readercata
for cata in self.listeCata :
- self.CBChoixCata.insertItem(0,cata)
+ self.CBChoixCata.insertItem(100,cata)
lab = QString(repr(len(listeCata)))
lab += QString(" versions du catalogue sont disponibles")
self.TLNb.setText(lab)
self.fic_cata = liste_cata_possibles[0][2]
self.version_code = liste_cata_possibles[0][1]
self.appliEficas.format_fichier=liste_cata_possibles[0][3]
- lab=QString("Eficas V1.")
+ lab=QString("Eficas ")
lab+=QString(self.VERSION_EFICAS)
lab+=QString(" pour ")
lab+=QString(self.code)
"""
# construction du dictionnaire et de la liste des catalogues
self.dico_catalogues = {}
- defaut = None
+ liste_choix=[]
for catalogue in self.appliEficas.CONFIGURATION.catalogues:
if catalogue[0] == self.code :
self.dico_catalogues[catalogue[1]] = catalogue
if len(catalogue) == 5 :
- if catalogue[4]=='defaut' : defaut = catalogue[1]
- liste_choix = self.dico_catalogues.keys()
- liste_choix.sort()
+ if catalogue[4]=='defaut' :
+ liste_choix.insert(0,catalogue[1])
+ else :
+ liste_choix.append(catalogue[1])
+
lab=QString(self.VERSION_EFICAS)
lab+=QString(" pour ")
print self.fic_cata_clef
f=open(self.fic_cata_clef)
except:
- print "Pas de fichier associé contenant des clefs documentaires"
+ #print "Pas de fichier associé contenant des clefs documentaires"
return
dict_clef_docu={}
if is_str(obj): return obj
elif type_permis == 'shell':
if is_str(obj): return obj
+ elif type_permis == 'Fichier' :
+ import os
+ if os.path.isfile(obj):return obj
+ else : raise ValError("%s n'est pas un fichier valide" % repr(obj))
elif type(type_permis) == types.ClassType or isinstance(type_permis,type):
try:
if self.is_object_from(obj,type_permis): return obj
# Les extensions de fichier permis?
extensions=('.map',)
- def gener(self,obj,format='brut',config=None):
- print 'generation dans generator_map'
+ def initialise(self,config):
self.config=config
self.dictMCVal={}
- self.text=PythonGenerator.gener(self,obj,format)
- self.generePythonMap()
- return self.text
+ self.listeCODE=[]
+ self.text=""
+ self.textCode=""
+
+ def verifie(self):
+ print 'verification generique'
+
+ def gener(self,obj,format='brut',config=None):
+ print 'generation dans generator_map'
+ self.initialise(config)
+ text=PythonGenerator.gener(self,obj,format)
+ self.verifie()
+ self.generePythonMap("non")
+ return text
def generRUN(self,obj,format='brut',config=None,):
print 'generRUN dans generator_map'
- self.config=config
- self.dictMCVal={}
+ self.initialise(config)
text=PythonGenerator.gener(self,obj,format)
- self.texteExecution=""
- for code in self.dictMCVal.keys():
- if code in self.__class__.__dict__.keys():
- texteCode=apply(self.__class__.__dict__[code],(self,"oui"))
- self.texteExecution=self.texteExecution+texteCode
+ self.verifie()
+ self.generePythonMap("oui")
return self.texteExecution
def generRUNYACS(self,obj,format='brut',config=None,):
print 'generRUNYACS dans generator_map'
- self.config=config
- self.dictMCVal={}
+ self.initialise(config)
text=PythonGenerator.gener(self,obj,format)
- self.texteExecution=""
- for code in self.dictMCVal.keys():
+ self.verifie()
+ for code in self.listeCODE:
+ print code
if code in self.__class__.__dict__.keys():
codeYACS=str(code)+"YACS"
texteCode=apply(self.__class__.__dict__[codeYACS],(self,))
self.texteExecution=self.texteExecution+texteCode
return self.texteExecution
- def generePythonMap(self) :
+ def generePythonMap(self,execution) :
'''
self.dictMCVal est un dictionnaire qui est indexe par le nom du code (exple PYGMEE)
la valeur associee a la clef est egalement un dictionnaire
'''
for code in self.dictMCVal.keys():
if code in self.__class__.__dict__.keys():
- texte=apply(self.__class__.__dict__[code],(self,"non"))
+ texteCode=apply(self.__class__.__dict__[code],(self,execution))
+ self.texteExecution=self.texteExecution+texteCode
def generPROC_ETAPE(self,obj):
- #print "PN: generPROC_ETAPE dans generatorMap"
+ self.listeCODE.append(obj.nom)
self.clefDico=obj.nom
if not( self.dictMCVal.has_key(self.clefDico)):
self.dictMCVal[self.clefDico]={}
else:
self.dictMCVal[self.clefDico]=[tempo,self.DictTemp]
s=PythonGenerator.generPROC_ETAPE(self,obj)
+ print self.listeCODE
+ print self.dictMCVal
return s
"""
+ def verifie(self):
+ if len(self.listeCODE) != len(set(self.listeCODE)):
+ raise AsException("il n'est pas prevu d avoir deux fois le meme code dans ce schema")
+
def PYGMEE(self,execution) :
dicoPygmee=self.dictMCVal["PYGMEE"]