# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2011-2012 CEA/DEN, EDF R&D
+# 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
Copyright EDF-R&D 2010, 2013
Test test_2
"""
-__revision__ = "V1.6"
+__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)
+ # 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)
+ # 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)
+ # 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
#
# Test of the result
#
-s_iter_test_file = str(n_iter_test_file)
-test_file_suff = "apad.0" + s_iter_test_file + ".bilan"
-rep_test_file = "I0" + s_iter_test_file
+test_file_suff = "apad.%02d.bilan" % n_iter_test_file
+rep_test_file = "I%02d" % n_iter_test_file
#
test_file = os.path.join(Rep_Test, Test_Name + "." + test_file_suff)
mess_error_ref = "\nReference file: " + test_file