Exemple de couplage HOMARD-Salome
Copyright EDF-R&D 1996, 2010, 2013
"""
-__revision__ = "V1.5"
+__revision__ = "V1.6"
#
import os
#
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)
# ==================================
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"
# =============
#
# 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)
Exemple de couplage HOMARD-Salome
Copyright EDF-R&D 1996, 2010, 2013
"""
-__revision__ = "V1.6"
+__revision__ = "V1.7"
#
import os
#
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)
# ==================================
# 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)
Exemple de couplage HOMARD-Salome
Copyright EDF-R&D 1996, 2010, 2013
"""
-__revision__ = "V1.6"
+__revision__ = "V1.7"
#
import os
#
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)
# ==================================
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)
Exemple de couplage HOMARD-Salome
Copyright EDF-R&D 1996, 2011, 2013
"""
-__revision__ = "V2.2"
+__revision__ = "V2.3"
#
import os
#
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')
#
# 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)
Exemple de couplage HOMARD-Salome
Copyright EDF-R&D 1996, 2010, 2013
"""
-__revision__ = "V1.5"
+__revision__ = "V1.6"
#
import os
#
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)
# ==================================
#
# 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
# =====================
#
# 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():
--- /dev/null
+// 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
--- /dev/null
+// 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
+//=============================================================================
+//=============================================================================
--- /dev/null
+// 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 <string>
+#include <list>
+
+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
#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
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;
_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
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;
#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
Chgt (false)
{
MESSAGE("Constructeur") ;
- myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen);
+ myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0);
setupUi(this);
setModal(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),
// -------------------------------------------------------------------------------
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") ;
* 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(""),
_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();
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);
// -------------------------------------------------------------------------------
MonCreateHypothesis::MonCreateHypothesis(MonCreateIteration* parent, bool modal,
- HOMARD::HOMARD_Gen_var myHomardGen,
+ HOMARD::HOMARD_Gen_var myHomardGen0,
QString Name,
QString caseName, QString aFieldFile)
// ---------------------------------------------------------------------------------
{
MESSAGE("Constructeur") ;
- myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen);
+ myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0);
setupUi(this);
setModal(modal);
InitConnect();
// -----------------------------------------------------------------------------------------------------
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
_CaseName("")
{
MESSAGE("Constructeur");
- myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen);
+ myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0);
setupUi(this);
setModal(modal);
InitConnect();
// --------------------------------------------------------------------------------------------------------------
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(),
_parentBound(parentBound)
{
MESSAGE("Debut de MonCreateListGroup")
- myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen);
+ myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0);
setupUi(this);
setModal(modal);
InitConnect();
#include <utilities.h>
-// -----------------------------------------------------------------------------------------
+// ----------------------------------------------------------------------
/* 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),
_aMeshFile("")
{
MESSAGE("Debut du constructeur de MonCreateYACS");
- myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen);
+ myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0);
setupUi(this);
setModal(modal);
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()
// ------------------------------------------------------------------------
virtual ~MonCreateYACS();
protected :
+ MonCreateYACS( QWidget* parent, HOMARD::HOMARD_Gen_var myHomardGen, QString CaseName);
+
QString _Name;
QString _aCaseName;
QString _aScriptFile;
int _Type;
+ bool Chgt;
+
HOMARD::HOMARD_YACS_var aYACS;
HOMARD::HOMARD_Cas_var aCase ;
HOMARD::HOMARD_Gen_var myHomardGen;
#include <SUIT_Session.h>
#include <SUIT_ViewManager.h>
-// ------------------------------------------------------------------------------------------------------------------------
+// ----------------------------------------------------------------------
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
Chgt (false)
{
MESSAGE("Constructeur") ;
- myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen) ;
+ myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0) ;
setupUi(this) ;
setModal(modal) ;
InitConnect( ) ;
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),
double _ZoneXaxis, _ZoneYaxis, _ZoneZaxis, _ZoneRayonInt, _ZoneHaut ;
double _DMax ;
-
bool Chgt;
HOMARD::HOMARD_Zone_var aZone ;
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"));
{
Q_OBJECT
public:
- MonEditCase( QWidget* parent, bool modal,
+ MonEditCase( bool modal,
HOMARD::HOMARD_Gen_var myHomardGen,
QString Name );
virtual ~MonEditCase();
--- /dev/null
+// 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 <utilities.h>
+
+
+// -------------------------------------------------------------
+/* 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 ;
+};
--- /dev/null
+// 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 <SALOMEconfig.h>
+#include <SalomeApp_Module.h>
+
+#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
+#include CORBA_CLIENT_HEADER(HOMARD_Gen)
+
+#include <MonCreateYACS.h>
+
+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
// -----------------------------------------------------------------------------------------
-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
_Option(-1)
{
MESSAGE("appel de _duplicate");
- myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen);
+ myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0);
setupUi(this);
setModal(modal);
InitConnect();
// -----------------------------------------------------------------------------------------
-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
_Entanglement(0),
_Quality(0)
{
- myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen);
+ myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0);
setupUi(this);
setModal(modal);
InitConnect();
_NS = SINGLETON_<SALOME_NamingService>::Instance();
ASSERT(SINGLETON_<SALOME_NamingService>::IsAlreadyExisting());
_NS->init_orb(_orb);
+
+ _tag_gene = 0 ;
+ _tag_boun = 0 ;
+ _tag_hypo = 0 ;
+ _tag_yacs = 0 ;
+ _tag_zone = 0 ;
}
//=================================
/*!
{
MESSAGE("PublishBoundaryStudy pour "<<theName);
SALOMEDS::SObject_var aResultSO;
- SALOMEDS::GenericAttribute_var anAttr;
// Caracteristique de la Boundary
HOMARD::HOMARD_Boundary_var myBoundary = myContextMap[GetCurrentStudyID()]._mesBoundarys[theName];
}
// On ajoute la categorie des boundarys dans l etude si necessaire
+ if ( _tag_boun == 0 )
+ {
+ _tag_gene += 1 ;
+ _tag_boun = _tag_gene ;
+ }
+ MESSAGE("PublishBoundaryInStudy _tag_gene = "<<_tag_gene << ", _tag_boun = "<<_tag_boun );
SALOMEDS::SObject_var aSObject;
- if (!theFatherHomard->FindSubObject(101, aSObject))
+ if (!theFatherHomard->FindSubObject(_tag_boun, aSObject))
{
MESSAGE("Ajout de la categorie des boundarys");
- aSObject = aStudyBuilder->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."); }
{
MESSAGE("PublishCaseInStudy pour "<<theName);
SALOMEDS::SObject_var aResultSO;
- SALOMEDS::GenericAttribute_var anAttr;
if (CORBA::is_nil(theObject)) {
MESSAGE("HOMARD_Gen_i::theObject->_is_nil()");
return aResultSO._retn();
}
+ // On recupere le module pere dans l etude
SALOMEDS::SComponent_var theFatherHomard = theStudy->FindComponent(ComponentDataType());
if (theFatherHomard->_is_nil())
{
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();
}
//=============================================================================
{
MESSAGE("PublishHypotheseInStudy pour "<<theName);
SALOMEDS::SObject_var aResultSO;
- SALOMEDS::GenericAttribute_var anAttr;
// On recupere le module pere dans l etude
// On ajoute la categorie des hypotheses dans l etude si necessaire
MESSAGE("theFatherHomard->_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."); }
{
MESSAGE("PublishYACSInStudy pour "<<theName);
SALOMEDS::SObject_var aResultSO;
- SALOMEDS::GenericAttribute_var anAttr;
// On recupere le module pere dans l etude
// On ajoute la categorie des schemas YACS dans l etude si necessaire
MESSAGE("theFatherHomard->_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."); }
{
MESSAGE("PublishZoneStudy pour "<<theName);
SALOMEDS::SObject_var aResultSO;
- SALOMEDS::GenericAttribute_var anAttr;
-
if (CORBA::is_nil(theObject))
{
MESSAGE("PublishZoneInStudy : theObject->_is_nil()");
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."); }
break ;
}
}
+ MESSAGE("Appel de PublishInStudyAttr pour name = "<<theName);
PublishInStudyAttr(aStudyBuilder, aResultSO, theName, "ZoneHomard", icone.c_str(), _orb->object_to_string(theObject) ) ;
return aResultSO._retn();
ContextMap myContextMap;
SALOME_NamingService* _NS;
+ int _tag_gene ;
+ int _tag_boun ;
+ int _tag_hypo ;
+ int _tag_yacs ;
+ int _tag_zone ;
+
};
#endif
--- /dev/null
+// 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
+//=============================================================================
+//=============================================================================
--- /dev/null
+// 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 <SALOMEconfig.h>
+#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 <string>
+
+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
Copyright EDF-R&D 2010, 2013
Test test_1
"""
-__revision__ = "V1.9"
+__revision__ = "V1.10"
#========================================================================
Test_Name = "test_1"
#
# 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
# ==========================
# 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
Copyright EDF-R&D 2010, 2013
Test test_2
"""
-__revision__ = "V1.8"
+__revision__ = "V1.9"
#========================================================================
Test_Name = "test_2"
#
# 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
Copyright EDF-R&D 2011, 2013
Test test_3
"""
-__revision__ = "V1.7"
+__revision__ = "V1.8"
#========================================================================
Test_Name = "test_3"
# 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
# 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
#