## BLSURF 2D algorithm. It is created by calling Mesh.Triangle(BLSURF,geom=0)
#
-# @ingroup l3_algos_basic
class BLSURF_Algorithm(Mesh_Algorithm):
meshMethod = "Triangle"
## Sets a way to define size of mesh elements to generate.
# @param thePhysicalMesh is: DefaultSize, BLSURF_Custom or SizeMap.
- # @ingroup l3_hypos_blsurf
def SetPhysicalMesh(self, thePhysicalMesh=DefaultSize):
self.Parameters().SetPhysicalMesh(thePhysicalMesh)
## Sets size of mesh elements to generate.
- # @ingroup l3_hypos_blsurf
def SetPhySize(self, theVal):
self.Parameters().SetPhySize(theVal)
## Sets lower boundary of mesh element size (PhySize).
- # @ingroup l3_hypos_blsurf
def SetPhyMin(self, theVal=-1):
self.Parameters().SetPhyMin(theVal)
## Sets upper boundary of mesh element size (PhySize).
- # @ingroup l3_hypos_blsurf
def SetPhyMax(self, theVal=-1):
self.Parameters().SetPhyMax(theVal)
## Sets a way to define maximum angular deflection of mesh from CAD model.
# @param theGeometricMesh is: 0 (None) or 1 (Custom)
- # @ingroup l3_hypos_blsurf
def SetGeometricMesh(self, theGeometricMesh=0):
if self.Parameters().GetPhysicalMesh() == 0: theGeometricMesh = 1
self.Parameters().SetGeometricMesh(theGeometricMesh)
## Sets angular deflection (in degrees) of a mesh face from CAD surface.
- # @ingroup l3_hypos_blsurf
def SetAngleMeshS(self, theVal=_angleMeshS):
if self.Parameters().GetGeometricMesh() == 0: theVal = self._angleMeshS
self.Parameters().SetAngleMeshS(theVal)
## Sets angular deflection (in degrees) of a mesh edge from CAD curve.
- # @ingroup l3_hypos_blsurf
def SetAngleMeshC(self, theVal=_angleMeshS):
if self.Parameters().GetGeometricMesh() == 0: theVal = self._angleMeshS
self.Parameters().SetAngleMeshC(theVal)
## Sets lower boundary of mesh element size computed to respect angular deflection.
- # @ingroup l3_hypos_blsurf
def SetGeoMin(self, theVal=-1):
self.Parameters().SetGeoMin(theVal)
## Sets upper boundary of mesh element size computed to respect angular deflection.
- # @ingroup l3_hypos_blsurf
def SetGeoMax(self, theVal=-1):
self.Parameters().SetGeoMax(theVal)
## Sets maximal allowed ratio between the lengths of two adjacent edges.
- # @ingroup l3_hypos_blsurf
def SetGradation(self, theVal=_gradation):
if self.Parameters().GetGeometricMesh() == 0: theVal = self._gradation
self.Parameters().SetGradation(theVal)
# <li>FromCAD - mesh conformity is assured by conformity of a shape</li>
# <li>PreProcess or PreProcessPlus - by pre-processing a CAD model</li>
# <li>PreCAD - by pre-processing with PreCAD a CAD model</li></ul>
- # @ingroup l3_hypos_blsurf
def SetTopology(self, way):
self.Parameters().SetTopology(way)
## To respect geometrical edges or not.
- # @ingroup l3_hypos_blsurf
def SetDecimesh(self, toIgnoreEdges=False):
self.Parameters().SetDecimesh(toIgnoreEdges)
## Sets verbosity level in the range 0 to 100.
- # @ingroup l3_hypos_blsurf
def SetVerbosity(self, level):
self.Parameters().SetVerbosity(level)
## To optimize merges edges.
- # @ingroup l3_hypos_blsurf
def SetPreCADMergeEdges(self, toMergeEdges=False):
self.Parameters().SetPreCADMergeEdges(toMergeEdges)
## To remove nano edges.
- # @ingroup l3_hypos_blsurf
def SetPreCADRemoveNanoEdges(self, toRemoveNanoEdges=False):
self.Parameters().SetPreCADRemoveNanoEdges(toRemoveNanoEdges)
## To compute topology from scratch
- # @ingroup l3_hypos_blsurf
def SetPreCADDiscardInput(self, toDiscardInput=False):
self.Parameters().SetPreCADDiscardInput(toDiscardInput)
## Sets the length below which an edge is considered as nano
# for the topology processing.
- # @ingroup l3_hypos_blsurf
def SetPreCADEpsNano(self, epsNano):
self.Parameters().SetPreCADEpsNano(epsNano)
## Sets advanced option value.
- # @ingroup l3_hypos_blsurf
def SetOptionValue(self, optionName, level):
self.Parameters().SetOptionValue(optionName,level)
# Keyword arguments:
# optionName: name of the option
# optionValue: value of the option
- # @ingroup l3_hypos_blsurf
def SetPreCADOptionValue(self, optionName, optionValue):
self.Parameters().SetPreCADOptionValue(optionName,optionValue)
## Sets GMF file for export at computation
- # @ingroup l3_hypos_blsurf
def SetGMFFile(self, fileName):
self.Parameters().SetGMFFile(fileName)
## Enforced vertices (BLSURF)
## To get all the enforced vertices
- # @ingroup l3_hypos_blsurf
def GetAllEnforcedVertices(self):
return self.Parameters().GetAllEnforcedVertices()
## To get all the enforced vertices sorted by face (or group, compound)
- # @ingroup l3_hypos_blsurf
def GetAllEnforcedVerticesByFace(self):
return self.Parameters().GetAllEnforcedVerticesByFace()
## To get all the enforced vertices sorted by coords of input vertices
- # @ingroup l3_hypos_blsurf
def GetAllEnforcedVerticesByCoords(self):
return self.Parameters().GetAllEnforcedVerticesByCoords()
## To get all the coords of input vertices sorted by face (or group, compound)
- # @ingroup l3_hypos_blsurf
def GetAllCoordsByFace(self):
return self.Parameters().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):
AssureGeomPublished( self.mesh, theFace )
return self.Parameters().GetEnforcedVertices(theFace)
## To clear all the enforced vertices
- # @ingroup l3_hypos_blsurf
def ClearAllEnforcedVertices(self):
return self.Parameters().ClearAllEnforcedVertices()
# @param z : z coordinate
# @param vertexName : name of the enforced vertex
# @param groupName : name of the group
- # @ingroup l3_hypos_blsurf
def SetEnforcedVertex(self, theFace, x, y, z, vertexName = "", groupName = ""):
AssureGeomPublished( self.mesh, theFace )
if vertexName == "":
# @param theFace : GEOM face (or group, compound) on which to define an enforced vertex
# @param theVertex : GEOM vertex (or group, compound) to be projected on theFace.
# @param groupName : name of the group
- # @ingroup l3_hypos_blsurf
def SetEnforcedVertexGeom(self, theFace, theVertex, groupName = ""):
AssureGeomPublished( self.mesh, theFace )
AssureGeomPublished( self.mesh, theVertex )
# @param x : x coordinate
# @param y : y coordinate
# @param z : z coordinate
- # @ingroup l3_hypos_blsurf
def UnsetEnforcedVertex(self, theFace, x, y, z):
AssureGeomPublished( self.mesh, theFace )
return self.Parameters().UnsetEnforcedVertex(theFace, x, y, z)
## To remove an enforced vertex on a given GEOM face (or group, compound) given a GEOM vertex, group or compound.
# @param theFace : GEOM face (or group, compound) on which to remove the enforced vertex
# @param theVertex : GEOM vertex (or group, compound) to remove.
- # @ingroup l3_hypos_blsurf
def UnsetEnforcedVertexGeom(self, theFace, theVertex):
AssureGeomPublished( self.mesh, theFace )
AssureGeomPublished( self.mesh, theVertex )
## To remove all enforced vertices on a given face.
# @param theFace : face (or group/compound of faces) on which to remove all enforced vertices
- # @ingroup l3_hypos_blsurf
def UnsetEnforcedVertices(self, theFace):
AssureGeomPublished( self.mesh, theFace )
return self.Parameters().UnsetEnforcedVertices(theFace)
## To tell BLSURF to add a node on internal vertices
# @param toEnforceInternalVertices : boolean; if True the internal vertices are added as enforced vertices
- # @ingroup l3_hypos_blsurf
def SetInternalEnforcedVertexAllFaces(self, toEnforceInternalVertices):
return self.Parameters().SetInternalEnforcedVertexAllFaces(toEnforceInternalVertices)
## To know if BLSURF will add a node on internal vertices
- # @ingroup l3_hypos_blsurf
def GetInternalEnforcedVertexAllFaces(self):
return self.Parameters().GetInternalEnforcedVertexAllFaces()
## To define a group for the nodes of internal vertices
# @param groupName : string; name of the group
- # @ingroup l3_hypos_blsurf
def SetInternalEnforcedVertexAllFacesGroup(self, groupName):
return self.Parameters().SetInternalEnforcedVertexAllFacesGroup(groupName)
## To get the group name of the nodes of internal vertices
- # @ingroup l3_hypos_blsurf
def GetInternalEnforcedVertexAllFacesGroup(self):
return self.Parameters().GetInternalEnforcedVertexAllFacesGroup()
# @param theEndSize : maximum size that will be reached on theFace
# @param theInfluenceDistance : influence of the attractor ( the size grow slower on theFace if it's high)
# @param theConstantSizeDistance : distance until which the mesh size will be kept constant on theFace
- # @ingroup l3_hypos_blsurf
def SetAttractorGeom(self, theFace, theAttractor, theStartSize, theEndSize, theInfluenceDistance, theConstantSizeDistance):
AssureGeomPublished( self.mesh, theFace )
AssureGeomPublished( self.mesh, theAttractor )
## Unsets an attractor on the chosen face.
# @param theFace : face on which the attractor has to be removed
- # @ingroup l3_hypos_blsurf
def UnsetAttractorGeom(self, theFace):
AssureGeomPublished( self.mesh, theFace )
self.Parameters().SetAttractorGeom(theFace)
# 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):
AssureGeomPublished( self.mesh, theObject )
self.Parameters().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):
AssureGeomPublished( self.mesh, theObject )
self.Parameters().UnsetSizeMap(theObject)
## To remove all the size maps
- # @ingroup l3_hypos_blsurf
def ClearSizeMaps(self):
self.Parameters().ClearSizeMaps()
## Sets QuadAllowed flag.
- # @ingroup l3_hypos_blsurf
def SetQuadAllowed(self, toAllow=True):
self.Parameters().SetQuadAllowed(toAllow)
## Defines hypothesis having several parameters
#
- # @ingroup l3_hypos_blsurf
def Parameters(self):
if not self.params:
self.params = self.Hypothesis("BLSURF_Parameters", [],