0022878: [CEA 1424] performances of Compute method from the Mesh class in smeshBuilder.py

This commit is contained in:
vsr 2015-02-20 10:08:10 +03:00
parent 0ff64bf022
commit 1b1945a31c
35 changed files with 143 additions and 31 deletions

View File

@ -89,5 +89,5 @@ smesh.SetName(hypNbSeg2, "NumberOfSegments_" + str(numberOfSegments2))
mesh1.Compute() mesh1.Compute()
mesh2.Compute() mesh2.Compute()
# ---- udate object browser # ---- update object browser
salome.sg.updateObjBrowser(1); salome.sg.updateObjBrowser(1)

View File

@ -103,3 +103,5 @@ smesh.SetName(Compound1, 'Compound_with_RenamedGrps_and_MergeElems')
Compound2 = smesh.Concatenate([Mesh_inf.GetMesh(), Mesh_sup.GetMesh()], 1, 0, 1e-05, True) Compound2 = smesh.Concatenate([Mesh_inf.GetMesh(), Mesh_sup.GetMesh()], 1, 0, 1e-05, True)
smesh.SetName(Compound2, 'Compound_with_UniteGrps_and_GrpsOfAllElems') smesh.SetName(Compound2, 'Compound_with_UniteGrps_and_GrpsOfAllElems')
#end #end
salome.sg.updateObjBrowser(1)

View File

@ -117,3 +117,5 @@ algo.NumberOfSegments(NbSeg)
my_hexa.Quadrangle() my_hexa.Quadrangle()
my_hexa.Hexahedron() my_hexa.Hexahedron()
my_hexa.Compute() my_hexa.Compute()
salome.sg.updateObjBrowser(1)

View File

@ -121,9 +121,6 @@ print hypVolume.GetId()
print hypVolume.GetMaxElementVolume() print hypVolume.GetMaxElementVolume()
smesh.SetName(hypVolume, "MaxElementVolume_" + str(maxElementVolume)) smesh.SetName(hypVolume, "MaxElementVolume_" + str(maxElementVolume))
salome.sg.updateObjBrowser(1)
print "-------------------------- compute shell" print "-------------------------- compute shell"
ret = mesh.Compute() ret = mesh.Compute()
print ret print ret
@ -140,3 +137,5 @@ if ret != 0:
print "Number of tetrahedrons: ", mesh.NbTetras() print "Number of tetrahedrons: ", mesh.NbTetras()
else: else:
print "probleme when computing the mesh" print "probleme when computing the mesh"
salome.sg.updateObjBrowser(1)

View File

@ -131,9 +131,6 @@ print hypVolume.GetId()
print hypVolume.GetMaxElementVolume() print hypVolume.GetMaxElementVolume()
smesh.SetName(hypVolume, "MaxElementVolume_" + str(maxElementVolume)) smesh.SetName(hypVolume, "MaxElementVolume_" + str(maxElementVolume))
salome.sg.updateObjBrowser(1)
print "-------------------------- compute shell" print "-------------------------- compute shell"
ret = mesh.Compute() ret = mesh.Compute()
print ret print ret
@ -150,3 +147,5 @@ if ret != 0:
print "Number of tetrahedrons: ", mesh.NbTetras() print "Number of tetrahedrons: ", mesh.NbTetras()
else: else:
print "probleme when computing the mesh" print "probleme when computing the mesh"
salome.sg.updateObjBrowser(1)

View File

@ -90,8 +90,6 @@ print hypVolume.GetId()
print hypVolume.GetMaxElementVolume() print hypVolume.GetMaxElementVolume()
smesh.SetName(hypVolume, "MaxElementVolume_" + str(maxElementVolume)) smesh.SetName(hypVolume, "MaxElementVolume_" + str(maxElementVolume))
salome.sg.updateObjBrowser(1)
print "-------------------------- compute the mesh of the boxe" print "-------------------------- compute the mesh of the boxe"
ret = mesh.Compute() ret = mesh.Compute()
print ret print ret
@ -108,3 +106,5 @@ if ret != 0:
print "Number of tetrahedrons: ", mesh.NbTetras() print "Number of tetrahedrons: ", mesh.NbTetras()
else: else:
print "probleme when computing the mesh" print "probleme when computing the mesh"
salome.sg.updateObjBrowser(1)

View File

