2 # -*- coding: iso-8859-1 -*-
4 # Copyright (C) 2011 CEA/DEN, EDF R&D
6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License.
11 # This library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # Lesser General Public License for more details.
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this library; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
24 Exemple de couplage HOMARD-Salome
25 Copyright EDF-R&D 1996, 2010
29 # ==================================
30 # Repertoire a personnaliser
31 # Ce repertoire contient les fichiers de donnees : tutorial_2.00.med
32 # Ce repertoire contiendra les fichiers de resultats : maill.01.med, maill.02.med
34 # ==================================
40 homard = salome.lcc.FindOrLoadComponent("FactoryServer", "HOMARD")
41 study_main = salome.myStudyManager.NewStudy("HOMARD")
42 homard.SetCurrentStudy(salome.myStudy)
44 # Creation of the zones
45 # =====================
47 Zone_0 = homard.CreateZoneBox ('Zone_0', -0.1, 1.1, -0.1, 1.1, 0.9, 1.1)
50 Zone_1 = homard.CreateZoneSphere ('Zone_1', 0., 0., 0., 1.05)
53 Zone_2 = homard.CreateZoneBox ('Zone_2', -0.1, 0.51, -0.1, 0.51, -0.1, 0.51)
57 Hypo_0 = homard.CreateHypothesis('Hypo_0')
58 Hypo_0.SetAdapRefinUnRef(0, 1, 0)
59 homard.AssociateHypoZone('Zone_1', 'Hypo_0')
60 homard.AssociateHypoZone('Zone_0', 'Hypo_0')
64 Hypo_1 = homard.CreateHypothesis('Hypo_1')
65 Hypo_1.SetAdapRefinUnRef(0, 1, 0)
66 homard.AssociateHypoZone('Zone_0', 'Hypo_1')
67 homard.AssociateHypoZone('Zone_2', 'Hypo_1')
71 Case_0 = homard.CreateCase('Case_0', 'MZERO', dircase+'/tutorial_2.00.med')
72 Case_0.SetDirName(dircase)
76 Iter_0 = homard.CreateIteration('Iter_0', Case_0.GetIter0Name())
77 Iter_0.SetMeshName('M_1')
78 Iter_0.SetMeshFile(dircase+'/maill.01.med')
79 homard.AssociateIterHypo('Iter_0', 'Hypo_0')
80 codret = homard.Compute('Iter_0', 1)
84 Iter_1 = homard.CreateIteration('Iter_1', 'Iter_0')
85 Iter_1.SetMeshName('M_2')
86 Iter_1.SetMeshFile(dircase+'/maill.02.med')
87 homard.AssociateIterHypo('Iter_1', 'Hypo_1')
88 codret = homard.Compute('Iter_1', 1)
90 if salome.sg.hasDesktop():
91 salome.sg.updateObjBrowser(1)