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")
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")
# --- 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"
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")
# 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")
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
# 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")
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
# --- 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"
salome.salome_init()
theStudy = salome.myStudy
-
+
#----------------------
-# --- HYDRO
+# --- HYDRO
#----------------------
from HYDROPy import *
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")
garonne_1_entry = garonne_1.Export( theStudy._get_StudyId() )
#----------------------
-# --- Geometry
+# --- Geometry
#----------------------
# Get geometry shape and print debug information
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
controlGeomProps(geompy, riveDroite, 32012.343241, 25998769.23615)
#----------------------
-# --- Meshing
+# --- Meshing
#----------------------
import SMESH, SALOMEDS
salome.sg.updateObjBrowser(1)
#----------------------
-# --- Z interpolation with HYDRO
+# --- Z interpolation with HYDRO
#----------------------
from salome.hydrotools.interpolZ import interpolZ, createZfield2
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
#----------------------
-# --- Telemac Calculation
+# --- Telemac Calculation
#----------------------
import shutil
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" )
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' )
#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)
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]
print " Wires length: ", refLength
print " Surface area: ", refArea
print " Volume : ", 0.
- raise ValueError("Bad length or area")
+ raise ValueError("Bad length or area")
# -------------------------------------
references['Entity_Node'] = nbNodes
references['Entity_Edge'] = nbEdges
references['Entity_Triangle'] = nbTriangles
-
+
mesures = aMesh.GetMeshInfo()
#print mesures
d= {}
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):
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
print nomreg
print "value: ", vals, " reference: ", valsref
raise ValueError("error in Telemac result")
-
+
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
fichierMaillage : 2D (x,y) med file produced by SMESH and used by interpolZ.
return <fichierMaillage>F.med : med file containing the field "BOTTOM"
"""
-
+
noms = string.split(fichierMaillage,'.')
basename = string.join(noms[:-1], '.')
fichierFMaillage = basename + 'F.med'
# --- 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
medenum.MED_FULL_INTERLACE, medenum.MED_ALL_CONSTITUENT, nnoe, valz)
# --- fermeture du fichier
medfile.MEDfileClose(fid)
+ print fichierFMaillage, " field BOTTOM OK"
# -----------------------------------------------------------------------------
fichierMaillage : 2D (x,y) med file produced by SMESH and used by interpolZ.
return <fichierMaillage>F.med : med file containing the field "BOTTOM"
"""
-
+
noms = string.split(fichierMaillage,'.')
basename = string.join(noms[:-1], '.')
fichierZMaillage = basename + 'Z.med'
mm=MEDFileMesh.New(fichierZMaillage)
mm.write(fichierFMaillage,2)
MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fichierFMaillage,fieldOnNodes)
+ print fichierFMaillage, " field BOTTOM OK"
# -----------------------------------------------------------------------------
#z2 = (z - 74.0)*10
z2 = z
return z2
-
+
# -----------------------------------------------------------------------------
import SMESH
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():
maxz = max(vz)
statz[grp.GetName()] = (minz, maxz)
-
+
for i,nodeId in enumerate(nodesIds):
x = vx[i]
y = vy[i]