@ -82,9 +82,6 @@ print "-------------------------- Hexa_3D"
hexa3D = mesh.Hexahedron() hexa3D = mesh.Hexahedron()
hexa3D.SetName("Hexa_3D") hexa3D.SetName("Hexa_3D")
salome.sg.updateObjBrowser(1)
print "-------------------------- compute compshell" print "-------------------------- compute compshell"
ret = mesh.Compute() ret = mesh.Compute()
print ret print ret
@ -101,3 +98,5 @@ if ret != 0:
print "Number of hexahedrons : ", mesh.NbHexas() print "Number of hexahedrons : ", mesh.NbHexas()
else: else:
print "problem when Computing the mesh" print "problem when Computing the mesh"
salome.sg.updateObjBrowser(1)

View File

@ -61,8 +61,6 @@ netgen.SetMaxSize( 50 )
netgen.SetFineness( smeshBuilder.Fine ) netgen.SetFineness( smeshBuilder.Fine )
#netgen.SetOptimize( 1 ) #netgen.SetOptimize( 1 )
salome.sg.updateObjBrowser(1)
print "-------------------------- compute mesh" print "-------------------------- compute mesh"
ret = mesh.Compute() ret = mesh.Compute()
print ret print ret
@ -77,3 +75,5 @@ if ret != 0:
else: else:
print "problem when computing the mesh" print "problem when computing the mesh"
salome.sg.updateObjBrowser(1)

View File

@ -105,9 +105,6 @@ print hypVolume.GetId()
print hypVolume.GetMaxElementVolume() print hypVolume.GetMaxElementVolume()
smesh.SetName(hypVolume, "MaxElementVolume_" + str(maxElementVolume)) smesh.SetName(hypVolume, "MaxElementVolume_" + str(maxElementVolume))
salome.sg.updateObjBrowser(1)
print "-------------------------- compute compshell" print "-------------------------- compute compshell"
ret = mesh.Compute(mesh) ret = mesh.Compute(mesh)
print ret print ret
@ -125,3 +122,5 @@ if ret != 0:
else: else:
print "problem when computing the mesh" print "problem when computing the mesh"
salome.sg.updateObjBrowser(1)

View File

@ -91,10 +91,6 @@ print hypLengthFromEdge.GetName()
print hypLengthFromEdge.GetId() print hypLengthFromEdge.GetId()
smesh.SetName(hypLengthFromEdge,"LengthFromEdge") smesh.SetName(hypLengthFromEdge,"LengthFromEdge")
salome.sg.updateObjBrowser(1)
print "-------------------------- compute the skin flight" print "-------------------------- compute the skin flight"
ret = mesh.Compute() ret = mesh.Compute()
print ret print ret
@ -110,3 +106,5 @@ if ret != 0:
print "Number of volumes : ", mesh.NbVolumes() print "Number of volumes : ", mesh.NbVolumes()
else: else:
print "probleme when computing the mesh" print "probleme when computing the mesh"
salome.sg.updateObjBrowser(1)

View File

@ -119,8 +119,6 @@ netgen.SetFineness( smeshBuilder.Fine )
netgen.SetQuadAllowed( 1 ) netgen.SetQuadAllowed( 1 )
#netgen.SetOptimize( 1 ) #netgen.SetOptimize( 1 )
salome.sg.updateObjBrowser(1)
print "-------------------------- compute mesh" print "-------------------------- compute mesh"
ret = mesh.Compute() ret = mesh.Compute()
print ret print ret
@ -136,3 +134,5 @@ if ret != 0:
else: else:
print "problem when computing the mesh" print "problem when computing the mesh"
salome.sg.updateObjBrowser(1)

View File

@ -146,3 +146,5 @@ for a in log:
#ii = ii+1 #ii = ii+1
ii = ii+1 ii = ii+1
print "AddTriangle %i - %i %i %i" % (ind, i1, i2, i3) print "AddTriangle %i - %i %i %i" % (ind, i1, i2, i3)
salome.sg.updateObjBrowser(1)

View File

@ -319,3 +319,8 @@ algo.Propagation()
# ---------------- # ----------------
hexa.Compute() hexa.Compute()
# Update object browser
# ---------------------
salome.sg.updateObjBrowser(1)

View File

@ -121,3 +121,8 @@ hexa.Hexahedron()
# ---------------- # ----------------
hexa.Compute() hexa.Compute()
# Update object browser
# ---------------------
salome.sg.updateObjBrowser(1)

View File

@ -108,3 +108,8 @@ hexa.Hexahedron()
# ---------------- # ----------------
hexa.Compute() hexa.Compute()
# Update object browser
# ---------------------
salome.sg.updateObjBrowser(1)

