From cf1e49c500cefe521f4a181d591771123713325e Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Mon, 29 May 2017 22:48:14 +0200 Subject: [PATCH] script h016 plus robuste --- .../examples/h016_pilesPontManualMesh.py | 535 ++++++++++-------- 1 file changed, 286 insertions(+), 249 deletions(-) diff --git a/doc/salome/examples/h016_pilesPontManualMesh.py b/doc/salome/examples/h016_pilesPontManualMesh.py index 94dffb39..2ecaf99b 100644 --- a/doc/salome/examples/h016_pilesPontManualMesh.py +++ b/doc/salome/examples/h016_pilesPontManualMesh.py @@ -924,122 +924,122 @@ pile4.Update() # Calculation case -casGaronne_1 = hydro_doc.CreateObject( KIND_CALCULATION ) -casGaronne_1.SetName( "casGaronne_1" ) - -casGaronne_1.SetAssignmentMode( HYDROData_CalculationCase.MANUAL ) -casGaronne_1.AddGeometryObject( domaineEtendu ) -casGaronne_1.AddGeometryObject( litMajeur ) -casGaronne_1.AddGeometryObject( litMineur_amont ) -casGaronne_1.AddGeometryObject( litMineur_aval ) -casGaronne_1.AddGeometryObject( litMineur_pont ) -casGaronne_1.AddGeometryObject( pile1 ) -casGaronne_1.AddGeometryObject( pile2 ) -casGaronne_1.AddGeometryObject( pile3 ) -casGaronne_1.AddGeometryObject( pile4 ) +garonne_1 = hydro_doc.CreateObject( KIND_CALCULATION ) +garonne_1.SetName( "garonne_1" ) + +garonne_1.SetAssignmentMode( HYDROData_CalculationCase.MANUAL ) +garonne_1.AddGeometryObject( domaineEtendu ) +garonne_1.AddGeometryObject( litMajeur ) +garonne_1.AddGeometryObject( litMineur_amont ) +garonne_1.AddGeometryObject( litMineur_aval ) +garonne_1.AddGeometryObject( litMineur_pont ) +garonne_1.AddGeometryObject( pile1 ) +garonne_1.AddGeometryObject( pile2 ) +garonne_1.AddGeometryObject( pile3 ) +garonne_1.AddGeometryObject( pile4 ) case_geom_group = domaineEtendu.GetGroup( 0 ) -casGaronne_1.AddGeometryGroup( case_geom_group ) +garonne_1.AddGeometryGroup( case_geom_group ) case_geom_group = litMajeur.GetGroup( 0 ) -casGaronne_1.AddGeometryGroup( case_geom_group ) +garonne_1.AddGeometryGroup( case_geom_group ) case_geom_group = litMineur_amont.GetGroup( 0 ) -casGaronne_1.AddGeometryGroup( case_geom_group ) +garonne_1.AddGeometryGroup( case_geom_group ) case_geom_group = litMineur_aval.GetGroup( 0 ) -casGaronne_1.AddGeometryGroup( case_geom_group ) +garonne_1.AddGeometryGroup( case_geom_group ) case_geom_group = litMineur_pont.GetGroup( 0 ) -casGaronne_1.AddGeometryGroup( case_geom_group ) +garonne_1.AddGeometryGroup( case_geom_group ) case_geom_group = pile1.GetGroup( 0 ) -casGaronne_1.AddGeometryGroup( case_geom_group ) +garonne_1.AddGeometryGroup( case_geom_group ) case_geom_group = pile2.GetGroup( 0 ) -casGaronne_1.AddGeometryGroup( case_geom_group ) +garonne_1.AddGeometryGroup( case_geom_group ) case_geom_group = pile3.GetGroup( 0 ) -casGaronne_1.AddGeometryGroup( case_geom_group ) +garonne_1.AddGeometryGroup( case_geom_group ) case_geom_group = pile4.GetGroup( 0 ) -casGaronne_1.AddGeometryGroup( case_geom_group ) -casGaronne_1.SetBoundaryPolyline( domaine ) +garonne_1.AddGeometryGroup( case_geom_group ) +garonne_1.SetBoundaryPolyline( domaine ) # Start the algorithm of the partition and assignment -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, 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.SetMergeType( HYDROData_Zone.Merge_Object ) +garonne_1.Update() +garonne_1_riveDroite = hydro_doc.FindObjectByName( "garonne_1_Reg_1" ) +garonne_1_Zone_1 = hydro_doc.FindObjectByName( "garonne_1_Zone_1" ) +garonne_1_Zone_1.SetColor( QColor( 64, 156, 192 )) +garonne_1_riveDroite.AddZone( garonne_1_Zone_1 ) +garonne_1_Zone_2 = hydro_doc.FindObjectByName( "garonne_1_Zone_2" ) +garonne_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_1_Zone_2.SetMergeObject( Cloud_02 ) +garonne_1_Zone_2.SetColor( QColor( 192, 183, 64 )) +garonne_1_riveDroite.AddZone( garonne_1_Zone_2 ) +garonne_1_aval = hydro_doc.FindObjectByName( "garonne_1_Reg_2" ) +garonne_1_Zone_3 = hydro_doc.FindObjectByName( "garonne_1_Zone_3" ) +garonne_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( 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.SetMergeType( HYDROData_Zone.Merge_Object ) +garonne_1_Zone_3.SetMergeObject( garonne_point_L93 ) +garonne_1_Zone_3.SetColor( QColor( 64, 183, 192 )) +garonne_1_aval.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" ) -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, 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_1_Zone_4.SetMergeObject( Cloud_02 ) +garonne_1_Zone_4.SetColor( QColor( 64, 192, 162 )) +garonne_1_riveGauche.AddZone( garonne_1_Zone_4 ) +garonne_1_Zone_6 = hydro_doc.FindObjectByName( "garonne_1_Zone_6" ) +garonne_1_Zone_6.SetColor( QColor( 64, 192, 90 )) +garonne_1_riveGauche.AddZone( garonne_1_Zone_6 ) +garonne_1_pont = hydro_doc.FindObjectByName( "garonne_1_Reg_4" ) +garonne_1_Zone_5 = hydro_doc.FindObjectByName( "garonne_1_Zone_5" ) +garonne_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( 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_1_Zone_5.SetMergeObject( garonne_point_L93 ) +garonne_1_Zone_5.SetColor( QColor( 64, 190, 192 )) +garonne_1_pont.AddZone( garonne_1_Zone_5 ) +garonne_1_amont = hydro_doc.FindObjectByName( "garonne_1_Reg_5" ) +garonne_1_Zone_7 = hydro_doc.FindObjectByName( "garonne_1_Zone_7" ) +garonne_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( 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( 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( 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( 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, 81 )) -casGaronne_1_pile4.AddZone( casGaronne_1_Zone_11 ) -casGaronne_1_riveDroite.SetName( "casGaronne_1_riveDroite" ) -casGaronne_1_aval.SetName( "casGaronne_1_aval" ) -casGaronne_1_riveGauche.SetName( "casGaronne_1_riveGauche" ) -casGaronne_1_pont.SetName( "casGaronne_1_pont" ) -casGaronne_1_amont.SetName( "casGaronne_1_amont" ) -casGaronne_1_pile1.SetName( "casGaronne_1_pile1" ) -casGaronne_1_pile2.SetName( "casGaronne_1_pile2" ) -casGaronne_1_pile3.SetName( "casGaronne_1_pile3" ) -casGaronne_1_pile4.SetName( "casGaronne_1_pile4" ) +garonne_1_Zone_7.SetMergeObject( garonne_point_L93 ) +garonne_1_Zone_7.SetColor( QColor( 109, 192, 64 )) +garonne_1_amont.AddZone( garonne_1_Zone_7 ) +garonne_1_pile1 = hydro_doc.FindObjectByName( "garonne_1_Reg_6" ) +garonne_1_Zone_8 = hydro_doc.FindObjectByName( "garonne_1_Zone_8" ) +garonne_1_Zone_8.SetMergeType( HYDROData_Zone.Merge_ZMAX ) +garonne_1_Zone_8.SetColor( QColor( 192, 179, 64 )) +garonne_1_pile1.AddZone( garonne_1_Zone_8 ) +garonne_1_pile2 = hydro_doc.FindObjectByName( "garonne_1_Reg_7" ) +garonne_1_Zone_9 = hydro_doc.FindObjectByName( "garonne_1_Zone_9" ) +garonne_1_Zone_9.SetMergeType( HYDROData_Zone.Merge_ZMAX ) +garonne_1_Zone_9.SetColor( QColor( 192, 75, 64 )) +garonne_1_pile2.AddZone( garonne_1_Zone_9 ) +garonne_1_pile3 = hydro_doc.FindObjectByName( "garonne_1_Reg_8" ) +garonne_1_Zone_10 = hydro_doc.FindObjectByName( "garonne_1_Zone_10" ) +garonne_1_Zone_10.SetMergeType( HYDROData_Zone.Merge_ZMAX ) +garonne_1_Zone_10.SetColor( QColor( 162, 192, 64 )) +garonne_1_pile3.AddZone( garonne_1_Zone_10 ) +garonne_1_pile4 = hydro_doc.FindObjectByName( "garonne_1_Reg_9" ) +garonne_1_Zone_11 = hydro_doc.FindObjectByName( "garonne_1_Zone_11" ) +garonne_1_Zone_11.SetMergeType( HYDROData_Zone.Merge_ZMAX ) +garonne_1_Zone_11.SetColor( QColor( 64, 192, 81 )) +garonne_1_pile4.AddZone( garonne_1_Zone_11 ) +garonne_1_riveDroite.SetName( "garonne_1_riveDroite" ) +garonne_1_aval.SetName( "garonne_1_aval" ) +garonne_1_riveGauche.SetName( "garonne_1_riveGauche" ) +garonne_1_pont.SetName( "garonne_1_pont" ) +garonne_1_amont.SetName( "garonne_1_amont" ) +garonne_1_pile1.SetName( "garonne_1_pile1" ) +garonne_1_pile2.SetName( "garonne_1_pile2" ) +garonne_1_pile3.SetName( "garonne_1_pile3" ) +garonne_1_pile4.SetName( "garonne_1_pile4" ) # Export of the calculation case -casGaronne_1_entry = casGaronne_1.Export( theStudy._get_StudyId() ) +garonne_1_entry = garonne_1.Export( theStudy._get_StudyId() ) # Get geometry shape and print debug information import GEOM -print "Entry:", casGaronne_1_entry -HYDRO_casGaronne_1 = salome.IDToObject( str( casGaronne_1_entry ) ) -print "Geom shape:", HYDRO_casGaronne_1 -print "Geom shape name:", HYDRO_casGaronne_1.GetName() +print "Entry:", garonne_1_entry +HYDRO_garonne_1 = salome.IDToObject( str( garonne_1_entry ) ) +print "Geom shape:", HYDRO_garonne_1 +print "Geom shape name:", HYDRO_garonne_1.GetName() ### @@ -1054,87 +1054,103 @@ from salome.hydrotools.controls import controlGeomProps geompy = geomBuilder.New(theStudy) -casGaronne_1_pile3_Outer = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(casGaronne_1_pile3_Outer, [68, 70, 66, 63]) -casGaronne_1_pile1_Outer = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(casGaronne_1_pile1_Outer, [77, 79, 75, 72]) -casGaronne_1_pile2_Outer = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(casGaronne_1_pile2_Outer, [57, 54, 59, 61]) -casGaronne_1_pile4_Outer = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(casGaronne_1_pile4_Outer, [84, 81, 86, 88]) -casGaronne_1_litMineur_amont_Outer = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(casGaronne_1_litMineur_amont_Outer, [21, 39]) -casGaronne_1_litMineur_aval_Outer = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(casGaronne_1_litMineur_aval_Outer, [17, 30]) -casGaronne_1_litMineur_pont_Outer = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(casGaronne_1_litMineur_pont_Outer, [52, 32, 19, 37]) -casGaronne_1_domaineEtendu_Outer = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(casGaronne_1_domaineEtendu_Outer, [28, 91, 13, 4, 7, 9, 11, 15, 23, 25, 35, 43, 41, 49, 47, 45]) -geomObj_1 = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(geomObj_1, [52, 32, 19, 37]) -geomObj_2 = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(geomObj_2, [57, 54, 59, 61]) -geomObj_3 = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(geomObj_3, [21, 39]) -geomObj_4 = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(geomObj_4, [17, 30]) -geomObj_5 = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(geomObj_5, [77, 79, 75, 72]) -geomObj_6 = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(geomObj_6, [84, 81, 86, 88]) -geomObj_7 = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(geomObj_7, [28, 91, 13, 4, 7, 9, 11, 15, 23, 25, 35, 43, 41, 49, 47, 45]) -geomObj_8 = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -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]) -litMineur_aval = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["FACE"]) -geompy.UnionIDs(litMineur_aval, [26]) -litMineur_pont = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["FACE"]) -geompy.UnionIDs(litMineur_pont, [50]) -litMineur_amont = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["FACE"]) -geompy.UnionIDs(litMineur_amont, [89]) -sections = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(sections, [28, 32, 52, 91]) -amont = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(amont, [91]) -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, 9, 11, 13, 15, 23, 25]) -bordGauche = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(bordGauche, [35, 41, 43, 45, 47, 49]) -piles = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -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' ) -geompy.addToStudyInFather( HYDRO_casGaronne_1, casGaronne_1_pile4_Outer, 'casGaronne_1_pile4_Outer' ) -geompy.addToStudyInFather( HYDRO_casGaronne_1, casGaronne_1_litMineur_amont_Outer, 'casGaronne_1_litMineur_amont_Outer' ) -geompy.addToStudyInFather( HYDRO_casGaronne_1, casGaronne_1_litMineur_aval_Outer, 'casGaronne_1_litMineur_aval_Outer' ) -geompy.addToStudyInFather( HYDRO_casGaronne_1, casGaronne_1_litMineur_pont_Outer, 'casGaronne_1_litMineur_pont_Outer' ) -geompy.addToStudyInFather( HYDRO_casGaronne_1, casGaronne_1_domaineEtendu_Outer, 'casGaronne_1_domaineEtendu_Outer' ) -geompy.addToStudyInFather( HYDRO_casGaronne_1, riveDroite, 'riveDroite' ) -geompy.addToStudyInFather( HYDRO_casGaronne_1, riveGauche, 'riveGauche' ) -geompy.addToStudyInFather( HYDRO_casGaronne_1, litMineur_aval, 'litMineur_aval' ) -geompy.addToStudyInFather( HYDRO_casGaronne_1, litMineur_pont, 'litMineur_pont' ) -geompy.addToStudyInFather( HYDRO_casGaronne_1, litMineur_amont, 'litMineur_amont' ) -geompy.addToStudyInFather( HYDRO_casGaronne_1, sections, 'sections' ) -geompy.addToStudyInFather( HYDRO_casGaronne_1, amont, 'amont' ) -geompy.addToStudyInFather( HYDRO_casGaronne_1, aval, 'aval' ) -geompy.addToStudyInFather( HYDRO_casGaronne_1, bordDroit, 'bordDroit' ) -geompy.addToStudyInFather( HYDRO_casGaronne_1, bordGauche, 'bordGauche' ) -geompy.addToStudyInFather( HYDRO_casGaronne_1, piles, 'piles' ) +[garonne_riveDroite,garonne_aval,garonne_riveGauche,garonne_pont,garonne_amont] = geompy.SubShapeAll(HYDRO_garonne_1, geompy.ShapeType["FACE"]) # --- basic properties control: edges length, surfaces -controlGeomProps(geompy, riveGauche, 29149.1353799, 35949580.6716) -controlGeomProps(geompy, litMineur_aval, 7965.23431497, 935955.786347) -controlGeomProps(geompy, litMineur_pont, 961.8255222, 19618.016847) -controlGeomProps(geompy, litMineur_amont, 22635.6212065, 2531409.65041) -controlGeomProps(geompy, riveDroite, 32012.2241814, 25998085.6892) - +controlGeomProps(geompy, garonne_riveGauche, 29149.1353799, 35949580.6716) +controlGeomProps(geompy, garonne_aval, 7965.23431497, 935955.786347) +controlGeomProps(geompy, garonne_pont, 961.8255222, 19618.016847) +controlGeomProps(geompy, garonne_amont, 22635.6212065, 2531409.65041) +controlGeomProps(geompy, garonne_riveDroite, 32012.2241814, 25998085.6892) + +# --- manual identification of all useful edge groups (boundary conditions) + +allEdgesIds = geompy.SubShapeAllIDs(HYDRO_garonne_1, geompy.ShapeType["EDGE"]) +print "allEdgesIds", allEdgesIds + +(isDone, ClosedFreeBoundary, OpenFreeBoundary) = geompy.GetFreeBoundary(HYDRO_garonne_1) +geompy.addToStudyInFather(HYDRO_garonne_1, ClosedFreeBoundary[0], "OuterFreeBoundary") +geompy.addToStudyInFather(HYDRO_garonne_1, ClosedFreeBoundary[1], "pilesPont1") +geompy.addToStudyInFather(HYDRO_garonne_1, ClosedFreeBoundary[2], "pilesPont2") +geompy.addToStudyInFather(HYDRO_garonne_1, ClosedFreeBoundary[3], "pilesPont3") +geompy.addToStudyInFather(HYDRO_garonne_1, ClosedFreeBoundary[4], "pilesPont4") + +freeBoundary = geompy.ExtractShapes(ClosedFreeBoundary[0], geompy.ShapeType["EDGE"], True) +freeBoundaryIds = [ geompy.GetSubShapeID(HYDRO_garonne_1, freeBoundary[i]) for i in range(len(freeBoundary)) ] +print "freeBoundaryIds", freeBoundaryIds + +edgesPile1 = geompy.ExtractShapes(ClosedFreeBoundary[1], geompy.ShapeType["EDGE"], True) +edgesPile2 = geompy.ExtractShapes(ClosedFreeBoundary[2], geompy.ShapeType["EDGE"], True) +edgesPile3 = geompy.ExtractShapes(ClosedFreeBoundary[3], geompy.ShapeType["EDGE"], True) +edgesPile4 = geompy.ExtractShapes(ClosedFreeBoundary[4], geompy.ShapeType["EDGE"], True) +pilesPont1Ids = [ geompy.GetSubShapeID(HYDRO_garonne_1, edgesPile1[i]) for i in range(len(edgesPile1)) ] +pilesPont2Ids = [ geompy.GetSubShapeID(HYDRO_garonne_1, edgesPile2[i]) for i in range(len(edgesPile2)) ] +pilesPont3Ids = [ geompy.GetSubShapeID(HYDRO_garonne_1, edgesPile3[i]) for i in range(len(edgesPile3)) ] +pilesPont4Ids = [ geompy.GetSubShapeID(HYDRO_garonne_1, edgesPile4[i]) for i in range(len(edgesPile4)) ] +pilesPontIds = pilesPont1Ids + pilesPont2Ids + pilesPont3Ids + pilesPont4Ids +print "pilesPontIds", pilesPontIds + +[garonne_aval_droite] = geompy.GetSharedShapesMulti([garonne_riveDroite, garonne_aval], geompy.ShapeType["EDGE"], True) +[garonne_aval_gauche] = geompy.GetSharedShapesMulti([garonne_riveGauche, garonne_aval], geompy.ShapeType["EDGE"], True) +geompy.addToStudyInFather(HYDRO_garonne_1, garonne_aval_droite, "garonne_aval_droite") +geompy.addToStudyInFather(HYDRO_garonne_1, garonne_aval_gauche, "garonne_aval_gauche") +[garonne_amont_droite] = geompy.GetSharedShapesMulti([garonne_riveDroite, garonne_amont], geompy.ShapeType["EDGE"], True) +[garonne_amont_gauche] = geompy.GetSharedShapesMulti([garonne_riveGauche, garonne_amont], geompy.ShapeType["EDGE"], True) +geompy.addToStudyInFather(HYDRO_garonne_1, garonne_amont_droite, "garonne_amont_droite") +geompy.addToStudyInFather(HYDRO_garonne_1, garonne_amont_gauche, "garonne_amont_gauche") +[garonne_pont_droite] = geompy.GetSharedShapesMulti([garonne_riveDroite, garonne_pont], geompy.ShapeType["EDGE"], True) +[garonne_pont_gauche] = geompy.GetSharedShapesMulti([garonne_riveGauche, garonne_pont], geompy.ShapeType["EDGE"], True) +geompy.addToStudyInFather(HYDRO_garonne_1, garonne_pont_droite, "garonne_pont_droite") +geompy.addToStudyInFather(HYDRO_garonne_1, garonne_pont_gauche, "garonne_pont_gauche") +rives = [garonne_aval_droite, garonne_aval_gauche, garonne_amont_droite, garonne_amont_gauche, garonne_pont_droite, garonne_pont_gauche] +rivesIds = [ geompy.GetSubShapeID(HYDRO_garonne_1, rives[i]) for i in range(len(rives)) ] +print "rivesIds", rivesIds + +edges_garonne_aval = geompy.GetSharedShapesMulti([HYDRO_garonne_1, garonne_aval], geompy.ShapeType["EDGE"], True) +edges_garonne_amont = geompy.GetSharedShapesMulti([HYDRO_garonne_1, garonne_amont], geompy.ShapeType["EDGE"], True) +edges_garonne_pont = geompy.GetSharedShapesMulti([HYDRO_garonne_1, garonne_pont], geompy.ShapeType["EDGE"], True) +edges_riveGauche = geompy.GetSharedShapesMulti([HYDRO_garonne_1, garonne_riveGauche], geompy.ShapeType["EDGE"], True) +edges_riveDroite = geompy.GetSharedShapesMulti([HYDRO_garonne_1, garonne_riveDroite], geompy.ShapeType["EDGE"], True) +edges_garonne_avalIds = [ geompy.GetSubShapeID(HYDRO_garonne_1, edges_garonne_aval[i]) for i in range(len(edges_garonne_aval)) ] +edges_garonne_amontIds = [ geompy.GetSubShapeID(HYDRO_garonne_1, edges_garonne_amont[i]) for i in range(len(edges_garonne_amont)) ] +edges_garonne_pontIds = [ geompy.GetSubShapeID(HYDRO_garonne_1, edges_garonne_pont[i]) for i in range(len(edges_garonne_pont)) ] +edges_riveGaucheIds = [ geompy.GetSubShapeID(HYDRO_garonne_1, edges_riveGauche[i]) for i in range(len(edges_riveGauche)) ] +edges_riveDroiteIds = [ geompy.GetSubShapeID(HYDRO_garonne_1, edges_riveDroite[i]) for i in range(len(edges_riveDroite)) ] + +print "edges_garonne_amontIds", edges_garonne_amontIds +print "edges_garonne_avalIds", edges_garonne_avalIds +print "edges_garonne_pontIds", edges_garonne_pontIds +print "edges_riveGaucheIds", edges_riveGaucheIds +print "edges_riveDroiteIds", edges_riveDroiteIds + +edges_litMineurIds = edges_garonne_amontIds +for edge in edges_garonne_avalIds: + edges_litMineurIds.append(edge) +for edge in edges_garonne_pontIds: + if edge not in edges_litMineurIds and edge not in pilesPontIds: + edges_litMineurIds.append(edge) + +sectionsIds = [Id for Id in edges_litMineurIds if Id not in rivesIds] +print "sectionsIds", sectionsIds +SectionsGaronne = geompy.CreateGroup(HYDRO_garonne_1, geompy.ShapeType["EDGE"]) +geompy.UnionIDs(SectionsGaronne, sectionsIds) +geompy.addToStudyInFather(HYDRO_garonne_1, SectionsGaronne, "SectionsGaronne") + +bordGaucheDomaineIds = [Id for Id in freeBoundaryIds if Id in edges_riveGaucheIds] +bordDroiteDomaineIds = [Id for Id in freeBoundaryIds if Id in edges_riveDroiteIds] +print "bordGaucheDomaineIds", bordGaucheDomaineIds +print "bordDroiteDomaineIds", bordDroiteDomaineIds +bordGaucheDomaine = geompy.CreateGroup(HYDRO_garonne_1, geompy.ShapeType["EDGE"]) +geompy.UnionIDs(bordGaucheDomaine, bordGaucheDomaineIds) +geompy.addToStudyInFather(HYDRO_garonne_1, bordGaucheDomaine, "bordGaucheDomaine") +bordDroiteDomaine = geompy.CreateGroup(HYDRO_garonne_1, geompy.ShapeType["EDGE"]) +geompy.UnionIDs(bordDroiteDomaine, bordDroiteDomaineIds) +geompy.addToStudyInFather(HYDRO_garonne_1, bordDroiteDomaine, "bordDroiteDomaine") + +amont = geompy.GetEdgeNearPoint(HYDRO_garonne_1, geompy.MakeVertex(46757.861314, 25833.234752, 0)) +aval = geompy.GetEdgeNearPoint(HYDRO_garonne_1, geompy.MakeVertex(39078.979127, 32588.627279, 0)) +geompy.addToStudyInFather(HYDRO_garonne_1, amont, "amont") +geompy.addToStudyInFather(HYDRO_garonne_1, aval, "aval") ### ### SMESH component ### @@ -1142,11 +1158,12 @@ controlGeomProps(geompy, riveDroite, 32012.2241814, 25998085.6892) import SMESH, SALOMEDS from salome.smesh import smeshBuilder from salome.hydrotools.controls import controlMeshStats, controlSubMeshStats +import tempfile smesh = smeshBuilder.New(theStudy) -casGaronne_1 = smesh.Mesh(HYDRO_casGaronne_1) -NETGEN_2D = casGaronne_1.Triangle(algo=smeshBuilder.NETGEN_1D2D) -NETGEN_2D_Parameters_1 = NETGEN_2D.Parameters() +garonne_1 = smesh.Mesh(HYDRO_garonne_1) +NETGEN_1D_2D = garonne_1.Triangle(algo=smeshBuilder.NETGEN_1D2D) +NETGEN_2D_Parameters_1 = NETGEN_1D_2D.Parameters() NETGEN_2D_Parameters_1.SetMaxSize( 200 ) NETGEN_2D_Parameters_1.SetSecondOrder( 0 ) NETGEN_2D_Parameters_1.SetOptimize( 1 ) @@ -1155,23 +1172,21 @@ NETGEN_2D_Parameters_1.SetMinSize( 50 ) NETGEN_2D_Parameters_1.SetUseSurfaceCurvature( 1 ) NETGEN_2D_Parameters_1.SetFuseEdges( 1 ) NETGEN_2D_Parameters_1.SetQuadAllowed( 0 ) -Regular_1D = casGaronne_1.Segment(geom=litMineur_aval) -litMineur_aval_1 = Regular_1D.GetSubMesh() -nbseg_litMineur_aval = Regular_1D.NumberOfSegments(100) -QuadFromMedialAxis_1D2D = casGaronne_1.Quadrangle(algo=smeshBuilder.QUAD_MA_PROJ,geom=litMineur_aval) -nbseg_litMineur_amont = smesh.CreateHypothesis('NumberOfSegments') -nbseg_litMineur_amont.SetNumberOfSegments( 150 ) -Regular_1D_1 = casGaronne_1.Segment(geom=litMineur_amont) -litMineur_amont_1 = Regular_1D_1.GetSubMesh() -nbSeg_litMineur_amont = Regular_1D_1.NumberOfSegments(150) -QuadFromMedialAxis_1D2D_1 = casGaronne_1.Quadrangle(algo=smeshBuilder.QUAD_MA_PROJ,geom=litMineur_amont) -Regular_1D_2 = casGaronne_1.Segment(geom=sections) -sections_1 = Regular_1D_2.GetSubMesh() -nbseg_sections = Regular_1D_2.NumberOfSegments(10) -isDone = casGaronne_1.SetMeshOrder( [ [ sections_1, litMineur_aval_1, litMineur_amont_1 ] ]) -NETGEN_2D_1 = casGaronne_1.Triangle(algo=smeshBuilder.NETGEN_1D2D,geom=litMineur_pont) -litMineur_pont_1 = NETGEN_2D_1.GetSubMesh() -NETGEN_2D_Parameters_2 = NETGEN_2D_1.Parameters() +Regular_1D = garonne_1.Segment(geom=garonne_aval) +garonne_aval_1 = Regular_1D.GetSubMesh() +Number_of_Segments_1 = Regular_1D.NumberOfSegments(100) +QuadFromMedialAxis_1D2D = garonne_1.Quadrangle(algo=smeshBuilder.QUAD_MA_PROJ,geom=garonne_aval) +Regular_1D_1 = garonne_1.Segment(geom=garonne_amont) +garonne_amont_1 = Regular_1D_1.GetSubMesh() +Number_of_Segments_2 = Regular_1D_1.NumberOfSegments(150) +QuadFromMedialAxis_1D2D_1 = garonne_1.Quadrangle(algo=smeshBuilder.QUAD_MA_PROJ,geom=garonne_amont) +Regular_1D_2 = garonne_1.Segment(geom=SectionsGaronne) +sections = Regular_1D_2.GetSubMesh() +Number_of_Segments_3 = Regular_1D_2.NumberOfSegments(10) +isDone = garonne_1.SetMeshOrder( [ [ sections, garonne_aval_1, garonne_amont_1 ] ]) +NETGEN_1D_2D_1 = garonne_1.Triangle(algo=smeshBuilder.NETGEN_1D2D,geom=garonne_pont) +garonne_pont_1 = NETGEN_1D_2D_1.GetSubMesh() +NETGEN_2D_Parameters_2 = NETGEN_1D_2D_1.Parameters() NETGEN_2D_Parameters_2.SetMaxSize( 50 ) NETGEN_2D_Parameters_2.SetSecondOrder( 0 ) NETGEN_2D_Parameters_2.SetOptimize( 1 ) @@ -1180,68 +1195,90 @@ NETGEN_2D_Parameters_2.SetMinSize( 10 ) NETGEN_2D_Parameters_2.SetUseSurfaceCurvature( 1 ) NETGEN_2D_Parameters_2.SetFuseEdges( 1 ) NETGEN_2D_Parameters_2.SetQuadAllowed( 0 ) -isDone = casGaronne_1.SetMeshOrder( [ [ sections_1, litMineur_aval_1, litMineur_amont_1, litMineur_pont_1 ] ]) -isDone = casGaronne_1.Compute() -isDone = casGaronne_1.SplitQuadObject( casGaronne_1, 1 ) - - -riveDroite_1 = casGaronne_1.GroupOnGeom(riveDroite,'riveDroite',SMESH.FACE) -riveGauche_1 = casGaronne_1.GroupOnGeom(riveGauche,'riveGauche',SMESH.FACE) -litMineur_aval_2 = casGaronne_1.GroupOnGeom(litMineur_aval,'litMineur_aval',SMESH.FACE) -litMineur_pont_2 = casGaronne_1.GroupOnGeom(litMineur_pont,'litMineur_pont',SMESH.FACE) -litMineur_amont_2 = casGaronne_1.GroupOnGeom(litMineur_amont,'litMineur_amont',SMESH.FACE) -riveDroite_2 = casGaronne_1.GroupOnGeom(riveDroite,'riveDroite',SMESH.NODE) -riveGauche_2 = casGaronne_1.GroupOnGeom(riveGauche,'riveGauche',SMESH.NODE) -litMineur_aval_3 = casGaronne_1.GroupOnGeom(litMineur_aval,'litMineur_aval',SMESH.NODE) -litMineur_pont_3 = casGaronne_1.GroupOnGeom(litMineur_pont,'litMineur_pont',SMESH.NODE) -litMineur_amont_3 = casGaronne_1.GroupOnGeom(litMineur_amont,'litMineur_amont',SMESH.NODE) -sections_2 = casGaronne_1.GroupOnGeom(sections,'sections',SMESH.EDGE) -amont_1 = casGaronne_1.GroupOnGeom(amont,'amont',SMESH.EDGE) -aval_1 = casGaronne_1.GroupOnGeom(aval,'aval',SMESH.EDGE) -bordDroit_1 = casGaronne_1.GroupOnGeom(bordDroit,'bordDroit',SMESH.EDGE) -bordGauche_1 = casGaronne_1.GroupOnGeom(bordGauche,'bordGauche',SMESH.EDGE) -piles_1 = casGaronne_1.GroupOnGeom(piles,'piles',SMESH.EDGE) -sections_3 = casGaronne_1.GroupOnGeom(sections,'sections',SMESH.NODE) -amont_2 = casGaronne_1.GroupOnGeom(amont,'amont',SMESH.NODE) -aval_2 = casGaronne_1.GroupOnGeom(aval,'aval',SMESH.NODE) -bordDroit_2 = casGaronne_1.GroupOnGeom(bordDroit,'bordDroit',SMESH.NODE) -bordGauche_2 = casGaronne_1.GroupOnGeom(bordGauche,'bordGauche',SMESH.NODE) -piles_2 = casGaronne_1.GroupOnGeom(piles,'piles',SMESH.NODE) +isDone = garonne_1.SetMeshOrder( [ [ sections, garonne_aval_1, garonne_amont_1, garonne_pont_1 ] ]) +isDone = garonne_1.Compute() +isDone = garonne_1.SplitQuadObject( garonne_1, 1 ) + +# --- geometrical groups of faces + +garonne_riveDroite_2 = garonne_1.GroupOnGeom(garonne_riveDroite,'garonne_riveDroite',SMESH.FACE) +garonne_aval_2 = garonne_1.GroupOnGeom(garonne_aval,'garonne_aval',SMESH.FACE) +garonne_riveGauche_2 = garonne_1.GroupOnGeom(garonne_riveGauche,'garonne_riveGauche',SMESH.FACE) +garonne_pont_2 = garonne_1.GroupOnGeom(garonne_pont,'garonne_pont',SMESH.FACE) +garonne_amont_2 = garonne_1.GroupOnGeom(garonne_amont,'garonne_amont',SMESH.FACE) + +# --- geometrical groups of edges + +ClosedFreeBoundary_1 = garonne_1.GroupOnGeom(ClosedFreeBoundary[0],'ClosedFreeBoundary',SMESH.EDGE) +garonne_amont_droite_2 = garonne_1.GroupOnGeom(garonne_amont_droite,'garonne_amont_droite',SMESH.EDGE) +garonne_amont_gauche_2 = garonne_1.GroupOnGeom(garonne_amont_gauche,'garonne_amont_gauche',SMESH.EDGE) +garonne_aval_droite_2 = garonne_1.GroupOnGeom(garonne_aval_droite,'garonne_aval_droite',SMESH.EDGE) +garonne_aval_gauche_2 = garonne_1.GroupOnGeom(garonne_aval_gauche,'garonne_aval_gauche',SMESH.EDGE) +garonne_pont_droite_2 = garonne_1.GroupOnGeom(garonne_pont_droite,'garonne_pont_droite',SMESH.EDGE) +garonne_pont_gauche_2 = garonne_1.GroupOnGeom(garonne_pont_gauche,'garonne_pont_gauche',SMESH.EDGE) +SectionsGaronne_1 = garonne_1.GroupOnGeom(SectionsGaronne,'SectionsGaronne',SMESH.EDGE) +bordGaucheDomaine_1 = garonne_1.GroupOnGeom(bordGaucheDomaine,'bordGaucheDomaine',SMESH.EDGE) +bordDroiteDomaine_1 = garonne_1.GroupOnGeom(bordDroiteDomaine,'bordDroiteDomaine',SMESH.EDGE) +amont_1 = garonne_1.GroupOnGeom(amont,'amont',SMESH.EDGE) +aval_1 = garonne_1.GroupOnGeom(aval,'aval',SMESH.EDGE) +pilePont1_1 = garonne_1.GroupOnGeom(ClosedFreeBoundary[1],'pilePont1',SMESH.EDGE) +pilePont2_1 = garonne_1.GroupOnGeom(ClosedFreeBoundary[2],'pilePont2',SMESH.EDGE) +pilePont3_1 = garonne_1.GroupOnGeom(ClosedFreeBoundary[3],'pilePont3',SMESH.EDGE) +pilePont4_1 = garonne_1.GroupOnGeom(ClosedFreeBoundary[4],'pilePont4',SMESH.EDGE) + +# --- geometrical groups of nodes + +garonne_amont_3 = garonne_1.GroupOnGeom(garonne_amont,'garonne_amont',SMESH.NODE) +garonne_aval_3 = garonne_1.GroupOnGeom(garonne_aval,'garonne_aval',SMESH.NODE) +garonne_pont_3 = garonne_1.GroupOnGeom(garonne_pont,'garonne_pont',SMESH.NODE) +garonne_riveDroite_3 = garonne_1.GroupOnGeom(garonne_riveDroite,'garonne_riveDroite',SMESH.NODE) +garonne_riveGauche_3 = garonne_1.GroupOnGeom(garonne_riveGauche,'garonne_riveGauche',SMESH.NODE) +ClosedFreeBoundary_2 = garonne_1.GroupOnGeom(ClosedFreeBoundary[0],'ClosedFreeBoundary',SMESH.NODE) +garonne_amont_droite_2 = garonne_1.GroupOnGeom(garonne_amont_droite,'garonne_amont_droite',SMESH.NODE) +garonne_amont_gauche_2 = garonne_1.GroupOnGeom(garonne_amont_gauche,'garonne_amont_gauche',SMESH.NODE) +garonne_aval_droite_2 = garonne_1.GroupOnGeom(garonne_aval_droite,'garonne_aval_droite',SMESH.NODE) +garonne_aval_gauche_2 = garonne_1.GroupOnGeom(garonne_aval_gauche,'garonne_aval_gauche',SMESH.NODE) +garonne_pont_droite_2 = garonne_1.GroupOnGeom(garonne_pont_droite,'garonne_pont_droite',SMESH.NODE) +garonne_pont_gauche_2 = garonne_1.GroupOnGeom(garonne_pont_gauche,'garonne_pont_gauche',SMESH.NODE) +SectionsGaronne_2 = garonne_1.GroupOnGeom(SectionsGaronne,'SectionsGaronne',SMESH.NODE) +bordGaucheDomaine_2 = garonne_1.GroupOnGeom(bordGaucheDomaine,'bordGaucheDomaine',SMESH.NODE) +bordDroiteDomaine_2 = garonne_1.GroupOnGeom(bordDroiteDomaine,'bordDroiteDomaine',SMESH.NODE) +amont_2 = garonne_1.GroupOnGeom(amont,'amont',SMESH.NODE) +aval_2 = garonne_1.GroupOnGeom(aval,'aval',SMESH.NODE) +pilePont1_2 = garonne_1.GroupOnGeom(ClosedFreeBoundary[1],'pilePont1',SMESH.NODE) +pilePont2_2 = garonne_1.GroupOnGeom(ClosedFreeBoundary[2],'pilePont2',SMESH.NODE) +pilePont3_2 = garonne_1.GroupOnGeom(ClosedFreeBoundary[3],'pilePont3',SMESH.NODE) +pilePont4_2 = garonne_1.GroupOnGeom(ClosedFreeBoundary[4],'pilePont4',SMESH.NODE) ## Set names of Mesh objects +smesh.SetName(NETGEN_1D_2D.GetAlgorithm(), 'NETGEN 1D-2D') smesh.SetName(QuadFromMedialAxis_1D2D.GetAlgorithm(), 'QuadFromMedialAxis_1D2D') smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D') -smesh.SetName(NETGEN_2D.GetAlgorithm(), 'NETGEN_2D') -smesh.SetName(casGaronne_1.GetMesh(), 'casGaronne_1') -smesh.SetName(litMineur_pont_1, 'litMineur_pont') -smesh.SetName(litMineur_amont_1, 'litMineur_amont') -smesh.SetName(litMineur_aval_1, 'litMineur_aval') -smesh.SetName(nbSeg_litMineur_amont, 'nbSeg_litMineur_amont') -smesh.SetName(nbseg_sections, 'nbseg_sections') -smesh.SetName(NETGEN_2D_Parameters_2, 'NETGEN 2D Parameters_2') +smesh.SetName(Number_of_Segments_1, 'Number of Segments_1') +smesh.SetName(Number_of_Segments_2, 'Number of Segments_2') smesh.SetName(NETGEN_2D_Parameters_1, 'NETGEN 2D Parameters_1') -smesh.SetName(nbseg_litMineur_aval, 'nbseg_litMineur_aval') -smesh.SetName(nbseg_litMineur_amont, 'nbseg_litMineur_amont') -smesh.SetName(sections_1, 'sections') - -med_file = r'/tmp/casGaronne_1.med' - -try: - os.remove(med_file) -except OSError: - pass - - -casGaronne_1.SetAutoColor( 1 ) -casGaronne_1.ExportMED( med_file, 0, SMESH.MED_V2_2, 1, None ,1) - -controlMeshStats(casGaronne_1, 6985, 745, 13761) -controlSubMeshStats(litMineur_pont_2, 202) -controlSubMeshStats(litMineur_amont_2, 3000) -controlSubMeshStats(litMineur_aval_2, 2000) -controlSubMeshStats(riveDroite_1, 3941) -controlSubMeshStats(riveGauche_1, 4635) +smesh.SetName(Number_of_Segments_3, 'Number of Segments_3') +smesh.SetName(NETGEN_2D_Parameters_2, 'NETGEN 2D Parameters_2') +smesh.SetName(garonne_aval_1, 'submesh_garonne_aval') +smesh.SetName(garonne_pont_1, 'submesh_garonne_pont') +smesh.SetName(garonne_amont_1, 'submesh_garonne_amont') +smesh.SetName(garonne_1.GetMesh(), 'submesh_garonne_1') +smesh.SetName(sections, 'submesh_sections') + + +garonne_1.SetAutoColor( 1 ) +tmpdir = tempfile.mkdtemp() +print "tmpdir=",tmpdir +fichierMaillage = os.path.join(tmpdir, 'garonne_1.med') +garonne_1.ExportMED(fichierMaillage, 0, SMESH.MED_V2_2, 1, None ,1) + +controlMeshStats(garonne_1, 6985, 745, 13761) +controlSubMeshStats(garonne_pont_2, 202) +controlSubMeshStats(garonne_amont_2, 3000) +controlSubMeshStats(garonne_aval_2, 2000) +controlSubMeshStats(garonne_riveDroite_2, 3941) +controlSubMeshStats(garonne_riveGauche_2, 4635) if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(1) -- 2.39.2