From: Paul RASCLE Date: Wed, 8 Feb 2017 20:49:09 +0000 (+0100) Subject: adjust tests X-Git-Tag: Salome_8_3_Hydro_1_1rc1~57 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=12cf9ae451f20d2990c6b6322487a520e228a88e;p=modules%2Fhydro.git adjust tests --- diff --git a/doc/salome/examples/h010_normalCaseManualMesh.py b/doc/salome/examples/h010_normalCaseManualMesh.py index 34fb00c5..ac617de4 100644 --- a/doc/salome/examples/h010_normalCaseManualMesh.py +++ b/doc/salome/examples/h010_normalCaseManualMesh.py @@ -274,16 +274,31 @@ garonne_1.Update() garonne_1_litMineur = hydro_doc.FindObjectByName( "garonne_1_Reg_1" ) garonne_1_Zone_1 = hydro_doc.FindObjectByName( "garonne_1_Zone_1" ) garonne_1_Zone_1.SetMergeType( HYDROData_Zone.Merge_ZMIN ) +garonne_1_Zone_1.SetColor( QColor( 192, 113, 64 )) garonne_1_litMineur.AddZone( garonne_1_Zone_1 ) + garonne_1_riveDroite = hydro_doc.FindObjectByName( "garonne_1_Reg_2" ) garonne_1_Zone_2 = hydro_doc.FindObjectByName( "garonne_1_Zone_2" ) +garonne_1_Zone_2.SetColor( QColor( 141, 192, 64 )) garonne_1_riveDroite.AddZone( garonne_1_Zone_2 ) + garonne_1_Zone_3 = hydro_doc.FindObjectByName( "garonne_1_Zone_3" ) +garonne_1_Zone_3.SetMergeType( HYDROData_Zone.Merge_Object ) +Cloud_02 = hydro_doc.FindObjectByName( "Cloud_02" ) +garonne_1_Zone_3.SetMergeObject( Cloud_02 ) +garonne_1_Zone_3.SetColor( QColor( 64, 192, 77 )) garonne_1_riveDroite.AddZone( garonne_1_Zone_3 ) + garonne_1_riveGauche = hydro_doc.FindObjectByName( "garonne_1_Reg_3" ) garonne_1_Zone_4 = hydro_doc.FindObjectByName( "garonne_1_Zone_4" ) +garonne_1_Zone_4.SetMergeType( HYDROData_Zone.Merge_Object ) +Cloud_02 = hydro_doc.FindObjectByName( "Cloud_02" ) +garonne_1_Zone_4.SetMergeObject( Cloud_02 ) +garonne_1_Zone_4.SetColor( QColor( 64, 75, 192 )) garonne_1_riveGauche.AddZone( garonne_1_Zone_4 ) + garonne_1_Zone_5 = hydro_doc.FindObjectByName( "garonne_1_Zone_5" ) +garonne_1_Zone_5.SetColor( QColor( 64, 192, 77 )) garonne_1_riveGauche.AddZone( garonne_1_Zone_5 ) garonne_1_litMineur.SetName("garonne_1_litMineur") diff --git a/doc/salome/examples/h011_normalCaseManualInterpolZ.py b/doc/salome/examples/h011_normalCaseManualInterpolZ.py index 4414c2c2..a874b4d0 100644 --- a/doc/salome/examples/h011_normalCaseManualInterpolZ.py +++ b/doc/salome/examples/h011_normalCaseManualInterpolZ.py @@ -274,16 +274,31 @@ garonne_1.Update() garonne_1_litMineur = hydro_doc.FindObjectByName( "garonne_1_Reg_1" ) garonne_1_Zone_1 = hydro_doc.FindObjectByName( "garonne_1_Zone_1" ) garonne_1_Zone_1.SetMergeType( HYDROData_Zone.Merge_ZMIN ) +garonne_1_Zone_1.SetColor( QColor( 192, 113, 64 )) garonne_1_litMineur.AddZone( garonne_1_Zone_1 ) + garonne_1_riveDroite = hydro_doc.FindObjectByName( "garonne_1_Reg_2" ) garonne_1_Zone_2 = hydro_doc.FindObjectByName( "garonne_1_Zone_2" ) +garonne_1_Zone_2.SetColor( QColor( 141, 192, 64 )) garonne_1_riveDroite.AddZone( garonne_1_Zone_2 ) + garonne_1_Zone_3 = hydro_doc.FindObjectByName( "garonne_1_Zone_3" ) +garonne_1_Zone_3.SetMergeType( HYDROData_Zone.Merge_Object ) +Cloud_02 = hydro_doc.FindObjectByName( "Cloud_02" ) +garonne_1_Zone_3.SetMergeObject( Cloud_02 ) +garonne_1_Zone_3.SetColor( QColor( 64, 192, 77 )) garonne_1_riveDroite.AddZone( garonne_1_Zone_3 ) + garonne_1_riveGauche = hydro_doc.FindObjectByName( "garonne_1_Reg_3" ) garonne_1_Zone_4 = hydro_doc.FindObjectByName( "garonne_1_Zone_4" ) +garonne_1_Zone_4.SetMergeType( HYDROData_Zone.Merge_Object ) +Cloud_02 = hydro_doc.FindObjectByName( "Cloud_02" ) +garonne_1_Zone_4.SetMergeObject( Cloud_02 ) +garonne_1_Zone_4.SetColor( QColor( 64, 75, 192 )) garonne_1_riveGauche.AddZone( garonne_1_Zone_4 ) + garonne_1_Zone_5 = hydro_doc.FindObjectByName( "garonne_1_Zone_5" ) +garonne_1_Zone_5.SetColor( QColor( 64, 192, 77 )) garonne_1_riveGauche.AddZone( garonne_1_Zone_5 ) garonne_1_litMineur.SetName("garonne_1_litMineur") @@ -463,7 +478,7 @@ zUndef = 90 # --- Z interpolation on the bathymety/altimetry on the mesh nodes statz = interpolZ(nomCas, fichierMaillage, dicoGroupeRegion, zUndef) -refstatz = {'riveDroite': (10.88, 32.47999954), 'riveGauche': (7.72, 71.38999939), 'litMineur': (2.06, 25.41)} +refstatz = {'riveDroite': (10.88, 32.61), 'riveGauche': (7.72, 71.86, 0.5), 'litMineur': (2.06, 25.41)} controlStatZ(statz, refstatz) # --- add a field on nodes of type double with z values, named "BOTTOM" diff --git a/doc/salome/examples/h012_caseDigueManual.py b/doc/salome/examples/h012_caseDigueManual.py index e67b5c3e..5e184af7 100644 --- a/doc/salome/examples/h012_caseDigueManual.py +++ b/doc/salome/examples/h012_caseDigueManual.py @@ -343,25 +343,43 @@ garonne_2.AddGeometryGroup( case_geom_group ); garonne_2.SetBoundaryPolyline( domaine ); # Start the algorithm of the partition and assignment -garonne_2.Update(); -garonne_2_litMineur = hydro_doc.FindObjectByName( "garonne_2_Reg_1" ); -garonne_2_Zone_1 = hydro_doc.FindObjectByName( "garonne_2_Zone_1" ); +garonne_2.Update() + +garonne_2_litMineur = hydro_doc.FindObjectByName( "garonne_2_Reg_1" ) +garonne_2_Zone_1 = hydro_doc.FindObjectByName( "garonne_2_Zone_1" ) garonne_2_Zone_1.SetMergeType( HYDROData_Zone.Merge_ZMIN ) -garonne_2_litMineur.AddZone( garonne_2_Zone_1 ); -garonne_2_riveDroite = hydro_doc.FindObjectByName( "garonne_2_Reg_2" ); -garonne_2_Zone_2 = hydro_doc.FindObjectByName( "garonne_2_Zone_2" ); -garonne_2_riveDroite.AddZone( garonne_2_Zone_2 ); -garonne_2_Zone_3 = hydro_doc.FindObjectByName( "garonne_2_Zone_3" ); -garonne_2_riveDroite.AddZone( garonne_2_Zone_3 ); -garonne_2_riveGauche = hydro_doc.FindObjectByName( "garonne_2_Reg_3" ); -garonne_2_Zone_4 = hydro_doc.FindObjectByName( "garonne_2_Zone_4" ); -garonne_2_riveGauche.AddZone( garonne_2_Zone_4 ); -garonne_2_Zone_5 = hydro_doc.FindObjectByName( "garonne_2_Zone_5" ); -garonne_2_riveGauche.AddZone( garonne_2_Zone_5 ); -garonne_2_digue = hydro_doc.FindObjectByName( "garonne_2_Reg_4" ); -garonne_2_Zone_6 = hydro_doc.FindObjectByName( "garonne_2_Zone_6" ); +garonne_2_Zone_1.SetColor( QColor( 192, 137, 64 )) +garonne_2_litMineur.AddZone( garonne_2_Zone_1 ) + +garonne_2_riveDroite = hydro_doc.FindObjectByName( "garonne_2_Reg_2" ) +garonne_2_Zone_2 = hydro_doc.FindObjectByName( "garonne_2_Zone_2" ) +garonne_2_Zone_2.SetColor( QColor( 64, 192, 98 )) +garonne_2_riveDroite.AddZone( garonne_2_Zone_2 ) + +garonne_2_Zone_3 = hydro_doc.FindObjectByName( "garonne_2_Zone_3" ) +garonne_2_Zone_3.SetMergeType( HYDROData_Zone.Merge_Object ) +Cloud_02 = hydro_doc.FindObjectByName( "Cloud_02" ) +garonne_2_Zone_3.SetMergeObject( Cloud_02 ) +garonne_2_Zone_3.SetColor( QColor( 64, 66, 192 )) +garonne_2_riveDroite.AddZone( garonne_2_Zone_3 ) + +garonne_2_riveGauche = hydro_doc.FindObjectByName( "garonne_2_Reg_3" ) +garonne_2_Zone_4 = hydro_doc.FindObjectByName( "garonne_2_Zone_4" ) +garonne_2_Zone_4.SetMergeType( HYDROData_Zone.Merge_Object ) +Cloud_02 = hydro_doc.FindObjectByName( "Cloud_02" ) +garonne_2_Zone_4.SetMergeObject( Cloud_02 ) +garonne_2_Zone_4.SetColor( QColor( 64, 192, 164 )) +garonne_2_riveGauche.AddZone( garonne_2_Zone_4 ) + +garonne_2_Zone_5 = hydro_doc.FindObjectByName( "garonne_2_Zone_5" ) +garonne_2_Zone_5.SetColor( QColor( 192, 149, 64 )) +garonne_2_riveGauche.AddZone( garonne_2_Zone_5 ) + +garonne_2_digue = hydro_doc.FindObjectByName( "garonne_2_Reg_4" ) +garonne_2_Zone_6 = hydro_doc.FindObjectByName( "garonne_2_Zone_6" ) garonne_2_Zone_6.SetMergeType( HYDROData_Zone.Merge_ZMAX ) -garonne_2_digue.AddZone( garonne_2_Zone_6 ); +garonne_2_Zone_6.SetColor( QColor( 64, 192, 177 )) +garonne_2_digue.AddZone( garonne_2_Zone_6 ) garonne_2_litMineur.SetName("garonne_2_litMineur") garonne_2_riveDroite.SetName("garonne_2_riveDroite") diff --git a/doc/salome/examples/h013_caseDigueManualMesh.py b/doc/salome/examples/h013_caseDigueManualMesh.py index 27b128c1..04289548 100644 --- a/doc/salome/examples/h013_caseDigueManualMesh.py +++ b/doc/salome/examples/h013_caseDigueManualMesh.py @@ -344,24 +344,42 @@ garonne_2.SetBoundaryPolyline( domaine ); # Start the algorithm of the partition and assignment garonne_2.Update(); -garonne_2_litMineur = hydro_doc.FindObjectByName( "garonne_2_Reg_1" ); -garonne_2_Zone_1 = hydro_doc.FindObjectByName( "garonne_2_Zone_1" ); + +garonne_2_litMineur = hydro_doc.FindObjectByName( "garonne_2_Reg_1" ) +garonne_2_Zone_1 = hydro_doc.FindObjectByName( "garonne_2_Zone_1" ) garonne_2_Zone_1.SetMergeType( HYDROData_Zone.Merge_ZMIN ) -garonne_2_litMineur.AddZone( garonne_2_Zone_1 ); -garonne_2_riveDroite = hydro_doc.FindObjectByName( "garonne_2_Reg_2" ); -garonne_2_Zone_2 = hydro_doc.FindObjectByName( "garonne_2_Zone_2" ); -garonne_2_riveDroite.AddZone( garonne_2_Zone_2 ); -garonne_2_Zone_3 = hydro_doc.FindObjectByName( "garonne_2_Zone_3" ); -garonne_2_riveDroite.AddZone( garonne_2_Zone_3 ); -garonne_2_riveGauche = hydro_doc.FindObjectByName( "garonne_2_Reg_3" ); -garonne_2_Zone_4 = hydro_doc.FindObjectByName( "garonne_2_Zone_4" ); -garonne_2_riveGauche.AddZone( garonne_2_Zone_4 ); -garonne_2_Zone_5 = hydro_doc.FindObjectByName( "garonne_2_Zone_5" ); -garonne_2_riveGauche.AddZone( garonne_2_Zone_5 ); -garonne_2_digue = hydro_doc.FindObjectByName( "garonne_2_Reg_4" ); -garonne_2_Zone_6 = hydro_doc.FindObjectByName( "garonne_2_Zone_6" ); +garonne_2_Zone_1.SetColor( QColor( 192, 137, 64 )) +garonne_2_litMineur.AddZone( garonne_2_Zone_1 ) + +garonne_2_riveDroite = hydro_doc.FindObjectByName( "garonne_2_Reg_2" ) +garonne_2_Zone_2 = hydro_doc.FindObjectByName( "garonne_2_Zone_2" ) +garonne_2_Zone_2.SetColor( QColor( 64, 192, 98 )) +garonne_2_riveDroite.AddZone( garonne_2_Zone_2 ) + +garonne_2_Zone_3 = hydro_doc.FindObjectByName( "garonne_2_Zone_3" ) +garonne_2_Zone_3.SetMergeType( HYDROData_Zone.Merge_Object ) +Cloud_02 = hydro_doc.FindObjectByName( "Cloud_02" ) +garonne_2_Zone_3.SetMergeObject( Cloud_02 ) +garonne_2_Zone_3.SetColor( QColor( 64, 66, 192 )) +garonne_2_riveDroite.AddZone( garonne_2_Zone_3 ) + +garonne_2_riveGauche = hydro_doc.FindObjectByName( "garonne_2_Reg_3" ) +garonne_2_Zone_4 = hydro_doc.FindObjectByName( "garonne_2_Zone_4" ) +garonne_2_Zone_4.SetMergeType( HYDROData_Zone.Merge_Object ) +Cloud_02 = hydro_doc.FindObjectByName( "Cloud_02" ) +garonne_2_Zone_4.SetMergeObject( Cloud_02 ) +garonne_2_Zone_4.SetColor( QColor( 64, 192, 164 )) +garonne_2_riveGauche.AddZone( garonne_2_Zone_4 ) + +garonne_2_Zone_5 = hydro_doc.FindObjectByName( "garonne_2_Zone_5" ) +garonne_2_Zone_5.SetColor( QColor( 192, 149, 64 )) +garonne_2_riveGauche.AddZone( garonne_2_Zone_5 ) + +garonne_2_digue = hydro_doc.FindObjectByName( "garonne_2_Reg_4" ) +garonne_2_Zone_6 = hydro_doc.FindObjectByName( "garonne_2_Zone_6" ) garonne_2_Zone_6.SetMergeType( HYDROData_Zone.Merge_ZMAX ) -garonne_2_digue.AddZone( garonne_2_Zone_6 ); +garonne_2_Zone_6.SetColor( QColor( 64, 192, 177 )) +garonne_2_digue.AddZone( garonne_2_Zone_6 ) garonne_2_litMineur.SetName("garonne_2_litMineur") garonne_2_riveDroite.SetName("garonne_2_riveDroite") @@ -396,11 +414,11 @@ geompy.addToStudyInFather( HYDRO_garonne_2, litMineur, 'litMineur' ) geompy.addToStudyInFather( HYDRO_garonne_2, riveDroite, 'riveDroite' ) SectionsGaronne = geompy.CreateGroup(HYDRO_garonne_2, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(SectionsGaronne, [4, 11]) +geompy.UnionIDs(SectionsGaronne, [7, 9]) geompy.addToStudyInFather( HYDRO_garonne_2, SectionsGaronne, 'SectionsGaronne' ) SectionsDigue = geompy.CreateGroup(HYDRO_garonne_2, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(SectionsDigue, [43, 48]) +geompy.UnionIDs(SectionsDigue, [40, 35]) geompy.addToStudyInFather( HYDRO_garonne_2, SectionsDigue, 'SectionsDigue' ) # --- recreate subshapes already exported from HYDRO to get access from Python diff --git a/doc/salome/examples/h014_caseDigueManualInterpolZ.py b/doc/salome/examples/h014_caseDigueManualInterpolZ.py index 6d6435a6..d5469b30 100644 --- a/doc/salome/examples/h014_caseDigueManualInterpolZ.py +++ b/doc/salome/examples/h014_caseDigueManualInterpolZ.py @@ -344,24 +344,42 @@ garonne_2.SetBoundaryPolyline( domaine ); # Start the algorithm of the partition and assignment garonne_2.Update(); -garonne_2_litMineur = hydro_doc.FindObjectByName( "garonne_2_Reg_1" ); -garonne_2_Zone_1 = hydro_doc.FindObjectByName( "garonne_2_Zone_1" ); + +garonne_2_litMineur = hydro_doc.FindObjectByName( "garonne_2_Reg_1" ) +garonne_2_Zone_1 = hydro_doc.FindObjectByName( "garonne_2_Zone_1" ) garonne_2_Zone_1.SetMergeType( HYDROData_Zone.Merge_ZMIN ) -garonne_2_litMineur.AddZone( garonne_2_Zone_1 ); -garonne_2_riveDroite = hydro_doc.FindObjectByName( "garonne_2_Reg_2" ); -garonne_2_Zone_2 = hydro_doc.FindObjectByName( "garonne_2_Zone_2" ); -garonne_2_riveDroite.AddZone( garonne_2_Zone_2 ); -garonne_2_Zone_3 = hydro_doc.FindObjectByName( "garonne_2_Zone_3" ); -garonne_2_riveDroite.AddZone( garonne_2_Zone_3 ); -garonne_2_riveGauche = hydro_doc.FindObjectByName( "garonne_2_Reg_3" ); -garonne_2_Zone_4 = hydro_doc.FindObjectByName( "garonne_2_Zone_4" ); -garonne_2_riveGauche.AddZone( garonne_2_Zone_4 ); -garonne_2_Zone_5 = hydro_doc.FindObjectByName( "garonne_2_Zone_5" ); -garonne_2_riveGauche.AddZone( garonne_2_Zone_5 ); -garonne_2_digue = hydro_doc.FindObjectByName( "garonne_2_Reg_4" ); -garonne_2_Zone_6 = hydro_doc.FindObjectByName( "garonne_2_Zone_6" ); +garonne_2_Zone_1.SetColor( QColor( 192, 137, 64 )) +garonne_2_litMineur.AddZone( garonne_2_Zone_1 ) + +garonne_2_riveDroite = hydro_doc.FindObjectByName( "garonne_2_Reg_2" ) +garonne_2_Zone_2 = hydro_doc.FindObjectByName( "garonne_2_Zone_2" ) +garonne_2_Zone_2.SetColor( QColor( 64, 192, 98 )) +garonne_2_riveDroite.AddZone( garonne_2_Zone_2 ) + +garonne_2_Zone_3 = hydro_doc.FindObjectByName( "garonne_2_Zone_3" ) +garonne_2_Zone_3.SetMergeType( HYDROData_Zone.Merge_Object ) +Cloud_02 = hydro_doc.FindObjectByName( "Cloud_02" ) +garonne_2_Zone_3.SetMergeObject( Cloud_02 ) +garonne_2_Zone_3.SetColor( QColor( 64, 66, 192 )) +garonne_2_riveDroite.AddZone( garonne_2_Zone_3 ) + +garonne_2_riveGauche = hydro_doc.FindObjectByName( "garonne_2_Reg_3" ) +garonne_2_Zone_4 = hydro_doc.FindObjectByName( "garonne_2_Zone_4" ) +garonne_2_Zone_4.SetMergeType( HYDROData_Zone.Merge_Object ) +Cloud_02 = hydro_doc.FindObjectByName( "Cloud_02" ) +garonne_2_Zone_4.SetMergeObject( Cloud_02 ) +garonne_2_Zone_4.SetColor( QColor( 64, 192, 164 )) +garonne_2_riveGauche.AddZone( garonne_2_Zone_4 ) + +garonne_2_Zone_5 = hydro_doc.FindObjectByName( "garonne_2_Zone_5" ) +garonne_2_Zone_5.SetColor( QColor( 192, 149, 64 )) +garonne_2_riveGauche.AddZone( garonne_2_Zone_5 ) + +garonne_2_digue = hydro_doc.FindObjectByName( "garonne_2_Reg_4" ) +garonne_2_Zone_6 = hydro_doc.FindObjectByName( "garonne_2_Zone_6" ) garonne_2_Zone_6.SetMergeType( HYDROData_Zone.Merge_ZMAX ) -garonne_2_digue.AddZone( garonne_2_Zone_6 ); +garonne_2_Zone_6.SetColor( QColor( 64, 192, 177 )) +garonne_2_digue.AddZone( garonne_2_Zone_6 ) garonne_2_litMineur.SetName("garonne_2_litMineur") garonne_2_riveDroite.SetName("garonne_2_riveDroite") @@ -396,11 +414,11 @@ geompy.addToStudyInFather( HYDRO_garonne_2, litMineur, 'litMineur' ) geompy.addToStudyInFather( HYDRO_garonne_2, riveDroite, 'riveDroite' ) SectionsGaronne = geompy.CreateGroup(HYDRO_garonne_2, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(SectionsGaronne, [4, 11]) +geompy.UnionIDs(SectionsGaronne, [7, 9]) geompy.addToStudyInFather( HYDRO_garonne_2, SectionsGaronne, 'SectionsGaronne' ) SectionsDigue = geompy.CreateGroup(HYDRO_garonne_2, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(SectionsDigue, [43, 48]) +geompy.UnionIDs(SectionsDigue, [40, 35]) geompy.addToStudyInFather( HYDRO_garonne_2, SectionsDigue, 'SectionsDigue' ) # --- recreate subshapes already exported from HYDRO to get access from Python @@ -556,7 +574,7 @@ zUndef = 90 # --- Z interpolation on the bathymety/altimetry on the mesh nodes statz = interpolZ(nomCas, fichierMaillage, dicoGroupeRegion, zUndef) -refstatz = {'riveDroite': (10.88, 32.47999954), 'riveGauche': (7.72, 71.38999939), 'litMineur': (2.06, 25.41), 'digue': (14.10,27.09)} +refstatz = {'riveDroite': (10.88, 32.61), 'riveGauche': (7.72, 71.86, 0.5), 'litMineur': (2.06, 25.41), 'digue': (14.10,27.09)} controlStatZ(statz, refstatz) # --- add a field on nodes of type double with z values, named "BOTTOM" diff --git a/doc/salome/examples/h015_normalCaseManualTelemac.py b/doc/salome/examples/h015_normalCaseManualTelemac.py index af484a0a..2b28ff3c 100644 --- a/doc/salome/examples/h015_normalCaseManualTelemac.py +++ b/doc/salome/examples/h015_normalCaseManualTelemac.py @@ -8,9 +8,9 @@ import salome salome.salome_init() theStudy = salome.myStudy - + #---------------------- -# --- HYDRO +# --- HYDRO #---------------------- from HYDROPy import * @@ -274,16 +274,31 @@ garonne_1.Update() garonne_1_litMineur = hydro_doc.FindObjectByName( "garonne_1_Reg_1" ) garonne_1_Zone_1 = hydro_doc.FindObjectByName( "garonne_1_Zone_1" ) garonne_1_Zone_1.SetMergeType( HYDROData_Zone.Merge_ZMIN ) +garonne_1_Zone_1.SetColor( QColor( 192, 113, 64 )) garonne_1_litMineur.AddZone( garonne_1_Zone_1 ) + garonne_1_riveDroite = hydro_doc.FindObjectByName( "garonne_1_Reg_2" ) garonne_1_Zone_2 = hydro_doc.FindObjectByName( "garonne_1_Zone_2" ) +garonne_1_Zone_2.SetColor( QColor( 141, 192, 64 )) garonne_1_riveDroite.AddZone( garonne_1_Zone_2 ) + garonne_1_Zone_3 = hydro_doc.FindObjectByName( "garonne_1_Zone_3" ) +garonne_1_Zone_3.SetMergeType( HYDROData_Zone.Merge_Object ) +Cloud_02 = hydro_doc.FindObjectByName( "Cloud_02" ) +garonne_1_Zone_3.SetMergeObject( Cloud_02 ) +garonne_1_Zone_3.SetColor( QColor( 64, 192, 77 )) garonne_1_riveDroite.AddZone( garonne_1_Zone_3 ) + garonne_1_riveGauche = hydro_doc.FindObjectByName( "garonne_1_Reg_3" ) garonne_1_Zone_4 = hydro_doc.FindObjectByName( "garonne_1_Zone_4" ) +garonne_1_Zone_4.SetMergeType( HYDROData_Zone.Merge_Object ) +Cloud_02 = hydro_doc.FindObjectByName( "Cloud_02" ) +garonne_1_Zone_4.SetMergeObject( Cloud_02 ) +garonne_1_Zone_4.SetColor( QColor( 64, 75, 192 )) garonne_1_riveGauche.AddZone( garonne_1_Zone_4 ) + garonne_1_Zone_5 = hydro_doc.FindObjectByName( "garonne_1_Zone_5" ) +garonne_1_Zone_5.SetColor( QColor( 64, 192, 77 )) garonne_1_riveGauche.AddZone( garonne_1_Zone_5 ) garonne_1_litMineur.SetName("garonne_1_litMineur") @@ -294,7 +309,7 @@ garonne_1_riveGauche.SetName("garonne_1_riveGauche") garonne_1_entry = garonne_1.Export( theStudy._get_StudyId() ) #---------------------- -# --- Geometry +# --- Geometry #---------------------- # Get geometry shape and print debug information @@ -311,7 +326,7 @@ HYDRO_garonne_1 = salome.IDToObject( str( garonne_1_entry ) ) print "Geom shape:", HYDRO_garonne_1 print "Geom shape name:", HYDRO_garonne_1.GetName() -# --- manual definition: geometrical faces +# --- manual definition: geometrical faces [riveGauche,litMineur,riveDroite] = geompy.ExtractShapes(HYDRO_garonne_1, geompy.ShapeType["FACE"], True) # --- manual definition: useful groups of edges @@ -347,7 +362,7 @@ controlGeomProps(geompy, litMineur, 30337.548492, 3488480.304388) controlGeomProps(geompy, riveDroite, 32012.343241, 25998769.23615) #---------------------- -# --- Meshing +# --- Meshing #---------------------- import SMESH, SALOMEDS @@ -438,7 +453,7 @@ if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(1) #---------------------- -# --- Z interpolation with HYDRO +# --- Z interpolation with HYDRO #---------------------- from salome.hydrotools.interpolZ import interpolZ, createZfield2 @@ -455,7 +470,7 @@ dicoGroupeRegion= dict(litMineur = 'garonne_1_litMineur', riveDroite = 'garonne_1_riveDroite', riveGauche = 'garonne_1_riveGauche', ) -# --- value to use for Z when the node is not in a region (used to detect problems) +# --- value to use for Z when the node is not in a region (used to detect problems) zUndef = 80 # --- Z interpolation on the bathymety/altimetry on the mesh nodes @@ -468,7 +483,7 @@ createZfield2(fichierMaillage) #---------------------- -# --- Telemac Calculation +# --- Telemac Calculation #---------------------- import shutil diff --git a/doc/salome/examples/h016_pilesPontManualMesh.py b/doc/salome/examples/h016_pilesPontManualMesh.py index cd432ccd..d7f32c7e 100644 --- a/doc/salome/examples/h016_pilesPontManualMesh.py +++ b/doc/salome/examples/h016_pilesPontManualMesh.py @@ -962,58 +962,64 @@ casGaronne_1.SetBoundaryPolyline( domaine ) casGaronne_1.Update() casGaronne_1_riveDroite = hydro_doc.FindObjectByName( "casGaronne_1_Reg_1" ) casGaronne_1_Zone_1 = hydro_doc.FindObjectByName( "casGaronne_1_Zone_1" ) -casGaronne_1_Zone_1.SetColor( QColor( 64, 192, 147 )) +casGaronne_1_Zone_1.SetColor( QColor( 64, 156, 192 )) casGaronne_1_riveDroite.AddZone( casGaronne_1_Zone_1 ) casGaronne_1_Zone_2 = hydro_doc.FindObjectByName( "casGaronne_1_Zone_2" ) -casGaronne_1_Zone_2.SetColor( QColor( 111, 192, 64 )) +casGaronne_1_Zone_2.SetMergeType( HYDROData_Zone.Merge_Object ) +Cloud_02 = hydro_doc.FindObjectByName( "Cloud_02" ) +casGaronne_1_Zone_2.SetMergeObject( Cloud_02 ) +casGaronne_1_Zone_2.SetColor( QColor( 192, 183, 64 )) casGaronne_1_riveDroite.AddZone( casGaronne_1_Zone_2 ) casGaronne_1_aval = hydro_doc.FindObjectByName( "casGaronne_1_Reg_2" ) casGaronne_1_Zone_3 = hydro_doc.FindObjectByName( "casGaronne_1_Zone_3" ) casGaronne_1_Zone_3.SetMergeType( HYDROData_Zone.Merge_Object ) garonne_point_L93 = hydro_doc.FindObjectByName( "garonne_point_L93" ) casGaronne_1_Zone_3.SetMergeObject( garonne_point_L93 ) -casGaronne_1_Zone_3.SetColor( QColor( 192, 183, 64 )) +casGaronne_1_Zone_3.SetColor( QColor( 64, 183, 192 )) casGaronne_1_aval.AddZone( casGaronne_1_Zone_3 ) casGaronne_1_riveGauche = hydro_doc.FindObjectByName( "casGaronne_1_Reg_3" ) casGaronne_1_Zone_4 = hydro_doc.FindObjectByName( "casGaronne_1_Zone_4" ) -casGaronne_1_Zone_4.SetColor( QColor( 158, 192, 64 )) +casGaronne_1_Zone_4.SetMergeType( HYDROData_Zone.Merge_Object ) +Cloud_02 = hydro_doc.FindObjectByName( "Cloud_02" ) +casGaronne_1_Zone_4.SetMergeObject( Cloud_02 ) +casGaronne_1_Zone_4.SetColor( QColor( 64, 192, 162 )) casGaronne_1_riveGauche.AddZone( casGaronne_1_Zone_4 ) casGaronne_1_Zone_6 = hydro_doc.FindObjectByName( "casGaronne_1_Zone_6" ) -casGaronne_1_Zone_6.SetColor( QColor( 64, 192, 156 )) +casGaronne_1_Zone_6.SetColor( QColor( 64, 192, 90 )) casGaronne_1_riveGauche.AddZone( casGaronne_1_Zone_6 ) casGaronne_1_pont = hydro_doc.FindObjectByName( "casGaronne_1_Reg_4" ) casGaronne_1_Zone_5 = hydro_doc.FindObjectByName( "casGaronne_1_Zone_5" ) casGaronne_1_Zone_5.SetMergeType( HYDROData_Zone.Merge_Object ) garonne_point_L93 = hydro_doc.FindObjectByName( "garonne_point_L93" ) casGaronne_1_Zone_5.SetMergeObject( garonne_point_L93 ) -casGaronne_1_Zone_5.SetColor( QColor( 192, 85, 64 )) +casGaronne_1_Zone_5.SetColor( QColor( 64, 190, 192 )) casGaronne_1_pont.AddZone( casGaronne_1_Zone_5 ) casGaronne_1_amont = hydro_doc.FindObjectByName( "casGaronne_1_Reg_5" ) casGaronne_1_Zone_7 = hydro_doc.FindObjectByName( "casGaronne_1_Zone_7" ) casGaronne_1_Zone_7.SetMergeType( HYDROData_Zone.Merge_Object ) garonne_point_L93 = hydro_doc.FindObjectByName( "garonne_point_L93" ) casGaronne_1_Zone_7.SetMergeObject( garonne_point_L93 ) -casGaronne_1_Zone_7.SetColor( QColor( 64, 90, 192 )) +casGaronne_1_Zone_7.SetColor( QColor( 109, 192, 64 )) casGaronne_1_amont.AddZone( casGaronne_1_Zone_7 ) casGaronne_1_pile1 = hydro_doc.FindObjectByName( "casGaronne_1_Reg_6" ) casGaronne_1_Zone_8 = hydro_doc.FindObjectByName( "casGaronne_1_Zone_8" ) casGaronne_1_Zone_8.SetMergeType( HYDROData_Zone.Merge_ZMAX ) -casGaronne_1_Zone_8.SetColor( QColor( 64, 190, 192 )) +casGaronne_1_Zone_8.SetColor( QColor( 192, 179, 64 )) casGaronne_1_pile1.AddZone( casGaronne_1_Zone_8 ) casGaronne_1_pile2 = hydro_doc.FindObjectByName( "casGaronne_1_Reg_7" ) casGaronne_1_Zone_9 = hydro_doc.FindObjectByName( "casGaronne_1_Zone_9" ) casGaronne_1_Zone_9.SetMergeType( HYDROData_Zone.Merge_ZMAX ) -casGaronne_1_Zone_9.SetColor( QColor( 160, 192, 64 )) +casGaronne_1_Zone_9.SetColor( QColor( 192, 75, 64 )) casGaronne_1_pile2.AddZone( casGaronne_1_Zone_9 ) casGaronne_1_pile3 = hydro_doc.FindObjectByName( "casGaronne_1_Reg_8" ) casGaronne_1_Zone_10 = hydro_doc.FindObjectByName( "casGaronne_1_Zone_10" ) casGaronne_1_Zone_10.SetMergeType( HYDROData_Zone.Merge_ZMAX ) -casGaronne_1_Zone_10.SetColor( QColor( 192, 166, 64 )) +casGaronne_1_Zone_10.SetColor( QColor( 162, 192, 64 )) casGaronne_1_pile3.AddZone( casGaronne_1_Zone_10 ) casGaronne_1_pile4 = hydro_doc.FindObjectByName( "casGaronne_1_Reg_9" ) casGaronne_1_Zone_11 = hydro_doc.FindObjectByName( "casGaronne_1_Zone_11" ) casGaronne_1_Zone_11.SetMergeType( HYDROData_Zone.Merge_ZMAX ) -casGaronne_1_Zone_11.SetColor( QColor( 64, 192, 92 )) +casGaronne_1_Zone_11.SetColor( QColor( 64, 192, 81 )) casGaronne_1_pile4.AddZone( casGaronne_1_Zone_11 ) casGaronne_1_riveDroite.SetName( "casGaronne_1_riveDroite" ) casGaronne_1_aval.SetName( "casGaronne_1_aval" ) @@ -1083,25 +1089,25 @@ geompy.UnionIDs(geomObj_8, [68, 70, 66, 63]) riveDroite = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["FACE"]) geompy.UnionIDs(riveDroite, [2]) riveGauche = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["FACE"]) -geompy.UnionIDs(riveGauche, [33]) +geompy.UnionIDs(riveGauche, [29]) litMineur_aval = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["FACE"]) -geompy.UnionIDs(litMineur_aval, [26]) +geompy.UnionIDs(litMineur_aval, [22]) litMineur_pont = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["FACE"]) -geompy.UnionIDs(litMineur_pont, [50]) +geompy.UnionIDs(litMineur_pont, [42]) litMineur_amont = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["FACE"]) -geompy.UnionIDs(litMineur_amont, [89]) +geompy.UnionIDs(litMineur_amont, [81]) sections = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(sections, [32, 91, 28, 52]) +geompy.UnionIDs(sections, [24, 28, 44, 83]) amont = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(amont, [91]) +geompy.UnionIDs(amont, [83]) aval = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) geompy.UnionIDs(aval, [28]) bordDroit = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(bordDroit, [4, 7, 25, 9, 15, 23, 13, 11]) +geompy.UnionIDs(bordDroit, [4, 7, 9, 11, 19, 21]) bordGauche = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(bordGauche, [43, 45, 49, 47, 41, 35]) +geompy.UnionIDs(bordGauche, [31, 34, 36, 41]) piles = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(piles, [57, 75, 88, 68, 63, 59, 54, 77, 61, 86, 81, 66, 84, 72, 70, 79]) +geompy.UnionIDs(piles, [73,58,71,49,55,67,46,80,53,76,78,62,69,60,51,64]) geompy.addToStudyInFather( HYDRO_casGaronne_1, casGaronne_1_pile3_Outer, 'casGaronne_1_pile3_Outer' ) geompy.addToStudyInFather( HYDRO_casGaronne_1, casGaronne_1_pile1_Outer, 'casGaronne_1_pile1_Outer' ) geompy.addToStudyInFather( HYDRO_casGaronne_1, casGaronne_1_pile2_Outer, 'casGaronne_1_pile2_Outer' ) @@ -1241,7 +1247,7 @@ casGaronne_1.ExportMED( med_file, 0, SMESH.MED_V2_2, 1, None ,1) #controlSubMeshStats(riveDroite_1, 4040) #controlSubMeshStats(riveGauche_1, 4627) controlMeshStats(casGaronne_1, 6985, 745, 13761) -controlSubMeshStats(litMineur_pont_2, 185) +controlSubMeshStats(litMineur_pont_2, 202) controlSubMeshStats(litMineur_amont_2, 3000) controlSubMeshStats(litMineur_aval_2, 2000) controlSubMeshStats(riveDroite_1, 3941) diff --git a/src/HYDROTools/controls.py b/src/HYDROTools/controls.py index 13197b5f..ff1f418e 100644 --- a/src/HYDROTools/controls.py +++ b/src/HYDROTools/controls.py @@ -5,7 +5,7 @@ def controlGeomProps(geompy, geomShape, refLength, refArea): """ compare area and length of a geometric face with a reference, - with relative precision of 1.E-3 + with relative precision of 1.E-3 """ props = geompy.BasicProperties(geomShape) print " Wires length: ", props[0] @@ -18,7 +18,7 @@ def controlGeomProps(geompy, geomShape, refLength, refArea): print " Wires length: ", refLength print " Surface area: ", refArea print " Volume : ", 0. - raise ValueError("Bad length or area") + raise ValueError("Bad length or area") # ------------------------------------- @@ -33,7 +33,7 @@ def controlMeshStats(aMesh, nbNodes, nbEdges, nbTriangles): references['Entity_Node'] = nbNodes references['Entity_Edge'] = nbEdges references['Entity_Triangle'] = nbTriangles - + mesures = aMesh.GetMeshInfo() #print mesures d= {} @@ -44,8 +44,8 @@ def controlMeshStats(aMesh, nbNodes, nbEdges, nbTriangles): or (d[key] > (1.0 + tolerance)*references[key]): print aMesh.GetName() print key, ": value: ", d[key], " reference: ", references[key] - raise ValueError("Bad number of nodes or elements") - + raise ValueError("Bad number of nodes or elements") + # ------------------------------------- def controlSubMeshStats(aSubMesh, nbItems): @@ -60,25 +60,31 @@ def controlSubMeshStats(aSubMesh, nbItems): if (nbItems < (1.0 - tolerance)*nbRef) \ or (nbItems > (1.0 + tolerance)*nbRef): print aSubMesh.GetName() - print "value: ", nbItems, " reference: ", nbRef - raise ValueError("Bad number of nodes or elements") - + print "value: ", nbRef, " reference: ", nbItems + raise ValueError("Bad number of nodes or elements") + # ------------------------------------- def controlStatZ(statz,refstatz): """ Compare min and max of z of regions with a reference, - with a precision of 0.05m. + with a precision of 0.05m by default. """ - tolerance = 0.05 # metres for nomreg, valsref in refstatz.iteritems(): vals = statz[nomreg] + tolerance =0.05 + if len(valsref) > 2: + tolerance = valsref[2] if abs(vals[0] - valsref[0]) > tolerance \ or abs(vals[1] - valsref[1]) > tolerance: print nomreg - print "value: ", vals, " reference: ", valsref - raise ValueError("z interpolation error") - + print "value: ", vals, " reference: ", valsref, "tolerance: ", tolerance + raise ValueError("z interpolation error") + else: + print nomreg + print "value: ", vals, " reference: ", valsref, "tolerance: ", tolerance, " OK" + + import MEDLoader from MEDLoader import MEDCouplingFieldDouble, ON_NODES, DataArrayDouble, MEDFileMesh import os, time @@ -111,4 +117,4 @@ def controlTelemacResult(aMedFile, refs): print nomreg print "value: ", vals, " reference: ", valsref raise ValueError("error in Telemac result") - + diff --git a/src/HYDROTools/interpolZ.py b/src/HYDROTools/interpolZ.py index 0321ca9d..946ad23d 100644 --- a/src/HYDROTools/interpolZ.py +++ b/src/HYDROTools/interpolZ.py @@ -14,7 +14,7 @@ dicoGroupeRegion= dict(litMineur = 'inondation1_litMineur', litMajeurDroite = 'inondation1_riveDroite', litMajeurGauche = 'inondation1_riveGauche', ) -# --- value to use for Z when the node is not in a region (used to detect problems) +# --- value to use for Z when the node is not in a region (used to detect problems) zUndef = 90 # --- Z interpolation on the bathymety/altimetry on the mesh nodes @@ -57,7 +57,7 @@ def createZfield1(fichierMaillage): fichierMaillage : 2D (x,y) med file produced by SMESH and used by interpolZ. return F.med : med file containing the field "BOTTOM" """ - + noms = string.split(fichierMaillage,'.') basename = string.join(noms[:-1], '.') fichierFMaillage = basename + 'F.med' @@ -82,21 +82,21 @@ def createZfield1(fichierMaillage): # --- table des numeros des noeuds numnoe = medfile.MEDINT(nnoe) - # --- Lecture des composantes des coordonnees des noeuds + # --- Lecture des composantes des coordonnees des noeuds medmesh.MEDmeshNodeCoordinateRd(fid, maa, medenum.MED_NO_DT, medenum.MED_NO_IT, medenum.MED_FULL_INTERLACE, coords) #print "Valeur de coords : ",coords valz=medfile.MEDFLOAT([z for (i,z) in enumerate(coords) if i%3==2]) #print "Valeur de z : ",valz - # --- creation du champ + # --- creation du champ nomcha1 = "BOTTOM" ncomp1 = 1 # --1234567890123456-- comp1 = "z " unit1 = "m " dtunit = "" - medfield.MEDfieldCr(fid, nomcha1, medfile.MED_FLOAT64, + medfield.MEDfieldCr(fid, nomcha1, medfile.MED_FLOAT64, ncomp1, comp1, unit1, dtunit, maa) # --- ecriture du champ @@ -106,6 +106,7 @@ def createZfield1(fichierMaillage): medenum.MED_FULL_INTERLACE, medenum.MED_ALL_CONSTITUENT, nnoe, valz) # --- fermeture du fichier medfile.MEDfileClose(fid) + print fichierFMaillage, " field BOTTOM OK" # ----------------------------------------------------------------------------- @@ -121,7 +122,7 @@ def createZfield2(fichierMaillage): fichierMaillage : 2D (x,y) med file produced by SMESH and used by interpolZ. return F.med : med file containing the field "BOTTOM" """ - + noms = string.split(fichierMaillage,'.') basename = string.join(noms[:-1], '.') fichierZMaillage = basename + 'Z.med' @@ -136,6 +137,7 @@ def createZfield2(fichierMaillage): mm=MEDFileMesh.New(fichierZMaillage) mm.write(fichierFMaillage,2) MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fichierFMaillage,fieldOnNodes) + print fichierFMaillage, " field BOTTOM OK" # ----------------------------------------------------------------------------- @@ -148,7 +150,7 @@ class MyInterpolator( HYDROPy.HYDROData_IInterpolator ): #z2 = (z - 74.0)*10 z2 = z return z2 - + # ----------------------------------------------------------------------------- import SMESH @@ -187,25 +189,25 @@ def interpolZ(nomCas, fichierMaillage, dicoGroupeRegion, zUndef, interpolMethod print fichierZMaillage print fichierFMaillage print fichierFonds - + regions = {} ([maillagePlat], status) = smesh.CreateMeshesFromMED(fichierMaillage) groups = maillagePlat.GetGroups() - + grpns = [grp for grp in groups if grp.GetType() == SMESH.NODE] if len(grpns) == 0: print "Problem! There are no groups of nodes in the mesh!" - print "Please create at least the groups of nodes corresponding to each region of the HYDRO case" + print "Please create at least the groups of nodes corresponding to each region of the HYDRO case" return {} - - + + for grp in groups: if grp.GetType() == SMESH.NODE: grpName = grp.GetName() print grpName if grpName in dicoGroupeRegion.keys(): regions[dicoGroupeRegion[grpName]] = grp - + fo = open(fichierFonds, 'w') statz = {} for nomreg, grp in regions.iteritems(): @@ -227,7 +229,7 @@ def interpolZ(nomCas, fichierMaillage, dicoGroupeRegion, zUndef, interpolMethod maxz = max(vz) statz[grp.GetName()] = (minz, maxz) - + for i,nodeId in enumerate(nodesIds): x = vx[i] y = vy[i]