View File

@ -113,3 +113,8 @@ localMesh(box_tetra2, 0)
# ------------- # -------------
mixed.Compute() mixed.Compute()
# Update object browser
# ---------------------
salome.sg.updateObjBrowser(1)

View File

@ -148,3 +148,8 @@ hexa.Hexahedron()
# ------------- # -------------
hexa.Compute() hexa.Compute()
# Update object browser
# ---------------------
salome.sg.updateObjBrowser(1)

View File

@ -165,3 +165,8 @@ algo4.Propagation()
# ------------- # -------------
hexa.Compute() hexa.Compute()
# Update object browser
# ---------------------
salome.sg.updateObjBrowser(1)

View File

@ -105,3 +105,8 @@ hexa.Hexahedron()
# ------------- # -------------
hexa.Compute() hexa.Compute()
# Update object browser
# ---------------------
salome.sg.updateObjBrowser(1)

View File

@ -138,3 +138,8 @@ hexa.Hexahedron()
# ------------- # -------------
hexa.Compute() hexa.Compute()
# Update object browser
# ---------------------
salome.sg.updateObjBrowser(1)

View File

@ -141,3 +141,8 @@ hexa.Hexahedron()
# ------------- # -------------
hexa.Compute() hexa.Compute()
# Update object browser
# ---------------------
salome.sg.updateObjBrowser(1)

View File

@ -103,3 +103,8 @@ hexa.Hexahedron()
# ------------- # -------------
hexa.Compute() hexa.Compute()
# Update object browser
# ---------------------
salome.sg.updateObjBrowser(1)

View File

@ -124,3 +124,8 @@ hexa.Hexahedron()
# ------------- # -------------
hexa.Compute() hexa.Compute()
# Update object browser
# ---------------------
salome.sg.updateObjBrowser(1)

View File

@ -139,3 +139,8 @@ hexa.Hexahedron()
# ------------- # -------------
hexa.Compute() hexa.Compute()
# Update object browser
# ---------------------
salome.sg.updateObjBrowser(1)

View File

@ -257,3 +257,8 @@ local(cyl_x+d, cyl_y+d, box_dz, 10)
# ---------------- # ----------------
hexa.Compute() hexa.Compute()
# Update object browser
# ---------------------
salome.sg.updateObjBrowser(1)

View File

@ -142,3 +142,8 @@ while m_i<m_n:
# -------------------- # --------------------
hexa.Compute() hexa.Compute()
# Update object browser
# ---------------------
salome.sg.updateObjBrowser(1)

View File

@ -201,3 +201,8 @@ hexa.Hexahedron()
# ------------- # -------------
hexa.Compute() hexa.Compute()
# Update object browser
# ---------------------
salome.sg.updateObjBrowser(1)

View File

@ -145,3 +145,8 @@ local(gx+g_dx, gy-g_dy, gz , 21)
# ------------- # -------------
hexa.Compute() hexa.Compute()
# Update object browser
# ---------------------
salome.sg.updateObjBrowser(1)

View File

@ -104,3 +104,7 @@ hexa.Hexahedron()
# ------------------ # ------------------
hexa.Compute() hexa.Compute()
# Update object browser
# ---------------------
salome.sg.updateObjBrowser(1)

View File

@ -141,3 +141,8 @@ hexa.Hexahedron()
# ------------------ # ------------------
hexa.Compute() hexa.Compute()
# Update object browser
# ---------------------
salome.sg.updateObjBrowser(1)

View File

@ -186,3 +186,8 @@ hexa.Compute()
# -------------------- # --------------------
hexa_groupe = hexa.Group(groupe) hexa_groupe = hexa.Group(groupe)
# Update object browser
# ---------------------
salome.sg.updateObjBrowser(1)

View File

@ -132,3 +132,8 @@ tetra.Compute()
# ------------------------ # ------------------------
tetra.Group(group) tetra.Group(group)
# Update object browser
# ---------------------
salome.sg.updateObjBrowser(1)

View File

@ -130,3 +130,8 @@ hexa.Compute()
hexa.Group(group_a) hexa.Group(group_a)
hexa.Group(group_b) hexa.Group(group_b)
hexa.Group(group_1) hexa.Group(group_1)
# Update object browser
# ---------------------
salome.sg.updateObjBrowser(1)

View File

