From: pascale.noyret Date: Tue, 23 Feb 2021 07:33:42 +0000 (+0100) Subject: pour regler la projection des particles X-Git-Tag: V210224_osthus~10 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9e94879a7c39842e7b0ea9a375b33efc417c0226;p=tools%2Feficas.git pour regler la projection des particles --- diff --git a/Efi2Xsd/AccasXsd.py b/Efi2Xsd/AccasXsd.py index a173b203..b5daa9c0 100755 --- a/Efi2Xsd/AccasXsd.py +++ b/Efi2Xsd/AccasXsd.py @@ -453,28 +453,29 @@ class X_compoFactoriseAmbigu(X_definition): nomTypePyxbUnion=self.entites[nomMC][0].nomDuTypePyxb texteSimpleUnion=debutSimpleType.format(nomTypePyxbUnion) texteSimpleUnion+=debutUnion + if nomMC == 'ParticleName' : print (texteSimpleUnion) if len(listePourUnion) == 1 : #PN 29 septembre 20. Est ce que ce if a un sens # si len(listePourUnion==1) on est deja sorti non ? mc=self.entites[nomMC][0] mc.dumpXsd(dansFactorisation=True,multiple=True,first=first) - if self.entites[nomMC][0].nom == 'SubgridScaleModel' : - print ('apres 2 dump', self.entites[nomMC][0].nomDuTypePyxb, self.entites[nomMC][0].aCreer) # inutile - deja fait plus haut if mc.aCreer : self.texteComplexeVenantDesFils += mc.texteComplexe if mc.aCreer : self.texteSimple += mc.texteSimple else : - texteSimpleUnion += '\t'*(indent)+self.entites[nomMC][0].texteSimple + texteSimpleUnion += '\t'*(indent)+self.entites[nomMC][0].texteSimplePart2 + texteSimplePart1= self.entites[nomMC][0].texteSimplePart1 for e in listePourUnion[1:] : e.dumpXsd(dansFactorisation=True,multiple=True,first=False) # si on ext un mc simple la ligne suivante est inutile # en revanche on ajoute le texte a tous les coups #self.texteComplexeVenantDesFils += e.texteComplexe e.metAJourPyxb(nomTypePyxbUnion) - texteSimpleUnion += '\t'*(indent)+e.texteSimple + texteSimpleUnion += '\t'*(indent) + e.texteSimplePart2 + texteSimplePart1 += e.texteSimplePart1 texteSimpleUnion += finUnion texteSimpleUnion+=fermeSimpleType - self.texteSimple += texteSimpleUnion + self.texteSimple += texteSimplePart1 + texteSimpleUnion #print ('self.texteSimple', self.texteSimple) @@ -847,17 +848,19 @@ class X_SIMP (X_definition): typeATraduire=self.type[0] + self.texteSimplePart1="" if not(isinstance(typeATraduire,str)) and not(isinstance(typeATraduire,Accas.Tuple)) and issubclass(typeATraduire, Accas.UserASSD) : - cata = CONTEXT.getCurrentCata() - if len(self.type) == 2 and self.type[1]=='createObject' : suffixe = 'C' - else : suffixe = 'U' - if typeATraduire.__name__+'_'+suffixe not in cata.listeUserASSDDumpes : - self.texteSimple = defUserAssd.format(typeATraduire.__name__, suffixe) + self.texteSimple - cata.listeUserASSDDumpes.add(typeATraduire.__name__+'_'+suffixe) + self.isAtypeUserASSD = True + cata = CONTEXT.getCurrentCata() + if len(self.type) == 2 and self.type[1]=='createObject' : suffixe = 'C' + else : suffixe = 'U' + if typeATraduire.__name__+'_'+suffixe not in cata.listeUserASSDDumpes : + self.texteSimplePart1 = defUserAssd.format(typeATraduire.__name__, suffixe) + cata.listeUserASSDDumpes.add(typeATraduire.__name__+'_'+suffixe) - if cata.definitUserASSD ==False : - cata.definitUserASSD = True - cata.texteSimple = cata.texteSimple + defBaseXSDUserAssd + if cata.definitUserASSD ==False : + cata.definitUserASSD = True + cata.texteSimple = cata.texteSimple + defBaseXSDUserAssd if not multiple : self.texteSimple += debutSimpleType.format(self.nomDuTypePyxb) @@ -892,6 +895,8 @@ class X_SIMP (X_definition): for val in into : print (str(val)) self.texteSimple += fermeRestrictionBase self.texteSimple += fermeSimpleType + self.texteSimplePart2 = self.texteSimple + self.texteSimple = self.texteSimplePart1 + self.texteSimplePart2 def prepareDumpXSD(self): diff --git a/Vimmp/cata_CSAndCPS_v15.py b/Vimmp/cata_CSAndCPS_v15.py index 9a3c9b29..e135eb25 100644 --- a/Vimmp/cata_CSAndCPS_v15.py +++ b/Vimmp/cata_CSAndCPS_v15.py @@ -186,30 +186,6 @@ def creeBlocPourLesFichiers(laCondition, Prefixe='Empty', ListeFormats=[], Field dicoDesBlocs[FieldName] = SIMPFieldName return BLOC(condition=laCondition, **dicoDesBlocs) -#--------------------------------------------------------------------- -def prepareBlocParticleDynVarOld(condition, nomDuFact, nomDelaContante) : -#--------------------------------------------------------------------- - dicoDesBlocs = {} - dicoDuFact = {} - dicoDuFact[nomDelaContante] = SIMP(typ=(dynamicVariableParticle,'createObject'), statut='o', defaut = nomDelaContante, homo='constant') - monFact = FACT ( statut ='o', - **dicoDuFact, - blocSteadyState = BLOC(condition = 'SteadyState == True', - blocFluidInSame = creeBlocPourLesFichiers('InSameFile == False', 'Position', ('Med', 'cgns' ), None), - blocGivenPosition = BLOC(condition = 'OriginOfDynamicalVariables == "Given"', - PositionFieldName = SIMP(typ='TXM',statut='o'), - ), - blocInteractionPosition = BLOC(condition = 'OriginOfDynamicalVariables == "Interaction"', - InteractionName = SIMP(typ=interaction,statut='o'), - Consigne = SIMP(statut="o", homo="information", typ="TXM", defaut='Create and choose suitable interaction'), - ), - ), - blocSimulatedPosition = prepareBlocInitialisation(condition = 'VariablesSimulation == True'), - ) - dicoDesBlocs[nomDuFact] = monFact - return BLOC(condition=condition,**dicoDesBlocs) - - #--------------------------------------------------------------------- def prepareBlocAmbiantMediaField(condition, nomDuFact, nomDelaContante) : #--------------------------------------------------------------------- @@ -230,9 +206,9 @@ def prepareBlocAmbiantMediaField(condition, nomDuFact, nomDelaContante) : Consigne = SIMP(statut="o", homo="information", typ="TXM", defaut='Create and choose suitable interaction'), ), ), - # blocConsigne = BLOC(condition = 'SteadyState == False', - # Consigne = SIMP(statut="o", homo="information", typ="TXM", defaut='Not implemented yet. Will ask for a range of calculation steps.'), - # ), #BlocNotSteady + blocConsigne = BLOC(condition = 'SteadyState == False', + Consigne = SIMP(statut="o", homo="information", typ="TXM", defaut='Not implemented yet. Will ask for a range of calculation steps.'), + ), #BlocNotSteady FieldAppliesOnAllSpecies = SIMP(statut='o', typ=bool, defaut=True), blocPorteEspece = BLOC(condition = 'FieldAppliesOnAllSpecies == False ', AppliesToSpecies = SIMP(statut='o', typ=userParticle, max= '**', homo='SansOrdreNiDoublon'), # faire un typ = "espece" @@ -327,7 +303,6 @@ def prepareFactTurbulence(statut, ajout=None , position=None, positionChoice=Non #------------------------------------------------------ def prepareFactTurbulenceForParticule(): -#statut, ajout=None , position=None, positionChoice=None): #------------------------------------------------------ listInto = ['Fully resolved (DNS)', 'Spatial filtering (LES)', 'One-point moment', 'One-point PDF'] return FACT(statut='o', @@ -380,9 +355,9 @@ def prepareFactTurbulenceScalaire(statut, ajout=None , position=None): into=['Algebraic flux models','Turbulent diffusivity models', 'Scalar-flux transport equations']), # Ce bloc consigne ne passe pas dans la projection XSD # blocAlgebraic = BLOC(condition= "RANSModel == 'Algebraic flux models'", - # blocConsigne = BLOC(condition= "RANSModel == 'Algebraic flux models'", - # Consigne = SIMP(statut="o", homo="information", typ="TXM", defaut='Not implemented yet'), - # ), # fin blocAlgebraic + blocConsigne = BLOC(condition= "RANSModel == 'Algebraic flux models'", + Consigne = SIMP(statut="o", homo="information", typ="TXM", defaut='Not implemented yet'), + ), # fin blocAlgebraic blocTDM = BLOC(condition = "RANSModel == 'Turbulent diffusivity models'", TDMChoice = SIMP(typ='TXM', statut='o', into=['SGDH', 'GGDH',]), ), # fin blocTDM @@ -543,7 +518,7 @@ def prepareBlocCPS(): ConstraintsAndReducedStatisticalDescription = FACT(statut='o', Constraint= FACT(statut='o', - TypeOfConstraint = SIMP( typ='TXM', statut='o', into=['Quasi-static_methods','Brownian_dynamics','Presumed_transport','Time-marching_equilibrium','Time-marching non-equilibrium'],defaut=['Time-marching_non-equilibrium',], max ='**', position='reCalculeEtape', homo='SansOrdreNiDoublon'), + TypeOfConstraint = SIMP( typ='TXM', statut='o', into=['Quasi-static_methods','Brownian_dynamics','Presumed_transport','Time-marching_equilibrium','Time-marching_non-equilibrium'],defaut=['Time-marching_non-equilibrium',], max ='**', position='reCalculeEtape', homo='SansOrdreNiDoublon'), ), ), @@ -592,12 +567,30 @@ def prepareBlocCPS(): )# fin du prepareBlocCps def prepareParticles(): - return FACT(statut='o', max='**', + return FACT(statut='o', max='**', ParticleNature = SIMP(statut='o', typ='TXM', into=['Atom', 'Molecule', 'Dissipative Particle', 'Fluid Particle', 'Discrete Particle']), - blocAtom = BLOC(condition='ParticleNature == "Atom"', - ParticleName = SIMP(statut='o', typ=(userAtom,'createObject'),nomXML='ParticleName'), + blocAtomName = BLOC(condition='ParticleNature == "Atom"', + ParticleName = SIMP(statut='o', typ=(userAtom,'createObject') ), InitialNumberOfParticles = SIMP(statut='o', typ='I', val_min=0), + ), + + blocMoleculeName = BLOC(condition='ParticleNature == "Molecule"', + ParticleName = SIMP(statut='o', typ=(userMolecule,'createObject')), + InitialNumberOfParticles = SIMP(statut='o', typ='I', val_min=0), + ), + + blocDissipativeName = BLOC(condition='ParticleNature == "Dissipative Particle"', + ParticleName = SIMP(statut='o', typ=(userDPD,'createObject')), + InitialNumberOfParticles = SIMP(statut='o', typ='I', val_min=0), + ), + + blocDiscreteName = BLOC(condition='ParticleNature == "Discrete Particle"', + ParticleName = SIMP(statut='o', typ=(userDiscrete,'createObject')), + InitialNumberOfParticles = SIMP(statut='o', typ='I', val_min=0), + ), + + blocAtom = BLOC(condition='ParticleNature == "Atom"', ChemicalSpecies = SIMP(statut='o', typ='TXM'), ElectricCharge = SIMP(statut='f', typ='R'), MagneticMoment = SIMP(statut='f', typ='R'), @@ -606,29 +599,24 @@ def prepareParticles(): ), # fin b_Atom # --------------- Molecules ------------------ blocMolecule = BLOC(condition='ParticleNature == "Molecule"', - ParticleName = SIMP(statut='o', typ=(userMolecule,'createObject'),nomXML='ParticleName'), - InitialNumberOfParticles = SIMP(statut='o', typ='I', val_min=0), Shape = SIMP(statut='o', typ='TXM', into=['Linear', 'Trigonal Planar', 'Angular', 'Tetrahedral', 'Octahedral', 'Trigonal pyramid', 'Other']), - Size = SIMP(statut='f', typ='R'), # relevant ? ElectricCharge = SIMP(statut='f', typ='R'), MagneticMoment = SIMP(statut='f', typ='R'), + Size = SIMP(statut='f', typ='R'), # relevant ? ), #fin b_Molecule # --------------- Dissipative ------------------ blocDissipative = BLOC(condition='ParticleNature == "Dissipative Particle"', - ParticleName = SIMP(statut='o', typ=(userDPD,'createObject'),nomXML='ParticleName'), - InitialNumberOfParticles = SIMP(statut='o', typ='I', val_min=0), - #BondedParticles = SIMP(statut="o", typ=bool, defaut=False), - ), # b_Dissipative + BondedParticles = SIMP(statut="o", typ=bool, defaut=False), + ), # b_Dissipative # --------------- Discrete Particle ------------------ blocDiscrete = BLOC(condition='ParticleNature == "Discrete Particle"', - ParticleName = SIMP(statut='o', typ=(userDiscrete,'createObject'),nomXML='ParticleName'), - InitialNumberOfParticles = SIMP(statut='o', typ='I', val_min=0), TypeOfDiscreteParticle = SIMP(statut='o', typ='TXM', into=['Solid', 'Droplets', 'Bubbles','Bio Organism'],), blocTypeDPSolid = BLOC(condition ='TypeOfDiscreteParticle == "Solid"', - PrimaryOrAggregate = SIMP(statut='o', typ='TXM', into=['Primary Particle', 'Assemblage / Aggregate'], position = 'global'), - b_SolidPrimary = BLOC(condition='PrimaryOrAggregate == "Primary Particle"', - ), + #PrimaryOrAggregate = SIMP(statut='o', typ='TXM', into=['Primary Particle', 'Assemblage / Aggregate'], position = 'global'), + PrimaryOrAggregate = SIMP(statut='o', typ='TXM', into=['Primary Particle', 'Assemblage / Aggregate'], ), +# b_SolidPrimary = BLOC(condition='PrimaryOrAggregate == "Primary Particle"', +# ), b_SolidAggregate = BLOC(condition='PrimaryOrAggregate == "Assemblage / Aggregate"', Morphology = FACT (statut ='o', NumberOfPrimaryParticles = SIMP(statut='o', typ='I', val_min=0), @@ -640,7 +628,6 @@ def prepareParticles(): ), # --------------- Bio Organism ------------------ blocTypeBioSolid = BLOC(condition='TypeOfDiscreteParticle == "Bio Organism"', - #ParticleName = SIMP(statut='o', typ=(userBioSolid,'createObject'),), TypeOfOrganism = SIMP(statut='o', typ='TXM', into=['Unicellular', 'Multicellular']), blocUnicellular = BLOC(condition ='TypeOfOrganism=="Unicellular"', Unicellular = SIMP(statut='o', typ='TXM', into=["Bactaria"], defaut='Bactaria') @@ -682,7 +669,7 @@ def prepareParticles(): ), ), # Properties ), # b_Discrete - ) # fin Particle + ) # fin Particle #--------------------------------- def prepareContactPhenomena(): @@ -690,7 +677,7 @@ def prepareContactPhenomena(): return FACT(statut='o', max= "**", withContactPhenomena = SIMP(statut='o', typ=bool, defaut=False), bwithContact = BLOC(condition = 'withContactPhenomena == True', - ŁevelOfDescription = SIMP(statut='o', typ='TXM', into=[ 'Microscopic', 'Macroscopic']), + LevelOfDescription = SIMP(statut='o', typ='TXM', into=[ 'Microscopic', 'Macroscopic']), bMicroscopic = BLOC(condition = 'LevelOfDescription == "Microscopic"', DescriptionOfContact = SIMP(statut='o', typ='TXM', into=[ 'Contact distance (cutoff)', 'Contact force']), ), @@ -1055,6 +1042,9 @@ def prepareBlocFluideMacro(): # REM : L'existence des mc TVMChoice et RSMChoice est exclusive, du coup une évaluation de condition # qui contient les deux renvoie forcément une exception, le bloc n'est alors pas evalué # sauf si le mc de la première condition existe (ordre évaluation du or) + # blocTurbulenceTWMChoice2 = BLOC(condition = 'TVMChoice == "K-Epsilon" or RSMChoice != None', + # blocTurbulenceTWMChoice2 = BLOC(condition = '(RSMChoice != None) or (TVMChoice == "K-Epsilon")', + # blocTurbulenceTWMChoice2 = BLOC(condition = 'TVMChoice == "K-Epsilon"', blocTurbulenceTWMChoice2 = BLOC(condition = 'RANSModel == "Reynolds Stress Model (RSM)" or TVMChoice == "K-Epsilon"', EpsilonDefinition = FACT(statut ='o', Name = SIMP(typ=(scalar,'createObject'), statut='o', defaut ='Epsilon', homo='constant'), @@ -1089,6 +1079,7 @@ def prepareBlocFluideMacro(): ), ), # blocTurbulenceTWMChoice3 + # blocTurbulenceRSMChoice1 = BLOC(condition = "(RANSModel == 'Reynolds Stress Model (RSM)') and (RSMChoice !=None)", blocTurbulenceRSMChoice1 = BLOC(condition = "RSMChoice !=None", RijDefinition = FACT(statut ='o', Name = SIMP(typ=(scalar,'createObject'), statut='o', defaut ='Rij', homo='constant'), @@ -1214,46 +1205,62 @@ def ActiveOnFlowEffect(inTemperature=True): #-----------------------------------------------------# def prepareBoundaryCondition(): - return FACT(statut='o',max = '**', - BCFluide = BLOC ( condition = 'SystemType == "Continuum system"', +#-----------------------------------------------------# +# on en fait 1 bloc seul pour CS and CPS +# pour pas de souci dans la projection XSD + return FACT(statut='o',max = '**', # max = nb de facette de bord TypeOfBoundaryCondition = SIMP(statut='o', typ='TXM', into=['Inlet', 'Outlet', 'Symmetry','Periodicity', 'Wall', 'Free Surface'], ), - ApplyOnGroups = SIMP(statut ='o', typ=meshGroup, max='**', homo='SansOrdreNiDoublon', nomXML='ApplyOnGroups', - filtre=( '(set(MeshIdentifiers).intersection( set(self.getParentsWithId().getListeUserASSD("MeshId")) ) != set()) ', - ( ('MeshIdentifiers', 'self.etape.getChild("blocModeleNumeriqueContinuum").getChild("NumericalModel")'), ) + + blocDesigneMesh = BLOC(condition = "SystemType == 'Continuum system'", + ApplyOnGroups = SIMP(statut ='o', typ=meshGroup, max='**', homo='SansOrdreNiDoublon', + filtre=( '(set(MeshIdentifiers).intersection( set(self.getParentsWithId().getListeUserASSD("MeshId")) ) != set()) ', + ( ('MeshIdentifiers', 'self.etape.getChild("blocModeleNumeriqueContinuum").getChild("NumericalModel")'), ) + ), ), - ), - blocOnStateVariable = BLOC(condition = "TypeOfBoundaryCondition not in ['Wall', 'Outlet']", - ApplyOnStateVariable = SIMP (statut ='o', typ=stateVariable, max='**', homo='SansOrdreNiDoublon',nomXML='ApplyOnGroups', + ), + blocDesigne_Shape = BLOC(condition = "SystemType == 'Classical particle system'", + #ApplyOnGroups = SIMP (statut ='o', typ=spatialRegion, max='**' + ApplyOnGroups = SIMP (statut ='o', typ=meshGroup, max='**', homo='SansOrdreNiDoublon', + filtre=( '(set(MeshIdentifiers).intersection( set(self.getParentsWithId().getListeUserASSD("MeshId")) ) != set()) ', + ( ('MeshIdentifiers', 'self.etape.getChild("blocModeleNumeriqueClassical").getChild("NumericalModel")'), ) + ), + ), + ), + + + blocOnStateVariable = BLOC(condition = "(TypeOfBoundaryCondition in ['Inlet', 'Symmetry','Periodicity', 'Free Surface'] and SystemType == 'Continuum system') or (SystemType == 'Classical particle system' and TypeOfBoundaryCondition not in ['Outlet','Inlet'])" , + ApplyOnStateVariable = SIMP (statut ='o', typ=stateVariable, max='**', homo='SansOrdreNiDoublon', filtre=( 'etape in set(self.getEtapes()) ', (('etape', None),), ), #Il ne faut pas proposer les variables d'état des autres composants. - ), #PNPN A FAIRE : fenetreIhm='menuDeroulant' + ), #PNPN A FAIRE : fenetreIhm='menuDeroulant' ), + blocPeriodique = BLOC(condition = "TypeOfBoundaryCondition == 'Periodicity'", Direction = SIMP(statut='o', typ='TXM', into=['X','Y','Z', 'XYZ']), ), # b_periodique - blocInlet = BLOC(condition = "TypeOfBoundaryCondition == 'Inlet'", - FormulationOfBoundary= SIMP(statut='o', typ='TXM', into=['Dirichlet','Neumann','Cauchy']), - blocDirichlet = BLOC(condition = 'FormulationOfBoundary == "Dirichlet"', - regles=(AU_MOINS_UN('InletProfile','IntegratedValue','IntegratedVectorValue',), + + blocInlet1 = BLOC(condition = "TypeOfBoundaryCondition == 'Inlet' and SystemType == 'Continuum system'", + FormulationOfBoundary= SIMP(statut='o', typ='TXM', into=['Dirichlet','Neumann','Cauchy']), + blocDirichlet = BLOC(condition = 'FormulationOfBoundary == "Dirichlet"', + regles=(AU_MOINS_UN('InletProfile','IntegratedValue','IntegratedVectorValue',), EXCLUS ('InletProfile','IntegratedValue','IntegratedVectorValue',), ), - Consigne = SIMP(statut ="o", homo="information", typ="TXM", defaut = "Choose between InletProfile,IntegratedValue,IntegratedVectorValue "), - InletProfile = SIMP (statut ='f', typ='TXM'), - IntegratedValue = SIMP (statut='f', typ='R'), - IntegratedVectorValue = FACT(statut='f', - U = SIMP (statut ='o', typ='R'), - V = SIMP (statut ='o', typ='R'), - W = SIMP (statut ='o', typ='R'), - ), - #PN : faire une regle - ), - blocNeumann = BLOC(condition = 'FormulationOfBoundary == "Neumann"', + Consigne = SIMP(statut ="o", homo="information", typ="TXM", defaut = "Choose between InletProfile,IntegratedValue,IntegratedVectorValue "), + InletProfile = SIMP (statut ='f', typ='TXM'), + IntegratedValue = SIMP (statut='f', typ='R'), + IntegratedVectorValue = FACT(statut='f', + U = SIMP (statut ='o', typ='R'), + V = SIMP (statut ='o', typ='R'), + W = SIMP (statut ='o', typ='R'), + ), + ),# fin Dirichlet + blocNeumann = BLOC(condition = 'FormulationOfBoundary == "Neumann"', FluxFile = SIMP (statut ='o', typ=('Fichier', " ;;All Files (*)"),) - ), - blocCauchy = BLOC(condition = 'FormulationOfBoundary == "Cauchy"', + ), + blocCauchy = BLOC(condition = 'FormulationOfBoundary == "Cauchy"', ImposedFlux = SIMP (statut ='o', typ='TXM'), _IntegratedValue = SIMP (statut='o', typ='R'), ), - ), # b_inlet - blocWall = BLOC(condition = "TypeOfBoundaryCondition == 'Wall'", + ), # b_inlet1 + blocWall = BLOC(condition = "TypeOfBoundaryCondition == 'Wall' and SystemType == 'Continuum system'", VelocityAtBoundary = FACT(statut='o', SlipVelocity = SIMP(statut='o', typ='R', defaut= 0.0), WallMotion = FACT(statut='o', @@ -1263,7 +1270,7 @@ def prepareBoundaryCondition(): ), ), LevelOfDescription = FACT(statut='o', - blocWall = BLOC(condition = "FlowNature == 'Turbulent'", ##JP+CH TODO : Choix des lois en fct du type du TurbulenceModelingType + blocWallInside = BLOC(condition = "FlowNature == 'Turbulent'", ##JP+CH TODO : Choix des lois en fct du type du TurbulenceModelingType WallFunction = SIMP(statut ='o', typ='TXM', into=['No wall function','1-scale model (Log law)', '2-scale model (Log law)','Scalable 2-scale model (Log law)', @@ -1271,33 +1278,12 @@ def prepareBoundaryCondition(): ), ), ), # b_Wall - ), # FinBCfuid - blocBDCpS = BLOC(condition = "SystemType == 'Classical particle system'", - TypeOfBoundaryCondition = SIMP(statut='o', typ='TXM', into=['Inlet', 'Outlet', 'Symmetry','Periodicity', 'Wall', 'Free Surface'], ), - ApplyOnShape = SIMP(statut ='o', typ=spatialRegion, max='**', homo='SansOrdreNiDoublon', nomXML='ApplyOnShape', - #ApplyOnGroups = SIMP(statut ='o', typ=spatialRegion, max='**', homo='SansOrdreNiDoublon',nomXML='ApplyOnGroups', -#PN a faire le filtre correctement - #filtre=( '(set(MeshIdentifiers).intersection( set(self.getParentsWithId().getListeUserASSD("MeshId")) ) != set()) ', - # ( ('MeshIdentifiers', 'self.etape.getChild("blocModeleNumeriqueClassical").getChild("NumericalModel")'), ) - # ), - ), - - blocWall = BLOC(condition = "TypeOfBoundaryCondition == 'Wall'", + blocWall2 = BLOC(condition = "TypeOfBoundaryCondition == 'Wall' and SystemType == 'Classical particle system'", ChoiceOfParticleWallInteraction = SIMP(statut='o', typ = wallInteractionId) ), # b_Wall - blocOnStateVariable = BLOC(condition = "TypeOfBoundaryCondition not in ['Outlet','Inlet']", - ApplyOnStateVariable = SIMP (statut ='o', typ=stateVariable, max='**', homo='SansOrdreNiDoublon', - filtre=( 'etape in set(self.getEtapes()) ', (('etape', None),), ), #Il ne faut pas proposer les variables d'état des autres composants. - ), #PNPN A FAIRE : fenetreIhm='menuDeroulant' - ), - - blocPeriodique = BLOC(condition = "TypeOfBoundaryCondition == 'Periodicity'", - Direction = SIMP(statut='o', typ='TXM', into=['X','Y','Z', 'XYZ']), - ), # b_periodique - - blocInlet = BLOC(condition = "TypeOfBoundaryCondition == 'Inlet'", + blocInlet2 = BLOC(condition = "TypeOfBoundaryCondition == 'Inlet' and SystemType == 'Classical particle system'", NumberOfParticleInjected = SIMP(statut='o', typ = 'I', val_min = 1), InjectionEveryNTimeSteps = SIMP(statut='o', typ = 'I', val_min = 0), DiameterOfParticleInjected = SIMP(statut='o', typ = 'R', val_min = 0), @@ -1317,9 +1303,8 @@ def prepareBoundaryCondition(): ), ), ),# blocNoBrownianDynamics - ), # b_inlet - ), # Boundary_Conditions -) + ), # bInlet2 + ) # Boundary_Conditions @@ -1338,6 +1323,7 @@ Component = OPER(nom='Component', sd_prod=composant, blocModeleNumeriqueQuantum = prepareBlocSystemType('Quantum system'), blocModeleNumeriqueClassical = prepareBlocSystemType('Classical particle system'), blocModeleNumeriqueContinuum = prepareBlocSystemType('Continuum system'), + # Exemple de reecriture d'un BLOC_XOR pour eviter la generation d'un type xsd double # BCFluide = BLOC ( condition = 'SystemType == "Continuum system"', # BoundaryConditions = FACT(statut = 'o', @@ -1350,7 +1336,7 @@ Component = OPER(nom='Component', sd_prod=composant, # ), # ), BoundaryConditions = FACT(statut = 'o', - BoundaryCondition = prepareBoundaryCondition(), + BoundaryCondition = prepareBoundaryCondition(), ), )