# Application tests
-SET(TEST_INSTALL_DIRECTORY ${SALOME_INSTALL_SCRIPT_SCRIPTS}/test/HYDRO)
+SET(TEST_INSTALL_DIRECTORY ${SALOME_INSTALL_SCRIPT_SCRIPTS}/test)
INSTALL(FILES ${EXAMPLES_TESTS} ${HYDRO_SAMPLES} DESTINATION ${TEST_INSTALL_DIRECTORY})
INSTALL(FILES CTestTestfileInstall.cmake
salome.salome_init()
theStudy = salome.myStudy
-
+
#----------------------
-# --- HYDRO
+# --- HYDRO
#----------------------
from HYDROPy import *
Case_1_entry = Case_1.Export( theStudy._get_StudyId() )
#----------------------
-# --- Geometry
+# --- Geometry
#----------------------
# Get geometry shape and print debug information
print "Geom shape:", Case_1_geom
print "Geom shape name:", Case_1_geom.GetName()
-controlGeomProps(geompy, Case_1_geom, 1218.7373973, 49697.2117918)
-
+#controlGeomProps(geompy, Case_1_geom, 1218.7373973, 49697.2117918)
+controlGeomProps(geompy, Case_1_geom, 1218.7373973, 49578.1516521)
+
if salome.sg.hasDesktop():
salome.sg.updateObjBrowser(1)
salome.salome_init()
theStudy = salome.myStudy
-
+
#----------------------
-# --- HYDRO
+# --- HYDRO
#----------------------
from HYDROPy import *
garonne_1_entry = garonne_1.Export( theStudy._get_StudyId() )
#----------------------
-# --- Geometry
+# --- Geometry
#----------------------
# Get geometry shape and print debug information
geompy.addToStudyInFather( HYDRO_garonne_1, riveDroite, 'riveDroite' )
controlGeomProps(geompy, riveGauche, 29149.36918, 35948828.352061)
-controlGeomProps(geompy, litMineur, 30337.5484919, 3263628.55399)
-controlGeomProps(geompy, riveDroite, 32012.3432411, 26177085.4601)
+#controlGeomProps(geompy, litMineur, 30337.5484919, 3263628.55399)
+#controlGeomProps(geompy, riveDroite, 32012.3432411, 26177085.4601)
+controlGeomProps(geompy, litMineur, 30337.548492, 3488480.304388)
+controlGeomProps(geompy, riveDroite, 32012.343241, 25998769.23615)
if salome.sg.hasDesktop():
salome.sg.updateObjBrowser(1)
salome.salome_init()
theStudy = salome.myStudy
-
+
#----------------------
-# --- HYDRO
+# --- HYDRO
#----------------------
from HYDROPy import *
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
# --- basic properties control: edges length, surfaces
controlGeomProps(geompy, riveGauche, 29149.36918, 35948828.352061)
-controlGeomProps(geompy, litMineur, 30337.5484919, 3263628.55399)
-controlGeomProps(geompy, riveDroite, 32012.3432411, 26177085.4601)
+#controlGeomProps(geompy, litMineur, 30337.5484919, 3263628.55399)
+#controlGeomProps(geompy, riveDroite, 32012.3432411, 26177085.4601)
+controlGeomProps(geompy, litMineur, 30337.548492, 3488480.304388)
+controlGeomProps(geompy, riveDroite, 32012.343241, 25998769.23615)
#----------------------
-# --- Meshing
+# --- Meshing
#----------------------
-med_file = r'/garonne_1.med'
+med_file = r'/tmp/garonne_1.med'
try:
os.remove(med_file)
garonne_1.SetAutoColor( 1 )
garonne_1.ExportMED( med_file, 0, SMESH.MED_V2_2, 1, None ,1)
-controlMeshStats(garonne_1, 1763, 180, 3360)
-controlSubMeshStats(litMineur_2, 48)
-controlSubMeshStats(riveDroite_1, 1360)
-controlSubMeshStats(riveGauche_1, 1952)
+#controlMeshStats(garonne_1, 1763, 180, 3360)
+#controlSubMeshStats(litMineur_2, 48)
+#controlSubMeshStats(riveDroite_1, 1360)
+#controlSubMeshStats(riveGauche_1, 1952)
+controlMeshStats(garonne_1, 3888, 475, 7597)
+controlSubMeshStats(litMineur_2, 2384)
+controlSubMeshStats(riveDroite_1, 2342)
+controlSubMeshStats(riveGauche_1, 2871)
if salome.sg.hasDesktop():
salome.sg.updateObjBrowser(1)
salome.salome_init()
theStudy = salome.myStudy
-
+
#----------------------
-# --- HYDRO
+# --- HYDRO
#----------------------
from HYDROPy import *
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
# --- basic properties control: edges length, surfaces
controlGeomProps(geompy, riveGauche, 29149.36918, 35948828.352061)
-controlGeomProps(geompy, litMineur, 30337.5484919, 3263628.55399)
-controlGeomProps(geompy, riveDroite, 32012.3432411, 26177085.4601)
+#controlGeomProps(geompy, litMineur, 30337.5484919, 3263628.55399)
+#controlGeomProps(geompy, riveDroite, 32012.3432411, 26177085.4601)
+controlGeomProps(geompy, litMineur, 30337.548492, 3488480.304388)
+controlGeomProps(geompy, riveDroite, 32012.343241, 25998769.23615)
#----------------------
-# --- Meshing
+# --- Meshing
#----------------------
-med_file = r'/garonne_1.med'
+med_file = r'/tmp/garonne_1.med'
try:
os.remove(med_file)
except OSError:
garonne_1.SetAutoColor( 1 )
garonne_1.ExportMED( med_file, 0, SMESH.MED_V2_2, 1, None ,1)
-controlMeshStats(garonne_1, 1763, 180, 3360)
-controlSubMeshStats(litMineur_2, 48)
-controlSubMeshStats(riveDroite_1, 1360)
-controlSubMeshStats(riveGauche_1, 1952)
+#controlMeshStats(garonne_1, 1763, 180, 3360)
+#controlSubMeshStats(litMineur_2, 48)
+#controlSubMeshStats(riveDroite_1, 1360)
+#controlSubMeshStats(riveGauche_1, 1952)
+controlMeshStats(garonne_1, 3888, 475, 7597)
+controlSubMeshStats(litMineur_2, 2384)
+controlSubMeshStats(riveDroite_1, 2342)
+controlSubMeshStats(riveGauche_1, 2871)
if salome.sg.hasDesktop():
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 = 90
# --- Z interpolation on the bathymety/altimetry on the mesh nodes
salome.salome_init()
theStudy = salome.myStudy
-
+
#----------------------
-# --- HYDRO
+# --- HYDRO
#----------------------
from HYDROPy import *
garonne_2_entry = garonne_2.Export( theStudy._get_StudyId() )
#----------------------
-# --- Geometry
+# --- Geometry
#----------------------
# Get geometry shape and print debug information
geompy.addToStudyInFather( HYDRO_garonne_2, litMineur, 'litMineur' )
geompy.addToStudyInFather( HYDRO_garonne_2, riveDroite, 'riveDroite' )
-controlGeomProps(geompy, riveGauche, 39489.5116033, 35889668.8348)
+#controlGeomProps(geompy, riveGauche, 39489.5116033, 35889668.8348)
+#controlGeomProps(geompy, digue, 10340.1424233, 102887.6201)
+#controlGeomProps(geompy, litMineur, 30337.5484919, 3646827.74981)
+#controlGeomProps(geompy, riveDroite, 32012.3432411, 26177085.4601)
+controlGeomProps(geompy, riveGauche, 39493.270283, 35845790.613557)
controlGeomProps(geompy, digue, 10340.1424233, 102887.6201)
-controlGeomProps(geompy, litMineur, 30337.5484919, 3646827.74981)
-controlGeomProps(geompy, riveDroite, 32012.3432411, 26177085.4601)
+controlGeomProps(geompy, litMineur, 30337.548492, 3488480.304388)
+controlGeomProps(geompy, riveDroite, 32012.343241, 25998769.23615)
if salome.sg.hasDesktop():
salome.sg.updateObjBrowser(1)
salome.salome_init()
theStudy = salome.myStudy
-
+
#----------------------
-# --- HYDRO
+# --- HYDRO
#----------------------
from HYDROPy import *
garonne_2_entry = garonne_2.Export( theStudy._get_StudyId() )
#----------------------
-# --- Geometry
+# --- Geometry
#----------------------
# Get geometry shape and print debug information
geompy.UnionIDs(SectionsDigue, [46, 50])
geompy.addToStudyInFather( HYDRO_garonne_2, SectionsDigue, 'SectionsDigue' )
-# --- recreate subshapes already exported from HYDRO to get access from Python
+# --- recreate subshapes already exported from HYDRO to get access from Python
#garonne_2_domaineEtendu_Outer = geompy.CreateGroup(HYDRO_garonne_2, geompy.ShapeType["EDGE"])
#geompy.UnionIDs(garonne_2_domaineEtendu_Outer, [4, 11, 17, 24, 26, 28, 14, 19, 20, 22, 31, 39, 41, 33, 35, 37])
#garonne_2_digue_Left_Bank = geompy.CreateGroup(HYDRO_garonne_2, geompy.ShapeType["EDGE"])
#garonne_2_digue_Right_Bank = geompy.CreateGroup(HYDRO_garonne_2, geompy.ShapeType["EDGE"])
#geompy.UnionIDs(garonne_2_digue_Right_Bank, [48])
-controlGeomProps(geompy, riveGauche, 39489.5116033, 35889668.8348)
+#controlGeomProps(geompy, riveGauche, 39489.5116033, 35889668.8348)
+#controlGeomProps(geompy, digue, 10340.1424233, 102887.6201)
+#controlGeomProps(geompy, litMineur, 30337.5484919, 3646827.74981)
+#controlGeomProps(geompy, riveDroite, 32012.3432411, 26177085.4601)
+controlGeomProps(geompy, riveGauche, 39493.270283, 35845790.613557)
controlGeomProps(geompy, digue, 10340.1424233, 102887.6201)
-controlGeomProps(geompy, litMineur, 30337.5484919, 3646827.74981)
-controlGeomProps(geompy, riveDroite, 32012.3432411, 26177085.4601)
+controlGeomProps(geompy, litMineur, 30337.548492, 3488480.304388)
+controlGeomProps(geompy, riveDroite, 32012.343241, 25998769.23615)
#----------------------
-# --- Meshing
+# --- Meshing
#----------------------
import SMESH, SALOMEDS
SectionsGaronne_3 = garonne_2.GroupOnGeom(SectionsGaronne,'SectionsGaronne',SMESH.NODE)
-med_file = r'/garonne_2.med'
+med_file = r'/tmp/garonne_2.med'
try:
os.remove(med_file)
garonne_2.SetAutoColor( 1 )
garonne_2.ExportMED( med_file, 0, SMESH.MED_V2_2, 1, None ,1)
-controlMeshStats(garonne_2, 5247, 717, 10075)
+#controlMeshStats(garonne_2, 5247, 717, 10075)
+#controlSubMeshStats(litMineur_2, 2384)
+#controlSubMeshStats(riveDroite_1, 2348)
+#controlSubMeshStats(riveGauche_1, 5343)
+#controlSubMeshStats(digue_1, 0)
+controlMeshStats(garonne_2, 6190, 691, 12201)
controlSubMeshStats(litMineur_2, 2384)
-controlSubMeshStats(riveDroite_1, 2348)
-controlSubMeshStats(riveGauche_1, 5343)
-controlSubMeshStats(digue_1, 0)
+controlSubMeshStats(riveDroite_1, 2400)
+controlSubMeshStats(riveGauche_1, 6585)
+controlSubMeshStats(digue_1, 832)
if salome.sg.hasDesktop():
salome.sg.updateObjBrowser(1)
salome.salome_init()
theStudy = salome.myStudy
-
+
#----------------------
-# --- HYDRO
+# --- HYDRO
#----------------------
from HYDROPy import *
garonne_2_entry = garonne_2.Export( theStudy._get_StudyId() )
#----------------------
-# --- Geometry
+# --- Geometry
#----------------------
# Get geometry shape and print debug information
geompy.UnionIDs(SectionsDigue, [46, 50])
geompy.addToStudyInFather( HYDRO_garonne_2, SectionsDigue, 'SectionsDigue' )
-# --- recreate subshapes already exported from HYDRO to get access from Python
+# --- recreate subshapes already exported from HYDRO to get access from Python
#garonne_2_domaineEtendu_Outer = geompy.CreateGroup(HYDRO_garonne_2, geompy.ShapeType["EDGE"])
#geompy.UnionIDs(garonne_2_domaineEtendu_Outer, [4, 11, 17, 24, 26, 28, 14, 19, 20, 22, 31, 39, 41, 33, 35, 37])
#garonne_2_digue_Left_Bank = geompy.CreateGroup(HYDRO_garonne_2, geompy.ShapeType["EDGE"])
#garonne_2_digue_Right_Bank = geompy.CreateGroup(HYDRO_garonne_2, geompy.ShapeType["EDGE"])
#geompy.UnionIDs(garonne_2_digue_Right_Bank, [48])
-controlGeomProps(geompy, riveGauche, 39489.5116033, 35889668.8348)
+#controlGeomProps(geompy, riveGauche, 39489.5116033, 35889668.8348)
+#controlGeomProps(geompy, digue, 10340.1424233, 102887.6201)
+#controlGeomProps(geompy, litMineur, 30337.5484919, 3646827.74981)
+#controlGeomProps(geompy, riveDroite, 32012.3432411, 26177085.4601)
+controlGeomProps(geompy, riveGauche, 39493.270283, 35845790.613557)
controlGeomProps(geompy, digue, 10340.1424233, 102887.6201)
-controlGeomProps(geompy, litMineur, 30337.5484919, 3646827.74981)
-controlGeomProps(geompy, riveDroite, 32012.3432411, 26177085.4601)
+controlGeomProps(geompy, litMineur, 30337.548492, 3488480.304388)
+controlGeomProps(geompy, riveDroite, 32012.343241, 25998769.23615)
#----------------------
-# --- Meshing
+# --- Meshing
#----------------------
import SMESH, SALOMEDS
SectionsGaronne_3 = garonne_2.GroupOnGeom(SectionsGaronne,'SectionsGaronne',SMESH.NODE)
-med_file = r'/garonne_2.med'
+med_file = r'/tmp/garonne_2.med'
try:
os.remove(med_file)
garonne_2.SetAutoColor( 1 )
garonne_2.ExportMED( med_file, 0, SMESH.MED_V2_2, 1, None ,1)
-controlMeshStats(garonne_2, 5247, 717, 10075)
+#controlMeshStats(garonne_2, 5247, 717, 10075)
+#controlSubMeshStats(litMineur_2, 2384)
+#controlSubMeshStats(riveDroite_1, 2348)
+#controlSubMeshStats(riveGauche_1, 5343)
+#controlSubMeshStats(digue_1, 0)
+controlMeshStats(garonne_2, 6190, 691, 12201)
controlSubMeshStats(litMineur_2, 2384)
-controlSubMeshStats(riveDroite_1, 2348)
-controlSubMeshStats(riveGauche_1, 5343)
-controlSubMeshStats(digue_1, 0)
+controlSubMeshStats(riveDroite_1, 2400)
+controlSubMeshStats(riveGauche_1, 6585)
+controlSubMeshStats(digue_1, 832)
if salome.sg.hasDesktop():
salome.sg.updateObjBrowser(1)
#----------------------
-# --- Z interpolation with HYDRO
+# --- Z interpolation with HYDRO
#----------------------
from salome.hydrotools.interpolZ import interpolZ, createZfield2
riveGauche = 'garonne_2_riveGauche',
digue = 'garonne_2_digue',
)
-# --- 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
geompy.addToStudyInFather( HYDRO_casGaronne_1, piles, 'piles' )
# --- basic properties control: edges length, surfaces
-controlGeomProps(geompy, riveGauche, 29149.1353799, 35950762.8967)
-controlGeomProps(geompy, litMineur_aval, 7965.23431497, 938890.904721)
-controlGeomProps(geompy, litMineur_pont, 961.8255222, 19618.0787789)
-controlGeomProps(geompy, litMineur_amont, 22635.6212065, 2548509.17447)
-controlGeomProps(geompy, riveDroite, 32012.2241814, 26188706.2202)
+#controlGeomProps(geompy, riveGauche, 29149.1353799, 35950762.8967)
+#controlGeomProps(geompy, litMineur_aval, 7965.23431497, 938890.904721)
+#controlGeomProps(geompy, litMineur_pont, 961.8255222, 19618.0787789)
+#controlGeomProps(geompy, litMineur_amont, 22635.6212065, 2548509.17447)
+#controlGeomProps(geompy, riveDroite, 32012.2241814, 26188706.2202)
+ontrolGeomProps(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)
###
### SMESH component
smesh.SetName(nbseg_litMineur_amont, 'nbseg_litMineur_amont')
smesh.SetName(sections_1, 'sections')
-med_file = r'/casGaronne_1.med'
+med_file = r'/tmp/casGaronne_1.med'
try:
os.remove(med_file)
casGaronne_1.SetAutoColor( 1 )
casGaronne_1.ExportMED( med_file, 0, SMESH.MED_V2_2, 1, None ,1)
-controlMeshStats(casGaronne_1, 7040, 746, 13871)
-controlSubMeshStats(litMineur_pont_2, 204)
+#controlMeshStats(casGaronne_1, 7040, 746, 13871)
+#controlSubMeshStats(litMineur_pont_2, 204)
+#controlSubMeshStats(litMineur_amont_2, 3000)
+#controlSubMeshStats(litMineur_aval_2, 2000)
+#controlSubMeshStats(riveDroite_1, 4040)
+#controlSubMeshStats(riveGauche_1, 4627)
+controlMeshStats(casGaronne_1, 6985, 745, 13761)
+controlSubMeshStats(litMineur_pont_2, 185)
controlSubMeshStats(litMineur_amont_2, 3000)
controlSubMeshStats(litMineur_aval_2, 2000)
-controlSubMeshStats(riveDroite_1, 4040)
-controlSubMeshStats(riveGauche_1, 4627)
+controlSubMeshStats(riveDroite_1, 3941)
+controlSubMeshStats(riveGauche_1, 4635)
if salome.sg.hasDesktop():
domaine_2 = relief.GroupOnGeom(domaine,'domaine',SMESH.NODE)
smesh.SetName(relief, 'relief')
-med_file = r'/relief.med'
+med_file = r'/tmp/relief.med'
try:
os.remove(med_file)