From: PASCALE NOYRET Date: Tue, 14 Jun 2022 07:10:27 +0000 (+0200) Subject: chgt pour uranie X-Git-Tag: merge_uncertainty_odysee_1210~64 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0bf0453ff655214126ea926d62b4293839463567;p=tools%2Feficas.git chgt pour uranie --- diff --git a/ReacteurNumerique/cata_UQ.py b/ReacteurNumerique/cata_UQ.py index eb4f7851..72a81ebb 100644 --- a/ReacteurNumerique/cata_UQ.py +++ b/ReacteurNumerique/cata_UQ.py @@ -10,9 +10,11 @@ import types from Accas import OPER, BLOC, FACT, SIMP, ASSD, JDC_CATA, VerifTypeTuple, Matrice, Tuple, AU_MOINS_UN, A_VALIDATOR, PROC from Noyau.N_VALIDATOR import Valid -def creeLienVPVI(monMC): - if monMC.valeur == () or monMC.valeur == None : return - print (monMC) +#TODO --> si UserDefined et Uranie alors UserDefined + +#def creeLienVPVD(monMC): +# if monMC.valeur == () or monMC.valeur == None : return +# print (monMC) # a faire class infFrereMC(Valid): @@ -37,7 +39,7 @@ listeLoiDistribution= ( #"Beta", #"Triangular", "TruncatedNormal", "Uniform", - #"UserDefined", + "UserDefined", #"Weibull", ), @@ -592,16 +594,18 @@ def creeUniform(): # # -# USERDEFINED = BLOC( condition = " Distribution in ( 'UserDefined', ) ", -# -# # Il faut definir une collection de couples ( x,p ) -# Values = SIMP( statut = 'o', -# typ = 'R', -# max = '**', -# ), -# -# ), # Fin BLOC USERDEFINED -# +def creeUserDefined (): + USERDEFINED = BLOC( condition = " Distribution in ( 'UserDefined', ) ", + + # Il faut definir une collection de couples ( x,p ) + Values = SIMP( statut = 'o', + typ = 'R', + max = '**', + ), + + ) # Fin BLOC USERDEFINED + return USERDEFINED + # # # WEIBULL = BLOC( condition = " Distribution in ( 'Weibull', ) ", @@ -1599,7 +1603,6 @@ def creeDistributionsSelonVariable(monDico): nomBloc = 'b_Model_Variable_' + var+'_'+nomLoi dicoDistribution[nomBloc]=bloc lesBlocs[nomBlocVar]= BLOC(condition=laCondition, Distribution = distribution, **dicoDistribution) - print (lesBlocs) return lesBlocs @@ -1616,7 +1619,7 @@ def creeOperExpressionIncertitude(monDico, maListe): homo='constant', ) laConsigne = SIMP(statut="o", homo="information", typ="TXM", defaut=' ') - xPathVariable = SIMP(statut='d', typ='TXM', defaut=(), max='**', min=0,)# siValide=creeLienVPVI) + xPathVariable = SIMP(statut='d', typ='TXM', defaut=(), max='**', min=0,) blocs=creeDistributionsSelonVariable(monDico) # Attention # l ordre des motclefs en 3.7 a l air de dépendre de l ordre de creation des objets @@ -1633,6 +1636,8 @@ def creeOperExpressionIncertitude(monDico, maListe): ), ), Propagation = FACT( max=1, statut ='o', + UncertaintyTool = SIMP ( statut = "o", typ = "TXM", into = ['Uranie', 'OpenTurns'], defaut='Uranie',position='global'), + Propagation_OT = BLOC( condition = "UncertaintyTool == 'OpenTurns'", Methode = SIMP( statut = "o", typ = "TXM", max=1, into = ('Taylor', 'MonteCarlo'), defaut='Taylor'), BlocMonteCarlo1 = BLOC ( condition = "Methode == 'MonteCarlo'", SimulationsNumber = SIMP ( statut = "o", typ = "I", val_min = 1, @@ -1672,7 +1677,11 @@ def creeOperExpressionIncertitude(monDico, maListe): ), # Fin BlocEmpiricalQuantileSettings ),# fin Result ),# fin BlocMonteCarlo2 - ), # fin Propoagation + ),# fin BlocOTPropagation + Propagation_Uranie = BLOC( condition = "UncertaintyTool == 'Uranie'", + Methode = SIMP( statut = "o", typ = "TXM", max=1, into = ('SRS', 'Sobol'), defaut='Sobol'), + ), # fin UraniePropagation + ), # fin Propagation Output = FACT (max=1, statut ='o', VariableDeSortie = FACT ( max='**', statut ='o', NomDeLaVariable = SIMP ( statut = "o", typ = "TXM", into = listeDesVariablesSortiePossibles, defaut='Average_mass_flux'), @@ -1683,7 +1692,6 @@ def creeOperExpressionIncertitude(monDico, maListe): ), ), Execution = FACT (max=1, statut ='o', - UncertaintyTool = SIMP ( statut = "o", typ = "TXM", into = ['Uranie', 'OpenTurns'], defaut='Uranie'), bloc_OT = BLOC (condition = 'UncertaintyTool == "OpenTurns"', ExecutionMode = SIMP ( statut = "o", typ = "TXM", into = ['local', 'cluster']), NbDeBranches = SIMP ( statut = "o", typ = "I", val_min = 0, fr='nb d evaluations simultanees'), @@ -1696,7 +1704,12 @@ def creeOperExpressionIncertitude(monDico, maListe): multiJobStudy = SIMP ( statut = "o", typ = bool, defaut=False), ), ), + bloc_Uranie = BLOC (condition = 'UncertaintyTool == "Uranie"', + DOEDimensions = SIMP ( statut = "o", typ = "I"), + NbDeBranches = SIMP ( statut = "o", typ = "I", val_min = 0, fr='nb d evaluations simultanees'), + ), ), ) return ExpressionIncertitude +#dictTraitementsAuChargement={'ExpressionIncertitude':creeLienVPVD()}