ParticleDiameter = FACT(statut ='o',
Diameter = SIMP(typ=(dynamicVariable,'createObject'), statut='o', defaut ='Diameter', homo='constant'),
ToSimulate = SIMP(typ=bool, statut ='o', defaut = True,),
- blocSimulatedDiameter = prepareBlocInitialisation(condition = 'ToSimulate == True', ajoutPossible='Not needed'),
+ blocSimulatedDiameter = prepareBlocInitialisationParticle(condition = 'ToSimulate == True', termeSource=True),
#blocNoSimulatedDiameter = prepareBlocOrigine(condition = 'ToSimulate == False'),
),
ParticleMass = FACT(statut ='o',
Mass = SIMP(typ=(dynamicVariable,'createObject'), statut='o', defaut ='Mass', homo='constant'),
ToSimulate = SIMP(typ=bool, statut ='o', defaut = True,),
- blocSimulatedMass = prepareBlocInitialisation(condition = 'ToSimulate == True', ajoutPossible ='Not needed',particle=True),
+ blocSimulatedMass = prepareBlocInitialisationParticle(condition = 'ToSimulate == True', termeSource=True),
#blocNoSimulatedMass = prepareBlocOrigine(condition = 'ToSimulate == False'),
),
ParticlePosition = FACT(statut ='o',
Position = SIMP(typ=(dynamicVariable,'createObject'), statut='o', defaut ='Position', homo='constant'),
ToSimulate = SIMP(typ=bool, statut ='o', defaut = True,),
- blocSimulatedPosition = prepareBlocInitialisationSansTermeSource(condition = 'ToSimulate == True', ajoutPossible='Not needed', particle=True),
+ blocSimulatedPosition = prepareBlocInitialisationParticle(condition = 'ToSimulate == True', termeSource=False),
blocNoSimulatedPosition = prepareBlocOrigine(condition = 'ToSimulate == False'),
),
blocNoBrownianDynamics = BLOC(condition = '(TypeOfConstraint != None) and not("Brownian dynamics" in TypeOfConstraint)',
ParticleVelocity = FACT(statut ='o',
Velocity = SIMP(typ=(dynamicVariable,'createObject'), statut='o', defaut ='Velocity', homo='constant'),
ToSimulate = SIMP(typ=bool, statut ='o', defaut = True,),
- blocSimulatedVelocity = prepareBlocInitialisation(condition = 'ToSimulate == True', ajoutPossible='Not needed',particle=True),
+ blocSimulatedVelocity = prepareBlocInitialisationParticle(condition = 'ToSimulate == True', termeSource=True),
blocNotSimulatedVelocity = prepareBlocOrigine(condition = 'ToSimulate == False',),
), #fin VelocityDefinition
blocHydrodynamic = BLOC(condition = '"Hydrodynamic" in MomentumFieldType',
FluidVelocitySeenByParticles = FACT(statut ='o',
- FluidSeenVelocity = SIMP(typ=(dynamicVariable,'createObject'), statut='o', defaut ='FluidSeenVelocity', homo='constant'),
+ FluidSeenVelocity = SIMP(typ=(dynamicVariable,'createObject'), statut='o', defaut ='FluidSeenVelocity', homo='constant'),
ToSimulate = SIMP(typ=bool, statut ='o', defaut = True,),
- blocHydrodynamicVelocity = prepareBlocInitialisation(condition = 'ToSimulate == True', ajoutPossible='Not needed',particle=True),
+ blocHydrodynamicVelocity = prepareBlocInitialisationParticle(condition = 'ToSimulate == True', termeSource=True),
blocNotHydrodynamicVelocity = prepareBlocOrigine(condition = 'ToSimulate == False',),
) ,
) ,
blocSourceTerm = prepareTermeSourceDynVar('SourceTerm==True'),
) #blocSimulatedPressure
-def prepareBlocInitialisationSansTermeSource(condition,ajoutPossible=None, particle=True):
- monIntoType = ['ByValue', 'ByFile', 'ByInteraction']
- if ajoutPossible != None :
- monIntoType.append(ajoutPossible)
- return BLOC(condition = condition,
+def prepareBlocInitialisationParticle(condition, termeSource=True):
+ monIntoType = ['ByValue', 'ByFile', 'ByInteraction','Not needed' ]
+ dicoTermeSource = {}
+ if termeSource :
+ dicoTermeSource['SourceTerm'] = SIMP(typ=bool, statut='o', defaut=False),
+ dicoTermeSource['blocSourceTerm'] = prepareTermeSourceDynVar('SourceTerm==True')
+
+ if termeSource :
+ return BLOC(condition = condition,
Initialisation = FACT(statut ='o',
- ParticleIdentifier=SIMP(statut='o', typ = userParticle),
InitialisationType = SIMP(statut='o', into =monIntoType, typ ='TXM', defaut='ByValue'),
+ blocNotNeeded = BLOC(condition = 'InitialisationType != "Not needed"',
+ ParticleIdentifier=SIMP(statut='o', typ = userParticle),
+ ),
+ blocByFile = creeBlocPourLesFichiers('InitialisationType == "ByFile"', '', ListeFormats = listeFormatGenerique, FieldName='FieldName'),
+ blocByInteraction = BLOC(condition = 'InitialisationType == "ByInteraction"',
+ InteractionName = SIMP(typ=interaction,statut='o'),
+ Consigne = SIMP(statut="o", homo="information", typ="TXM", defaut='Create and choose suitable interaction'),
+ ),
+ blocByValue = BLOC(condition = 'InitialisationType == "ByValue"',
+ Value = SIMP (statut ='o', typ='R'),
+ ),
+ SourceTerm = SIMP(typ=bool, statut='o', defaut=False),
+ blocSourceTerm = prepareTermeSourceDynVar('SourceTerm==True'),
+ ),
+ ) #blocSimulatedPressure
+ else :
+ return BLOC(condition = condition,
+ Initialisation = FACT(statut ='o',
+ InitialisationType = SIMP(statut='o', into =monIntoType, typ ='TXM', defaut='ByValue'),
+ blocNotNeeded = BLOC(condition = 'InitialisationType == "Not needed"',
+ ParticleIdentifier=SIMP(statut='o', typ = userParticle),
+ ),
blocByFile = creeBlocPourLesFichiers('InitialisationType == "ByFile"', '', ListeFormats = listeFormatGenerique, FieldName='FieldName'),
blocByInteraction = BLOC(condition = 'InitialisationType == "ByInteraction"',
InteractionName = SIMP(typ=interaction,statut='o'),