From: Pascale Noyret Date: Fri, 2 Jul 2010 09:54:02 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: V2_0~37 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=98a2530b1767139bd7861efc10a8fb5b48ae27bc;p=modules%2Feficas.git *** empty log message *** --- diff --git a/Accas/A_AU_PLUS_UN.py b/Accas/A_AU_PLUS_UN.py index e7742703..c1a95bdb 100644 --- a/Accas/A_AU_PLUS_UN.py +++ b/Accas/A_AU_PLUS_UN.py @@ -20,8 +20,9 @@ from Noyau import N_REGLE from Validation import V_AU_PLUS_UN +from Ihm import I_REGLE -class AU_PLUS_UN(V_AU_PLUS_UN.AU_PLUS_UN,N_REGLE.REGLE): +class AU_PLUS_UN(V_AU_PLUS_UN.AU_PLUS_UN,I_REGLE.REGLE,N_REGLE.REGLE): """ La classe utilise l'initialiseur de REGLE. Il n'est pas nécessaire d'expliciter son initialiseur car diff --git a/Aster/qtGroup.py b/Aster/qtGroup.py index e8cea27d..930d1cfb 100755 --- a/Aster/qtGroup.py +++ b/Aster/qtGroup.py @@ -32,4 +32,4 @@ __import__(name) from InterfaceQT4 import eficas_go -eficas_go.lance_eficas_ssIhm(code=prefs.code,fichier="/local/noyret/toto.comm",version='v9.5') +eficas_go.lance_eficas_ssIhm(code=prefs.code,fichier="/local/noyret/Eficas_Aster/cable.comm",version='v10.0') diff --git a/InterfaceQT4/readercata.py b/InterfaceQT4/readercata.py index 7a88e5ad..4a9896cb 100644 --- a/InterfaceQT4/readercata.py +++ b/InterfaceQT4/readercata.py @@ -85,6 +85,7 @@ class READERCATA: print "Catalog description cannot be interpreted: ", catalogue # TODO: Remove this filter. Normally, CONFIGURATION should only define the catalogs for this code anyway. + # Non pas pour Map qui a une notion de sscode for catalogue in all_cata_list: if catalogue.code == self.code : if (self.ssCode == None) or (self.ssCode == catalogue.file_format): diff --git a/Map/Map1_Cata_V0.py b/Map/Map1_Cata_V0.py deleted file mode 100644 index d6ebd5bf..00000000 --- a/Map/Map1_Cata_V0.py +++ /dev/null @@ -1,52 +0,0 @@ -## -*- coding: utf-8 -*- -# -## -------------------------------------------------- -## debut entete -## -------------------------------------------------- -# -from Accas import * -class Tuple: - def __init__(self,ntuple): - self.ntuple=ntuple - - def __convert__(self,valeur): - if type(valeur) == types.StringType: - return None - if len(valeur) != self.ntuple: - return None - return valeur - - def info(self): - return "Tuple de %s elements" % self.ntuple - - __repr__=info - __str__=info - -# -#CONTEXT.debug = 1 -JdC = JDC_CATA ( code = 'MAP', - execmodul = None, - regles=(AU_MOINS_UN('VER_MOX',),), - )# Fin JDC_CATA -# - - -VER_MOX= PROC(nom="VER_MOX",op=None, - fr='mise en donnee de la generation du VER MOX', - - NBPHASES=SIMP(statut='o',typ='I',defaut=1,into=(1,2)), - FUSEAU1=FACT(fr="entree de lecfus", statut='o', - FORME=SIMP(statut = "o", typ='TXM', defaut="fichier", into=("manuel","fichier")), - - b_forme=BLOC( condition = "FORME == 'fichier'", - FORMAT = SIMP(statut = "o", typ='TXM', defaut="croissant", into=("croissant","decroissant")), - FICHIER = SIMP ( statut = "o", typ = "Fichier", ), - ), - - b_manuel=BLOC( condition = "FORME == 'manuel'", - LFUSEAU = SIMP ( statut = "o", typ=Tuple(2),validators=VerifTypeTuple(('R','R')), max="**",) ,),), - - - TAILLE=SIMP(statut = "o",fr="taille du VER en microns", typ='I'), - DISTANCE=SIMP(statut = "o",fr="distance de replusions", typ='R'), -) diff --git a/Map/Map1_Cata_V1.py b/Map/Map1_Cata_V1.py deleted file mode 100644 index 59bef87c..00000000 --- a/Map/Map1_Cata_V1.py +++ /dev/null @@ -1,74 +0,0 @@ -## -*- coding: utf-8 -*- -# -## -------------------------------------------------- -## debut entete -## -------------------------------------------------- -# -from Accas import * -class Tuple: - def __init__(self,ntuple): - self.ntuple=ntuple - - def __convert__(self,valeur): - if type(valeur) == types.StringType: - return None - if len(valeur) != self.ntuple: - return None - return valeur - - def info(self): - return "Tuple de %s elements" % self.ntuple - - __repr__=info - __str__=info - -# -#CONTEXT.debug = 1 -JdC = JDC_CATA ( code = 'MAP', - execmodul = None, - regles=(AU_MOINS_UN('PYGMEE',),AU_MOINS_UN('BENHUR',), AVANT ('PYGMEE' , 'BENHUR'),), - )# Fin JDC_CATA -# - -PYGMEE= PROC(nom="PYGMEE",op=None, - fr='definition de la morphologie', - -# NBPHASES=SIMP(statut='o',typ='I',defaut=1,into=(1,2)), - FUSEAU1=FACT(fr="entree de lecfus", statut='o', - FORME=SIMP(statut = "o", typ='TXM', defaut="fichier", into=("manuel","fichier")), - - b_forme=BLOC( condition = "FORME == 'fichier'", - FORMAT = SIMP(statut = "o", typ='TXM', defaut="croissant", into=("croissant","decroissant")), - FICHIER = SIMP ( statut = "o", typ = "Fichier", defaut="/local00/bin/MAP/studies/demonstrateur_poly_st_1/inclusion_size_distribution.txt"), - ), - - b_manuel=BLOC( condition = "FORME == 'manuel'", -# LFUSEAU = SIMP ( statut = "o", typ=Tuple(2),validators=VerifTypeTuple(('R','R')), max="**",) ,),), - LFUSEAU = SIMP ( statut = "o", typ=Tuple(2), max="**",) ,),), - - - TAILLE=SIMP(statut = "o",fr="taille du VER", typ='R', defaut=50.), - DISTANCE=SIMP(statut = "o",fr="distance de replusions", typ='R', defaut=0.1), - LANCEMENT=SIMP(statut = "o",fr="lancement de PYGMEE", typ='TXM', defaut="oui", into=("oui","non")), -) - -BENHUR= PROC(nom="BENHUR",op=None, - fr='definition du maillage', - - FINESSE=SIMP(statut = "o",fr="nombre d\'elements par cote", typ='I', into=(10,12), defaut=10), - LANCEMENT=SIMP(statut = "o",fr="lancement de BENHUR", typ='TXM', defaut="oui", into=("oui","non")), -) - -ASTER= PROC(nom="ASTER",op=None, - fr='definition du calcul', - - CONDUCTIVITE_M=SIMP(statut = "o",fr="conductivite de la matrice", typ='R', defaut=1.0 , val_min =0.), - CONDUCTIVITE_I=SIMP(statut = "o",fr="conductivite des inclusions", typ='R', defaut=1.0, val_min =0.), - LANCEMENT=SIMP(statut = "o",fr="lancement de Code_Aster", typ='TXM', defaut="oui", into=("oui","non")), -) - -GMSH= PROC(nom="GMSH",op=None, - fr='post-traitement', - - LANCEMENT=SIMP(statut = "o",fr="lancement de GMSH", typ='TXM', defaut="oui", into=("oui","non")), -) diff --git a/Map/Map_Cata_V0.py b/Map/Map_Cata_V0.py deleted file mode 100644 index 5036f45c..00000000 --- a/Map/Map_Cata_V0.py +++ /dev/null @@ -1,62 +0,0 @@ -# -*- coding: utf-8 -*- - -# -------------------------------------------------- -# debut entete -# -------------------------------------------------- - -import Accas -from Accas import * - -class loi ( ASSD ) : pass -class variable ( ASSD ) : pass - - -#CONTEXT.debug = 1 -JdC = JDC_CATA ( code = 'PERFECT', - execmodul = None, - regles = ( AU_MOINS_UN ( 'RPV' , 'INTERNALS'), ), - ) # Fin JDC_CATA - -# -------------------------------------------------- -# fin entete -# -------------------------------------------------- - - -#================================ -# 1. Definition des LOIS -#================================ - -# Nota : les variables de type OPER doivent etre en majuscules ! -# Nota : les variables de type OPER doivent etre de premier niveau (pas imbriquees dans un autre type) -RPV = PROC(nom = "RPV", - op = 68, - fr = "end-products RPV-2 and ToughnessModule", - regles = ( AU_MOINS_UN ( 'RPV2' , 'ToughnessModule'), ), - RPV2 = FACT(statut='f', - regles = ( AU_MOINS_UN ( 'IRRAD' , 'CONVOLVE', 'LONG_TERM','HARD'), ), - IRRAD = FACT( statut='f', - neutron_spectrum = SIMP(statut='f',typ='R', max='**'), - fcc_crystal = FACT(statut='o', - nu = SIMP(statut='o',typ='R',defaut=0.3), - mu = SIMP(statut='o',typ='R',defaut=70),), - operating_conditions = FACT(statut = 'o', - relative_time_increments = SIMP(statut='o',typ='R', max='**'), - time_irrad = SIMP(statut='o',typ='R',defaut=1e+07,), - temp_irrad = SIMP(statut='o',typ='R',defaut=573,), - flux_cut_off_energy = SIMP (statut='o',typ='R',defaut=1),) - ), - CONVOLVE = FACT(statut='f', - UNITE_RESU = SIMP(statut='f',typ='I',defaut=32), - UNITE_RESU2 = SIMP(statut='f',typ='I',defaut=32), - )) -); - -INTERNALS = PROC ( nom = "INTERNALS", - op = 68, - fr = "end-products INTERN-1", - # regles = ( AU_MOINS_UN ( 'RPV2' , 'ToughnessModule'), ), - INTERN1 = FACT(statut='f', - UNITE_RESU_FORC = SIMP(statut='f',typ='I',defaut=33), - UNITE_RESU_IMPE = SIMP(statut='f',typ='I',defaut=32),) -); - diff --git a/Map/Map_Openturns.py b/Map/Map_Openturns.py deleted file mode 100644 index 351aa74b..00000000 --- a/Map/Map_Openturns.py +++ /dev/null @@ -1,20 +0,0 @@ -## -*- coding: utf-8 -*- -# -## -------------------------------------------------- -## debut entete -## -------------------------------------------------- -# -from Accas import * -# -#CONTEXT.debug = 1 -JdC = JDC_CATA ( code = 'OPENTURNS_GENERIC', - execmodul = None, - regles=(AU_MOINS_UN('CODE',)), - )# Fin JDC_CATA -# - -CODE= PROC(nom="CODE",op=None, - fr='solver', - NOMCODE = SIMP(statut = "o", typ='TXM',), - FICH_RESULTAT = SIMP(statut = "o", typ='Fichier',), -) diff --git a/Map/benhur_pygmee.txt b/Map/benhur_pygmee.txt deleted file mode 100644 index 899e8a0c..00000000 --- a/Map/benhur_pygmee.txt +++ /dev/null @@ -1,28 +0,0 @@ -OPTIONS -3D BENHUR SCALE -I - Morphologie (MESSALA) -1) dimension du VER cubique [m] (entree) -%_PYGMEE_TAILLE% -2) fraction volumique seuil écrétant le fuseau (entree) -.11 -3) fichier decrivant le fuseau granulaire descendant (entree) -- -4) fichier decrivant la position et la taille des boules (sortie) -%_PATH_PYGMEE%/benhur_input.txt -5) fichier CAO de la morphologie (sortie) -- -6) facteur de correction de fraction volumique (entree) -1.0 - -II - Maillage (BENHUR) -1) fichier entree décrivant le maillage support (entree) -%_PATH_BENHUR%/regular_mesh_3D_%_BENHUR_FINESSE%.msh -2) fichier sortie du maillage (sortie) -%_PATH_STUDY%/%_NAME_SCHEME%_benhur_%_BENHUR_FINESSE%.msh -3) fichier commentaire sur les statistiques décrivant le maillage (sortie) -%_PATH_STUDY%/%_NAME_SCHEME%_benhur_%_BENHUR_FINESSE%.log -4) fichier BMP décrivant une coupe binarisée du VER (sortie) -%_PATH_BENHUR%/%_NAME_SCHEME%_benhur_%_BENHUR_FINESSE%.bmp -5) fichier TXT donnant la level set du contour aux noeuds (sortie) -%_PATH_BENHUR%/%_NAME_SCHEME%_benhur_%_BENHUR_FINESSE%_levelset.txt - diff --git a/Map/catalogues_Map.ini b/Map/catalogues_Map.ini index 005eaa09..2db9a444 100644 --- a/Map/catalogues_Map.ini +++ b/Map/catalogues_Map.ini @@ -5,11 +5,7 @@ rep_cata=os.getcwd() catalogues = ( # (ssCode,version,catalogue,formatIn) -# ('Map','V0',os.path.join(rep_cata,'Map2_Cata_V0.py'),'map'), - ('Map','V1',os.path.join(rep_cata,'Map1_Cata_V0.py'),'map_OT'), - ('Map','V2',os.path.join(rep_cata,'Map_Openturns.py'),'map_OT'), ('Map','s_poly_st_1_V1',os.path.join(rep_cata,'s_poly_st_1_V1.py'),'s_poly_st_1'), ('Map','s_scc_st_2_V1',os.path.join(rep_cata,'s_scc_st_2_V1.py'),'s_scc_st_2'), -# ('Map','s_poly_st_1_V2',os.path.join(rep_cata,'s_poly_st_1_V2.py'),'s_poly_st_1'), ) diff --git a/Map/configuration_Map.py b/Map/configuration_Map.py index b18b082f..7c918342 100644 --- a/Map/configuration_Map.py +++ b/Map/configuration_Map.py @@ -51,6 +51,7 @@ class CONFIG: self.salome = appli.salome self.repIni = repIni self.REPINI = repIni + self.INSTALLDIR =os.path.dirname(__file__) if self.appli: self.parent=appli.top diff --git a/Map/prefs_Map.py b/Map/prefs_Map.py index f7483ed4..f1e5eaec 100644 --- a/Map/prefs_Map.py +++ b/Map/prefs_Map.py @@ -33,7 +33,7 @@ initialdir=REPINI INSTALLDIR=os.path.join(REPINI,'..') PATH_PYGMEE="/local/noyret/MAP/components/pygmee_v1" PATH_BENHUR="/local/noyret/MAP/components/benhur" -PATH_ASTER="/local/noyret/bin/aster/bin" +PATH_ASTER="/local/noyret/bin/Aster10/bin" PATH_MODULE="/local/noyret/MAP/modules/polymers" PATH_STUDY="/local/noyret/MAP/studies/demonstrateur_poly_st1" diff --git a/Map/test_module.bhr b/Map/test_module.bhr deleted file mode 100644 index 0198dcbc..00000000 --- a/Map/test_module.bhr +++ /dev/null @@ -1,29 +0,0 @@ -OPTIONS -3D BENHUR SCALE -I - Morphologie (MESSALA) -1) dimension du VER cubique [m] (entree) -50.0 -2) fraction volumique seuil écrétant le fuseau (entree) -.11 -3) fichier decrivant le fuseau granulaire descendant (entree) -- -4) fichier decrivant la position et la taille des boules (sortie) -/local00/bin/MAP/modules/test_module/pygmee_v1/benhur_input.txt -5) fichier CAO de la morphologie (sortie) -- -6) facteur de correction de fraction volumique (entree) -1.0 - -II - Maillage (BENHUR) -1) fichier entree décrivant le maillage support (entree) -/local00/bin/MAP/modules/test_module/benhur/regular_mesh_3D_10.msh -2) fichier sortie du maillage (sortie) -test_module_10.msh -3) fichier commentaire sur les statistiques décrivant le maillage (sortie) -test_module_10.log -4) fichier BMP décrivant une coupe binarisée du VER (sortie) -test_module_10.bmp -5) fichier TXT donnant la level set du contour aux noeuds (sortie) -test_module_10_levelset.txt - - diff --git a/Sep/catalogues_sep.ini b/Sep/catalogues_sep.ini index 783d3c0d..ca1eb025 100644 --- a/Sep/catalogues_sep.ini +++ b/Sep/catalogues_sep.ini @@ -9,6 +9,6 @@ catalogues = ( #('SEP','V1_1',os.path.join(rep_cata,'SEP_Cata_V1_1.py'),'SEP','SEP'), #('SEP','V1_2',os.path.join(rep_cata,'SEP_Cata_V1_2.py'),'SEP','SEP'), # ('SEP','V1_3',os.path.join(rep_cata,'SEP_Cata_V1_3.py'),'SEP','SEP'), - ('SEP','V1_4',os.path.join(rep_cata,'SEP_Cata_V1_4.py'),'SEP','SEP'), + ('SEP','V1',os.path.join(rep_cata,'SEP_Cata_V0_1.py'),'SEP','SEP'), ) diff --git a/Sep/configuration_SEP.py b/Sep/configuration_SEP.py index def14dc4..d7518dbb 100644 --- a/Sep/configuration_SEP.py +++ b/Sep/configuration_SEP.py @@ -61,9 +61,9 @@ class CONFIG: # Valeurs par defaut self.rep_user = os.path.join(os.environ['HOME'],'.Eficas_SousEp') - self.initialdir = self.rep_user self.path_doc = self.rep_user - self.savedir = self.rep_user + self.savedir = os.environ['HOME'] + self.initialdir = os.environ['HOME'] self.exec_acrobat = self.rep_user #Lecture des fichiers utilisateurs diff --git a/Traducteur/toto.comm b/Traducteur/toto.comm deleted file mode 100644 index cb6cc097..00000000 --- a/Traducteur/toto.comm +++ /dev/null @@ -1,443 +0,0 @@ -# MODIF DATE 31/10/2006 AUTEUR A3BHHAE H.ANDRIAMBOLOLONA -# TITRE MODIFICATION STRUCTURALE D UNE POUTRE -# CONFIGURATION MANAGEMENT OF EDF VERSION -# ====================================================================== -# COPYRIGHT (C) 1991 - 2006 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. -# ====================================================================== - -DEBUT(CODE=_F( NOM = 'SDLL137A',NIV_PUB_WEB='INTERNET'),); - -#********************************** -# CREATION DU MODELE EXPERIMENTAL -#********************************** - -MAILEXP=LIRE_MAILLAGE(UNITE=22); - -MODLEXP=AFFE_MODELE(MAILLAGE=MAILEXP, - AFFE=_F(TOUT='OUI', - PHENOMENE='MECANIQUE', - MODELISATION='DIS_TR',),); - -CHCAREXP=AFFE_CARA_ELEM(MODELE=MODLEXP, - DISCRET=_F(GROUP_MA='POUTRE', - REPERE='GLOBAL', - CARA='K_TR_D_L', - VALE=(1.e+12,1.e+12,1.e+12,1.e+12,1.e+12,1.e+12,), - ),); - -KELEXP=CALC_MATR_ELEM(OPTION='RIGI_MECA', - MODELE=MODLEXP, - CARA_ELEM=CHCAREXP, - ); - -MELEXP=CALC_MATR_ELEM(OPTION='MASS_MECA', - MODELE=MODLEXP, - CARA_ELEM=CHCAREXP, - ); - -NUMEXP=NUME_DDL( MATR_RIGI=KELEXP, - ); - -KASSEXP=ASSE_MATRICE(MATR_ELEM=KELEXP, - NUME_DDL=NUMEXP,); - -MASSEXP=ASSE_MATRICE(MATR_ELEM=MELEXP, - NUME_DDL=NUMEXP,); - -# LECTURE DES MODES IDENTIFIES - -MODMESU=LIRE_RESU(TYPE_RESU='MODE_MECA', - FORMAT='IDEAS', - MODELE=MODLEXP, - UNITE=21, - NOM_CHAM='DEPL', - MATR_A =KASSEXP, - MATR_B =MASSEXP, - FORMAT_IDEAS=_F(NOM_CHAM='DEPL', - NUME_DATASET=55, - RECORD_6=(1,2,3,8,2,6,), - POSI_ORDRE=(7,4,), - POSI_NUME_MODE=(7,4), - POSI_FREQ=(8,1,), - POSI_MASS_GENE=(8,2), - POSI_AMOR_GENE=(8,3), - NOM_CMP=('DX','DY','DZ','DRX','DRY','DRZ'),), - TOUT_ORDRE='OUI',); - -# TRI EVENTUEL - -MODEIDE=EXTR_MODE(FILTRE_MODE=_F(MODE=MODMESU, - NUME_MODE=(1,2,3,4,5,), - ),); - -#******************************** -# CREATION MODELE SUPPORT -#******************************** - -MAILSUP=LIRE_MAILLAGE(UNITE=20); - -MODLSUP=AFFE_MODELE(MAILLAGE=MAILSUP, - AFFE=(_F(GROUP_MA=('POUTRE','VISUAL',), - PHENOMENE='MECANIQUE', - MODELISATION='POU_D_E',),),) - -MATSUP=DEFI_MATERIAU(ELAS=_F(E=2.1E11, - NU=0.3, - RHO=7800.,),); - -CHMATSUP=AFFE_MATERIAU(MAILLAGE=MAILSUP, - MODELE=MODLSUP, - AFFE=(_F(GROUP_MA='POUTRE', - MATER=MATSUP,),),); - -CHCARSUP=AFFE_CARA_ELEM(MODELE=MODLSUP, - POUTRE=(_F(GROUP_MA='POUTRE', - SECTION='RECTANGLE', - CARA=('HY','HZ',), - VALE=(9.E-3,38.E-3,),),), - ORIENTATION=(_F(GROUP_MA='POUTRE', - CARA='VECT_Y', - VALE=(0.,0.,1.),),), - ) - -CONDLSUP=AFFE_CHAR_MECA(MODELE=MODLSUP, - DDL_IMPO=( _F(GROUP_NO=('FIXE',), - DX=0.0, - DY=0.0, - DZ=0.0, - DRX=0.0, - DRY=0.0, - DRZ=0.0,), - ),); - -KELSUP=CALC_MATR_ELEM(OPTION='RIGI_MECA', - MODELE=MODLSUP, - CHAM_MATER=CHMATSUP, - CARA_ELEM=CHCARSUP, - CHARGE=CONDLSUP,); - -MELSUP=CALC_MATR_ELEM(OPTION='MASS_MECA', - MODELE=MODLSUP, - CHAM_MATER=CHMATSUP, - CARA_ELEM=CHCARSUP, - CHARGE=CONDLSUP,); - -NUMSUP=NUME_DDL(MATR_RIGI=KELSUP,); - -KASSUP=ASSE_MATRICE(MATR_ELEM=KELSUP, - NUME_DDL=NUMSUP,); - -MASSUP=ASSE_MATRICE(MATR_ELEM=MELSUP, - NUME_DDL=NUMSUP,); - -MODESUP=MODE_ITER_SIMULT(MATR_A=KASSUP, - MATR_B=MASSUP, - VERI_MODE=_F(SEUIL=1.E-05,STOP_ERREUR='OUI',), - CALC_FREQ=_F(OPTION='PLUS_PETITE', - NMAX_FREQ=20, - SEUIL_FREQ=1.E-4,),); - -MODSTSUP=MODE_STATIQUE(MATR_RIGI=KASSUP, - FORCE_NODALE=( - _F(GROUP_NO='CAPTEUR',AVEC_CMP=('DY','DZ',),), - ),); - -BASEMO=DEFI_BASE_MODALE(RITZ=( - _F(MODE_MECA=MODESUP,NMAX_MODE=0,), - _F(MODE_STAT=MODSTSUP,NMAX_MODE=8,), - ), - NUME_REF=NUMSUP,); - -#******************************** -# CORRESPONDANCE MESURE - SUPPORT -#******************************** - -PROJ=PROJ_MESU_MODAL(MODELE_CALCUL=_F(MODELE=MODLSUP, - BASE=BASEMO,), - MODELE_MESURE=_F(MODELE=MODLEXP, - MESURE=MODEIDE, - NOM_CHAM='DEPL',), - RESOLUTION=_F(METHODE='SVD', - EPS=1.E-5), - ); - -# CONDENSATION DE LA MESURE SUR DDL INTERFACES - -SSEXP = MACR_ELEM_STAT( - DEFINITION=_F(MODELE=MODLSUP, - PROJ_MESU=PROJ,MODE_MESURE=MODEIDE, - CARA_ELEM =CHCARSUP,CHAM_MATER=CHMATSUP, - ), - EXTERIEUR=_F(GROUP_NO = ('EXTERNE',),), - RIGI_MECA=_F(), - MASS_MECA=_F(), - ) - -MAILCOND=DEFI_MAILLAGE( - DEFI_SUPER_MAILLE=_F( MACR_ELEM_STAT = SSEXP,SUPER_MAILLE='SUMAIL',), - DEFI_NOEUD=_F( TOUT = 'OUI', INDEX = (1,0,1,8,)) - ) - -#********************************** -# CREATION DU MODELE COUPLE (MESURE + MODIFICATION) -#********************************** - -MAILX=LIRE_MAILLAGE(UNITE=24); - -MAILCPL=ASSE_MAILLAGE( - MAILLAGE_1=MAILCOND, - MAILLAGE_2=MAILX, - OPERATION='SOUS_STR' - ) - -MODLCPL=AFFE_MODELE( - MAILLAGE=MAILCPL, - AFFE=(_F(GROUP_MA=('POUTRE',), - PHENOMENE='MECANIQUE', - MODELISATION='POU_D_E',),), - AFFE_SOUS_STRUC=_F( SUPER_MAILLE = 'SUMAIL', - PHENOMENE='MECANIQUE',), - ) - -CHCARCPL=AFFE_CARA_ELEM(MODELE=MODLCPL, - POUTRE=(_F(GROUP_MA='POUTRE', - SECTION='RECTANGLE', - CARA=('HY','HZ',), - VALE=(9.E-3,38.E-3,),),), - ORIENTATION=(_F(GROUP_MA='POUTRE', - CARA='VECT_Y', - VALE=(0.,0.,1.),),), - ) - -MATERX=DEFI_MATERIAU(ELAS=_F(E=2.1E11, - NU=0.3, - RHO=7800.,),); - -CHMATCPL=AFFE_MATERIAU( MAILLAGE=MAILCPL, - AFFE=(_F(GROUP_MA=('POUTRE',), - MATER=MATERX,),),); - -CONDLCPL=AFFE_CHAR_MECA(MODELE=MODLCPL, - DDL_IMPO=( _F(GROUP_NO=('EXTERNE',), - DX=0.0, - DRX=0.0, - ),),); - -KELCPL=CALC_MATR_ELEM(MODELE=MODLCPL,OPTION='RIGI_MECA', - CARA_ELEM=CHCARCPL,CHAM_MATER=CHMATCPL, - CHARGE=CONDLCPL, - ) - -MELCPL=CALC_MATR_ELEM(MODELE=MODLCPL,OPTION='MASS_MECA', - CARA_ELEM=CHCARCPL,CHAM_MATER=CHMATCPL, - CHARGE=CONDLCPL, - ) - -NUMCPL=NUME_DDL(MATR_RIGI=KELCPL,) - -KASCPL=ASSE_MATRICE(MATR_ELEM=KELCPL,NUME_DDL=NUMCPL) - -MASCPL=ASSE_MATRICE(MATR_ELEM=MELCPL,NUME_DDL=NUMCPL) - -# CALCUL MODAL SUR LE MODELE COUPLE - -MODECPL=MODE_ITER_SIMULT(MATR_A=KASCPL,MATR_B=MASCPL, - VERI_MODE=_F(SEUIL=1.E-05,STOP_ERREUR='OUI',), - CALC_FREQ=_F(OPTION='PLUS_PETITE', - NMAX_FREQ=2, - SEUIL_FREQ=1.E-4,),); - -# RETROPROJECTION SUR LE MODELE EXPERIMENTAL (INTERFACE -> DDL MESURE) - -MODERETR=DEPL_INTERNE(DEPL_GLOBAL=MODECPL,SUPER_MAILLE='SUMAIL') - -#********************************** -# INDICATEUR SUR CHOIX DE BASE DE PROJECTION -# COMPARAISON CHAMP INTERFACE <> CHAMP OBTENU PAR EXPANSION STATIQUE AUX INTERFACES -#********************************** - -# CREATION MODELE FICTIF DE L INTERFACE - -MAILINT=LIRE_MAILLAGE(UNITE=26); - -MODLINT=AFFE_MODELE(MAILLAGE=MAILINT, - AFFE=_F(GROUP_MA='VISUAL', - PHENOMENE='MECANIQUE', - MODELISATION='DIS_TR',),); - -CHCARINT=AFFE_CARA_ELEM(MODELE=MODLINT, - DISCRET=_F(GROUP_MA='VISUAL', - REPERE='GLOBAL', - CARA='K_TR_D_L', - VALE=(1e+12,1e+12,1e+12,1e+12,1e+12,1e+12,), - ),); - -KELINT=CALC_MATR_ELEM(OPTION='RIGI_MECA', - MODELE=MODLINT, - CARA_ELEM=CHCARINT, - ); - -NUMINT=NUME_DDL( MATR_RIGI=KELINT,); - -# EXPANSION STATIQUE DU CHAMP DE DEPL AUX INTERFACES - -MODSTINT=MODE_STATIQUE(MATR_RIGI=KASSUP, - FORCE_NODALE=( _F(GROUP_NO='CAPTEUR',AVEC_CMP=('DY','DZ',),), - ),); - -BASEINT=DEFI_BASE_MODALE(RITZ=( - _F(MODE_MECA=MODESUP,NMAX_MODE=0,), - _F(MODE_STAT=MODSTINT,NMAX_MODE=4,), - ), - NUME_REF=NUMSUP,); - -PROJMS=PROJ_MESU_MODAL(MODELE_CALCUL=_F(MODELE=MODLSUP, - BASE=BASEINT,), - MODELE_MESURE=_F(MODELE=MODLEXP, - MESURE=MODERETR, - NOM_CHAM='DEPL',), - RESOLUTION=_F(METHODE='SVD', - EPS=1.E-5), - ); - -DEPLPR=REST_BASE_PHYS(RESU_GENE=PROJMS, - TOUT_ORDRE='OUI', - NOM_CHAM ='DEPL'); - -DEPLINT=PROJ_CHAMP(METHODE='ELEM', - RESULTAT=DEPLPR, - MODELE_1=MODLSUP, - MODELE_2=MODLINT, - NOM_CHAM='DEPL', - TOUT_ORDRE='OUI', - NUME_DDL=NUMINT, - VIS_A_VIS=_F(GROUP_MA_1='VISUAL', - GROUP_MA_2='VISUAL',), - ); - -# CHAMP DE DEPL AUX INTERFACES SUR LE MODELE COUPLE - -DEPLXINT=PROJ_CHAMP(METHODE='ELEM', - RESULTAT=MODECPL, - MODELE_1=MODLCPL, - MODELE_2=MODLINT, - NOM_CHAM='DEPL', - TOUT_ORDRE='OUI', - NUME_DDL=NUMINT, - VIS_A_VIS=_F(GROUP_MA_1='VISUAL', - GROUP_MA_2='VISUAL',), - ); - -# INDICATEUR DE PROXIMITE DES MODES -# LA BASE DE PROJECTION EST CORRECT SI DEPLINT = DEPLXINT - -# LES MODES SONT PROCHES SI LES TERMES DIAG DU MAC PROCHE DE 1 - -MACINT=MAC_MODES(BASE_1=DEPLINT, - BASE_2=DEPLXINT, - INFO =2, - ); - -TEST_TABLE(TABLE=MACINT, REFERENCE='ANALYTIQUE', - NOM_PARA = 'MAC', - TYPE_TEST='SOMM', - CRITERE='ABSOLU', - VALE = 2, - PRECISION = 0.02) - -#********************************** -# COMPARAISON AVEC CALCUL DIRECT -#********************************** - -MODLDIR=AFFE_MODELE(MAILLAGE=MAILSUP, - AFFE=(_F(GROUP_MA=('SIMPLE','VISUAL',), - PHENOMENE='MECANIQUE', - MODELISATION='POU_D_E',),),) - -MATDBL=DEFI_MATERIAU(ELAS=_F(E=4.2E11, - NU=0.3, - RHO=15600.,),); - -CHMATDIR=AFFE_MATERIAU(MAILLAGE=MAILSUP, - MODELE=MODLDIR, - AFFE=(_F(GROUP_MA='SIMPLE', - MATER=MATSUP,), - _F(GROUP_MA='VISUAL', - MATER=MATDBL,),),); - -CHCARDIR=AFFE_CARA_ELEM(MODELE=MODLDIR, - POUTRE=(_F(GROUP_MA='POUTRE', - SECTION='RECTANGLE', - CARA=('HY','HZ',), - VALE=(9.E-3,38.E-3,),),), - ORIENTATION=(_F(GROUP_MA='POUTRE', - CARA='VECT_Y', - VALE=(0.,0.,1.),),), - ) - -CONDLDIR=AFFE_CHAR_MECA(MODELE=MODLDIR, - DDL_IMPO=( _F(GROUP_NO=('FIXE',), - DX=0.0, - DY=0.0, - DZ=0.0, - DRX=0.0, - DRY=0.0, - DRZ=0.0,), - ),); - -KELDIR=CALC_MATR_ELEM(OPTION='RIGI_MECA', - MODELE=MODLDIR, - CHAM_MATER=CHMATDIR, - CARA_ELEM=CHCARDIR, - CHARGE=CONDLDIR,); - -MELDIR=CALC_MATR_ELEM(OPTION='MASS_MECA', - MODELE=MODLDIR, - CHAM_MATER=CHMATDIR, - CARA_ELEM=CHCARDIR, - CHARGE=CONDLDIR,); - -NUMDIR=NUME_DDL(MATR_RIGI=KELDIR,); - -KASDIR=ASSE_MATRICE(MATR_ELEM=KELDIR, - NUME_DDL=NUMDIR,); - -MASDIR=ASSE_MATRICE(MATR_ELEM=MELDIR, - NUME_DDL=NUMDIR,); - -MODEDIR=MODE_ITER_SIMULT(MATR_A=KASDIR, - MATR_B=MASDIR, - VERI_MODE=_F(SEUIL=1.E-05,STOP_ERREUR='OUI',), - CALC_FREQ=_F(OPTION='PLUS_PETITE', - NMAX_FREQ=2, - SEUIL_FREQ=1.E-4,),); - -#tmodes = aster.getvectjev("MODEDIR .FREQ ") -#tmodes[0] = 7.7807E+0 -#tmodes[1] = 3.2852E+1 - -TEST_RESU(RESU=( - _F(RESULTAT=MODECPL, NUME_ORDRE=1, PARA='FREQ', - VALE=7.7807E+0, CRITERE='RELATIF', PRECISION=1.E-2, - REFERENCE='AUTRE_ASTER',), - _F(RESULTAT=MODECPL, NUME_ORDRE=2, PARA='FREQ', - VALE=3.2852E+1, CRITERE='RELATIF', PRECISION=1.E-2, - REFERENCE='AUTRE_ASTER',), - ),); - - -FIN(); - diff --git a/UiQT4/desInclude.ui b/UiQT4/desInclude.ui index 189df4af..4ab0ed9a 100644 --- a/UiQT4/desInclude.ui +++ b/UiQT4/desInclude.ui @@ -57,7 +57,7 @@ - 0 + 2 @@ -240,7 +240,7 @@ 20 - 270 + 110 161 41 @@ -259,7 +259,7 @@ 20 - 320 + 160 161 41 diff --git a/generator/generator_map.py b/generator/generator_map.py index 477f487c..0255bbd9 100644 --- a/generator/generator_map.py +++ b/generator/generator_map.py @@ -85,6 +85,7 @@ class MapGenerator(PythonGenerator): self.initialise(config) text=PythonGenerator.gener(self,obj,format) self.verifie() + self.loadSchema() for elt in self.listeCODE: code=elt.keys()[0] dico=elt[code] @@ -148,3 +149,18 @@ class MapGenerator(PythonGenerator): result=chaine.replace(rplact,str(dico[mot])) chaine=result return chaine + + def loadSchema(self): + print "je passe par la" + #PNPNPN + import sys + sys.path.append('/local/noyret/Salome_5.1.3/Install/YACS/lib/python2.5/site-packages/salome/') + try: + import libYACS_Swig + yacs_swig = libYACS_Swig.YACS_Swig() + yacs_swig.loadSchema(self.__yacs_filename) + except: + msg = "Please install YACS module, error was: \n" + msg += traceback.format_exc() + return msg + diff --git a/generator/generator_perfect.py b/generator/generator_perfect.py deleted file mode 100644 index 66e91f23..00000000 --- a/generator/generator_perfect.py +++ /dev/null @@ -1,301 +0,0 @@ -# -*- coding: utf-8 -*- -# CONFIGURATION MANAGEMENT OF EDF VERSION -# ====================================================================== -# COPYRIGHT (C) 1991 - 2002 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. -# -# -# ====================================================================== -""" - Ce module contient le plugin generateur de fichier au format - SEP pour EFICAS. - -""" -import traceback -import types,string,re,os - -from generator_python import PythonGenerator - -def entryPoint(): - """ - Retourne les informations necessaires pour le chargeur de plugins - - Ces informations sont retournees dans un dictionnaire - """ - return { - # Le nom du plugin - 'name' : 'perfect', - # La factory pour creer une instance du plugin - 'factory' : PerfectGenerator, - } - - -class PerfectGenerator(PythonGenerator): - """ - Ce generateur parcourt un objet de type JDC et produit - un texte au format eficas et - un texte au format py - - """ - # Les extensions de fichier permis? - extensions=('.comm',) - - def gener(self,obj,format='brut',config=None): - self.text=PythonGenerator.gener(self,obj,format) - self.generePythonPerfect() - return self.text - - def generePythonPerfect(self) : - ''' - ''' - import sys - sys.path.append("/local/noyret/PERFECT/perfect_platform") - print "avant import" - import PDM - import PMM - import PSM - print "apres import" -#!/usr/bin/env python - - - -# script exported from study my new study -# generated using the PSM.ExportStudy package and the script_tmpl.py -# template - - import getopt, sys, time - from PSM.PerfectStudy import ExecutionStatus - - short_opts = "dhst" - long_opts = [ - "debug", - "help", - "save", - "test", - ] - - TXT_HELP = r""" - SYNTAX: - python script.py [options] - DESCRIPTION: - will launch the exported python script - OPTIONS: - -h, --help: - print this help (and you found it!) - -d, --debug: - when enabled, if a module execution fails, the error messages of this - module will be printed (default no) - -s, --save: - will save the study (format .prf) when the computation is - finished, if it has finished with no error (default no) - -t, --test: - will automatically look for a 'return_flag' produced by a comparison - list in the current study, and will exit with a return code depending - on the return_flag: - 0 (normal exit) if the return_flag is 1 (criterion satisfied) - 1 (error exit) if the return_flag is 0 (criterion not satisfied) - This is usefull especially for non-regression tests. - """ - - START_MESSAGE = r""" - - +-------------------------+ - | PERFECT python script | - +-------------------------+ - - """ - - DEBUG_MODE = False - TEST_MODE = False - SAVE_STUDY = False - INDENT = 4*" " - - # set the options - opts, args = getopt.getopt(sys.argv[1:], short_opts, long_opts) - for opt,arg in opts: - if opt in ("-h", "--help"): - print TXT_HELP - sys.exit(0) - if opt in ("-d", "--debug"): - DEBUG_MODE = True - if opt in ("-s", "--save"): - SAVE_STUDY = True - if opt in ("-t", "--test"): - TEST_MODE = True - - # 1st: determine and write what are the packages needed for the definition - # of the input data - from PDM.BasicUnits import Flux, Energy, Temperature, Time, DamageRate, Volume, Dimension, AtomicDensity, Stress - from PDM.Crystal import IronBccCrystal - from PDM.BasicTypes import PerfectFile, String, TableCoefficient, Coefficient, StringListChoice - from PDM.Irradiation import NeutronSpectrum, OperatingConditions - - - ################################################################################ - - # 2nd: write study preferences and so on - print START_MESSAGE - print ">>> Defining study '%s'" % ("my new study") - from PSM import PerfectStudy - a_study = PerfectStudy.PerfectStudy() - a_study.set_study({'date': '12/11/09', 'description': 'no description', 'filename': '/local/noyret/PerfectStudy/studies/my_new_new_study.prf', 'name': 'my new study', 'author': 'gadjanor'}) - - # 3rd: write the study chain - print ">>> Setting the study chain" - a_study.set_chain_modules_path_list([['RPV2.IRRAD', 'PMM.RPV']]) - - # 4th: list and write all input data needed - print ">>> Defining the list of input data" - specter_path = PerfectFile() - specter_path.path = '/local/noyret/PERFECT/perfect_platform/tools/bin/specter.exe_64' - specter_path.format = '' - - neutron_spectrum = NeutronSpectrum() - neutron_spectrum.spectrum_description.value = 'Flux de neutrons total osiris' - col0 = Coefficient() - col0.name = 'Energies' - col0.value = 20.0 - col0.unit = 'MeV' - col1 = Flux() - col1.name = 'Fluxes' - col1.value = 2213561344.0 - col1.unit = 'n_per_cm2_per_s' - neutron_spectrum.spectrum.columns = [col0, col1] - neutron_spectrum.spectrum.values = [[1.6195e-08, 157854046530.125], [3.2380000000000003e-08, 50535692980.711899], [6.9749999999999999e-08, 66380592563.133797], [1.5029999999999999e-07, 85471465500.099396], [3.2370000000000002e-07, 112865380791.41], [6.9729999999999998e-07, 132262477629.74699], [1.502e-06, 125499304036.588], [3.236e-06, 155325512030.22501], [6.9709999999999998e-06, 165859614237.423], [1.502e-05, 138404454165.83801], [3.235e-05, 136094651024.06], [6.9690000000000005e-05, 125096838337.642], [0.00015009999999999999, 169481805527.93799], [0.0003234, 126382978723.40401], [0.00069669999999999997, 74648637900.179001], [0.0015009999999999999, 147792404056.47198], [0.0032330000000000002, 174136408828.793], [0.0069649999999999998, 119086100616.425], [0.015010000000000001, 151134619208.59], [0.032320000000000002, 142105388745.27701], [0.069620000000000001, 212703121893.01999], [0.14999999999999999, 321412606880.09497], [0.1832, 294202425929.60797], [0.22370000000000001, 355893418174.58698], [0.40760000000000002, 392456551998.409], [0.49790000000000001, 482468880493.14001], [0.60809999999999997, 408021475442.43402], [0.74270000000000003, 580268045337.04504], [0.90720000000000001, 680368264068.40295], [1.1080000000000001, 628730165042.75195], [1.353, 567879101212.96497], [1.653, 633883000000.0], [2.0190000000000001, 726967000000.0], [2.4660000000000002, 584931000000.0], [3.012, 627575000000.0], [3.6789999999999998, 484280000000.0], [4.4930000000000003, 354030000000.0], [5.4880000000000004, 259284000000.0], [6.7030000000000003, 214234000000.0], [8.1869999999999994, 119961000000.0], [10.0, 63117120700.0], [14.960000000000001, 24112944919.0], [20.0, 2213561344.0]] - - operating_conditions = OperatingConditions() - operating_conditions.flux_cut_off_energy.name = '' - operating_conditions.flux_cut_off_energy.value = 1.0 - operating_conditions.flux_cut_off_energy.unit = 'MeV' - operating_conditions.temp_irrad.name = 'T' - operating_conditions.temp_irrad.value = 573.0 - operating_conditions.temp_irrad.unit = 'K' - operating_conditions.time_irrad.name = '' - operating_conditions.time_irrad.value = 10000000.0 - operating_conditions.time_irrad.unit = 's' - col0 = Coefficient() - col0.name = 'relative_time' - col0.value = 1.0 - col0.unit = '' - operating_conditions.relative_time_increments.columns = [col0] - operating_conditions.relative_time_increments.values = [[1e-10], [1.0000000000000001e-09], [3e-09], [1e-08], [2.9999999999999997e-08], [9.9999999999999995e-08], [2.9999999999999999e-07], [9.9999999999999995e-07], [3.0000000000000001e-06], [1.0000000000000001e-05], [3.0000000000000001e-05], [0.0001], [0.00029999999999999997], [0.001], [0.0030000000000000001], [0.01], [0.029999999999999999], [0.10000000000000001], [0.29999999999999999], [1.0]] - operating_conditions.rescaling_flux.name = '' - operating_conditions.rescaling_flux.value = 0.0 - operating_conditions.rescaling_flux.unit = 'n_per_cm2_per_s' - operating_conditions.rescaling_NRT_damage_rate.name = '' - operating_conditions.rescaling_NRT_damage_rate.value = 0.0 - operating_conditions.rescaling_NRT_damage_rate.unit = 'dpa_per_s' - - bcc_crystal = IronBccCrystal() - bcc_crystal.atomic_volume.name = '' - bcc_crystal.atomic_volume.value = 1.18199515e-29 - bcc_crystal.atomic_volume.unit = 'm3' - bcc_crystal.lattice_parameter.name = 'Dimension' - bcc_crystal.lattice_parameter.value = 2.87 - bcc_crystal.lattice_parameter.unit = 'angstrom' - bcc_crystal.atomic_density.name = '' - bcc_crystal.atomic_density.value = 8.46027160095e+28 - bcc_crystal.atomic_density.unit = 'at_per_m3' - bcc_crystal.mu.name = 'Sigma' - bcc_crystal.mu.value = 70.0 - bcc_crystal.mu.unit = 'GPa' - bcc_crystal.structure.string_list = ['bcc', 'fcc'] - bcc_crystal.structure.value = 'bcc' - bcc_crystal.nu.name = '' - bcc_crystal.nu.value = 0.3 - bcc_crystal.nu.unit = '' - - a_study.perfect_chain.set_dict_inputs({ - 'specter_path': specter_path, - 'neutron_spectrum': neutron_spectrum, - 'operating_conditions': operating_conditions, - 'bcc_crystal': bcc_crystal, - }) - - - # 5th: checks if the study is correctly defined - print ">>> Assert if the study is correctly defined" - if not a_study.ok(): - raise AssertionError - print INDENT + "Ok." - - # 6th: initilize study execution callbacks - def current_module_changed(the_module): - print INDENT + 60*"-" - print INDENT + ">>> Module " + the_module.get_absolute_name() - pass - - a_study.on_current_module_changed = current_module_changed - - def progress_value_changed(the_progress_value): - sys.stdout.write( 2*INDENT + "- Completed: %4.1f %%\r" % (the_progress_value*100.) ) - sys.stdout.flush() - pass - - a_study.on_progress_value_changed = progress_value_changed - - # 7th: launch the study and wait till it will finish - print "creating new script" - parser_module = __import__( - 'Parser.perfect_filtre', - globals(), locals(), ['perfect_filtre'] - ) - setattr(parser_module, 'current_study', a_study) - template_py_file = '/local/noyret/PERFECT/perfect_platform/PSM/script_tmpl.py' - this_params = parser_module.analyse( template_py_file ) - print "this_params ", this_params - parser_module.perf_filter( this_params, "/local/noyret/new_script_eficas.py" ) - print "fin parser_module" - - - #a_study.run_study() - #a_study.wait() - - ## 8th: process the study execution output - #print INDENT + 60*"-" - #print ">>> Execution finished." - #print INDENT + "Final status of the execution:", a_study.get_status() - - ## if DEBUG_MODE is set, and the study is finished with an error, - ## prints information on the failed last module - #if a_study.get_execution_status() == ExecutionStatus.Failed and DEBUG_MODE: - #print ">>> Standard messages of the last module:" - #print a_study.get_execution_stack()[-1][0] - #print ">>> Error messages of the last module:" - #print a_study.get_execution_stack()[-1][1] - #sys.exit(1) - - ## if SAVE_STUDY is set, saves the study - #if SAVE_STUDY: - #print ">>> Saving the study" - #a_study.save() - - ## if TEST_MODE is set, return a code depending on the return flag - #if TEST_MODE: - #return_flag = a_study.get_final_dict()['return_flag'].value - #discrepency = a_study.get_final_dict()['discrepency'].value - #print ">>> Comparison with reference curve(s) returned the value:", \ - #discrepency - #if return_flag: - #print INDENT + "which is under the criterion" - #sys.exit( 0 ) - #else: - #print INDENT + "which is not under the criterion" - #sys.exit( 1 ) - - # End of script - - return 'a faire' - diff --git a/generator/generator_s_poly_st_1.py b/generator/generator_s_poly_st_1.py index 683b1a1a..e8c434e5 100644 --- a/generator/generator_s_poly_st_1.py +++ b/generator/generator_s_poly_st_1.py @@ -29,37 +29,13 @@ import types,string,re,os from generator_map import MapGenerator #____________________________________________________________________________________ -# PYGMEEDict contient une equivalence entre le catalogue Map et les lignes generees -# comme entete (commentaire ?) dans le fichier d'input de pygmee +# Liste des mots cles de config remplaces dans les fichiers à trous # - CONFIGliste=('NAME_SCHEME', 'PATH_ASTER', 'PATH_BENHUR', 'PATH_MODULE', 'PATH_PYGMEE', 'PATH_STUDY', 'repIni') -PYGMEEDict={ - "_PYGMEE_FUSEAU1_b_forme_FICHIER" : "#fuseau 1 (entree de lecfus) format : diametre DCE croissant / fraction cumulee decroisant ", - "FUSEAU2" : "#fuseau 2 (entree de lecfus) format : diametre DCE croissant / fraction cumulee decroisant", - "_PYGMEE_TAILLE" : "# taille du VER en microns ", - "_PYGMEE_DISTANCE" : "# distance de repulsion :", - } - -#_______________________________________________________________________________________________________ -# listeOrdonneeMCPygmee contient une liste (donc ordonnee) des mots clefs pour -# imposer l'ordre des lignes generees -listeOrdonneeMCPygmee =('_PYGMEE_FUSEAU1_b_forme_FICHIER', 'FUSEAU2', '_PYGMEE_TAILLE','_PYGMEE_DISTANCE') - -BENHURDict={ - "_BENHUR_FINESSE" : "discretisation des arretes du VER ", - } - -ASTERDict={ - "_ASTER_LANCEMENT" : "execution de Code_Aster", - "_ASTER_CONDUCTIVITE_I" : "conductivite des inclusions", - "_ASTER_CONDUCTIVITE_M" : "conductivite de la matrice", - } - -GMSHDict={ - "_GMSH_LANCEMENT" : "execution de GMSH", - } +#_____________________________________________________________________ +# Attention les variables suivantes sont nécessaires entre les codes : +# finesse et taille def entryPoint(): """ @@ -84,6 +60,7 @@ class s_poly_st_1Generator(MapGenerator): """ def verifie(self): + self.ssRepertoire=self.config.appli.readercata.fic_cata.split("/")[-1].split(".")[0] liste=[] for i in self.listeCODE: liste.append(i.keys()[0]) @@ -92,24 +69,33 @@ class s_poly_st_1Generator(MapGenerator): def PYGMEE(self,execution) : + #-------------------------------------------------------------------- + # utilisation d un fichier a trous pour generer le fichier de l etude + + # on recupere les valeurs de PYGMEE + # qui seront utilisés par d autres codes + # en particulier Benhur et Aster dicoPygmee=self.dictMCVal["PYGMEE"] - self.dictPYGMEE=dicoPygmee - monFichier=self.config.PATH_PYGMEE+"/pygmee_input.txt" + self.taillePYGMEE=dicoPygmee['_PYGMEE_TAILLE'] - #Lecture du fichier a trous - f = file(self.config.repIni+"/pygmee_input.txt","r") + monFichierOutput=self.config.PATH_PYGMEE+"/pygmee_input.txt" + monFichierInput=self.config.INSTALLDIR+"/MAP/template/"+self.ssRepertoire+"/pygmee_input_template.txt" + + f = file(monFichierInput,"r") chaine = f.read() f.close() + chaine2=self.remplaceCONFIG(chaine,CONFIGliste) chaine=self.remplaceDICO(chaine2,dicoPygmee) - if os.path.isfile(monFichier) : + if os.path.isfile(monFichierOutput) : print "je detruis pygmee_input.txt" - commande="rm -rf " + monFichier + commande="rm -rf " + monFichierOutput os.system (commande) - f=open(monFichier,'wb') + f=open(monFichierOutput,'wb') f.write(chaine) f.close() + if execution=="non" : return "" if ('_PYGMEE_LANCEMENT' in dicoPygmee.keys()) and dicoPygmee['_PYGMEE_LANCEMENT'] == 'oui': @@ -124,34 +110,33 @@ class s_poly_st_1Generator(MapGenerator): return "" def BENHUR(self,execution) : + #-------------------------------------------------------------------- + # dicoBenhur=self.dictMCVal["BENHUR"] - if hasattr(self,'dictPYGMEE') and '_PYGMEE_TAILLE' in self.dictMCVal['PYGMEE']: - dicoBenhur["_PYGMEE_TAILLE"]=self.dictPYGMEE['_PYGMEE_TAILLE'] + if hasattr(self,'taillePYGMEE'): + dicoBenhur["_PYGMEE_TAILLE"]=self.taillePYGMEE else : dicoBenhur["_PYGMEE_TAILLE"]=0 print "Attention la variable Taille_VER non definie" finesse=str(dicoBenhur["_BENHUR_FINESSE"]) - nom_fichier_BHR=self.config.PATH_STUDY+"/"+self.config.NAME_SCHEME+"_benhur_"+finesse+".bhr" - nom_BHR_Files=self.config.PATH_BENHUR+"/BHR_files.txt" + self.finesseBENHUR=finesse #Lecture du fichier a trous - f = file(self.config.repIni+"/benhur_pygmee.txt","r") + monFichierInput=self.config.INSTALLDIR+"/MAP/template/"+self.ssRepertoire+"/benhur_pygmee_template.txt" + monFichierOutput=self.config.PATH_STUDY+"/"+self.config.NAME_SCHEME+"_benhur_"+finesse+".bhr" + f = file(monFichierInput) chaine = f.read() f.close() chaine2=self.remplaceCONFIG(chaine,CONFIGliste) chaine=self.remplaceDICO(chaine2,dicoBenhur) - - try : - f=open(nom_fichier_BHR,'wb') - except : - print "Pb de Generation de BENHUR" - return "" + f=open(monFichierOutput,'wb') f.write(chaine) f.close() + nom_BHR_Files=self.config.PATH_BENHUR+"/BHR_files.txt" f=open(nom_BHR_Files,'wb') - f.write(nom_fichier_BHR) + f.write(monFichierOutput) f.write("\n\n\n") f.close() @@ -177,19 +162,48 @@ class s_poly_st_1Generator(MapGenerator): return "" def ASTER(self,execution) : + #-------------------------------------------------------------------- + # utilisation de deux fichiers a trous pour generer les .comm et .export print "Generation de ASTER" dicoAster=self.dictMCVal["ASTER"] - nom_racine=self.config.PATH_MODULE+"/"+self.config.NAME_SCHEME+"/"+self.config.NAME_SCHEME - nom_fichier_ASTER=nom_racine+"_aster.comm" - #Lecture du fichier a trous - f = file(self.config.repIni+"/s_poly_st_1_aster_template.comm","r") + try : + dicoAster["_PYGMEE_TAILLE"]=self.taillePYGMEE + except : + print "Necessite de definir PYGMEE" + try : + dicoAster["_BENHUR_FINESSE"]=self.finesseBENHUR + except : + print "Necessite de definir BENHUR" + + nom_racine=self.config.PATH_MODULE+"/"+self.config.NAME_SCHEME+"/" + monFichierCommOutput=nom_racine+"s_poly_st_1_aster.comm" + monFichierExportOutput=nom_racine+"s_poly_st_1_aster.export" + + monFichierCommInput=self.config.INSTALLDIR+"/MAP/template/"+self.ssRepertoire+"/s_poly_st_1_aster_template.comm" + monFichierExportInput=self.config.INSTALLDIR+"/MAP/template/"+self.ssRepertoire+"/s_poly_st_1_aster_template.export" + + #Lecture du fichier a trous a pour le fichier export + f = file(monFichierExportInput) chaine = f.read() f.close() - chaine2=self.remplaceDICO(chaine,self.dictPYGMEE) + chaine2=self.remplaceCONFIG(chaine,CONFIGliste) chaine=self.remplaceDICO(chaine2,dicoAster) + print monFichierExportOutput + print chaine + f=open(monFichierExportOutput,'wb') + f.write(chaine) + f.close() - f=open(nom_fichier_ASTER,'wb') + #Lecture du fichier a trous a pour le fichier comm + f = file(monFichierCommInput) + chaine = f.read() + f.close() + chaine2=self.remplaceCONFIG(chaine,CONFIGliste) + chaine=self.remplaceDICO(chaine2,dicoAster) + print monFichierCommOutput + print chaine + f=open(monFichierCommOutput,'wb') f.write(chaine) f.close() @@ -197,7 +211,7 @@ class s_poly_st_1Generator(MapGenerator): commande="cd "+self.config.PATH_MODULE+";" commande=commande + self.config.PATH_ASTER + "/as_run "+self.config.PATH_MODULE commande=commande + "/"+self.config.NAME_SCHEME+"/"+self.config.NAME_SCHEME+"_aster.export" - os.system(commande) + return commande else: return ""