2 # -*- coding: iso-8859-1 -*-
4 Exemple de couplage HOMARD-Salome
5 Copyright EDF-R&D 1996, 2010
13 homard = salome.lcc.FindOrLoadComponent("FactoryServer", "HOMARD")
14 study_main = salome.myStudyManager.NewStudy("HOMARD")
15 homard.SetCurrentStudy(salome.myStudy)
19 # Creation of the zones
20 # =====================
22 Zone_0 = homard.CreateZone('Zone_0', 2)
23 Zone_0.SetBox(-0.1, 1.1, -0.1, 1.1, 0.9, 1.1)
26 Zone_1 = homard.CreateZone('Zone_1', 4)
27 Zone_1.SetSphere(0., 0., 0., 1.05)
30 Zone_2 = homard.CreateZone('Zone_2', 2)
31 Zone_2.SetBox(-0.1, 0.51, -0.1, 0.51, -0.1, 0.51)
35 Hypo_0 = homard.CreateHypothesis('Hypo_0')
36 Hypo_0.SetAdapRefinUnRef(0, 1, 0)
37 homard.AssociateHypoZone('Zone_1', 'Hypo_0')
38 homard.AssociateHypoZone('Zone_0', 'Hypo_0')
42 Hypo_1 = homard.CreateHypothesis('Hypo_1')
43 Hypo_1.SetAdapRefinUnRef(0, 1, 0)
44 homard.AssociateHypoZone('Zone_0', 'Hypo_1')
45 homard.AssociateHypoZone('Zone_2', 'Hypo_1')
49 Case_0 = homard.CreateCase('Case_0', 'MZERO', dircase+'/tutorial_2.00.med')
50 Case_0.SetDirName(dircase)
54 Iter_0 = homard.CreateIteration('Iter_0', Case_0.GetIter0Name())
55 Iter_0.SetMeshName('M_1')
56 Iter_0.SetMeshFile(dircase+'/maill.01.med')
57 homard.AssociateIterHypo('Iter_0', 'Hypo_0')
58 codret = homard.Compute('Iter_0', 1)
62 Iter_1 = homard.CreateIteration('Iter_1', 'Iter_0')
63 Iter_1.SetMeshName('M_2')
64 Iter_1.SetMeshFile(dircase+'/maill.02.med')
65 homard.AssociateIterHypo('Iter_1', 'Hypo_1')
66 codret = homard.Compute('Iter_1', 1)
68 if salome.sg.hasDesktop():
69 salome.sg.updateObjBrowser(1)