- # Creation of the hypothesis DISTANCE INVERSE
- HypoName_3 = "DISTANCE INVERSE"
- print "-------- Creation of the hypothesis", HypoName_3
- Hypo_4_3 = homard.CreateHypothesis(HypoName_3)
- Hypo_4_3.SetField('DISTANCE')
- Hypo_4_3.SetUseComp(0)
- Hypo_4_3.SetRefinThr(1, 0.3)
- Hypo_4_3.SetUnRefThr(1, 0.2)
- Hypo_4_3.AddFieldInterp('DISTANCE')
- Hypo_4_3.SetExtraOutput(2)
- print HypoName_3, " : zones utilisées :", Hypo_4_3.GetZones()
- print HypoName_3, " : champ utilisé :", Hypo_4_3.GetFieldName()
- print HypoName_3, " : composantes utilisées :", Hypo_4_3.GetComps()
- if ( len (Hypo_4_3.GetFieldName()) > 0 ) :
- print ".. caractéristiques de l'adaptation :", Hypo_4_3.GetField()
- print HypoName_3, " : champs interpolés :", Hypo_4_3.GetFieldInterps()
- #
- # Creation of the cases
- # =====================
- # Creation of the case
- CaseName = "Case_" + Test_Name
- print "-------- Creation of the case", CaseName
- MeshFile = os.path.join(dircase, 'maill.00.med')
- Case_test_4 = homard.CreateCase(CaseName, 'MESH', MeshFile)
- Case_test_4.SetDirName(dircase)
- #
- # Creation of the iterations
- # ==========================
- # Creation of the iteration 1
- IterName = "I_" + Test_Name + "_1"
- print "-------- Creation of the iteration", IterName
- Iter_test_4_1 = Case_test_4.NextIteration(IterName)
- Iter_test_4_1.AssociateHypo(HypoName_1)
- print ". Hypothese :", HypoName_1
- Iter_test_4_1.SetMeshName('M1')
- Iter_test_4_1.SetMeshFile(os.path.join(dircase, 'maill.01.med'))
- error = Iter_test_4_1.Compute(1, 2)
+# 3. Creation of the hypothesis DISTANCE INVERSE
+# ==============================================
+ hyponame.append("DISTANCE INVERSE")
+ print("-------- Creation of the hypothesis {}".format(hyponame[2]))
+ hypo_4_3 = HOMARD.CreateHypothesis(hyponame[2])
+ hypo_4_3.SetField('DISTANCE')
+ hypo_4_3.SetUseComp(0)
+ hypo_4_3.SetRefinThr(1, 0.3)
+ hypo_4_3.SetUnRefThr(1, 0.2)
+ hypo_4_3.AddFieldInterp('DISTANCE')
+ hypo_4_3.SetExtraOutput(2)
+ print(hyponame[2], " : zones utilisées : {}".format(hypo_4_3.GetZones()))
+ print(hyponame[2], " : champ utilisé : {}".format(hypo_4_3.GetFieldName()))
+ print(hyponame[2], " : composantes utilisées : {}".format(hypo_4_3.GetComps()))
+ if len (hypo_4_3.GetFieldName()):
+ print(".. caractéristiques de l'adaptation : {}".format(hypo_4_3.GetField()))
+ print(hyponame[2], " : champs interpolés : {}".format(hypo_4_3.GetFieldInterps()))
+
+ break
+
+ return error, hyponame
+
+#========================================================================
+
+#========================================================================
+def homard_exec_iter(case_test_4, hyponame):
+ """Python script for HOMARD - Creation of the iterations"""
+
+ error = 0
+ while not error :
+
+# 1. Creation of the iteration 1
+ iter_name = "I_" + TEST_NAME + "_1"
+ print("-------- Creation of the iteration", iter_name)
+ iter_test_4_1 = case_test_4.NextIteration(iter_name)
+ iter_test_4_1.AssociateHypo(hyponame[0])
+ print(". Hypothese :", hyponame[0])
+ iter_test_4_1.SetMeshName('M1')
+ iter_test_4_1.SetMeshFile(os.path.join(DIRCASE, 'maill.01.med'))
+ error = iter_test_4_1.Compute(1, 2)