From 78fd150f79b9e629e266141a5b1204fb2efdfc15 Mon Sep 17 00:00:00 2001 From: gdd Date: Tue, 26 Jul 2011 17:18:04 +0000 Subject: [PATCH] Add PreCAD Update doc Update smeshDC.py --- doc/salome/gui/SMESH/input/blsurf_hypo.doc | 10 +++ doc/salome/gui/SMESH/input/ghs3d_hypo.doc | 1 + doc/salome/gui/SMESH/input/hexotic_hypo.doc | 1 + .../input/tui_defining_blsurf_hypotheses.doc | 35 ++++---- src/SMESH_SWIG/smeshDC.py | 89 +++++++++++++++++-- 5 files changed, 110 insertions(+), 26 deletions(-) diff --git a/doc/salome/gui/SMESH/input/blsurf_hypo.doc b/doc/salome/gui/SMESH/input/blsurf_hypo.doc index 795fbb974..3f3d9cb5f 100644 --- a/doc/salome/gui/SMESH/input/blsurf_hypo.doc +++ b/doc/salome/gui/SMESH/input/blsurf_hypo.doc @@ -4,6 +4,7 @@ \n BLSURF Parameters hypothesis works only with BLSURF 2d algorithm. This algorithm is a commercial software. +\n To get a licence, visit http://www.distene.com/corp/eval-distene.html

General parameters

