From: nicolas Date: Wed, 18 Sep 2013 07:38:47 +0000 (+0000) Subject: Schémas YACS - suite X-Git-Tag: V7_3_0a1~43 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=de3963adc6da4f33b81a3990d07fb6c64f4e2d35;p=modules%2Fhomard.git Schémas YACS - suite --- diff --git a/doc/files/tutorial_1.py b/doc/files/tutorial_1.py index 3ab26775..9f14755d 100644 --- a/doc/files/tutorial_1.py +++ b/doc/files/tutorial_1.py @@ -24,7 +24,7 @@ Exemple de couplage HOMARD-Salome Copyright EDF-R&D 1996, 2010, 2013 """ -__revision__ = "V1.5" +__revision__ = "V1.6" # import os # @@ -36,6 +36,9 @@ if os.environ.has_key("LOGNAME") : else : user = "anonymous" dircase = os.path.join( os.sep, "tmp", "HOMARD_"+user) +if not os.path.isdir(dircase) : + os.mkdir (dircase) +dircase = os.path.join( dircase, "tutorial_1" ) if not os.path.isdir(dircase) : os.mkdir (dircase) # ================================== @@ -51,10 +54,10 @@ homard = salome.lcc.FindOrLoadComponent("FactoryServer", "HOMARD") study_main = salome.myStudyManager.NewStudy("HOMARD") homard.SetCurrentStudy(salome.myStudy) # -# Hypothesis "Hypo_0" +# Hypothesis "Hypo_1" # =================== -Hypo_0 = homard.CreateHypothesis('Hypo_0') -Hypo_0.SetAdapRefinUnRef(-1, 1, 0) +Hypo_1 = homard.CreateHypothesis('Hypo_1') +Hypo_1.SetAdapRefinUnRef(-1, 1, 0) # # Case "Case_1" # ============= @@ -64,26 +67,26 @@ Case_1.SetConfType(1) # # Iterations # ========== -# Iteration "Iter_0" -Iter_0 = Case_1.NextIteration('Iter_0') -Iter_0.SetMeshName('MESH') -Iter_0.SetMeshFile(dircase+'/maill.01.med') -Iter_0.AssociateHypo('Hypo_0') -codret = Iter_0.Compute(1, 2) +# Iteration "Iter_1_0" +Iter_1_0 = Case_1.NextIteration('Iter_1_0') +Iter_1_0.SetMeshName('MESH') +Iter_1_0.SetMeshFile(dircase+'/maill.01.med') +Iter_1_0.AssociateHypo('Hypo_1') +codret = Iter_1_0.Compute(1, 2) -# Iteration "Iter_1" -Iter_1 = Iter_0.NextIteration('Iter_1') -Iter_1.SetMeshName('MESH') -Iter_1.SetMeshFile(dircase+'/maill.02.med') -Iter_1.AssociateHypo('Hypo_0') -codret = Iter_1.Compute(1, 2) +# Iteration "Iter_1_1" +Iter_1_1 = Iter_1_0.NextIteration('Iter_1_1') +Iter_1_1.SetMeshName('MESH') +Iter_1_1.SetMeshFile(dircase+'/maill.02.med') +Iter_1_1.AssociateHypo('Hypo_1') +codret = Iter_1_1.Compute(1, 2) -# Iteration "Iter_2" -Iter_2 = Iter_1.NextIteration('Iter_2') -Iter_2.SetMeshName('MESH') -Iter_2.SetMeshFile(dircase+'/maill.03.med') -Iter_2.AssociateHypo('Hypo_0') -codret = Iter_2.Compute(1, 2) +# Iteration "Iter_1_2" +Iter_1_2 = Iter_1_1.NextIteration('Iter_1_2') +Iter_1_2.SetMeshName('MESH') +Iter_1_2.SetMeshFile(dircase+'/maill.03.med') +Iter_1_2.AssociateHypo('Hypo_1') +codret = Iter_1_2.Compute(1, 2) if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(1) diff --git a/doc/files/tutorial_2.py b/doc/files/tutorial_2.py index 30b35ad7..46375f71 100644 --- a/doc/files/tutorial_2.py +++ b/doc/files/tutorial_2.py @@ -24,7 +24,7 @@ Exemple de couplage HOMARD-Salome Copyright EDF-R&D 1996, 2010, 2013 """ -__revision__ = "V1.6" +__revision__ = "V1.7" # import os # @@ -36,6 +36,9 @@ if os.environ.has_key("LOGNAME") : else : user = "anonymous" dircase = os.path.join( os.sep, "tmp", "HOMARD_"+user) +if not os.path.isdir(dircase) : + os.mkdir (dircase) +dircase = os.path.join( dircase, "tutorial_2" ) if not os.path.isdir(dircase) : os.mkdir (dircase) # ================================== @@ -62,40 +65,40 @@ Zone_1 = homard.CreateZoneSphere ('Zone_1', 0., 0., 0., 1.05) # Box "Zone_2" Zone_2 = homard.CreateZoneBox ('Zone_2', -0.1, 0.51, -0.1, 0.51, -0.1, 0.51) # -# Hypothesis "Hypo_0" +# Hypothesis "Hypo_2" # =================== -Hypo_0 = homard.CreateHypothesis('Hypo_0') -Hypo_0.SetAdapRefinUnRef(0, 1, 0) -Hypo_0.AddZone('Zone_1', 1) -Hypo_0.AddZone('Zone_0', 1) +Hypo_2 = homard.CreateHypothesis('Hypo_2') +Hypo_2.SetAdapRefinUnRef(0, 1, 0) +Hypo_2.AddZone('Zone_1', 1) +Hypo_2.AddZone('Zone_0', 1) # -# Hypothesis "Hypo_1" +# Hypothesis "Hypo_2_bis" # =================== -Hypo_1 = homard.CreateHypothesis('Hypo_1') -Hypo_1.SetAdapRefinUnRef(0, 1, 0) -Hypo_1.AddZone('Zone_0', 1) -Hypo_1.AddZone('Zone_2', 1) +Hypo_2_bis = homard.CreateHypothesis('Hypo_2_bis') +Hypo_2_bis.SetAdapRefinUnRef(0, 1, 0) +Hypo_2_bis.AddZone('Zone_0', 1) +Hypo_2_bis.AddZone('Zone_2', 1) # -# Case "Case_1" +# Case "Case_2" # ============= -Case_1 = homard.CreateCase('Case_1', 'MZERO', data_dir+'/tutorial_2.00.med') -Case_1.SetDirName(dircase) +Case_2 = homard.CreateCase('Case_2', 'MZERO', data_dir+'/tutorial_2.00.med') +Case_2.SetDirName(dircase) # -# Iteration "Iter_0" +# Iteration "Iter_2_0" # ================== -Iter_0 = Case_1.NextIteration('Iter_0') -Iter_0.SetMeshName('M_1') -Iter_0.SetMeshFile(dircase+'/maill.01.med') -Iter_0.AssociateHypo('Hypo_0') -codret = Iter_0.Compute(1, 2) +Iter_2_0 = Case_2.NextIteration('Iter_2_0') +Iter_2_0.SetMeshName('M_1') +Iter_2_0.SetMeshFile(dircase+'/maill.01.med') +Iter_2_0.AssociateHypo('Hypo_2') +codret = Iter_2_0.Compute(1, 2) # -# Iteration "Iter_1" +# Iteration "Iter_2_1" # ================== -Iter_1 = Iter_0.NextIteration('Iter_1') -Iter_1.SetMeshName('M_2') -Iter_1.SetMeshFile(dircase+'/maill.02.med') -Iter_1.AssociateHypo('Hypo_1') -codret = Iter_1.Compute(1, 2) +Iter_2_1 = Iter_2_0.NextIteration('Iter_2_1') +Iter_2_1.SetMeshName('M_2') +Iter_2_1.SetMeshFile(dircase+'/maill.02.med') +Iter_2_1.AssociateHypo('Hypo_2_bis') +codret = Iter_2_1.Compute(1, 2) if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(1) diff --git a/doc/files/tutorial_3.py b/doc/files/tutorial_3.py index ac9e91ec..86ba7bb9 100644 --- a/doc/files/tutorial_3.py +++ b/doc/files/tutorial_3.py @@ -24,7 +24,7 @@ Exemple de couplage HOMARD-Salome Copyright EDF-R&D 1996, 2010, 2013 """ -__revision__ = "V1.6" +__revision__ = "V1.7" # import os # @@ -36,6 +36,9 @@ if os.environ.has_key("LOGNAME") : else : user = "anonymous" dircase = os.path.join( os.sep, "tmp", "HOMARD_"+user) +if not os.path.isdir(dircase) : + os.mkdir (dircase) +dircase = os.path.join( dircase, "tutorial_3" ) if not os.path.isdir(dircase) : os.mkdir (dircase) # ================================== @@ -92,40 +95,40 @@ Hypo_1vers2_bis.SetRefinThr(1, 0.0001) Hypo_1vers2_bis.SetUnRefThr(1, 0.000001) Hypo_1vers2_bis.SetTypeFieldInterp(0) # -# Case "Case_1" +# Case "Case_3" # ============= -Case_1 = homard.CreateCase('Case_1', 'G_0', data_dir+'/tutorial_3.00.med') -Case_1.SetDirName(dircase) +Case_3 = homard.CreateCase('Case_3', 'G_0', data_dir+'/tutorial_3.00.med') +Case_3.SetDirName(dircase) # -# Iteration "Iter_1" +# Iteration "Iter_3_1" # ================== -Iter_1 = Case_1.NextIteration('Iter_1') -Iter_1.SetMeshName('H_1') -Iter_1.SetMeshFile(dircase+'/maill.01.med') -Iter_1.SetFieldFile(data_dir+'/tutorial_3.00.med') -Iter_1.SetTimeStepRank( 1, 1) -Iter_1.AssociateHypo('Hypo_0vers1') -codret = Iter_1.Compute(1, 2) -# -# Iteration "Iter_2" +Iter_3_1 = Case_3.NextIteration('Iter_3_1') +Iter_3_1.SetMeshName('H_1') +Iter_3_1.SetMeshFile(dircase+'/maill.01.med') +Iter_3_1.SetFieldFile(data_dir+'/tutorial_3.00.med') +Iter_3_1.SetTimeStepRank( 1, 1) +Iter_3_1.AssociateHypo('Hypo_0vers1') +codret = Iter_3_1.Compute(1, 2) +# +# Iteration "Iter_3_2" # ================== -Iter_2 = Iter_1.NextIteration('Iter_2') -Iter_2.SetMeshName('H_2') -Iter_2.SetMeshFile(dircase+'/maill.02.med') -Iter_2.SetFieldFile(data_dir+'/tutorial_3.01.med') -Iter_2.SetTimeStepRank(1, 1) -Iter_2.AssociateHypo('Hypo_1vers2') -codret = Iter_2.Compute(1, 2) -# -# Iteration "Iter_2_bis" +Iter_3_2 = Iter_3_1.NextIteration('Iter_3_2') +Iter_3_2.SetMeshName('H_2') +Iter_3_2.SetMeshFile(dircase+'/maill.02.med') +Iter_3_2.SetFieldFile(data_dir+'/tutorial_3.01.med') +Iter_3_2.SetTimeStepRank(1, 1) +Iter_3_2.AssociateHypo('Hypo_1vers2') +codret = Iter_3_2.Compute(1, 2) +# +# Iteration "Iter_3_2_bis" # ====================== -Iter_2_bis = Iter_1.NextIteration('Iter_2_bis') -Iter_2_bis.SetMeshName('H_2_bis') -Iter_2_bis.SetMeshFile(dircase+'/maill.02.bis.med') -Iter_2_bis.SetFieldFile(data_dir+'/tutorial_3.01.med') -Iter_2_bis.SetTimeStepRank(1, 1) -Iter_2_bis.AssociateHypo('Hypo_1vers2_bis') -codret = Iter_2_bis.Compute(1, 2) +Iter_3_2_bis = Iter_3_1.NextIteration('Iter_3_2_bis') +Iter_3_2_bis.SetMeshName('H_2_bis') +Iter_3_2_bis.SetMeshFile(dircase+'/maill.02.bis.med') +Iter_3_2_bis.SetFieldFile(data_dir+'/tutorial_3.01.med') +Iter_3_2_bis.SetTimeStepRank(1, 1) +Iter_3_2_bis.AssociateHypo('Hypo_1vers2_bis') +codret = Iter_3_2_bis.Compute(1, 2) # if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(1) diff --git a/doc/files/tutorial_4.py b/doc/files/tutorial_4.py index 59467a9f..73b10b77 100644 --- a/doc/files/tutorial_4.py +++ b/doc/files/tutorial_4.py @@ -24,7 +24,7 @@ Exemple de couplage HOMARD-Salome Copyright EDF-R&D 1996, 2011, 2013 """ -__revision__ = "V2.2" +__revision__ = "V2.3" # import os # @@ -38,6 +38,9 @@ else : dircase = os.path.join( os.sep, "tmp", "HOMARD_"+user) if not os.path.isdir(dircase) : os.mkdir (dircase) +dircase = os.path.join( dircase, "tutorial_4" ) +if not os.path.isdir(dircase) : + os.mkdir (dircase) # ================================== # Ce repertoire contient les fichiers de donnees : tutorial_4.00.med, tutorial_4.fr.med pathHomard = os.getenv('HOMARD_ROOT_DIR') @@ -53,63 +56,63 @@ homard.SetCurrentStudy(salome.myStudy) # # Creation of the boundaries # ========================== -Boundary_1 = homard.CreateBoundaryDi('intersection', 'PIQUAGE', data_dir+'/tutorial_4.fr.med') +Boun_4_1 = homard.CreateBoundaryDi('intersection', 'PIQUAGE', data_dir+'/tutorial_4.fr.med') # -Boundary_2 = homard.CreateBoundaryCylinder('cyl_1_ext', 0.0, 25., -25., 25., 50., 75., 100.) +Boun_4_2 = homard.CreateBoundaryCylinder('cyl_1_ext', 0.0, 25., -25., 25., 50., 75., 100.) # -Boundary_3 = homard.CreateBoundaryCylinder('cyl_2_ext', 17.5, -2.5, -12.5, -100., -75., -25., 50.) +Boun_4_3 = homard.CreateBoundaryCylinder('cyl_2_ext', 17.5, -2.5, -12.5, -100., -75., -25., 50.) # -Boundary_4 = homard.CreateBoundaryCylinder('cyl_1_int', 0.0, 25., -25., 25., 50., 75., 75.) +Boun_4_4 = homard.CreateBoundaryCylinder('cyl_1_int', 0.0, 25., -25., 25., 50., 75., 75.) # -Boundary_5 = homard.CreateBoundaryCylinder('cyl_2_int', 17.5, -2.5, -12.5, -100., -75., -25., 25.) +Boun_4_5 = homard.CreateBoundaryCylinder('cyl_2_int', 17.5, -2.5, -12.5, -100., -75., -25., 25.) # # Hypothesis # ========== -# Creation of the hypothesis Hypo_1 -Hypo_1 = homard.CreateHypothesis('Hypo_1') -Hypo_1.SetAdapRefinUnRef(-1, 1, 0) -Hypo_1.AddGroup('T1_INT_I') -Hypo_1.AddGroup('T1_INT_O') -Hypo_1.AddGroup('T2_INT') -# Creation of the hypothesis Hypo_2 -Hypo_2 = homard.CreateHypothesis('Hypo_2') -Hypo_2.SetAdapRefinUnRef(-1, 1, 0) -Hypo_2.AddGroup('T1_EXT_I') -Hypo_2.AddGroup('T1_EXT_O') -Hypo_2.AddGroup('T2_EXT') -# -# Case "Case" +# Creation of the hypothesis Hypo_4 +Hypo_4 = homard.CreateHypothesis('Hypo_4') +Hypo_4.SetAdapRefinUnRef(-1, 1, 0) +Hypo_4.AddGroup('T1_INT_I') +Hypo_4.AddGroup('T1_INT_O') +Hypo_4.AddGroup('T2_INT') +# Creation of the hypothesis Hypo_4_bis +Hypo_4_bis = homard.CreateHypothesis('Hypo_4_bis') +Hypo_4_bis.SetAdapRefinUnRef(-1, 1, 0) +Hypo_4_bis.AddGroup('T1_EXT_I') +Hypo_4_bis.AddGroup('T1_EXT_O') +Hypo_4_bis.AddGroup('T2_EXT') +# +# Case "Case_4" # ============= -Case = homard.CreateCase('Case', 'PIQUAGE', data_dir+'/tutorial_4.00.med') -Case.SetDirName(dircase) -Case.AddBoundaryGroup( 'intersection', '' ) -Case.AddBoundaryGroup( 'cyl_1_int', 'T1_INT_I' ) -Case.AddBoundaryGroup( 'cyl_1_ext', 'T1_EXT_I' ) -Case.AddBoundaryGroup( 'cyl_1_int', 'T1_INT_O' ) -Case.AddBoundaryGroup( 'cyl_1_ext', 'T1_EXT_O' ) -Case.AddBoundaryGroup( 'cyl_2_int', 'T2_INT' ) -Case.AddBoundaryGroup( 'cyl_2_ext', 'T2_EXT' ) +Case_4 = homard.CreateCase('Case_4', 'PIQUAGE', data_dir+'/tutorial_4.00.med') +Case_4.SetDirName(dircase) +Case_4.AddBoundaryGroup( 'intersection', '' ) +Case_4.AddBoundaryGroup( 'cyl_1_int', 'T1_INT_I' ) +Case_4.AddBoundaryGroup( 'cyl_1_ext', 'T1_EXT_I' ) +Case_4.AddBoundaryGroup( 'cyl_1_int', 'T1_INT_O' ) +Case_4.AddBoundaryGroup( 'cyl_1_ext', 'T1_EXT_O' ) +Case_4.AddBoundaryGroup( 'cyl_2_int', 'T2_INT' ) +Case_4.AddBoundaryGroup( 'cyl_2_ext', 'T2_EXT' ) # # Creation of the iterations # ========================== -# Creation of the iteration Iter_1 : raffinement selon les faces internes -Iter_1 = Case.NextIteration('Iter_1') -Iter_1.SetMeshName('PIQUAGE_1') -Iter_1.SetMeshFile(dircase+'/maill.01.med') -Iter_1.AssociateHypo('Hypo_1') -codret = Iter_1.Compute(1, 2) -# Creation of the iteration Iter_2 : raffinement selon les faces externes -Iter_2 = Iter_1.NextIteration('Iter_2') -Iter_2.SetMeshName('PIQUAGE_2') -Iter_2.SetMeshFile(dircase+'/maill.02.med') -Iter_2.AssociateHypo('Hypo_2') -codret = Iter_2.Compute(1, 2) -# Creation of the iteration Iter_3 : second raffinement selon les faces externes -Iter_3 = Iter_2.NextIteration('Iter_3') -Iter_3.SetMeshName('PIQUAGE_3') -Iter_3.SetMeshFile(dircase+'/maill.03.med') -Iter_3.AssociateHypo('Hypo_2') -codret = Iter_3.Compute(1, 2) +# Creation of the iteration Iter_4_1 : raffinement selon les faces internes +Iter_4_1 = Case_4.NextIteration('Iter_4_1') +Iter_4_1.SetMeshName('PIQUAGE_1') +Iter_4_1.SetMeshFile(dircase+'/maill.01.med') +Iter_4_1.AssociateHypo('Hypo_4') +codret = Iter_4_1.Compute(1, 2) +# Creation of the iteration Iter_4_2 : raffinement selon les faces externes +Iter_4_2 = Iter_4_1.NextIteration('Iter_4_2') +Iter_4_2.SetMeshName('PIQUAGE_2') +Iter_4_2.SetMeshFile(dircase+'/maill.02.med') +Iter_4_2.AssociateHypo('Hypo_4_bis') +codret = Iter_4_2.Compute(1, 2) +# Creation of the iteration Iter_4_3 : second raffinement selon les faces externes +Iter_4_3 = Iter_4_2.NextIteration('Iter_4_3') +Iter_4_3.SetMeshName('PIQUAGE_3') +Iter_4_3.SetMeshFile(dircase+'/maill.03.med') +Iter_4_3.AssociateHypo('Hypo_4_bis') +codret = Iter_4_3.Compute(1, 2) if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(1) diff --git a/doc/files/tutorial_5.py b/doc/files/tutorial_5.py index 58908a33..03da77fe 100644 --- a/doc/files/tutorial_5.py +++ b/doc/files/tutorial_5.py @@ -24,7 +24,7 @@ Exemple de couplage HOMARD-Salome Copyright EDF-R&D 1996, 2010, 2013 """ -__revision__ = "V1.5" +__revision__ = "V1.6" # import os # @@ -36,6 +36,9 @@ if os.environ.has_key("LOGNAME") : else : user = "anonymous" dircase = os.path.join( os.sep, "tmp", "HOMARD_"+user) +if not os.path.isdir(dircase) : + os.mkdir (dircase) +dircase = os.path.join( dircase, "tutorial_5" ) if not os.path.isdir(dircase) : os.mkdir (dircase) # ================================== @@ -53,8 +56,8 @@ homard.SetCurrentStudy(salome.myStudy) # # Creation of the boundaries # ========================== -# Creation of the discrete boundary Boun_1 -Boun_1 = homard.CreateBoundaryDi('Boun_1', 'MAIL_EXT', data_dir+'/tutorial_5.fr.med') +# Creation of the discrete boundary Boun_5_1 +Boun_5_1 = homard.CreateBoundaryDi('Boun_5_1', 'MAIL_EXT', data_dir+'/tutorial_5.fr.med') # # Creation of the zones # ===================== @@ -65,37 +68,37 @@ quart_sup = homard.CreateZoneBox2D( 'quart_sup', 0., 250., 0., 250., 1 ) # # Hypothesis # ========== -# Creation of the hypothesis Hypo_1 -Hypo_1 = homard.CreateHypothesis('Hypo_1') -Hypo_1.SetAdapRefinUnRef(0, 1, 0) -Hypo_1.AddZone('enveloppe', 1) -# Creation of the hypothesis Hypo_2 -Hypo_2 = homard.CreateHypothesis('Hypo_2') -Hypo_2.SetAdapRefinUnRef(0, 1, 0) -Hypo_2.AddZone('quart_sup', 1) +# Creation of the hypothesis Hypo_5 +Hypo_5 = homard.CreateHypothesis('Hypo_5') +Hypo_5.SetAdapRefinUnRef(0, 1, 0) +Hypo_5.AddZone('enveloppe', 1) +# Creation of the hypothesis Hypo_5_bis +Hypo_5_bis = homard.CreateHypothesis('Hypo_5_bis') +Hypo_5_bis.SetAdapRefinUnRef(0, 1, 0) +Hypo_5_bis.AddZone('quart_sup', 1) # -# Case "Case_1" +# Case "Case_5" # ============= -Case_1 = homard.CreateCase('Case_1', 'COEUR_2D', data_dir+'/tutorial_5.00.med') -Case_1.SetDirName(dircase) -Case_1.SetConfType(3) -Case_1.AddBoundaryGroup('Boun_1', '') +Case_5 = homard.CreateCase('Case_5', 'COEUR_2D', data_dir+'/tutorial_5.00.med') +Case_5.SetDirName(dircase) +Case_5.SetConfType(3) +Case_5.AddBoundaryGroup('Boun_5_1', '') # -# Iteration "Iter_1" +# Iteration "Iter_5_1" # ================== -Iter_1 = Case_1.NextIteration('Iter_1') -Iter_1.SetMeshName('COEUR_2D_01') -Iter_1.SetMeshFile(dircase+'/maill.01.med') -Iter_1.AssociateHypo('Hypo_1') -codret = Iter_1.Compute(1, 2) +Iter_5_1 = Case_5.NextIteration('Iter_5_1') +Iter_5_1.SetMeshName('COEUR_2D_01') +Iter_5_1.SetMeshFile(dircase+'/maill.01.med') +Iter_5_1.AssociateHypo('Hypo_5') +codret = Iter_5_1.Compute(1, 2) # -# Iteration "Iter_2" +# Iteration "Iter_5_2" # ================== -Iter_2 = Iter_1.NextIteration('Iter_2') -Iter_2.SetMeshName('COEUR_2D_02') -Iter_2.SetMeshFile(dircase+'/maill.02.med') -Iter_2.AssociateHypo('Hypo_2') -codret = Iter_2.Compute(1, 2) +Iter_5_2 = Iter_5_1.NextIteration('Iter_5_2') +Iter_5_2.SetMeshName('COEUR_2D_02') +Iter_5_2.SetMeshFile(dircase+'/maill.02.med') +Iter_5_2.AssociateHypo('Hypo_5_bis') +codret = Iter_5_2.Compute(1, 2) if salome.sg.hasDesktop(): diff --git a/idl/HOMARD_YACS.idl b/idl/HOMARD_YACS.idl new file mode 100644 index 00000000..60574ac4 --- /dev/null +++ b/idl/HOMARD_YACS.idl @@ -0,0 +1,71 @@ +// Copyright (C) 2011-2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier +// + +#ifndef _HOMARD_YACS_IDL +#define _HOMARD_YACS_IDL + +#include "SALOME_Component.idl" +#include "SALOME_Exception.idl" +#include "SALOMEDS.idl" + +module HOMARD +{ + interface HOMARD_YACS : Engines::EngineComponent + { +// Generalites + void SetName(in string Name) raises (SALOME::SALOME_Exception); + string GetName() raises (SALOME::SALOME_Exception); + + long Delete(in long Option) raises (SALOME::SALOME_Exception); + + string GetDumpPython() raises (SALOME::SALOME_Exception); + +// Caracteristiques + void SetType (in long Type) raises (SALOME::SALOME_Exception); + long GetType() raises (SALOME::SALOME_Exception); + + void SetDirName(in string NomDir) raises (SALOME::SALOME_Exception); + string GetDirName() raises (SALOME::SALOME_Exception); + + void SetMeshFile(in string MeshFile) raises (SALOME::SALOME_Exception); + string GetMeshFile() raises (SALOME::SALOME_Exception); + + void SetScriptFile(in string ScriptFile) raises (SALOME::SALOME_Exception); + string GetScriptFile() raises (SALOME::SALOME_Exception); + + long Write() raises (SALOME::SALOME_Exception); + long WriteOnFile( in string YACSFile ) raises (SALOME::SALOME_Exception); + +// Liens avec les autres structures + void SetCaseName(in string NomCas) raises (SALOME::SALOME_Exception); + string GetCaseName() raises (SALOME::SALOME_Exception); + +// Divers + }; +}; +#endif diff --git a/src/HOMARD/HOMARD_YACS.cxx b/src/HOMARD/HOMARD_YACS.cxx new file mode 100644 index 00000000..0e238804 --- /dev/null +++ b/src/HOMARD/HOMARD_YACS.cxx @@ -0,0 +1,149 @@ +// HOMARD HOMARD : implementation of HOMARD idl descriptions +// +// Copyright (C) 2011-2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// File : HOMARD_YACS.cxx +// Author : Paul RASCLE, EDF +// Module : HOMARD +// +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier + +#include "HOMARD_YACS.hxx" +#include "utilities.h" + +//============================================================================= +/*! + * default constructor: + */ +//============================================================================= +HOMARD_YACS::HOMARD_YACS(): + _Name( "" ), + _NomCas( "" ), + _NomDir( "" ), + _MeshFile( "" ), + _ScriptFile( "" ), + _Type( 1 ) +{ + MESSAGE("HOMARD_YACS"); +} +//============================================================================= +/*! + * + */ +//============================================================================= +HOMARD_YACS::~HOMARD_YACS() +{ + MESSAGE("~HOMARD_YACS"); +} +//============================================================================= +//============================================================================= +// Generalites +//============================================================================= +//============================================================================= +void HOMARD_YACS::SetName( const char* Name ) +{ + _Name = std::string( Name ); +} +//============================================================================= +std::string HOMARD_YACS::GetName() const +{ + return _Name; +} +//============================================================================= +std::string HOMARD_YACS::GetDumpPython() const +{ + MESSAGE (". Ecriture du schema " << _Name ); + std::ostringstream aScript; + aScript << "\n# Creation of the schema " << _Name << "\n"; +// Le fichier du maillage initial + aScript << "\t" << _Name << ".SetMeshFile(\"" << _MeshFile << "\")\n"; + +// MESSAGE (". Fin de l ecriture du schema " << _Name ); + + return aScript.str(); +} +//============================================================================= +//============================================================================= +// Caracteristiques +//============================================================================= +//============================================================================= +void HOMARD_YACS::SetType( int Type ) +{ + _Type = Type; +} +//============================================================================= +int HOMARD_YACS::GetType() const +{ + return _Type; +} +void HOMARD_YACS::SetDirName( const char* NomDir ) +{ + _NomDir = std::string( NomDir ); +} +//============================================================================= +std::string HOMARD_YACS::GetDirName() const +{ + return _NomDir; +} +//============================================================================= +void HOMARD_YACS::SetMeshFile( const char* MeshFile ) +{ + _MeshFile = std::string( MeshFile ); +} +//============================================================================= +std::string HOMARD_YACS::GetMeshFile() const +{ + return _MeshFile; +} +//============================================================================= +void HOMARD_YACS::SetScriptFile( const char* ScriptFile ) +{ + _ScriptFile = std::string( ScriptFile ); +} +//============================================================================= +std::string HOMARD_YACS::GetScriptFile() const +{ + return _ScriptFile; +} +//============================================================================= +//============================================================================= +// Liens avec les autres structures +//============================================================================= +//============================================================================= +void HOMARD_YACS::SetCaseName( const char* NomCas ) +{ + _NomCas = std::string( NomCas ); +} +//============================================================================= +std::string HOMARD_YACS::GetCaseName() const +{ + return _NomCas; +} +//============================================================================= +//============================================================================= +// Divers +//============================================================================= +//============================================================================= diff --git a/src/HOMARD/HOMARD_YACS.hxx b/src/HOMARD/HOMARD_YACS.hxx new file mode 100644 index 00000000..af331722 --- /dev/null +++ b/src/HOMARD/HOMARD_YACS.hxx @@ -0,0 +1,81 @@ +// HOMARD HOMARD : implementation of HOMARD idl descriptions +// +// Copyright (C) 2011-2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// File : HOMARD_YACS.hxx +// Author : Paul RASCLE, EDF +// Module : HOMARD +// +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier + +#ifndef _HOMARD_YACS_HXX_ +#define _HOMARD_YACS_HXX_ + +#include +#include + +class HOMARD_YACS +{ +public: + HOMARD_YACS(); + ~HOMARD_YACS(); + +// Generalites + void SetName( const char* Name ); + std::string GetName() const; + + std::string GetDumpPython() const; + +// Caracteristiques + void SetType( int Type ); + int GetType() const; + + void SetDirName( const char* NomDir ); + std::string GetDirName() const; + + void SetMeshFile( const char* MeshFile ); + std::string GetMeshFile() const; + + void SetScriptFile( const char* ScriptFile ); + std::string GetScriptFile() const; + +// Liens avec les autres structures + void SetCaseName( const char* NomCas ); + std::string GetCaseName() const; + + +// Divers + +private: + std::string _Name; + std::string _NomCas; + std::string _NomDir; + std::string _MeshFile; + std::string _ScriptFile; + int _Type; +}; + +#endif diff --git a/src/HOMARDGUI/HOMARDGUI.cxx b/src/HOMARDGUI/HOMARDGUI.cxx index eaa72df3..56949368 100644 --- a/src/HOMARDGUI/HOMARDGUI.cxx +++ b/src/HOMARDGUI/HOMARDGUI.cxx @@ -60,16 +60,17 @@ using namespace std; #include "MonCreateCase.h" #include "MonCreateIteration.h" #include "MonPursueIteration.h" -#include "MonEditFile.h" +#include "MonCreateYACS.h" +#include "MonEditBoundaryAn.h" +#include "MonEditBoundaryDi.h" #include "MonEditCase.h" -#include "MonEditIteration.h" #include "MonEditHypothesis.h" +#include "MonEditIteration.h" +#include "MonEditYACS.h" #include "MonEditZone.h" -#include "MonEditBoundaryAn.h" -#include "MonEditBoundaryDi.h" #include "MonMeshInfo.h" -#include "MonCreateYACS.h" #include "MonIterInfo.h" +#include "MonEditFile.h" #include "HomardQtCommun.h" // BOOST Includes @@ -272,7 +273,7 @@ bool HOMARDGUI::OnGUIEvent (int theCommandID) case 1101: // Creation d un Cas { MESSAGE("command " << theCommandID << " activated"); - MonCreateCase *aDlg = new MonCreateCase( parent, true, + MonCreateCase *aDlg = new MonCreateCase( true, HOMARD::HOMARD_Gen::_duplicate(homardGen) ) ; aDlg->show(); break; @@ -335,16 +336,22 @@ bool HOMARDGUI::OnGUIEvent (int theCommandID) _PTR(SObject) obj = chercheMonObjet(); if (obj) { - // Edition d'un cas - if (HOMARD_UTILS::isCase(obj)) + // Edition d'une frontiere discrete + if (HOMARD_UTILS::isBoundaryDi(obj)) { - MonEditCase *aDlg = new MonEditCase(parent, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), _ObjectName ) ; + MonEditBoundaryDi *aDlg = new MonEditBoundaryDi(0, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; aDlg->show(); } - // Edition d'une iteration - else if (HOMARD_UTILS::isIter(obj)) + // Edition d'une frontiere analytique + else if (HOMARD_UTILS::isBoundaryAn(obj)) { - MonEditIteration *aDlg = new MonEditIteration(parent, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; + MonEditBoundaryAn *aDlg = new MonEditBoundaryAn(0, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; + aDlg->show(); + } + // Edition d'un cas + else if (HOMARD_UTILS::isCase(obj)) + { + MonEditCase *aDlg = new MonEditCase(true, HOMARD::HOMARD_Gen::_duplicate(homardGen), _ObjectName ) ; aDlg->show(); } // Edition d'une hypothese @@ -353,25 +360,23 @@ bool HOMARDGUI::OnGUIEvent (int theCommandID) MonEditHypothesis *aDlg = new MonEditHypothesis(0, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), _ObjectName, QString(""), QString("")) ; aDlg->show(); } - // Edition d'une zone - else if (HOMARD_UTILS::isZone(obj)) + // Edition d'une iteration + else if (HOMARD_UTILS::isIter(obj)) { - MonEditZone *aDlg = new MonEditZone(0, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; + MonEditIteration *aDlg = new MonEditIteration(parent, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; aDlg->show(); } - // Edition d'une frontiere discrete - else if (HOMARD_UTILS::isBoundaryDi(obj)) + // Edition d'un schema YACS + else if (HOMARD_UTILS::isYACS(obj)) { - MESSAGE(".. Lancement de MonEditBoundaryDi" ); - MonEditBoundaryDi *aDlg = new MonEditBoundaryDi(0, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; - aDlg->show(); + MonEditYACS *aDlg = new MonEditYACS(0, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), _ObjectName) ; + aDlg->show(); } - // Edition d'une frontiere analytique - else if (HOMARD_UTILS::isBoundaryAn(obj)) + // Edition d'une zone + else if (HOMARD_UTILS::isZone(obj)) { - MESSAGE(".. Lancement de MonEditBoundaryAn" ); - MonEditBoundaryAn *aDlg = new MonEditBoundaryAn(0, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; - aDlg->show(); + MonEditZone *aDlg = new MonEditZone(0, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; + aDlg->show(); } } break; diff --git a/src/HOMARDGUI/MonCreateBoundaryAn.cxx b/src/HOMARDGUI/MonCreateBoundaryAn.cxx index 701e8100..21a0b2fa 100644 --- a/src/HOMARDGUI/MonCreateBoundaryAn.cxx +++ b/src/HOMARDGUI/MonCreateBoundaryAn.cxx @@ -40,7 +40,7 @@ using namespace std; #define PI 3.141592653589793 // ------------------------------------------------------------------------------------------------------------------------ MonCreateBoundaryAn::MonCreateBoundaryAn(MonCreateCase* parent, bool modal, - HOMARD::HOMARD_Gen_var myHomardGen, + HOMARD::HOMARD_Gen_var myHomardGen0, QString caseName) : // ------------------------------------------------------------------------------------------------------------------------------ /* Constructs a MonCreateBoundaryAn @@ -63,7 +63,7 @@ MonCreateBoundaryAn::MonCreateBoundaryAn(MonCreateCase* parent, bool modal, Chgt (false) { MESSAGE("Constructeur") ; - myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen); + myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0); setupUi(this); setModal(modal); @@ -94,13 +94,13 @@ MonCreateBoundaryAn::MonCreateBoundaryAn(MonCreateCase* parent, bool modal, } // -------------------------------------------------------------------------------------------------------------- MonCreateBoundaryAn::MonCreateBoundaryAn(MonCreateCase* parent, - HOMARD::HOMARD_Gen_var myHomardGen, + HOMARD::HOMARD_Gen_var myHomardGen0, QString caseName): // -------------------------------------------------------------------------------------------------------------- // Constructeur appele par MonEditBoundaryAn // QDialog(0), Ui_CreateBoundaryAn(), - myHomardGen(myHomardGen), + myHomardGen(myHomardGen0), _parent(parent), _aName (""), _aCaseName(caseName), diff --git a/src/HOMARDGUI/MonCreateBoundaryDi.cxx b/src/HOMARDGUI/MonCreateBoundaryDi.cxx index 7ba67548..0a40cd2b 100644 --- a/src/HOMARDGUI/MonCreateBoundaryDi.cxx +++ b/src/HOMARDGUI/MonCreateBoundaryDi.cxx @@ -33,14 +33,14 @@ using namespace std; // ------------------------------------------------------------------------------- MonCreateBoundaryDi::MonCreateBoundaryDi(MonCreateCase* parent, bool modal, - HOMARD::HOMARD_Gen_var myHomardGen, + HOMARD::HOMARD_Gen_var myHomardGen0, QString caseName, QString aName) // --------------------------------------------------------------------------------- /* Constructs a MonCreateBoundaryDi */ : QDialog(0), Ui_CreateBoundaryDi(), _parent(parent), _aName(aName), - myHomardGen(HOMARD::HOMARD_Gen::_duplicate(myHomardGen)), + myHomardGen(HOMARD::HOMARD_Gen::_duplicate(myHomardGen0)), _aCaseName(caseName) { MESSAGE("Constructeur") ; diff --git a/src/HOMARDGUI/MonCreateCase.cxx b/src/HOMARDGUI/MonCreateCase.cxx index af10a230..7a71d11e 100644 --- a/src/HOMARDGUI/MonCreateCase.cxx +++ b/src/HOMARDGUI/MonCreateCase.cxx @@ -40,7 +40,7 @@ using namespace std; * Sets attributes to default values */ // ----------------------------------------------------------------------------------------- -MonCreateCase::MonCreateCase(QWidget* parent, bool modal, HOMARD::HOMARD_Gen_var myHomardGen) +MonCreateCase::MonCreateCase( bool modal, HOMARD::HOMARD_Gen_var myHomardGen0) : Ui_CreateCase(), _aCaseName(""),_aDirName(""), @@ -48,7 +48,7 @@ MonCreateCase::MonCreateCase(QWidget* parent, bool modal, HOMARD::HOMARD_Gen_var _Pyram(0) { MESSAGE("Debut du constructeur de MonCreateCase"); - myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen); + myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0); setupUi(this); setModal(modal); InitConnect(); diff --git a/src/HOMARDGUI/MonCreateCase.h b/src/HOMARDGUI/MonCreateCase.h index 00fa925f..6fbbfb01 100644 --- a/src/HOMARDGUI/MonCreateCase.h +++ b/src/HOMARDGUI/MonCreateCase.h @@ -35,7 +35,7 @@ class MonCreateCase : public QDialog, public Ui_CreateCase Q_OBJECT public: - MonCreateCase( QWidget* parent, bool modal, HOMARD::HOMARD_Gen_var myHomardGen); + MonCreateCase( bool modal, HOMARD::HOMARD_Gen_var myHomardGen); ~MonCreateCase(); void AddBoundaryAn(QString newBoundary); diff --git a/src/HOMARDGUI/MonCreateHypothesis.cxx b/src/HOMARDGUI/MonCreateHypothesis.cxx index a29acebf..a754df6a 100644 --- a/src/HOMARDGUI/MonCreateHypothesis.cxx +++ b/src/HOMARDGUI/MonCreateHypothesis.cxx @@ -35,7 +35,7 @@ using namespace std; // ------------------------------------------------------------------------------- MonCreateHypothesis::MonCreateHypothesis(MonCreateIteration* parent, bool modal, - HOMARD::HOMARD_Gen_var myHomardGen, + HOMARD::HOMARD_Gen_var myHomardGen0, QString Name, QString caseName, QString aFieldFile) // --------------------------------------------------------------------------------- @@ -56,7 +56,7 @@ MonCreateHypothesis::MonCreateHypothesis(MonCreateIteration* parent, bool modal, { MESSAGE("Constructeur") ; - myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen); + myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0); setupUi(this); setModal(modal); InitConnect(); diff --git a/src/HOMARDGUI/MonCreateIteration.cxx b/src/HOMARDGUI/MonCreateIteration.cxx index 5325bf05..ba7ece29 100644 --- a/src/HOMARDGUI/MonCreateIteration.cxx +++ b/src/HOMARDGUI/MonCreateIteration.cxx @@ -33,7 +33,7 @@ using namespace std; // ----------------------------------------------------------------------------------------------------- MonCreateIteration::MonCreateIteration(QWidget* parent, bool modal, - HOMARD::HOMARD_Gen_var myHomardGen, QString IterParentName ): + HOMARD::HOMARD_Gen_var myHomardGen0, QString IterParentName ): // ----------------------------------------------------------------------------------------------------- /* Constructs a MonCreateIteration * Inherits from CasHomard @@ -46,7 +46,7 @@ MonCreateIteration::MonCreateIteration(QWidget* parent, bool modal, _CaseName("") { MESSAGE("Constructeur"); - myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen); + myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0); setupUi(this); setModal(modal); InitConnect(); diff --git a/src/HOMARDGUI/MonCreateListGroup.cxx b/src/HOMARDGUI/MonCreateListGroup.cxx index 75e86992..7bd45e56 100644 --- a/src/HOMARDGUI/MonCreateListGroup.cxx +++ b/src/HOMARDGUI/MonCreateListGroup.cxx @@ -38,7 +38,7 @@ using namespace std; // -------------------------------------------------------------------------------------------------------------- MonCreateListGroup::MonCreateListGroup(MonCreateHypothesis* parentHyp, MonCreateBoundaryDi* parentBound, bool modal, - HOMARD::HOMARD_Gen_var myHomardGen, QString aCaseName, QStringList listeGroupesHypo) : + HOMARD::HOMARD_Gen_var myHomardGen0, QString aCaseName, QStringList listeGroupesHypo) : // -------------------------------------------------------------------------------------------------------------- // QDialog(0), Ui_CreateListGroup(), @@ -48,7 +48,7 @@ MonCreateListGroup::MonCreateListGroup(MonCreateHypothesis* parentHyp, MonCreate _parentBound(parentBound) { MESSAGE("Debut de MonCreateListGroup") - myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen); + myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0); setupUi(this); setModal(modal); InitConnect(); diff --git a/src/HOMARDGUI/MonCreateYACS.cxx b/src/HOMARDGUI/MonCreateYACS.cxx index 3c94b5c0..74538e81 100644 --- a/src/HOMARDGUI/MonCreateYACS.cxx +++ b/src/HOMARDGUI/MonCreateYACS.cxx @@ -30,12 +30,12 @@ using namespace std; #include -// ----------------------------------------------------------------------------------------- +// ---------------------------------------------------------------------- /* Constructs a MonCreateYACS * Sets attributes to default values */ -// ----------------------------------------------------------------------------------------- -MonCreateYACS::MonCreateYACS (QWidget* parent, bool modal, HOMARD::HOMARD_Gen_var myHomardGen, QString CaseName ) +// ---------------------------------------------------------------------- +MonCreateYACS::MonCreateYACS (QWidget* parent, bool modal, HOMARD::HOMARD_Gen_var myHomardGen0, QString CaseName ) : Ui_CreateYACS(), _aCaseName(CaseName), @@ -44,7 +44,7 @@ MonCreateYACS::MonCreateYACS (QWidget* parent, bool modal, HOMARD::HOMARD_Gen_va _aMeshFile("") { MESSAGE("Debut du constructeur de MonCreateYACS"); - myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen); + myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0); setupUi(this); setModal(modal); @@ -61,6 +61,24 @@ MonCreateYACS::MonCreateYACS (QWidget* parent, bool modal, HOMARD::HOMARD_Gen_va MESSAGE("Fin du constructeur de MonCreateYACS"); } +// ---------------------------------------------------------------------- +MonCreateYACS::MonCreateYACS(QWidget* parent, + HOMARD::HOMARD_Gen_var myHomardGen0, + QString caseName): +// ---------------------------------------------------------------------- +// Constructeur appele par MonEditYACS +// + myHomardGen(myHomardGen0), + _Name (""), + Chgt (false) + { + // MESSAGE("Debut de MonCreateYACS") + setupUi(this) ; + + setModal(true) ; + InitConnect() ; + } + // ------------------------------------------------------------------------ MonCreateYACS::~MonCreateYACS() // ------------------------------------------------------------------------ diff --git a/src/HOMARDGUI/MonCreateYACS.h b/src/HOMARDGUI/MonCreateYACS.h index c7cf5bdd..39043f20 100644 --- a/src/HOMARDGUI/MonCreateYACS.h +++ b/src/HOMARDGUI/MonCreateYACS.h @@ -39,6 +39,8 @@ class MonCreateYACS : public QDialog, public Ui_CreateYACS virtual ~MonCreateYACS(); protected : + MonCreateYACS( QWidget* parent, HOMARD::HOMARD_Gen_var myHomardGen, QString CaseName); + QString _Name; QString _aCaseName; QString _aScriptFile; @@ -47,6 +49,8 @@ class MonCreateYACS : public QDialog, public Ui_CreateYACS int _Type; + bool Chgt; + HOMARD::HOMARD_YACS_var aYACS; HOMARD::HOMARD_Cas_var aCase ; HOMARD::HOMARD_Gen_var myHomardGen; diff --git a/src/HOMARDGUI/MonCreateZone.cxx b/src/HOMARDGUI/MonCreateZone.cxx index c279af1e..7a01d9c7 100644 --- a/src/HOMARDGUI/MonCreateZone.cxx +++ b/src/HOMARDGUI/MonCreateZone.cxx @@ -36,11 +36,11 @@ using namespace std; #include #include -// ------------------------------------------------------------------------------------------------------------------------ +// ---------------------------------------------------------------------- MonCreateZone::MonCreateZone(MonCreateHypothesis* parent, bool modal, - HOMARD::HOMARD_Gen_var myHomardGen, + HOMARD::HOMARD_Gen_var myHomardGen0, QString caseName) : -// ------------------------------------------------------------------------------------------------------------------------------ +// ---------------------------------------------------------------------- /* Constructs a MonCreateZone appele pour une vraie creation initialise une boite et non une sphere @@ -61,7 +61,7 @@ MonCreateZone::MonCreateZone(MonCreateHypothesis* parent, bool modal, Chgt (false) { MESSAGE("Constructeur") ; - myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen) ; + myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0) ; setupUi(this) ; setModal(modal) ; InitConnect( ) ; @@ -72,15 +72,15 @@ MonCreateZone::MonCreateZone(MonCreateHypothesis* parent, bool modal, SetBox() ; // Propose une boite en premier choix } -// -------------------------------------------------------------------------------------------------------------- +// ---------------------------------------------------------------------- MonCreateZone::MonCreateZone(MonCreateHypothesis* parent, - HOMARD::HOMARD_Gen_var myHomardGen, + HOMARD::HOMARD_Gen_var myHomardGen0, QString caseName): -// -------------------------------------------------------------------------------------------------------------- +// ---------------------------------------------------------------------- // Constructeur appele par MonEditZone // QDialog(0), Ui_CreateZone(), - myHomardGen(myHomardGen), + myHomardGen(myHomardGen0), _parent(parent), _Name (""), _aCaseName(caseName), diff --git a/src/HOMARDGUI/MonCreateZone.h b/src/HOMARDGUI/MonCreateZone.h index a7c4f49d..0d0419cf 100644 --- a/src/HOMARDGUI/MonCreateZone.h +++ b/src/HOMARDGUI/MonCreateZone.h @@ -61,7 +61,6 @@ protected : double _ZoneXaxis, _ZoneYaxis, _ZoneZaxis, _ZoneRayonInt, _ZoneHaut ; double _DMax ; - bool Chgt; HOMARD::HOMARD_Zone_var aZone ; diff --git a/src/HOMARDGUI/MonEditCase.cxx b/src/HOMARDGUI/MonEditCase.cxx index 7017bbf7..46de00a9 100644 --- a/src/HOMARDGUI/MonEditCase.cxx +++ b/src/HOMARDGUI/MonEditCase.cxx @@ -32,10 +32,10 @@ using namespace std; herite de MonCreateCase */ // ------------------------------------------------------------- -MonEditCase::MonEditCase ( QWidget* parent, bool modal, +MonEditCase::MonEditCase ( bool modal, HOMARD::HOMARD_Gen_var myHomardGen, QString CaseName ): - MonCreateCase(parent, modal, myHomardGen) + MonCreateCase(modal, myHomardGen) { MESSAGE("Debut de MonEditCase" << CaseName.toStdString().c_str()); setWindowTitle(QObject::tr("HOM_CASE_EDIT_WINDOW_TITLE")); diff --git a/src/HOMARDGUI/MonEditCase.h b/src/HOMARDGUI/MonEditCase.h index 2e7692ff..2fcd0baf 100644 --- a/src/HOMARDGUI/MonEditCase.h +++ b/src/HOMARDGUI/MonEditCase.h @@ -32,7 +32,7 @@ class MonEditCase : public MonCreateCase { Q_OBJECT public: - MonEditCase( QWidget* parent, bool modal, + MonEditCase( bool modal, HOMARD::HOMARD_Gen_var myHomardGen, QString Name ); virtual ~MonEditCase(); diff --git a/src/HOMARDGUI/MonEditYACS.cxx b/src/HOMARDGUI/MonEditYACS.cxx new file mode 100644 index 00000000..9986a305 --- /dev/null +++ b/src/HOMARDGUI/MonEditYACS.cxx @@ -0,0 +1,93 @@ +// Copyright (C) 2011-2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +using namespace std; + +#include "MonEditYACS.h" + +#include "SalomeApp_Tools.h" +#include "HOMARDGUI_Utils.h" +#include "HomardQtCommun.h" +#include + + +// ------------------------------------------------------------- +/* Constructs a MonEditYACS + herite de MonCreateYACS +*/ +// ------------------------------------------------------------- +MonEditYACS::MonEditYACS ( QWidget* parent, bool modal, + HOMARD::HOMARD_Gen_var myHomardGen, + QString Name ): + MonCreateYACS(parent, modal, myHomardGen, Name) +{ + MESSAGE("Debut de MonEditYACS" << Name.toStdString().c_str()); + setWindowTitle(QObject::tr("HOM_YACS_EDIT_WINDOW_TITLE")); + _Name = Name; + aYACS = myHomardGen->GetYACS(_Name.toStdString().c_str()); + InitValEdit(); +} +// ------------------------------ +MonEditYACS::~MonEditYACS() +// ------------------------------ +{ +} +// ------------------------------ +void MonEditYACS::InitValEdit() +// ------------------------------ +{ + MESSAGE("InitValEdit"); + LEName->setText(_Name); + LEName->setReadOnly(true); + + QString aCaseName = aYACS->GetCaseName(); + LECaseName->setText(aCaseName); + LECaseName->setReadOnly(true); + PushDir->setVisible(0); + + QString aScriptFile = aYACS->GetScriptFile(); + LEScriptFile->setText(aScriptFile); + LEScriptFile->setReadOnly(true); + PushDir->setVisible(0); + + QString aDirName = aYACS->GetDirName(); + LEDirName->setText(aDirName); + LEDirName->setReadOnly(true); + PushDir->setVisible(0); + + QString aMeshFile = aYACS->GetMeshFile(); + LEMeshFile->setText(aMeshFile); + LEMeshFile->setReadOnly(true); + PushDir->setVisible(0); + + int Type=aYACS->GetType(); + if(Type==1) { RBStatic->setChecked(true); } + else { RBTransient->setChecked(true); }; + RBStatic->setEnabled(false); + RBTransient->setEnabled(false); +// + adjustSize(); +} + +// ------------------------------------- +bool MonEditYACS::PushOnApply() +// ------------------------------------- +{ + return true ; +}; diff --git a/src/HOMARDGUI/MonEditYACS.h b/src/HOMARDGUI/MonEditYACS.h new file mode 100644 index 00000000..232e4965 --- /dev/null +++ b/src/HOMARDGUI/MonEditYACS.h @@ -0,0 +1,48 @@ +// Copyright (C) 2011-2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef MON_EDITYACS_H +#define MON_EDITYACS_H + +#include +#include + +#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) +#include CORBA_CLIENT_HEADER(HOMARD_Gen) + +#include + +class MonEditYACS : public MonCreateYACS +{ + Q_OBJECT +public: + MonEditYACS( QWidget* parent, bool modal, + HOMARD::HOMARD_Gen_var myHomardGen, + QString Name ); + virtual ~MonEditYACS(); + +protected : + virtual void InitValEdit(); + virtual bool PushOnApply(); + +public slots: + +}; + +#endif diff --git a/src/HOMARDGUI/MonIterInfo.cxx b/src/HOMARDGUI/MonIterInfo.cxx index 2f0a3e90..7442bd5a 100644 --- a/src/HOMARDGUI/MonIterInfo.cxx +++ b/src/HOMARDGUI/MonIterInfo.cxx @@ -34,7 +34,7 @@ using namespace std; // ----------------------------------------------------------------------------------------- -MonIterInfo::MonIterInfo(QWidget* parent, bool modal, HOMARD::HOMARD_Gen_var myHomardGen, QString IterName) +MonIterInfo::MonIterInfo(QWidget* parent, bool modal, HOMARD::HOMARD_Gen_var myHomardGen0, QString IterName) // ----------------------------------------------------------------------------------------- /* Constructs a MonIterInfo * Inherits from CasHomard @@ -52,7 +52,7 @@ MonIterInfo::MonIterInfo(QWidget* parent, bool modal, HOMARD::HOMARD_Gen_var myH _Option(-1) { MESSAGE("appel de _duplicate"); - myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen); + myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0); setupUi(this); setModal(modal); InitConnect(); diff --git a/src/HOMARDGUI/MonMeshInfo.cxx b/src/HOMARDGUI/MonMeshInfo.cxx index 7d136774..a1af7d20 100644 --- a/src/HOMARDGUI/MonMeshInfo.cxx +++ b/src/HOMARDGUI/MonMeshInfo.cxx @@ -32,7 +32,7 @@ using namespace std; // ----------------------------------------------------------------------------------------- -MonMeshInfo::MonMeshInfo(QWidget* parent, bool modal, HOMARD::HOMARD_Gen_var myHomardGen) +MonMeshInfo::MonMeshInfo(QWidget* parent, bool modal, HOMARD::HOMARD_Gen_var myHomardGen0) // ----------------------------------------------------------------------------------------- /* Constructs a MonMeshInfo * Inherits from CasHomard @@ -47,7 +47,7 @@ MonMeshInfo::MonMeshInfo(QWidget* parent, bool modal, HOMARD::HOMARD_Gen_var myH _Entanglement(0), _Quality(0) { - myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen); + myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0); setupUi(this); setModal(modal); InitConnect(); diff --git a/src/HOMARD_I/HOMARD_Gen_i.cxx b/src/HOMARD_I/HOMARD_Gen_i.cxx index 39673c01..5629b019 100755 --- a/src/HOMARD_I/HOMARD_Gen_i.cxx +++ b/src/HOMARD_I/HOMARD_Gen_i.cxx @@ -91,6 +91,12 @@ Engines_Component_i(orb, poa, contId, instanceName, interfaceName) _NS = SINGLETON_::Instance(); ASSERT(SINGLETON_::IsAlreadyExisting()); _NS->init_orb(_orb); + + _tag_gene = 0 ; + _tag_boun = 0 ; + _tag_hypo = 0 ; + _tag_yacs = 0 ; + _tag_zone = 0 ; } //================================= /*! @@ -3038,7 +3044,6 @@ SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishBoundaryInStudy(SALOMEDS::Study_ptr t { MESSAGE("PublishBoundaryStudy pour "<NewObjectToTag(theFatherHomard, 101); + aSObject = aStudyBuilder->NewObjectToTag(theFatherHomard, _tag_boun); PublishInStudyAttr(aStudyBuilder, aSObject, "Boundaries", "BoundList", "zone_icone_2.png", NULL ) ; } else { MESSAGE("La categorie des boundarys existe deja."); } @@ -3104,7 +3115,6 @@ SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishCaseInStudy(SALOMEDS::Study_ptr theSt { MESSAGE("PublishCaseInStudy pour "<_is_nil()"); @@ -3115,6 +3125,7 @@ SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishCaseInStudy(SALOMEDS::Study_ptr theSt return aResultSO._retn(); } + // On recupere le module pere dans l etude SALOMEDS::SComponent_var theFatherHomard = theStudy->FindComponent(ComponentDataType()); if (theFatherHomard->_is_nil()) { @@ -3122,9 +3133,12 @@ SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishCaseInStudy(SALOMEDS::Study_ptr theSt return aResultSO._retn(); } + _tag_gene += 1 ; + MESSAGE("PublishCaseInStudy _tag_gene = "<<_tag_gene ); aResultSO = aStudyBuilder->NewObject(theFatherHomard); PublishInStudyAttr(aStudyBuilder, aResultSO, theName, "CasHomard", "cas_calcule.png", _orb->object_to_string(theObject) ) ; + return aResultSO._retn(); } //============================================================================= @@ -3134,7 +3148,6 @@ SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishHypotheseInStudy(SALOMEDS::Study_ptr { MESSAGE("PublishHypotheseInStudy pour "<_is_nil()"); return aResultSO._retn(); } + + // On ajoute la categorie des hypotheses dans l etude si necessaire SALOMEDS::SObject_var aSObject; - if (!theFatherHomard->FindSubObject(0, aSObject)) + if ( _tag_hypo == 0 ) + { + _tag_gene += 1 ; + _tag_hypo = _tag_gene ; + } + MESSAGE("PublishHypotheseInStudy _tag_gene = "<<_tag_gene << ", _tag_hypo = "<<_tag_hypo ); + if (!theFatherHomard->FindSubObject(_tag_hypo, aSObject)) { MESSAGE("Ajout de la categorie des hypotheses"); - aSObject = aStudyBuilder->NewObjectToTag(theFatherHomard, 0); + aSObject = aStudyBuilder->NewObjectToTag(theFatherHomard, _tag_hypo); PublishInStudyAttr(aStudyBuilder, aSObject, "Hypothesis", "HypoList", "hypotheses.png", NULL); } else { MESSAGE("La categorie des hypotheses existe deja."); } @@ -3166,7 +3187,6 @@ SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishYACSInStudy(SALOMEDS::Study_ptr theSt { MESSAGE("PublishYACSInStudy pour "<_is_nil()"); return aResultSO._retn(); } + // On ajoute la categorie des schemas YACS dans l etude si necessaire + if ( _tag_yacs == 0 ) + { + _tag_gene += 1 ; + _tag_yacs = _tag_gene ; + } + MESSAGE("PublishZoneStudy _tag_gene = "<<_tag_gene << ", _tag_yacs = "<<_tag_yacs ); SALOMEDS::SObject_var aSObject; - if (!theFatherHomard->FindSubObject(102, aSObject)) + if (!theFatherHomard->FindSubObject(_tag_yacs, aSObject)) { MESSAGE("Ajout de la categorie des schemas YACS"); - aSObject = aStudyBuilder->NewObjectToTag(theFatherHomard, 102); + aSObject = aStudyBuilder->NewObjectToTag(theFatherHomard, _tag_yacs); PublishInStudyAttr(aStudyBuilder, aSObject, "YACS", "YACSList", "full_view.png", NULL); } else { MESSAGE("La categorie des schemas YACS existe deja."); } @@ -3199,8 +3226,6 @@ SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishZoneInStudy(SALOMEDS::Study_ptr theSt { MESSAGE("PublishZoneStudy pour "<_is_nil()"); @@ -3223,11 +3248,17 @@ SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishZoneInStudy(SALOMEDS::Study_ptr theSt CORBA::Long ZoneType = myZone->GetType(); // On ajoute la categorie des zones dans l etude si necessaire + if ( _tag_zone == 0 ) + { + _tag_gene += 1 ; + _tag_zone = _tag_gene ; + } + MESSAGE("PublishZoneStudy _tag_gene = "<<_tag_gene << ", _tag_zone = "<<_tag_zone ); SALOMEDS::SObject_var aSObject; - if (!theFatherHomard->FindSubObject(100, aSObject)) + if (!theFatherHomard->FindSubObject(_tag_zone, aSObject)) { MESSAGE("Ajout de la categorie des zones"); - aSObject = aStudyBuilder->NewObjectToTag(theFatherHomard, 100); + aSObject = aStudyBuilder->NewObjectToTag(theFatherHomard, _tag_zone); PublishInStudyAttr(aStudyBuilder, aSObject, "Zones", "ZoneList", "zone_icone_2.png", NULL ) ; } else { MESSAGE("La categorie des zones existe deja."); } @@ -3277,6 +3308,7 @@ SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishZoneInStudy(SALOMEDS::Study_ptr theSt break ; } } + MESSAGE("Appel de PublishInStudyAttr pour name = "<object_to_string(theObject) ) ; return aResultSO._retn(); diff --git a/src/HOMARD_I/HOMARD_Gen_i.hxx b/src/HOMARD_I/HOMARD_Gen_i.hxx index 3eff7e8b..1af594b5 100644 --- a/src/HOMARD_I/HOMARD_Gen_i.hxx +++ b/src/HOMARD_I/HOMARD_Gen_i.hxx @@ -304,6 +304,12 @@ private: ContextMap myContextMap; SALOME_NamingService* _NS; + int _tag_gene ; + int _tag_boun ; + int _tag_hypo ; + int _tag_yacs ; + int _tag_zone ; + }; #endif diff --git a/src/HOMARD_I/HOMARD_YACS_i.cxx b/src/HOMARD_I/HOMARD_YACS_i.cxx new file mode 100644 index 00000000..b5928a7a --- /dev/null +++ b/src/HOMARD_I/HOMARD_YACS_i.cxx @@ -0,0 +1,209 @@ +// Copyright (C) 2011-2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier +// + +#include "HOMARD_YACS_i.hxx" +#include "HOMARD_Gen_i.hxx" +#include "HOMARD_YACS.hxx" +#include "HOMARD_DriverTools.hxx" + +#include "SALOMEDS_Tool.hxx" + +#include "utilities.h" + +//============================================================================= +/*! + * standard constructor + */ +//============================================================================= +HOMARD_YACS_i::HOMARD_YACS_i() +{ + MESSAGE( "Default constructor, not for use" ); + ASSERT( 0 ); +} +//============================================================================= +/*! + * standard constructor + */ +//============================================================================= +HOMARD_YACS_i::HOMARD_YACS_i( CORBA::ORB_ptr orb, + HOMARD::HOMARD_Gen_var engine ) +{ + MESSAGE("constructor"); + _gen_i = engine; + _orb = orb; + myHomardYACS = new ::HOMARD_YACS(); + ASSERT( myHomardYACS ); +} +//============================================================================= +/*! + * standard destructor + */ +//============================================================================= +HOMARD_YACS_i::~HOMARD_YACS_i() +{ +} +//============================================================================= +//============================================================================= +// Generalites +//============================================================================= +//============================================================================= +void HOMARD_YACS_i::SetName( const char* Name ) +{ + ASSERT( myHomardYACS ); + myHomardYACS->SetName( Name ); +} +//============================================================================= +char* HOMARD_YACS_i::GetName() +{ + ASSERT( myHomardYACS ); + return CORBA::string_dup( myHomardYACS->GetName().c_str() ); +} +//============================================================================= +CORBA::Long HOMARD_YACS_i::Delete( CORBA::Long Option ) +{ + ASSERT( myHomardYACS ); + char* YACSName = GetName() ; + MESSAGE ( "Delete : destruction du schema " << YACSName << ", Option = " << Option ); + return _gen_i->DeleteYACS(YACSName, Option) ; +} +//============================================================================= +char* HOMARD_YACS_i::GetDumpPython() +{ + ASSERT( myHomardYACS ); + return CORBA::string_dup( myHomardYACS->GetDumpPython().c_str() ); +} +//============================================================================= +std::string HOMARD_YACS_i::Dump() const +{ + return HOMARD::Dump( *myHomardYACS ); +} +//============================================================================= +bool HOMARD_YACS_i::Restore( const std::string& stream ) +{ + return HOMARD::Restore( *myHomardYACS, stream ); +} +//============================================================================= +//============================================================================= +// Caracteristiques +//============================================================================= +//============================================================================= +void HOMARD_YACS_i::SetType( CORBA::Long Type ) +{ + ASSERT( myHomardYACS ); + myHomardYACS->SetType( Type ); +} +//============================================================================= +CORBA::Long HOMARD_YACS_i::GetType() +{ + ASSERT( myHomardYACS ); + return CORBA::Long( myHomardYACS->GetType() ); +} +void HOMARD_YACS_i::SetDirName( const char* NomDir ) +{ + ASSERT( myHomardYACS ); + myHomardYACS->SetDirName( NomDir ); +} +//============================================================================= +char* HOMARD_YACS_i::GetDirName() +{ + ASSERT( myHomardYACS ); + return CORBA::string_dup( myHomardYACS->GetDirName().c_str() ); +} +//============================================================================= +void HOMARD_YACS_i::SetMeshFile( const char* MeshFile ) +{ + ASSERT( myHomardYACS ); + myHomardYACS->SetMeshFile( MeshFile ); +} +//============================================================================= +char* HOMARD_YACS_i::GetMeshFile() +{ + ASSERT( myHomardYACS ); + return CORBA::string_dup( myHomardYACS->GetMeshFile().c_str() ); +} +//============================================================================= +void HOMARD_YACS_i::SetScriptFile( const char* ScriptFile ) +{ + ASSERT( myHomardYACS ); + myHomardYACS->SetScriptFile( ScriptFile ); +} +//============================================================================= +char* HOMARD_YACS_i::GetScriptFile() +{ + ASSERT( myHomardYACS ); + return CORBA::string_dup( myHomardYACS->GetScriptFile().c_str() ); +} +//============================================================================= +//============================================================================= +// Liens avec les autres structures +//============================================================================= +//============================================================================= +void HOMARD_YACS_i::SetCaseName( const char* NomCas ) +{ + ASSERT( myHomardYACS ); + myHomardYACS->SetCaseName( NomCas ); +} +//============================================================================= +char* HOMARD_YACS_i::GetCaseName() +{ + ASSERT( myHomardYACS ); + return CORBA::string_dup( myHomardYACS->GetCaseName().c_str() ); +} +//============================================================================= +CORBA::Long HOMARD_YACS_i::Write() +{ + MESSAGE ( "Write : ecriture du schema"); + ASSERT( myHomardYACS ); +// +// Le repertoire du cas + std::string casename = GetCaseName() ; + HOMARD::HOMARD_Cas_ptr caseyacs = _gen_i->GetCase(casename.c_str()) ; + std::string dirnamecase = caseyacs->GetDirName() ; +// Le nom par defaut du fichier du schema + std::string YACSFile ; + YACSFile = dirnamecase + "/schema.xml" ; +// + return WriteOnFile(YACSFile.c_str()) ; +} +//============================================================================= +CORBA::Long HOMARD_YACS_i::WriteOnFile( const char* YACSFile ) +{ + MESSAGE ( "WriteOnFile : ecriture du schema sur " << YACSFile ); + ASSERT( myHomardYACS ); +// +// Nom du schema + char* nomYACS = GetName() ; + MESSAGE ( "WriteOnFile : ecriture du schema " << nomYACS); + return _gen_i->YACSWriteOnFile(nomYACS, YACSFile) ; +} +//============================================================================= +//============================================================================= +//============================================================================= +// Divers +//============================================================================= +//============================================================================= diff --git a/src/HOMARD_I/HOMARD_YACS_i.hxx b/src/HOMARD_I/HOMARD_YACS_i.hxx new file mode 100644 index 00000000..4a26544a --- /dev/null +++ b/src/HOMARD_I/HOMARD_YACS_i.hxx @@ -0,0 +1,97 @@ +// Copyright (C) 2011-2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier +// + +#ifndef _HOMARD_YACS_I_HXX_ +#define _HOMARD_YACS_I_HXX_ + +#include +#include CORBA_SERVER_HEADER(HOMARD_Gen) +#include CORBA_SERVER_HEADER(HOMARD_YACS) + +#include "SALOME_Component_i.hxx" +#include "SALOME_NamingService.hxx" +#include "Utils_CorbaException.hxx" + +#include + +class HOMARD_YACS; + +class HOMARD_YACS_i: + public virtual Engines_Component_i, + public virtual POA_HOMARD::HOMARD_YACS, + public virtual PortableServer::ServantBase +{ +public: + HOMARD_YACS_i( CORBA::ORB_ptr orb, + HOMARD::HOMARD_Gen_var gen_i ); + HOMARD_YACS_i(); + + virtual ~HOMARD_YACS_i(); + +// Generalites + void SetName( const char* Name ); + char* GetName(); + + CORBA::Long Delete( CORBA::Long Option ); + + char* GetDumpPython(); + + std::string Dump() const; + bool Restore( const std::string& stream ); + +// Caracteristiques + void SetType( CORBA::Long Type ); + CORBA::Long GetType(); + + void SetDirName( const char* NomDir ); + char* GetDirName(); + + void SetMeshFile( const char* MeshFile ); + char* GetMeshFile(); + + void SetScriptFile( const char* ScriptFile ); + char* GetScriptFile(); + + + CORBA::Long Write() ; + CORBA::Long WriteOnFile( const char* YACSFile ) ; + + // Liens avec les autres structures + void SetCaseName( const char* NomCas ); + char* GetCaseName(); + +// Divers + +private: + ::HOMARD_YACS* myHomardYACS; + + CORBA::ORB_ptr _orb; + HOMARD::HOMARD_Gen_var _gen_i; +}; + +#endif diff --git a/tests/test_1.py b/tests/test_1.py index 08307af0..3d9f9d84 100644 --- a/tests/test_1.py +++ b/tests/test_1.py @@ -22,7 +22,7 @@ Python script for HOMARD Copyright EDF-R&D 2010, 2013 Test test_1 """ -__revision__ = "V1.9" +__revision__ = "V1.10" #======================================================================== Test_Name = "test_1" @@ -77,11 +77,11 @@ Copyright EDF-R&D 2010, 2013 # # Creation of the zones # ===================== - # Creation of the box Zone_1 - Zone_1 = homard.CreateZoneBox('Zone_1', -0.01, 1.01, -0.01, 0.4, -0.01, 0.6) + # Creation of the box Zone_1_1 + Zone_1_1 = homard.CreateZoneBox('Zone_1_1', -0.01, 1.01, -0.01, 0.4, -0.01, 0.6) - # Creation of the sphere Zone_2 - Zone_2 = homard.CreateZoneSphere('Zone_2', 0.5, 0.6, 0.7, 0.75) + # Creation of the sphere Zone_1_2 + Zone_1_2 = homard.CreateZoneSphere('Zone_1_2', 0.5, 0.6, 0.7, 0.75) # # Creation of the hypotheses # ========================== @@ -98,48 +98,48 @@ Copyright EDF-R&D 2010, 2013 # Creation of the hypothesis Zones_1_et_2 Zones_1_et_2 = homard.CreateHypothesis('Zones_1_et_2') Zones_1_et_2.SetAdapRefinUnRef(0, 1, 0) - Zones_1_et_2.AddZone('Zone_1', 1) - Zones_1_et_2.AddZone('Zone_2', 1) + Zones_1_et_2.AddZone('Zone_1_1', 1) + Zones_1_et_2.AddZone('Zone_1_2', 1) # # Creation of the cases # ===================== - # Creation of the case zzzz121b - Case_1 = homard.CreateCase('zzzz121b', 'MAILL', os.path.join(Rep_Test, Test_Name + '.00.med')) + # Creation of the case Case_1 + Case_1 = homard.CreateCase('Case_1', 'MAILL', os.path.join(Rep_Test, Test_Name + '.00.med')) Case_1.SetDirName(Rep_Test_Resu) Case_1.SetConfType(1) # # Creation of the iterations # ========================== - # Creation of the iteration I1 - I1 = Case_1.NextIteration('I1') - I1.SetMeshName('M1') - I1.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.01.med')) - I1.SetFieldFile(os.path.join(Rep_Test, Test_Name + '.00.med')) - I1.SetTimeStepRank(1, 1) - I1.AssociateHypo('a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM') - error = I1.Compute(1, 1) + # Creation of the iteration I1_1 + I1_1 = Case_1.NextIteration('I1_1') + I1_1.SetMeshName('M1') + I1_1.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.01.med')) + I1_1.SetFieldFile(os.path.join(Rep_Test, Test_Name + '.00.med')) + I1_1.SetTimeStepRank(1, 1) + I1_1.AssociateHypo('a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM') + error = I1_1.Compute(1, 1) if error : error = 1 break - # Creation of the iteration I2 - I2 = I1.NextIteration('I2') - I2.SetMeshName('M2') - I2.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.02.med')) - I2.SetFieldFile(os.path.join(Rep_Test, Test_Name + '.01.med')) - I2.SetTimeStepRank(1, 1) - I2.AssociateHypo('a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM') - error = I2.Compute(1, 1) + # Creation of the iteration I1_2 + I1_2 = I1_1.NextIteration('I1_2') + I1_2.SetMeshName('M2') + I1_2.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.02.med')) + I1_2.SetFieldFile(os.path.join(Rep_Test, Test_Name + '.01.med')) + I1_2.SetTimeStepRank(1, 1) + I1_2.AssociateHypo('a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM') + error = I1_2.Compute(1, 1) if error : error = 2 break - # Creation of the iteration I3 - I3 = I2.NextIteration('I3') - I3.SetMeshName('M3') - I3.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.03.med')) - I3.AssociateHypo('Zones_1_et_2') - error = I3.Compute(1, 1) + # Creation of the iteration I1_3 + I1_3 = I1_2.NextIteration('I1_3') + I1_3.SetMeshName('M3') + I1_3.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.03.med')) + I1_3.AssociateHypo('Zones_1_et_2') + error = I1_3.Compute(1, 1) if error : error = 3 break diff --git a/tests/test_2.py b/tests/test_2.py index 20fc41ab..82c7ac8a 100644 --- a/tests/test_2.py +++ b/tests/test_2.py @@ -22,7 +22,7 @@ Python script for HOMARD Copyright EDF-R&D 2010, 2013 Test test_2 """ -__revision__ = "V1.8" +__revision__ = "V1.9" #======================================================================== Test_Name = "test_2" @@ -82,53 +82,53 @@ Copyright EDF-R&D 2010, 2013 # # Creation of the hypotheses # ========================== - # Creation of the hypothesis Hypo_1 - Hypo_1 = homard.CreateHypothesis('Hypo_1') - Hypo_1.SetAdapRefinUnRef(-1, 1, 0) - Hypo_1.AddGroup('EG') - Hypo_1.AddGroup('BANDE') + # Creation of the hypothesis Hypo_2_1 + Hypo_2_1 = homard.CreateHypothesis('Hypo_2_1') + Hypo_2_1.SetAdapRefinUnRef(-1, 1, 0) + Hypo_2_1.AddGroup('EG') + Hypo_2_1.AddGroup('BANDE') - # Creation of the hypothesis Hypo_2 - Hypo_2 = homard.CreateHypothesis('Hypo_2') - Hypo_2.SetAdapRefinUnRef(-1, 1, 0) - Hypo_2.AddGroup('M_D') + # Creation of the hypothesis Hypo_2_2 + Hypo_2_2 = homard.CreateHypothesis('Hypo_2_2') + Hypo_2_2.SetAdapRefinUnRef(-1, 1, 0) + Hypo_2_2.AddGroup('M_D') # # Creation of the cases # ===================== - # Creation of the case Case_1 - Case_1 = homard.CreateCase('Case_1', 'PLAQUE_0', os.path.join(Rep_Test, Test_Name + '.00.med')) - Case_1.SetDirName(Rep_Test_Resu) - Case_1.SetConfType(1) - Case_1.AddBoundaryGroup('internal_boundary', '') + # Creation of the case Case_2 + Case_2 = homard.CreateCase('Case_2', 'PLAQUE_0', os.path.join(Rep_Test, Test_Name + '.00.med')) + Case_2.SetDirName(Rep_Test_Resu) + Case_2.SetConfType(1) + Case_2.AddBoundaryGroup('internal_boundary', '') # # Creation of the iterations # ========================== - # Creation of the iteration Iter_1 - Iter_1 = Case_1.NextIteration('Iter_1') - Iter_1.SetMeshName('PLAQUE_1') - Iter_1.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.01.med')) - Iter_1.AssociateHypo('Hypo_1') - error = Iter_1.Compute(1, 1) + # Creation of the iteration Iter_2_1 + Iter_2_1 = Case_2.NextIteration('Iter_2_1') + Iter_2_1.SetMeshName('PLAQUE_1') + Iter_2_1.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.01.med')) + Iter_2_1.AssociateHypo('Hypo_2_1') + error = Iter_2_1.Compute(1, 1) if error : error = 1 break - # Creation of the iteration Iter_2 - Iter_2 = Iter_1.NextIteration('Iter_2') - Iter_2.SetMeshName('PLAQUE_2') - Iter_2.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.02.med')) - Iter_2.AssociateHypo('Hypo_1') - error = Iter_2.Compute(1, 1) + # Creation of the iteration Iter_2_2 + Iter_2_2 = Iter_2_1.NextIteration('Iter_2_2') + Iter_2_2.SetMeshName('PLAQUE_2') + Iter_2_2.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.02.med')) + Iter_2_2.AssociateHypo('Hypo_2_1') + error = Iter_2_2.Compute(1, 1) if error : error = 2 break - # Creation of the iteration Iter_3 - Iter_3 = Iter_2.NextIteration('Iter_3') - Iter_3.SetMeshName('PLAQUE_3') - Iter_3.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.03.med')) - Iter_3.AssociateHypo('Hypo_2') - error = Iter_3.Compute(1, 1) + # Creation of the iteration Iter_2_3 + Iter_2_3 = Iter_2_2.NextIteration('Iter_2_3') + Iter_2_3.SetMeshName('PLAQUE_3') + Iter_2_3.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.03.med')) + Iter_2_3.AssociateHypo('Hypo_2_2') + error = Iter_2_3.Compute(1, 1) if error : error = 3 break diff --git a/tests/test_3.py b/tests/test_3.py index 390d35e3..7e06ec5c 100644 --- a/tests/test_3.py +++ b/tests/test_3.py @@ -22,7 +22,7 @@ Python script for HOMARD Copyright EDF-R&D 2011, 2013 Test test_3 """ -__revision__ = "V1.7" +__revision__ = "V1.8" #======================================================================== Test_Name = "test_3" @@ -79,59 +79,59 @@ Copyright EDF-R&D 2010, 2013 # Creation of the boundaries # ========================== # Creation of the discrete boundary - Boundary_1 = homard.CreateBoundaryDi('courbes', 'COURBES', os.path.join(Rep_Test, Test_Name + '.fr.med')) + Boundary_3_1 = homard.CreateBoundaryDi('courbes', 'COURBES', os.path.join(Rep_Test, Test_Name + '.fr.med')) # # Creation of the external cylinder - Boundary_2 = homard.CreateBoundaryCylinder('cyl_ext', 50.0, 25., -25., 1., 0., 0., 100.) + Boundary_3_2 = homard.CreateBoundaryCylinder('cyl_ext', 50.0, 25., -25., 1., 0., 0., 100.) # # Creation of the internal cylinder - Boundary_3 = homard.CreateBoundaryCylinder('cyl_int', 50.0, 25., -25., 1., 0., 0., 50.) + Boundary_3_3 = homard.CreateBoundaryCylinder('cyl_int', 50.0, 25., -25., 1., 0., 0., 50.) # # Creation of the first sphere - Boundary_4 = homard.CreateBoundarySphere('sphere_1', 50.0, 25., -25., 100.) + Boundary_3_4 = homard.CreateBoundarySphere('sphere_1', 50.0, 25., -25., 100.) # # Creation of the second sphere - Boundary_5 = homard.CreateBoundarySphere('sphere_2', 450.0, 25., -25., 100.) + Boundary_3_5 = homard.CreateBoundarySphere('sphere_2', 450.0, 25., -25., 100.) # # Creation of the hypotheses # ========================== # Uniform refinement - Hypo = homard.CreateHypothesis('Hypo') - Hypo.SetAdapRefinUnRef(-1, 1, 0) + Hypo_3_ = homard.CreateHypothesis('Hypo_3_') + Hypo_3_.SetAdapRefinUnRef(-1, 1, 0) # for iaux in range (n_boucle+1) : # -# Creation of the case Case_1 +# Creation of the case Case_3 # =========================== if ( iaux <= 1 ) : - Case_1 = homard.CreateCase('Case_1', 'MOYEU', os.path.join(Rep_Test, Test_Name + '.00.med')) - Case_1.SetDirName(Rep_Test_Resu) - Case_1.SetConfType(1) - Case_1.AddBoundaryGroup('courbes', '') - Case_1.AddBoundaryGroup('cyl_ext', 'EXT') - Case_1.AddBoundaryGroup('cyl_int', 'INT') - Case_1.AddBoundaryGroup('sphere_1', 'END_1') - Case_1.AddBoundaryGroup('sphere_2', 'END_2') + Case_3 = homard.CreateCase('Case_3', 'MOYEU', os.path.join(Rep_Test, Test_Name + '.00.med')) + Case_3.SetDirName(Rep_Test_Resu) + Case_3.SetConfType(1) + Case_3.AddBoundaryGroup('courbes', '') + Case_3.AddBoundaryGroup('cyl_ext', 'EXT') + Case_3.AddBoundaryGroup('cyl_int', 'INT') + Case_3.AddBoundaryGroup('sphere_1', 'END_1') + Case_3.AddBoundaryGroup('sphere_2', 'END_2') # # Creation and destruction of the iterations # ========================================== # - # Creation of the iteration Iter_1 - Iter_1 = Case_1.NextIteration('Iter_1') - Iter_1.SetMeshName('MOYEU_1') - Iter_1.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.01.med')) - Iter_1.AssociateHypo('Hypo') - error = Iter_1.Compute(1, 1) + # Creation of the iteration Iter_3_1 + Iter_3_1 = Case_3.NextIteration('Iter_3_1') + Iter_3_1.SetMeshName('MOYEU_1') + Iter_3_1.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.01.med')) + Iter_3_1.AssociateHypo('Hypo_3_') + error = Iter_3_1.Compute(1, 1) if error : error = 10*iaux + 1 break - # Creation of the iteration Iter_2 - Iter_2 = Iter_1.NextIteration('Iter_2') - Iter_2.SetMeshName('MOYEU_2') - Iter_2.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.02.med')) - Iter_2.AssociateHypo('Hypo') - error = Iter_2.Compute(1, 1) + # Creation of the iteration Iter_3_2 + Iter_3_2 = Iter_3_1.NextIteration('Iter_3_2') + Iter_3_2.SetMeshName('MOYEU_2') + Iter_3_2.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.02.med')) + Iter_3_2.AssociateHypo('Hypo_3_') + error = Iter_3_2.Compute(1, 1) if error : error = 10*iaux + 2 break @@ -139,24 +139,24 @@ Copyright EDF-R&D 2010, 2013 # Destruction # After the first loop, the case is deleted, except the final mesh files if ( iaux == 0 ) : - error = Case_1.Delete(0) + error = Case_3.Delete(0) if error : break # After the second loop, the iterations are deleted, with the final mesh files elif ( iaux == 1 ) : # Recursive destruction of the iterations - error = Iter_1.Delete(1) + error = Iter_3_1.Delete(1) if error : error = 10*iaux + 3 break # Destruction and creation of the hypothese if ( iaux == 1 ) : - error = Hypo.Delete() + error = Hypo_3_.Delete() if error : error = 10*iaux + 4 break - Hypo = homard.CreateHypothesis('Hypo') - Hypo.SetAdapRefinUnRef(-1, 1, 0) + Hypo_3_ = homard.CreateHypothesis('Hypo_3_') + Hypo_3_.SetAdapRefinUnRef(-1, 1, 0) # break #