8 monDico= { 'Equation_Liste' : ('initiation', 'propagation', 'termination', 'stabilization'),
\r
9 'Modele_TechnicalUse' : ('cable', 'coating', 'pipes'),
\r
10 'Aging_Factor' : { 'predefinedSimulationTime' : ('40years BR top', '40years BR bottom')},
\r
11 'Boundary_Conditions' : ('flux_volume','flux_surface','constant_constration','convection_flux'),
\r
12 'postTraitement_Typ' : ('chimique','mecanique','physique'),
\r
15 monModele=listesDB.sModele().monModele
\r
16 monPost=listesDB.sModele().monPost
\r
20 def __init__(self,ntuple):
\r
23 def __convert__(self,valeur):
\r
24 if type(valeur) == types.StringType:
\r
26 if len(valeur) != self.ntuple:
\r
31 return "Tuple de %s elements" % self.ntuple
\r
34 JdC = JDC_CATA(code='VP',
\r
39 #---------------------------------
\r
40 Equation = PROC (nom="Equation",
\r
42 #---------------------------------
\r
43 Equation_DB=SIMP(statut= 'o',typ= 'TXM', into=("Approved data base", "My data base") ),
\r
44 #b_suite = BLOC(condition = "Equation_DB == 'My data base' ",
\r
45 Equation_Type = SIMP(statut= 'o',typ= 'TXM', into=("Show equation database", "Equation creation"),),
\r
47 #b_suite_2 = BLOC(condition = "Equation_DB == 'Approved data base' ",
\r
48 #Equation_Type = SIMP(statut= 'o',typ= 'TXM', into=("Show equation database", ),),
\r
51 # ---------------------------------------------------------------------------
\r
52 b_type_show = BLOC(condition = " Equation_Type == 'Show equation database'",
\r
53 # ---------------------------------------------------------------------------
\r
54 Equation_Liste=SIMP(statut= 'o',typ= 'TXM', into=('reaction_type','aging_type')),
\r
56 b_reaction_type = BLOC(condition = " Equation_Liste == 'reaction_type'",
\r
57 Equation_reaction=SIMP(statut= 'o',typ= 'TXM', into=monDico['Equation_Liste'],siValide=lienDB.recupereDicoEquation),
\r
58 ), # Fin b_reaction_type
\r
60 b_aging_type = BLOC(condition = " Equation_Liste == 'aging_type'",
\r
61 Equation_reaction=SIMP(statut= 'o',typ= 'TXM', into=('All', 'thermo', 'radio'),siValide=lienDB.recupereDicoEquation),
\r
62 ), # Fin b_reaction_type
\r
64 ListeEquation = SIMP(statut='o', typ='TXM', homo='SansOrdreNiDoublon',siValide=lienDB.afficheValeurEquation),
\r
65 #ListeEquation = SIMP(statut='o', typ='TXM', homo='SansOrdreNiDoublon'),
\r
66 b_modification = BLOC(condition = " ListeEquation != None ",
\r
67 modification = SIMP(typ = bool, statut = 'o',defaut = False, fr='toto', ang='toto en anglais', siValide=lienDB.instancieChemicalFormulation),
\r
69 b_modif = BLOC(condition = "modification == True",
\r
70 Reaction_Type=SIMP(statut= 'o',typ= 'TXM', min=1,into=monDico['Equation_Liste'],),
\r
71 Aging_Type=SIMP(statut= 'o',typ= 'TXM', min=1,max='**', homo='SansOrdreNiDoublon', into=('All', 'thermo', 'radio'),),
\r
72 ChemicalFormulation = SIMP(statut='o', typ='TXM', defaut = 'POOH -> 2P'),
\r
74 OptionnelConstituant = FACT ( statut = 'f',max = '**',
\r
75 Constituant = SIMP (statut = 'o', typ = 'TXM'),
\r
76 Differential_Equation = SIMP(statut= 'o',typ= 'TXM'),
\r
78 OptionnelleConstante = FACT (statut = 'f', max = '**',
\r
79 ConstanteName= SIMP (statut = 'o', typ = 'TXM',),
\r
80 ConstanteType = SIMP(statut= 'o',typ= 'TXM', min=1,into=('Arrhenius type','non Arrhenius type'),defaut='Arrhenius type'),
\r
81 ),# fin ConstanteOptionnelle
\r
82 Commentaire = SIMP (statut = 'f', typ = 'TXM', defaut = ' '),
\r
87 ), # fin b_modification
\r
88 ), # Fin b_type_show
\r
91 # ---------------------------------------------------------------------------
\r
92 b_type_creation = BLOC(condition = " Equation_Type == 'Equation creation'",
\r
93 # ---------------------------------------------------------------------------
\r
94 Equation_Modification = FACT ( statut = 'o',
\r
96 ChemicalFormulation = SIMP(statut='o', typ='TXM', defaut = 'POOH -> 2P'),
\r
98 Reaction_Type=SIMP(statut= 'o',typ= 'TXM', min=1,into=monDico['Equation_Liste'],),
\r
99 Aging_Type=SIMP(statut= 'o',typ= 'TXM', min=1,max='**', homo='SansOrdreNiDoublon', into=('All', 'thermo', 'radio'),),
\r
101 Constituants = FACT ( statut = 'o',
\r
102 ConstituantPOOH = SIMP (statut = 'f', typ = 'TXM', into = ('POOH',)),
\r
103 b_pooh = BLOC(condition = " ConstituantPOOH == 'POOH'" ,
\r
104 Differential_Equation_POOH = SIMP(statut= 'o',typ= 'TXM', defaut = '-ku1*POOH'),
\r
106 #ConstituantP = SIMP (statut = 'f', typ = 'TXM', into = ('P',)),
\r
107 #b_p = BLOC(condition = " ConstituantP == 'P'" ,
\r
108 # Differential_Equation_P = SIMP(statut= 'o',typ= 'TXM', defaut = '2*ku1*POOH'),
\r
110 ConstituantP = FACT ( statut = 'f',
\r
111 ConstituantP = SIMP (statut = 'f', typ = 'TXM', into = ('P',)),
\r
112 Differential_Equation_P = SIMP(statut= 'o',typ= 'TXM', defaut = '2*ku1*POOH'),
\r
113 ), # Fin ConstituantP
\r
115 OptionnelConstituant = FACT ( statut = 'f',max = '**',
\r
116 Constituant = SIMP (statut = 'o', typ = 'TXM'),
\r
117 Differential_Equation = SIMP(statut= 'o',typ= 'TXM'),
\r
118 ), # fin Const_Equa
\r
119 ),# Fin Constituants
\r
121 Constante = FACT ( statut = 'o',
\r
122 Constanteku1 = SIMP (statut = 'f', typ = 'TXM', into = ('ku1',), defaut= 'ku1'),
\r
123 b_cku1 = BLOC(condition = "Constanteku1 == 'ku1'" ,
\r
124 ConstanteType = SIMP(statut= 'o',typ= 'TXM', into=('Arrhenius type','non Arrhenius type'),defaut='Arrhenius type'),
\r
126 OptionnelleConstante = FACT (statut = 'f', max = '**',
\r
127 ConstanteName= SIMP (statut = 'o', typ = 'TXM',),
\r
128 ConstanteType = SIMP(statut= 'o',typ= 'TXM', min=1,into=('Arrhenius type','non Arrhenius type'),defaut='Arrhenius type'),
\r
129 ),# fin ConstanteOptionnelle
\r
131 Commentaire = SIMP (statut = 'f', typ = 'TXM', defaut = ' '),
\r
133 ), # Fin Equation_Modification
\r
134 ), # fin b_type_creation
\r
139 #---------------------------------
\r
140 Modele = PROC (nom="Modele",
\r
142 Modele_DB=SIMP(statut= 'o',typ= 'TXM', into=("Approved data base", "My data base"),siValide=lienDB.recupereDicoModele ),
\r
143 Modele_Type = SIMP(statut= 'o',typ= 'TXM', into=("Show modele database", "Modele creation"),siValide=lienDB.creeListeEquation),
\r
144 # ---------------------------------------------------------------------------
\r
145 b_type_creation = BLOC(condition = " Modele_Type == 'Modele creation'",
\r
146 # ---------------------------------------------------------------------------
\r
147 ID=FACT(statut='o',
\r
148 technicalUse= SIMP(statut= 'o',typ= 'TXM',into=monDico['Modele_TechnicalUse'],defaut=monModele.technical_use ),
\r
149 modeleName=SIMP(statut='o',typ='TXM',defaut=monModele.nom,),
\r
150 material=SIMP(statut='o',typ='TXM',defaut=monModele.materiaux[0],),
\r
151 agingType=SIMP(statut= 'o',typ='TXM', min=1,max='**', homo='SansOrdreNiDoublon', into=('All', 'thermo', 'radio'), defaut=monModele.type_vieil),
\r
152 stabilizer = SIMP(typ = bool, statut = 'o',defaut = monModele.stabilise),
\r
153 material_thickness = SIMP(typ = 'TXM', statut = 'o',defaut = monModele.thickness, into = ['thin','thick']),
\r
154 # il faudrait que position=global_jdc fonctionne
\r
155 model_developed_by_for_EDF = SIMP(typ = bool, statut = 'o',defaut = monModele.dvt_EDF[0]),
\r
156 documentation=SIMP(statut='o',typ='TXM',defaut=monModele.reference,),
\r
159 # ajouter la liste des equations et le remove (il faut garder ceux qu on a enlever)
\r
161 Chemical_Equation = FACT( statut='o',
\r
162 Initial_Equation_List=SIMP(statut='o',typ='TXM',max="**",homo='SansOrdreNiDoublon',into=[],defaut=[], siValide=lienDB.recupereModeleEquation),
\r
164 AjoutEquation=SIMP(statut= 'o',typ= bool, defaut=False, siValide=lienDB.recupereModeleEquation),
\r
165 b_ajout_equation = BLOC(condition = " AjoutEquation == True",
\r
166 listeEquation_initiation=SIMP(statut='o', typ='TXM',homo='SansOrdreNiDoublon', max='**', min=0, defaut=[],siValide=lienDB.ajoutDUneEquation ),
\r
167 listeEquation_propagation=SIMP(statut='o', typ='TXM',homo='SansOrdreNiDoublon', max='**', min=0, defaut=[],siValide=lienDB.ajoutDUneEquation ),
\r
168 listeEquation_termination=SIMP(statut='o', typ='TXM',homo='SansOrdreNiDoublon', max='**', min=0, defaut=[],siValide=lienDB.ajoutDUneEquation ),
\r
169 listeEquation_stabilization=SIMP(statut='o',typ='TXM', homo='SansOrdreNiDoublon', max='**', min=0, defaut=[],siValide=lienDB.ajoutDUneEquation ),
\r
170 ),# fin b_ajout_equation
\r
173 # coefficients monModele.coef = liste de dictionnaire mais il faut prendre que le 0
\r
174 # on enleve ceux qui commence par D, S et B(casse imprtante)
\r
175 # la clef est le coef, puis les valeurs
\r
178 #b_material_thickness = BLOC(condition = "material_thickness == 'thick'",
\r
179 # si position=global fonctionne
\r
180 Transport = FACT( statut = 'o',
\r
181 #Diffusion = SIMP(typ = bool, statut = 'o',defaut = monModele.diffusion,siValide = lienDB.prepareDiffusion),
\r
182 Diffusion = SIMP(typ = bool, statut = 'o',defaut = False ,siValide = lienDB.prepareDiffusion),
\r
184 b_diffusion = BLOC(condition = " Diffusion == True",
\r
185 listeProduitPourLaDiffusion=SIMP(statut='o', typ='TXM', max='**', min=1,homo='SansOrdreNiDoublon', into = [],siValide=lienDB.ajouteDiffusion),
\r
186 ), # fin b_diffusion
\r
188 Evaporation = SIMP(typ = bool, statut = 'o',defaut = False ,siValide = lienDB.prepareDiffusion),
\r
189 b_evaporation = BLOC(condition = " Evaporation == True",
\r
190 listeProduitPourLEvaporation=SIMP(statut='o', typ='TXM', max='**', min=1,homo='SansOrdreNiDoublon', into = [],siValide=lienDB.ajouteEvaporation),
\r
191 ), # fin b_evaporation
\r
195 #), # fin b_material_thickness
\r
197 Coefficients = FACT( statut = 'o',
\r
198 Coef_k2 = SIMP (statut ='o', typ='R'),
\r
199 Coef_ku1 = SIMP (statut ='o', typ=Tuple(2),validators = VerifTypeTuple(('R','R')),),
\r
201 Parametres_Initiaux = FACT( statut = 'o',
\r
202 Param_POOH=SIMP (statut ='o', typ='R'),
\r
203 # La liste est la meme que le INTO des listeProduitsPourlaDiffusion
\r
204 # la valeur par defaut si elle existe est contenue dans modele.param_ini['POOH']
\r
208 #AjoutEquation=Fact(statut='f',
\r
209 # Reaction_Type=SIMP(statut= 'o',typ= 'TXM', min=1,into=monDico['Equation_Liste'],siValide=lienDB.recupereModeleEquation),
\r
210 #), # fin AjoutEquation
\r
212 # ---------------------------------------------------------------------------
\r
213 b_type_modification = BLOC(condition = " Modele_Type == 'Show modele database'",
\r
214 # ---------------------------------------------------------------------------
\r
215 technicalUse= SIMP(statut= 'o',typ= 'TXM',into=monDico['Modele_TechnicalUse'],siValide=lienDB.creeListeMateriauxSelonModele),
\r
216 b_technicalUse = BLOC (condition = 'technicalUse != None and technicalUse != ""',
\r
217 material= SIMP (statut ='o', typ='TXM',siValide=lienDB.creeListeModelesPossibles),
\r
218 modele= SIMP (statut ='o', typ='TXM',siValide=lienDB.choisitModele),
\r
219 b_modele = BLOC (condition = 'modele != None and modele != ""',
\r
220 action = SIMP (statut ='o', typ='TXM',into = ['display','use','modify'], siValide=lienDB.choisitActionModele),
\r
221 # ---------------------------------------------------------------------------
\r
222 b_type_modify = BLOC(condition = " action == 'modify'",
\r
223 # ---------------------------------------------------------------------------
\r
224 ID=FACT(statut='o',
\r
225 modeleName=SIMP(statut='o',typ='TXM'),
\r
226 technicalUse= SIMP(statut= 'o',typ= 'TXM', into=monDico['Modele_TechnicalUse'] ),
\r
227 material=SIMP(statut='o',typ='TXM'),
\r
228 agingType=SIMP(statut= 'o',typ='TXM', min=1,max='**', homo='SansOrdreNiDoublon', into=('All', 'thermo', 'radio')),
\r
229 stabilizer = SIMP(typ = bool, statut = 'o',),
\r
230 material_thickness = SIMP(typ = 'TXM', statut = 'o', into = ['thin','thick']),
\r
231 # il faudrait que position=global_jdc fonctionne
\r
232 model_developed_by_for_EDF = SIMP(typ = bool, statut = 'o',),
\r
233 documentation=SIMP(statut='o',typ='TXM',),
\r
236 # il faut recopier toute la suite en changeant eventuellement le nom du modele
\r
237 # il faut cocher toutes les equations par defaut
\r
240 ), # fin b_type_modify
\r
241 # ---------------------------------------------------------------------------
\r
242 b_type_use = BLOC(condition = " action == 'use'",
\r
243 # ---------------------------------------------------------------------------
\r
244 simulationName=SIMP(statut='o',typ='TXM'),
\r
245 outputFolder = SIMP(statut="o", typ="Repertoire",siValide=lienDB.creeCoefAModifier),
\r
246 ), # fin b_type_use
\r
247 # ---------------------------------------------------------------------------
\r
248 b_type_use2 = BLOC(condition = " action == 'use'",
\r
249 # ---------------------------------------------------------------------------
\r
250 Aging_Factor = FACT(statut='o',
\r
251 predefinedSimulationTime = SIMP(statut='o',typ='TXM',into=monDico['Aging_Factor']['predefinedSimulationTime'],siValide=lienDB.remplirAgingFactor),
\r
252 simulationTime=SIMP(statut='o',typ='R',),
\r
253 numberOfNodes=SIMP(statut='o',typ='I',val_min=3,siValide=lienDB.creeInitialParameter),
\r
254 sampleThickness=SIMP(statut='o',typ='R',),
\r
255 #debitOfDose=SIMP(statut='o',typ='R',),
\r
256 temperature=SIMP(statut='o',typ='R',),
\r
257 oxygenPressure=SIMP(statut='o',typ='R',),
\r
258 polymerConcentration=SIMP(statut='o',typ='R',),
\r
260 Initial_Parameter = FACT(statut='o',
\r
263 Boundary_Conditions_Param = FACT(statut='o',
\r
264 diffusionSpecies=SIMP(statut='o',typ='TXM',defaut='O2', into=['O2',]),
\r
265 nodeNumber = SIMP(statut='o',typ='I',defaut=1, into=[1]), # tjours1
\r
266 Boundary_Conditions_O2_1 = SIMP(statut='o',typ='TXM',into=monDico['Boundary_Conditions']),
\r
267 BC_Value_Espece_1=SIMP(statut='o',typ='R'),
\r
268 nodeNumber_Espece_4 = SIMP(statut='o',typ='I',defaut=4, into=[4]), # numberOfNodes+1
\r
269 Boundary_Conditions_Espece_4 = SIMP(statut='o',typ='TXM',into=monDico['Boundary_Conditions']),
\r
270 BC_Value_Espece_4=SIMP(statut='o',typ='R'),
\r
273 ), # fin b_type_use2
\r
275 ), # fin b_technicalUse
\r
276 ), # fin modification
\r
278 Commentaire = SIMP (statut = 'f', typ = 'TXM'),
\r
280 #---------------------------------
\r
281 PostTraitement = PROC (nom="PostTraitement",
\r
283 postTraitement_DB=SIMP(statut= 'o',typ= 'TXM', into=("Approved data base", "My data base") ),
\r
284 postTraitement_Type = SIMP(statut= 'o',typ= 'TXM', into=("Show post-traitement database", "post-traitement creation"),),
\r
285 # ---------------------------------------------------------------------------
\r
286 b_post_creation = BLOC(condition = " postTraitement_Type == 'post-traitement creation'",
\r
287 postTraitement_Name=SIMP(statut= 'o',typ= 'TXM',defaut=monPost.nom,),
\r
288 generic=SIMP(statut= 'o',typ= bool,defaut=monPost.general,),
\r
289 postTraitement_Typ = SIMP(statut= 'o',typ= 'TXM', into=monDico['postTraitement_Typ'],homo='SansOrdreNiDoublon',max='**',defaut=monPost.type_post),
\r
290 calculation= FACT(statut='o',
\r
291 # il faut un fact horizontal
\r
292 calculation_results=SIMP(statut= 'o',typ= 'TXM', min=0,max='**', intoSug=monPost.calculation_results,defaut=monPost.calculation_results),
\r
293 results_units=SIMP(statut= 'o',typ= 'TXM', min=0,max='**', intoSug=monPost.results_units,defaut=monPost.results_units),
\r
294 #integrate=SIMP(statut= 'o',typ= 'TXM', min=0,max='**', intoSug=monPost.results_units,defaut=monPost.results_units),
\r
295 prerequisite=SIMP(statut= 'o',typ= 'TXM', min=0,max='**', intoSug=monPost.prerequisite,defaut=monPost.prerequisite),
\r
298 constituant=SIMP(statut= 'o',typ= 'TXM', min=0,max='**', intoSug=monPost.constituants,defaut=monPost.constituants)
\r
300 )# fin b_post_creation
\r
301 # ---------------------------------------------------------------------------
\r
302 #---------------------------------
\r