@@ -67,6 +68,15 @@ not sewed faces.
  • "Pre-process" and "Pre-process++" allow the BLSURF software to pre-process the geometrical model to eventually produce a conform mesh.
  • +
  • "PreCAD" is an auxiliary CAD pre-processing module which has + two main goals: + + This module requires a specific licence. +
  • Verbosity level - Defines the percentage of "verbosity" of diff --git a/doc/salome/gui/SMESH/input/ghs3d_hypo.doc b/doc/salome/gui/SMESH/input/ghs3d_hypo.doc index eb4b981b6..b3bdb0a68 100644 --- a/doc/salome/gui/SMESH/input/ghs3d_hypo.doc +++ b/doc/salome/gui/SMESH/input/ghs3d_hypo.doc @@ -4,6 +4,7 @@ \n GHS3D Parameters hypothesis works only with Tetrahedron (GHS3D) algorithm. This algorithm is a commercial software. +\n To get a licence, visit http://www.distene.com/corp/eval-distene.html

    General parameters

    diff --git a/doc/salome/gui/SMESH/input/hexotic_hypo.doc b/doc/salome/gui/SMESH/input/hexotic_hypo.doc index 902b93ac5..15bc862a6 100644 --- a/doc/salome/gui/SMESH/input/hexotic_hypo.doc +++ b/doc/salome/gui/SMESH/input/hexotic_hypo.doc @@ -4,6 +4,7 @@ \n Hexotic Parameters hypothesis works only with Hexotic algorithm. This algorithm is a commercial software. +\n To get a licence, visit http://www.distene.com/corp/eval-distene.html \image html hexotic_parameters.png diff --git a/doc/salome/gui/SMESH/input/tui_defining_blsurf_hypotheses.doc b/doc/salome/gui/SMESH/input/tui_defining_blsurf_hypotheses.doc index 61827a73a..470d6c5fe 100644 --- a/doc/salome/gui/SMESH/input/tui_defining_blsurf_hypotheses.doc +++ b/doc/salome/gui/SMESH/input/tui_defining_blsurf_hypotheses.doc @@ -34,36 +34,33 @@ geompy.addToStudyInFather(Face_2,Wire_1, "Wire_1") blsurfMesh = smesh.Mesh(box,"box: BLSurf mesh") # create a BLSurf algorithm for faces -BLSURF = blsurfMesh.Triangle(algo=smesh.BLSURF) +algo2d = blsurfMesh.Triangle(algo=smesh.BLSURF) -# get BLSurf algorithm hypothesis -BLSURF_Parameters = BLSURF.Parameters() +# optional - set physical mesh to 2 = Size Map +algo2d.SetPhysicalMesh( 2 ) -# set physical mesh to 2 = Size Map -BLSURF_Parameters.SetPhysicalMesh( 2 ) - -# set global mesh size -BLSURF_Parameters.SetPhySize( 34.641 ) +# optional - set global mesh size +algo2d.SetPhySize( 34.641 ) # set size on Face_1 -BLSURF_Parameters.SetSizeMap(Face_1, 'def f(u,v): return 10' ) +algo2d.SetSizeMap(Face_1, 'def f(u,v): return 10' ) # set size on Edge_1 -BLSURF_Parameters.SetSizeMap(Edge_1, 'def f(t): return 5' ) +algo2d.SetSizeMap(Edge_1, 'def f(t): return 5' ) # set size on Vertex_1 -BLSURF_Parameters.SetSizeMap(Vertex_1, 'def f(): return 2' ) +algo2d.SetSizeMap(Vertex_1, 'def f(): return 2' ) # compute the mesh blsurfMesh.Compute() # Add enforced vertex for Face_1 on (50, 50, 50) # The projection coordinates will be (50, 50, 0) -BLSURF_Parameters.SetEnforcedVertex(Face_1, 50, 50, 50) +algo2d.SetEnforcedVertex(Face_1, 50, 50, 50) # Add another enforced vertex on (150, 150, 150) -BLSURF_Parameters.SetEnforcedVertex(Face_1, 150, 150, 150) +algo2d.SetEnforcedVertex(Face_1, 150, 150, 150) # Retrieve and print the list of enforced vertices defines on Face_1 -enfList = BLSURF_Parameters.GetEnforcedVertices(Face_1) +enfList = algo2d.GetEnforcedVertices(Face_1) print "List of enforced vertices for Face_1: " print enfList @@ -71,8 +68,8 @@ print enfList blsurfMesh.Compute() # Remove an enforced vertex and print the list -BLSURF_Parameters.UnsetEnforcedVertex(Face_1, 50, 50, 50) -enfList = BLSURF_Parameters.GetEnforcedVertices(Face_1) +algo2d.UnsetEnforcedVertex(Face_1, 50, 50, 50) +enfList = algo2d.GetEnforcedVertices(Face_1) print "List of enforced vertices for Face_1: " print enfList @@ -80,7 +77,7 @@ print enfList blsurfMesh.Compute() # Remove all enforced vertices defined on Face_1 -BLSURF_Parameters.UnsetEnforcedVertices(Face_1) +algo2d.UnsetEnforcedVertices(Face_1) # compute the mesh blsurfMesh.Compute() @@ -91,11 +88,11 @@ blsurfMesh.Compute() # The size on Wire_1 is 1 and will grow until a maximum of 36.641 (physical size set above) # The influence distance of the attractor is 20 # The size is kept constant until a distance of 10 -BLSURF_Parameters.SetAttractorGeom(Face_2, Wire_1, 1, 36.641, 20, 10) +algo2d.SetAttractorGeom(Face_2, Wire_1, 1, 36.641, 20, 10) # In order to let the attractor control the growing of the mesh let set # the gradation to its maximum -BLSURF_Parameters.SetGradation( 2.5 ) +algo2d.SetGradation( 2.5 ) # compute the mesh blsurfMesh.Compute() diff --git a/src/SMESH_SWIG/smeshDC.py b/src/SMESH_SWIG/smeshDC.py index d80f826b5..91df7d4af 100644 --- a/src/SMESH_SWIG/smeshDC.py +++ b/src/SMESH_SWIG/smeshDC.py @@ -188,7 +188,7 @@ None_Optimization, Light_Optimization, Medium_Optimization, Strong_Optimization None_Optimization, Light_Optimization, Standard_Optimization, StandardPlus_Optimization, Strong_Optimization = 0,1,2,3,4 # Topology treatment way of BLSURF -FromCAD, PreProcess, PreProcessPlus = 0,1,2 +FromCAD, PreProcess, PreProcessPlus, PreCAD = 0,1,2,3 # Element size flag of BLSURF DefaultSize, DefaultGeom, BLSURF_Custom, SizeMap = 0,0,1,2 @@ -5053,6 +5053,7 @@ class Mesh_Triangle(Mesh_Algorithm): # @param way defines how mesh conformity is assured + #
  • PreCAD - by pre-processing with PreCAD a CAD model
  • # @ingroup l3_hypos_blsurf def SetTopology(self, way): if self.Parameters(): @@ -5080,6 +5081,52 @@ class Mesh_Triangle(Mesh_Algorithm): # Parameter of BLSURF algo self.params.SetOptionValue(optionName,level) + ## Enforced vertices (BLSURF) + + ## To get all the enforced vertices + # @ingroup l3_hypos_blsurf + def GetAllEnforcedVertices(self): + if self.Parameters(): + # Parameter of BLSURF algo + return self.params.GetAllEnforcedVertices() + + ## To get all the enforced vertices sorted by face (or group, compound) + # @ingroup l3_hypos_blsurf + def GetAllEnforcedVerticesByFace(self): + if self.Parameters(): + # Parameter of BLSURF algo + return self.params.GetAllEnforcedVerticesByFace() + + ## To get all the enforced vertices sorted by coords of input vertices + # @ingroup l3_hypos_blsurf + def GetAllEnforcedVerticesByCoords(self): + if self.Parameters(): + # Parameter of BLSURF algo + return self.params.GetAllEnforcedVerticesByCoords() + + ## To get all the coords of input vertices sorted by face (or group, compound) + # @ingroup l3_hypos_blsurf + def GetAllCoordsByFace(self): + if self.Parameters(): + # Parameter of BLSURF algo + return self.params.GetAllCoordsByFace() + + ## To get all the enforced vertices on a face (or group, compound) + # @param theFace : GEOM face (or group, compound) on which to define an enforced vertex + # @ingroup l3_hypos_blsurf + def GetEnforcedVertices(self, theFace): + if self.Parameters(): + # Parameter of BLSURF algo + AssureGeomPublished( self.mesh, theFace ) + return self.params.GetEnforcedVertices(theFace) + + ## To clear all the enforced vertices + # @ingroup l3_hypos_blsurf + def ClearAllEnforcedVertices(self): + if self.Parameters(): + # Parameter of BLSURF algo + return self.params.ClearAllEnforcedVertices() + ## To set an enforced vertex on a face (or group, compound) given the coordinates of a point. If the point is not on the face, it will projected on it. If there is no projection, no enforced vertex is created. # @param theFace : GEOM face (or group, compound) on which to define an enforced vertex # @param x : x coordinate @@ -5089,7 +5136,6 @@ class Mesh_Triangle(Mesh_Algorithm): def SetEnforcedVertex(self, theFace, x, y, z): if self.Parameters(): # Parameter of BLSURF algo -# self.SetPhysicalMesh(2) AssureGeomPublished( self.mesh, theFace ) return self.params.SetEnforcedVertex(theFace, x, y, z) @@ -5103,7 +5149,6 @@ class Mesh_Triangle(Mesh_Algorithm): def SetEnforcedVertexNamed(self, theFace, x, y, z, vertexName): if self.Parameters(): # Parameter of BLSURF algo -# self.SetPhysicalMesh(2) AssureGeomPublished( self.mesh, theFace ) return self.params.SetEnforcedVertexNamed(theFace, x, y, z, vertexName) @@ -5114,7 +5159,6 @@ class Mesh_Triangle(Mesh_Algorithm): def SetEnforcedVertexGeom(self, theFace, theVertex): if self.Parameters(): # Parameter of BLSURF algo -# self.SetPhysicalMesh(2) AssureGeomPublished( self.mesh, theFace ) AssureGeomPublished( self.mesh, theVertex ) return self.params.SetEnforcedVertexGeom(theFace, theVertex) @@ -5129,7 +5173,6 @@ class Mesh_Triangle(Mesh_Algorithm): def SetEnforcedVertexWithGroup(self, theFace, x, y, z, groupName): if self.Parameters(): # Parameter of BLSURF algo -# self.SetPhysicalMesh(2) AssureGeomPublished( self.mesh, theFace ) return self.params.SetEnforcedVertexWithGroup(theFace, x, y, z, groupName) @@ -5144,7 +5187,6 @@ class Mesh_Triangle(Mesh_Algorithm): def SetEnforcedVertexNamedWithGroup(self, theFace, x, y, z, vertexName, groupName): if self.Parameters(): # Parameter of BLSURF algo -# self.SetPhysicalMesh(2) AssureGeomPublished( self.mesh, theFace ) return self.params.SetEnforcedVertexNamedWithGroup(theFace, x, y, z, vertexName, groupName) @@ -5156,7 +5198,6 @@ class Mesh_Triangle(Mesh_Algorithm): def SetEnforcedVertexGeomWithGroup(self, theFace, theVertex, groupName): if self.Parameters(): # Parameter of BLSURF algo -# self.SetPhysicalMesh(2) AssureGeomPublished( self.mesh, theFace ) AssureGeomPublished( self.mesh, theVertex ) return self.params.SetEnforcedVertexGeomWithGroup(theFace, theVertex,groupName) @@ -5193,6 +5234,8 @@ class Mesh_Triangle(Mesh_Algorithm): AssureGeomPublished( self.mesh, theFace ) return self.params.UnsetEnforcedVertices(theFace) + ## Attractors (BLSURF) + ## Sets an attractor on the chosen face. The mesh size will decrease exponentially with the distance from theAttractor, following the rule h(d) = theEndSize - (theEndSize - theStartSize) * exp [ - ( d / theInfluenceDistance ) ^ 2 ] # @param theFace : face on which the attractor will be defined # @param theAttractor : geometrical object from which the mesh size "h" decreases exponentially @@ -5217,6 +5260,38 @@ class Mesh_Triangle(Mesh_Algorithm): AssureGeomPublished( self.mesh, theFace ) self.params.SetAttractorGeom(theFace) + ## Size maps (BLSURF) + + ## To set a size map on a face, edge or vertex (or group, compound) given Python function. + # If theObject is a face, the function can be: def f(u,v): return u+v + # If theObject is an edge, the function can be: def f(t): return t/2 + # If theObject is a vertex, the function can be: def f(): return 10 + # @param theObject : GEOM face, edge or vertex (or group, compound) on which to define a size map + # @param theSizeMap : Size map defined as a string + # @ingroup l3_hypos_blsurf + def SetSizeMap(self, theObject, theSizeMap): + if self.Parameters(): + # Parameter of BLSURF algo + AssureGeomPublished( self.mesh, theObject ) + return self.params.SetSizeMap(theObject, theSizeMap) + + ## To remove a size map defined on a face, edge or vertex (or group, compound) + # @param theObject : GEOM face, edge or vertex (or group, compound) on which to define a size map + # @ingroup l3_hypos_blsurf + def UnsetSizeMap(self, theObject): + if self.Parameters(): + # Parameter of BLSURF algo + AssureGeomPublished( self.mesh, theObject ) + return self.params.UnsetSizeMap(theObject) + + ## To remove all the size maps + # @ingroup l3_hypos_blsurf + def ClearSizeMaps(self): + if self.Parameters(): + # Parameter of BLSURF algo + return self.params.ClearSizeMaps() + + ## Sets QuadAllowed flag. # Only for algoType == NETGEN(NETGEN_1D2D) || NETGEN_2D || BLSURF # @ingroup l3_hypos_netgen l3_hypos_blsurf -- 2.39.2