From 2e4a190748ae820e132196f1ebfef3bfba627e5a Mon Sep 17 00:00:00 2001 From: gdd Date: Tue, 24 Apr 2012 09:30:58 +0000 Subject: [PATCH] Fix indentation errors in test scripts --- tests/test_1.py | 118 ++++++++++++++++++++++++------------------------ tests/test_2.py | 96 +++++++++++++++++++-------------------- tests/test_3.py | 51 +++++++++++---------- 3 files changed, 133 insertions(+), 132 deletions(-) diff --git a/tests/test_1.py b/tests/test_1.py index a15865f3..01a07768 100644 --- a/tests/test_1.py +++ b/tests/test_1.py @@ -53,81 +53,81 @@ Copyright EDF-R&D 2010 error = 0 # while not error : -# - homard.SetCurrentStudy(theStudy) -# -# 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) + # + homard.SetCurrentStudy(theStudy) + # + # 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 sphere Zone_2 - Zone_2 = homard.CreateZoneSphere('Zone_2', 0.5, 0.6, 0.7, 0.75) -# -# Creation of the hypotheses -# ========================== -# Creation of the hypothesis a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM - a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM = homard.CreateHypothesis('a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM') - a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM.SetAdapRefinUnRef(1, 1, 0) - a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM.SetField('RESU____ERRE_ELEM_SIGM__________') - a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM.SetUseComp(0) - a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM.AddComp('ERREST') - a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM.SetRefinThr(3, 10.1) - a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM.SetTypeFieldInterp(2) - a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM.AddFieldInterp('RESU____DEPL____________________') - a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM.AddFieldInterp('RESU____ERRE_ELEM_SIGM__________') -# 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) - homard.AssociateHypoZone('Zones_1_et_2', 'Zone_1', 1) - homard.AssociateHypoZone('Zones_1_et_2', 'Zone_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')) - Case_1.SetDirName(Rep_Test_Resu) - Case_1.SetConfType(1) -# -# Creation of the iterations -# ========================== -# Creation of the iteration I1 - I1 = homard.CreateIteration('I1', Case_1.GetIter0Name() ) - 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) - homard.AssociateIterHypo('I1', 'a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM') + # Creation of the sphere Zone_2 + Zone_2 = homard.CreateZoneSphere('Zone_2', 0.5, 0.6, 0.7, 0.75) + # + # Creation of the hypotheses + # ========================== + # Creation of the hypothesis a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM + a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM = homard.CreateHypothesis('a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM') + a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM.SetAdapRefinUnRef(1, 1, 0) + a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM.SetField('RESU____ERRE_ELEM_SIGM__________') + a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM.SetUseComp(0) + a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM.AddComp('ERREST') + a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM.SetRefinThr(3, 10.1) + a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM.SetTypeFieldInterp(2) + a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM.AddFieldInterp('RESU____DEPL____________________') + a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM.AddFieldInterp('RESU____ERRE_ELEM_SIGM__________') + # 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) + homard.AssociateHypoZone('Zones_1_et_2', 'Zone_1', 1) + homard.AssociateHypoZone('Zones_1_et_2', 'Zone_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')) + Case_1.SetDirName(Rep_Test_Resu) + Case_1.SetConfType(1) + # + # Creation of the iterations + # ========================== + # Creation of the iteration I1 + I1 = homard.CreateIteration('I1', Case_1.GetIter0Name() ) + 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) + homard.AssociateIterHypo('I1', 'a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM') error = I1.Compute(1) if error : error = 1 break -# Creation of the iteration I2 - I2 = homard.CreateIteration('I2', 'I1') - 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) - homard.AssociateIterHypo('I2', 'a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM') + # Creation of the iteration I2 + I2 = homard.CreateIteration('I2', 'I1') + 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) + homard.AssociateIterHypo('I2', 'a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM') error = I2.Compute(1) if error : error = 2 break -# Creation of the iteration I3 - I3 = homard.CreateIteration('I3', 'I2') - I3.SetMeshName('M3') - I3.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.03.med')) - homard.AssociateIterHypo('I3', 'Zones_1_et_2') + # Creation of the iteration I3 + I3 = homard.CreateIteration('I3', 'I2') + I3.SetMeshName('M3') + I3.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.03.med')) + homard.AssociateIterHypo('I3', 'Zones_1_et_2') error = I3.Compute(1) if error : error = 3 break -# + # break -# - return error + # + return error ###################################################################################### diff --git a/tests/test_2.py b/tests/test_2.py index 770dd45d..60110999 100644 --- a/tests/test_2.py +++ b/tests/test_2.py @@ -53,70 +53,70 @@ Copyright EDF-R&D 2010 error = 0 # while not error : -# - homard.SetCurrentStudy(theStudy) -# -# Creation of the boundaries -# ========================== -# Creation of the discrete boundary Boundary_1 - Boundary_1 = homard.CreateBoundaryDi('internal_boundary', 'plaque', os.path.join(Rep_Test, Test_Name + '.fr.med')) -# -# 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') + # + homard.SetCurrentStudy(theStudy) + # + # Creation of the boundaries + # ========================== + # Creation of the discrete boundary Boundary_1 + Boundary_1 = homard.CreateBoundaryDi('internal_boundary', 'plaque', os.path.join(Rep_Test, Test_Name + '.fr.med')) + # + # 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 - Hypo_2 = homard.CreateHypothesis('Hypo_2') - Hypo_2.SetAdapRefinUnRef(-1, 1, 0) - Hypo_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 iterations -# ========================== -# Creation of the iteration Iter_1 - Iter_1 = homard.CreateIteration('Iter_1', Case_1.GetIter0Name() ) - Iter_1.SetMeshName('PLAQUE_1') - Iter_1.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.01.med')) - homard.AssociateIterHypo('Iter_1', 'Hypo_1') + # 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 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 iterations + # ========================== + # Creation of the iteration Iter_1 + Iter_1 = homard.CreateIteration('Iter_1', Case_1.GetIter0Name() ) + Iter_1.SetMeshName('PLAQUE_1') + Iter_1.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.01.med')) + homard.AssociateIterHypo('Iter_1', 'Hypo_1') error = Iter_1.Compute(1) if error : error = 1 break -# Creation of the iteration Iter_2 - Iter_2 = homard.CreateIteration('Iter_2', 'Iter_1') - Iter_2.SetMeshName('PLAQUE_2') - Iter_2.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.02.med')) - homard.AssociateIterHypo('Iter_2', 'Hypo_1') + # Creation of the iteration Iter_2 + Iter_2 = homard.CreateIteration('Iter_2', 'Iter_1') + Iter_2.SetMeshName('PLAQUE_2') + Iter_2.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.02.med')) + homard.AssociateIterHypo('Iter_2', 'Hypo_1') error = Iter_2.Compute(1) if error : error = 2 break -# Creation of the iteration Iter_3 - Iter_3 = homard.CreateIteration('Iter_3', 'Iter_2') - Iter_3.SetMeshName('PLAQUE_3') - Iter_3.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.03.med')) - homard.AssociateIterHypo('Iter_3', 'Hypo_2') + # Creation of the iteration Iter_3 + Iter_3 = homard.CreateIteration('Iter_3', 'Iter_2') + Iter_3.SetMeshName('PLAQUE_3') + Iter_3.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.03.med')) + homard.AssociateIterHypo('Iter_3', 'Hypo_2') error = Iter_3.Compute(1) if error : error = 3 break -# + # break -# - return error + # + return error ###################################################################################### diff --git a/tests/test_3.py b/tests/test_3.py index 33840564..5e7cdcc4 100644 --- a/tests/test_3.py +++ b/tests/test_3.py @@ -54,60 +54,60 @@ Copyright EDF-R&D 2010 # while not error : # - homard.SetCurrentStudy(theStudy) + homard.SetCurrentStudy(theStudy) # # 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_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_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 = 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_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_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 = homard.CreateHypothesis('Hypo') + Hypo.SetAdapRefinUnRef(-1, 1, 0) # # Creation of the cases # ===================== # Creation of the case Case_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_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') # # Creation of the iterations # ========================== # Creation of the iteration Iter_1 - Iter_1 = homard.CreateIteration('Iter_1', Case_1.GetIter0Name() ) - Iter_1.SetMeshName('MOYEU_1') - Iter_1.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.01.med')) - homard.AssociateIterHypo('Iter_1', 'Hypo') + Iter_1 = homard.CreateIteration('Iter_1', Case_1.GetIter0Name() ) + Iter_1.SetMeshName('MOYEU_1') + Iter_1.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.01.med')) + homard.AssociateIterHypo('Iter_1', 'Hypo') error = Iter_1.Compute(1) if error : error = 1 break # Creation of the iteration Iter_2 - Iter_2 = homard.CreateIteration('Iter_2', 'Iter_1') - Iter_2.SetMeshName('MOYEU_2') - Iter_2.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.02.med')) - homard.AssociateIterHypo('Iter_2', 'Hypo') + Iter_2 = homard.CreateIteration('Iter_2', 'Iter_1') + Iter_2.SetMeshName('MOYEU_2') + Iter_2.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.02.med')) + homard.AssociateIterHypo('Iter_2', 'Hypo') error = Iter_2.Compute(1) if error : error = 2 @@ -128,7 +128,8 @@ try : if error_main : raise Exception('Pb in homard_exec at iteration %d' %error_main ) except : - raise Exception('Pb in homard_exec at iteration %d' %error_main ) + if error_main : + raise Exception('Pb in homard_exec at iteration %d' %error_main ) sys.exit(1) # # Test of the result -- 2.39.2