@ -90,3 +90,8 @@ if os.access(results+".xml", os.F_OK):
print "Ok: tepal" print "Ok: tepal"
else: else:
print "KO: tepal" print "KO: tepal"
# Update object browser
# ---------------------
salome.sg.updateObjBrowser(1)

View File

@ -1375,9 +1375,10 @@ class Mesh:
# @param discardModifs if True and the mesh has been edited since # @param discardModifs if True and the mesh has been edited since
# a last total re-compute and that may prevent successful partial re-compute, # a last total re-compute and that may prevent successful partial re-compute,
# then the mesh is cleaned before Compute() # then the mesh is cleaned before Compute()
# @param refresh if @c True, Object browser is automatically updated (when running in GUI)
# @return True or False # @return True or False
# @ingroup l2_construct # @ingroup l2_construct
def Compute(self, geom=0, discardModifs=False): def Compute(self, geom=0, discardModifs=False, refresh=False):
if geom == 0 or not isinstance(geom, geomBuilder.GEOM._objref_GEOM_Object): if geom == 0 or not isinstance(geom, geomBuilder.GEOM._objref_GEOM_Object):
if self.geom == 0: if self.geom == 0:
geom = self.mesh.GetShapeToMesh() geom = self.mesh.GetShapeToMesh()
@ -1505,7 +1506,7 @@ class Mesh:
smeshgui = salome.ImportComponentGUI("SMESH") smeshgui = salome.ImportComponentGUI("SMESH")
smeshgui.Init(self.mesh.GetStudyId()) smeshgui.Init(self.mesh.GetStudyId())
smeshgui.SetMeshIcon( salome.ObjectToID( self.mesh ), ok, (self.NbNodes()==0) ) smeshgui.SetMeshIcon( salome.ObjectToID( self.mesh ), ok, (self.NbNodes()==0) )
salome.sg.updateObjBrowser(1) if refresh: salome.sg.updateObjBrowser(1)
pass pass
return ok return ok
@ -1522,25 +1523,27 @@ class Mesh:
return self.mesh.SetMeshOrder(submeshes) return self.mesh.SetMeshOrder(submeshes)
## Removes all nodes and elements ## Removes all nodes and elements
# @refresh if @c True, Object browser is automatically updated (when running in GUI)
# @ingroup l2_construct # @ingroup l2_construct
def Clear(self): def Clear(self, refresh=False):
self.mesh.Clear() self.mesh.Clear()
if ( salome.sg.hasDesktop() and if ( salome.sg.hasDesktop() and
salome.myStudyManager.GetStudyByID( self.mesh.GetStudyId() )): salome.myStudyManager.GetStudyByID( self.mesh.GetStudyId() ) ):
smeshgui = salome.ImportComponentGUI("SMESH") smeshgui = salome.ImportComponentGUI("SMESH")
smeshgui.Init(self.mesh.GetStudyId()) smeshgui.Init(self.mesh.GetStudyId())
smeshgui.SetMeshIcon( salome.ObjectToID( self.mesh ), False, True ) smeshgui.SetMeshIcon( salome.ObjectToID( self.mesh ), False, True )
salome.sg.updateObjBrowser(1) if refresh: salome.sg.updateObjBrowser(1)
## Removes all nodes and elements of indicated shape ## Removes all nodes and elements of indicated shape
# @refresh if @c True, Object browser is automatically updated (when running in GUI)
# @ingroup l2_construct # @ingroup l2_construct
def ClearSubMesh(self, geomId): def ClearSubMesh(self, geomId, refresh=False):
self.mesh.ClearSubMesh(geomId) self.mesh.ClearSubMesh(geomId)
if salome.sg.hasDesktop(): if salome.sg.hasDesktop():
smeshgui = salome.ImportComponentGUI("SMESH") smeshgui = salome.ImportComponentGUI("SMESH")
smeshgui.Init(self.mesh.GetStudyId()) smeshgui.Init(self.mesh.GetStudyId())
smeshgui.SetMeshIcon( salome.ObjectToID( self.mesh ), False, True ) smeshgui.SetMeshIcon( salome.ObjectToID( self.mesh ), False, True )
salome.sg.updateObjBrowser(1) if refresh: salome.sg.updateObjBrowser(1)
## Computes a tetrahedral mesh using AutomaticLength + MEFISTO + Tetrahedron ## Computes a tetrahedral mesh using AutomaticLength + MEFISTO + Tetrahedron
# @param fineness [0.0,1.0] defines mesh fineness # @param fineness [0.0,1.0] defines mesh fineness