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 = {
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 + "'"
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):