From: pascale.noyret Date: Mon, 23 Nov 2020 11:53:34 +0000 (+0100) Subject: echange Eric pour verfi X-Git-Tag: V210224_osthus~93^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9c93b2263f711b3f9248042289f8bb20db7422b9;p=tools%2Feficas.git echange Eric pour verfi --- diff --git a/Vimmp/cata_CSAndCPS_v4.py b/Vimmp/cata_CSAndCPS_v4.py index 8d78954b..25cce974 100644 --- a/Vimmp/cata_CSAndCPS_v4.py +++ b/Vimmp/cata_CSAndCPS_v4.py @@ -22,19 +22,20 @@ class simulatedTime(UserASSD):pass class scalar(UserASSD):pass -dictSystemTypeModeleNumerique = { 'Quantum system' : (), - 'Classical particle system' : ('MD', 'DPD', 'LBM', 'SDPD','SPH','CFD_Discrete_Particles'), - 'Continuum system' :('Fluid_Fields','Fluid_Particles', 'SPH','Lagrangian one-particle pdf'), - } +#dictSystemTypeModeleNumerique = { 'Quantum system' : (), +# 'Classical particle system' : ('MD', 'DPD', 'LBM', 'SDPD','SPH','CFD_Discrete_Particles'), +# 'Continuum system' :('Fluid_Fields','Fluid_Particles', 'SPH','Lagrangian one-particle pdf'), +# } +# # PN a faire --> ajouter un MC modeleNumerique ( apres avoir renomme le modeleNumerique actuel en classe de modele numerique) et le dictionnaire d apres dictTypModNumModNum = { - ('Continuum system','Particles') : ('SPH','Lagrangian one-fluid-particle pdf'), - ('Continuum system','Fields') : ('FV','FEM', 'Spectral method'), + ('Continuum system','Particles') : ('SPH','Lagrangian one-fluid-particle pdf'), + ('Continuum system','Fields') : ('FV','FEM', 'Spectral method'), ('Classical particle system','Particles') : ('MD', 'DPD', 'SDPD','SPH','CFD_Discrete_Particles'), ('Classical particle system','Fields') : ('LBM',), - ('Quantum system','Particles') : ('Particle method',), - ('Quantum system','Fields') : ('Wave',), + ('Quantum system','Particles') : ('Particle method',), + ('Quantum system','Fields') : ('Wave',), } dictCodeModeleNumerique = { @@ -94,18 +95,22 @@ def prepareBlocSystemType(systemType) : condition = "SystemType == '" + systemType + "'" Identifier = SIMP(statut='o', typ=(modeleNumDuCompo,'createObject'),) ModelType = SIMP(statut='o', typ='TXM', into = ('Particles', 'Fields'),position='global') + stl = SIMP (statut ='o', typ = simulatedTime) dicoArgs={} - for typeMod in ('Particles', 'Fields'): + + first=1 + for typeMod in ( 'Fields', 'Particles'): conditionType = "ModelType == '" + typeMod + "'" NumericalMethod = SIMP(statut='o',typ='TXM', into=dictTypModNumModNum[systemType, typeMod], position='global_jdc', intoXML=allValueInDict(dictTypModNumModNum)) - bloc_numMethod = BLOC(condition =conditionType, NumericalMethod=NumericalMethod) - bloc_meshRef = BLOC(condition = 'ModelType == "Fields" and NumericalMethod == "FV"', - Mesh_Identifiers = SIMP (statut ='o', max ='**', typ = meshIdentifier), - ) - # il faut faire le else - # il faut faire un bloc avec Numerical Method pour reordonner les mc - stl = SIMP (statut ='o', typ = simulatedTime) + if first : + blocNumMethod_1 = BLOC(condition =conditionType, NumericalMethod_1=NumericalMethod) + first=0 + else : + blocNumMethod_2 = BLOC(condition =conditionType, NumericalMethod_2=NumericalMethod) + blocMeshRef = BLOC(condition = 'ModelType == "Fields" and NumericalMethod == "FV"', + Mesh_Identifiers = SIMP (statut ='o', max ='**', typ = meshIdentifier),) + dicoBloc = {} for modeleNumerique in list(dictTypModNumModNum[systemType,typeMod]): conditionNum = "NumericalMethod == '" + modeleNumerique + "'" @@ -115,9 +120,12 @@ def prepareBlocSystemType(systemType) : Solver = SIMP(statut='o', typ='TXM', into=list(setCode), intoXML=list(dictCodeModeleNumerique.keys()) ) monNomBloc='b_ModelName_' + modeleNumerique.replace(' ','_') if setCode !=set(): dicoBloc[monNomBloc]=BLOC(condition=conditionNum, nomXML='b_ModelName',Solver=Solver) + if setCode ==set(): print (condition, conditionNum) #dicoArgs['b_modelType'+typeMod] = BLOC(condition=conditionType, NumericalMethod=NumericalMethod,**dicoBloc) dicoArgs['b_modelType'+typeMod] = BLOC(condition=conditionType, **dicoBloc) - NumericalModel = FACT(statut='o', max= '**', Identifier=Identifier, ModelType=ModelType,bloc_numMethod=bloc_numMethod,bloc_meshRef=bloc_meshRef, Simulated_Time_Lapse=stl, **dicoArgs) + NumericalModel = FACT(statut='o', max= '**', Identifier=Identifier, ModelType=ModelType, + blocNumMethod_1 = blocNumMethod_1, blocNumMethod_2 = blocNumMethod_2, + blocMeshRef=blocMeshRef , Simulated_Time_Lapse=stl, **dicoArgs) return BLOC(condition=condition, nomXML='b_systemType', NumericalModel=NumericalModel) def calculCommun( key1, key2, dico):