X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESH_SWIG%2FsmeshDC.py;h=1a9fdbe48ec336f8863a3ef8e4871f16fd41d732;hb=ae0943024f3416658be5ed1a8c781c44c2f0074e;hp=a2476107ad5b5eb4a81e490359eb6e37a3ca77ef;hpb=d8f644ca3d4ce62f2ef41d4aacb52f5bb1221df3;p=modules%2Fsmesh.git diff --git a/src/SMESH_SWIG/smeshDC.py b/src/SMESH_SWIG/smeshDC.py index a2476107a..1a9fdbe48 100644 --- a/src/SMESH_SWIG/smeshDC.py +++ b/src/SMESH_SWIG/smeshDC.py @@ -17,11 +17,10 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # - # File : smesh.py # Author : Francis KLOSS, OCC # Module : SMESH -# + """ \namespace smesh \brief Module smesh @@ -358,7 +357,7 @@ def ParseDirStruct(Dir): pntStr = Dir.pointStruct if isinstance(pntStr, PointStructStr6): Parameters = str(pntStr.x1Str) + var_separator + str(pntStr.x2Str) + var_separator - Parameters += str(pntStr.y1Str) + var_separator + str(pntStr.y2Str) + var_separator + Parameters += str(pntStr.y1Str) + var_separator + str(pntStr.y2Str) + var_separator Parameters += str(pntStr.z1Str) + var_separator + str(pntStr.z2Str) Point = PointStruct(pntStr.x2 - pntStr.x1, pntStr.y2 - pntStr.y1, pntStr.z2 - pntStr.z1) else: @@ -387,13 +386,13 @@ def ParseAngles(list): else: Result.append(parameter) pass - + Parameters = Parameters + str(parameter) Parameters = Parameters + var_separator pass Parameters = Parameters[:len(Parameters)-1] return Result, Parameters - + def IsEqual(val1, val2, tol=PrecisionConfusion): if abs(val1 - val2) < tol: return True @@ -491,7 +490,7 @@ def CheckPlugin(plugin): print "Warning: BLSURFPlugin module unavailable" return False return True - + # end of l1_auxiliary ## @} @@ -570,7 +569,7 @@ class smeshDC(SMESH._objref_SMESH_Gen): # @return SMESH.AxisStruct # @ingroup l1_auxiliary def GetAxisStruct(self,theObj): - edges = self.geompyD.SubShapeAll( theObj, geompyDC.ShapeType["EDGE"] ) + edges = self.geompyD.ExtractShapes( theObj, geompyDC.ShapeType["EDGE"] ) if len(edges) > 1: vertex1, vertex2 = self.geompyD.SubShapeAll( edges[0], geompyDC.ShapeType["VERTEX"] ) vertex3, vertex4 = self.geompyD.SubShapeAll( edges[1], geompyDC.ShapeType["VERTEX"] ) @@ -663,27 +662,6 @@ class smeshDC(SMESH._objref_SMESH_Gen): aMesh = Mesh(self, self.geompyD, aSmeshMesh) return aMesh - ## From SMESH_Gen interface - # @return the list of integer values - # @ingroup l1_auxiliary - def GetSubShapesId( self, theMainObject, theListOfSubObjects ): - return SMESH._objref_SMESH_Gen.GetSubShapesId(self,theMainObject, theListOfSubObjects) - - ## From SMESH_Gen interface. Creates a pattern - # @return an instance of SMESH_Pattern - # - # Example of Patterns usage - # @ingroup l2_modif_patterns - def GetPattern(self): - return SMESH._objref_SMESH_Gen.GetPattern(self) - - ## Sets number of segments per diagonal of boundary box of geometry by which - # default segment length of appropriate 1D hypotheses is defined. - # Default value is 10 - # @ingroup l1_auxiliary - def SetBoundaryBoxSegmentation(self, nbSegments): - SMESH._objref_SMESH_Gen.SetBoundaryBoxSegmentation(self,nbSegments) - ## Concatenate the given meshes into one mesh. # @return an instance of Mesh class # @param meshes the meshes to combine into one mesh @@ -707,6 +685,41 @@ class smeshDC(SMESH._objref_SMESH_Gen): aMesh = Mesh(self, self.geompyD, aSmeshMesh) return aMesh + ## Create a mesh by copying a part of another mesh. + # @param meshPart a part of mesh to copy, either a Mesh, a sub-mesh or a group; + # to copy nodes or elements not contained in any mesh object, + # pass result of Mesh.GetIDSource( list_of_ids, type ) as meshPart + # @param meshName a name of the new mesh + # @param toCopyGroups to create in the new mesh groups the copied elements belongs to + # @param toKeepIDs to preserve IDs of the copied elements or not + # @return an instance of Mesh class + def CopyMesh( self, meshPart, meshName, toCopyGroups=False, toKeepIDs=False): + if (isinstance( meshPart, Mesh )): + meshPart = meshPart.GetMesh() + mesh = SMESH._objref_SMESH_Gen.CopyMesh( self,meshPart,meshName,toCopyGroups,toKeepIDs ) + return Mesh(self, self.geompyD, mesh) + + ## From SMESH_Gen interface + # @return the list of integer values + # @ingroup l1_auxiliary + def GetSubShapesId( self, theMainObject, theListOfSubObjects ): + return SMESH._objref_SMESH_Gen.GetSubShapesId(self,theMainObject, theListOfSubObjects) + + ## From SMESH_Gen interface. Creates a pattern + # @return an instance of SMESH_Pattern + # + # Example of Patterns usage + # @ingroup l2_modif_patterns + def GetPattern(self): + return SMESH._objref_SMESH_Gen.GetPattern(self) + + ## Sets number of segments per diagonal of boundary box of geometry by which + # default segment length of appropriate 1D hypotheses is defined. + # Default value is 10 + # @ingroup l1_auxiliary + def SetBoundaryBoxSegmentation(self, nbSegments): + SMESH._objref_SMESH_Gen.SetBoundaryBoxSegmentation(self,nbSegments) + # Filtering. Auxiliary functions: # ------------------------------ @@ -735,6 +748,8 @@ class smeshDC(SMESH._objref_SMESH_Gen): # @param UnaryOp FT_LogicalNOT or FT_Undefined # @param BinaryOp a binary logical operation FT_LogicalAND, FT_LogicalOR or # FT_Undefined (must be for the last criterion of all criteria) + # @param Tolerance the tolerance used by FT_BelongToGeom, FT_BelongToSurface, + # FT_LyingOnGeom, FT_CoplanarFaces criteria # @return SMESH.Filter.Criterion # @ingroup l1_controls def GetCriterion(self,elementType, @@ -742,10 +757,12 @@ class smeshDC(SMESH._objref_SMESH_Gen): Compare = FT_EqualTo, Treshold="", UnaryOp=FT_Undefined, - BinaryOp=FT_Undefined): + BinaryOp=FT_Undefined, + Tolerance=1e-07): aCriterion = self.GetEmptyCriterion() aCriterion.TypeOfElement = elementType aCriterion.Type = self.EnumToLong(CritType) + aCriterion.Tolerance = Tolerance aTreshold = Treshold @@ -810,7 +827,9 @@ class smeshDC(SMESH._objref_SMESH_Gen): return None pass elif CritType in [FT_FreeBorders, FT_FreeEdges, FT_BadOrientedVolume, FT_FreeNodes, - FT_FreeFaces, FT_LinearOrQuadratic]: + FT_FreeFaces, FT_LinearOrQuadratic, + FT_BareBorderFace, FT_BareBorderVolume, + FT_OverConstrainedFace, FT_OverConstrainedVolume]: # At this point the treshold is unnecessary if aTreshold == FT_LogicalNOT: aCriterion.UnaryOp = self.EnumToLong(FT_LogicalNOT) @@ -845,14 +864,17 @@ class smeshDC(SMESH._objref_SMESH_Gen): # @param Compare belongs to {FT_LessThan, FT_MoreThan, FT_EqualTo} # @param Treshold the threshold value (range of id ids as string, shape, numeric) # @param UnaryOp FT_LogicalNOT or FT_Undefined + # @param Tolerance the tolerance used by FT_BelongToGeom, FT_BelongToSurface, + # FT_LyingOnGeom, FT_CoplanarFaces criteria # @return SMESH_Filter # @ingroup l1_controls def GetFilter(self,elementType, CritType=FT_Undefined, Compare=FT_EqualTo, Treshold="", - UnaryOp=FT_Undefined): - aCriterion = self.GetCriterion(elementType, CritType, Compare, Treshold, UnaryOp, FT_Undefined) + UnaryOp=FT_Undefined, + Tolerance=1e-07): + aCriterion = self.GetCriterion(elementType, CritType, Compare, Treshold, UnaryOp, FT_Undefined,Tolerance) aFilterMgr = self.CreateFilterManager() aFilter = aFilterMgr.CreateFilter() aCriteria = [] @@ -913,7 +935,7 @@ class smeshDC(SMESH._objref_SMESH_Gen): obj = obj.GetMesh() d = {} if hasattr(obj, "_narrow") and obj._narrow(SMESH.SMESH_IDSource): - values = obj.GetMeshInfo() + values = obj.GetMeshInfo() for i in range(SMESH.Entity_Last._v): if i < len(values): d[SMESH.EntityType._item(i)]=values[i] pass @@ -924,7 +946,7 @@ class smeshDC(SMESH._objref_SMESH_Gen): # If @a src2 is None, and @a id2 = 0, distance from @a src1 / @a id1 to the origin is computed. # If @a src2 is None, and @a id2 != 0, it is assumed that both @a id1 and @a id2 belong to @a src1. # - # @param src1 first source object + # @param src1 first source object # @param src2 second source object # @param id1 node/element id from the first source # @param id2 node/element id from the second (or first) source @@ -940,13 +962,13 @@ class smeshDC(SMESH._objref_SMESH_Gen): else: result = result.value return result - + ## Get measure structure specifying minimum distance data between two objects # # If @a src2 is None, and @a id2 = 0, distance from @a src1 / @a id1 to the origin is computed. # If @a src2 is None, and @a id2 != 0, it is assumed that both @a id1 and @a id2 belong to @a src1. # - # @param src1 first source object + # @param src1 first source object # @param src2 second source object # @param id1 node/element id from the first source # @param id2 node/element id from the second (or first) source @@ -985,7 +1007,7 @@ class smeshDC(SMESH._objref_SMESH_Gen): result = aMeasurements.MinDistance(src1, src2) aMeasurements.Destroy() return result - + ## Get bounding box of the specified object(s) # @param objects single source object or list of source objects # @return tuple of six values (minX, minY, minZ, maxX, maxY, maxZ) @@ -1059,7 +1081,16 @@ class Mesh: if obj != 0: if isinstance(obj, geompyDC.GEOM._objref_GEOM_Object): self.geom = obj + # publish geom of mesh (issue 0021122) + if not self.geom.GetStudyEntry(): + studyID = smeshpyD.GetCurrentStudy()._get_StudyId() + if studyID != geompyD.myStudyId: + geompyD.init_geom( smeshpyD.GetCurrentStudy()) + pass + name = "%s_%s"%(self.geom.GetShapeType(), id(self.geom)%100) + geompyD.addToStudy( self.geom, name ) self.mesh = self.smeshpyD.CreateMesh(self.geom) + elif isinstance(obj, SMESH._objref_SMESH_Mesh): self.SetMesh(obj) else: @@ -1412,14 +1443,14 @@ class Mesh: except: shapeText = " on subshape #%s" % (err.subShapeID) errText = "" - stdErrors = ["OK", #COMPERR_OK + stdErrors = ["OK", #COMPERR_OK "Invalid input mesh", #COMPERR_BAD_INPUT_MESH - "std::exception", #COMPERR_STD_EXCEPTION - "OCC exception", #COMPERR_OCC_EXCEPTION - "SALOME exception", #COMPERR_SLM_EXCEPTION - "Unknown exception", #COMPERR_EXCEPTION - "Memory allocation problem", #COMPERR_MEMORY_PB - "Algorithm failed", #COMPERR_ALGO_FAILED + "std::exception", #COMPERR_STD_EXCEPTION + "OCC exception", #COMPERR_OCC_EXCEPTION + "SALOME exception", #COMPERR_SLM_EXCEPTION + "Unknown exception", #COMPERR_EXCEPTION + "Memory allocation problem", #COMPERR_MEMORY_PB + "Algorithm failed", #COMPERR_ALGO_FAILED "Unexpected geometry"]#COMPERR_BAD_SHAPE if err.code > 0: if err.code < len(stdErrors): errText = stdErrors[err.code] @@ -1744,6 +1775,8 @@ class Mesh: # @param Compare belongs to {FT_LessThan, FT_MoreThan, FT_EqualTo} # @param Treshold the threshold value (range of id ids as string, shape, numeric) # @param UnaryOp FT_LogicalNOT or FT_Undefined + # @param Tolerance the tolerance used by FT_BelongToGeom, FT_BelongToSurface, + # FT_LyingOnGeom, FT_CoplanarFaces criteria # @return SMESH_Group # @ingroup l2_grps_create def MakeGroup(self, @@ -1752,8 +1785,9 @@ class Mesh: CritType=FT_Undefined, Compare=FT_EqualTo, Treshold="", - UnaryOp=FT_Undefined): - aCriterion = self.smeshpyD.GetCriterion(elementType, CritType, Compare, Treshold, UnaryOp, FT_Undefined) + UnaryOp=FT_Undefined, + Tolerance=1e-07): + aCriterion = self.smeshpyD.GetCriterion(elementType, CritType, Compare, Treshold, UnaryOp, FT_Undefined,Tolerance) group = self.MakeGroupByCriterion(groupName, aCriterion) return group @@ -1855,15 +1889,15 @@ class Mesh: # @ingroup l2_grps_operon def UnionGroups(self, group1, group2, name): return self.mesh.UnionGroups(group1, group2, name) - + ## Produces a union list of groups - # New group is created. All mesh elements that are present in + # New group is created. All mesh elements that are present in # initial groups are added to the new one # @return an instance of SMESH_Group # @ingroup l2_grps_operon def UnionListOfGroups(self, groups, name): return self.mesh.UnionListOfGroups(groups, name) - + ## Prodices an intersection of two groups # A new group is created. All mesh elements that are common # for the two initial groups are added to the new one. @@ -1871,9 +1905,9 @@ class Mesh: # @ingroup l2_grps_operon def IntersectGroups(self, group1, group2, name): return self.mesh.IntersectGroups(group1, group2, name) - + ## Produces an intersection of groups - # New group is created. All mesh elements that are present in all + # New group is created. All mesh elements that are present in all # initial groups simultaneously are added to the new one # @return an instance of SMESH_Group # @ingroup l2_grps_operon @@ -1887,17 +1921,17 @@ class Mesh: # @ingroup l2_grps_operon def CutGroups(self, main_group, tool_group, name): return self.mesh.CutGroups(main_group, tool_group, name) - + ## Produces a cut of groups - # A new group is created. All mesh elements that are present in main groups + # A new group is created. All mesh elements that are present in main groups # but do not present in tool groups are added to the new one # @return an instance of SMESH_Group # @ingroup l2_grps_operon def CutListOfGroups(self, main_groups, tool_groups, name): return self.mesh.CutListOfGroups(main_groups, tool_groups, name) - + ## Produces a group of elements with specified element type using list of existing groups - # A new group is created. System + # A new group is created. System # 1) extract all nodes on which groups elements are built # 2) combine all elements of specified dimension laying on these nodes # @return an instance of SMESH_Group @@ -1969,6 +2003,13 @@ class Mesh: def GetMeshEditor(self): return self.mesh.GetMeshEditor() + ## Wrap a list of IDs of elements or nodes into SMESH_IDSource which + # can be passed as argument to accepting mesh, group or sub-mesh + # @return an instance of SMESH_IDSource + # @ingroup l1_auxiliary + def GetIDSource(self, ids, elemType): + return self.GetMeshEditor().MakeIDSource(ids, elemType) + ## Gets MED Mesh # @return an instance of SALOME_MED::MESH # @ingroup l1_auxiliary @@ -2346,7 +2387,7 @@ class Mesh: def MinDistance(self, id1, id2=0, isElem1=False, isElem2=False): aMeasure = self.GetMinDistance(id1, id2, isElem1, isElem2) return aMeasure.value - + ## Get measure structure specifying minimum distance data between two objects # @param id1 first node/element id # @param id2 second node/element id (if 0, distance from @a id1 to the origin is computed) @@ -2367,12 +2408,12 @@ class Mesh: pass else: id2 = None - + aMeasurements = self.smeshpyD.CreateMeasurements() aMeasure = aMeasurements.MinDistance(id1, id2) aMeasurements.Destroy() return aMeasure - + ## Get bounding box of the specified object(s) # @param objects single source object or list of source objects or list of nodes/elements IDs # @param isElem if @a objects is a list of IDs, @c True value in this parameters specifies that @a objects are elements, @@ -2421,7 +2462,7 @@ class Mesh: aMeasure = aMeasurements.BoundingBox(srclist) aMeasurements.Destroy() return aMeasure - + # Mesh edition (SMESH_MeshEditor functionality): # --------------------------------------------- @@ -2651,10 +2692,10 @@ class Mesh: # @ingroup l2_modif_throughp def FindElementsByPoint(self, x, y, z, elementType = SMESH.ALL): return self.editor.FindElementsByPoint(x, y, z, elementType) - + # Return point state in a closed 2D mesh in terms of TopAbs_State enumeration. # TopAbs_UNKNOWN state means that either mesh is wrong or the analysis fails. - + def GetPointState(self, x, y, z): return self.editor.GetPointState(x, y, z) @@ -2722,7 +2763,7 @@ class Mesh: IDsOfElements = self.GetElementsId() self.mesh.SetParameters(Parameters) Functor = 0 - if ( isinstance( theCriterion, SMESH._objref_NumericalFunctor ) ): + if ( isinstance( theCriterion, SMESH._objref_NumericalFunctor ) ): Functor = theCriterion else: Functor = self.smeshpyD.GetFunctor(theCriterion) @@ -3044,7 +3085,7 @@ class Mesh: # @param meshName - a name of new mesh to store created boundary elements in, # "" means not to create the new mesh # @param toCopyElements - if true, the checked elements will be copied into the new mesh - # @param toCopyExistingBondary - if true, not only new but also pre-existing + # @param toCopyExistingBondary - if true, not only new but also pre-existing # boundary elements will be copied into the new mesh # @return tuple (mesh, group) where bondary elements were added to # @ingroup l2_modif_edit @@ -3107,7 +3148,8 @@ class Mesh: return [] ## Generates new elements by rotation of the elements of object around the axis - # @param theObject object which elements should be sweeped + # @param theObject object which elements should be sweeped. + # It can be a mesh, a sub mesh or a group. # @param Axis the axis of rotation, AxisStruct or line(geom object) # @param AngleInRadians the angle of Rotation # @param NbOfSteps number of steps @@ -3142,7 +3184,8 @@ class Mesh: return [] ## Generates new elements by rotation of the elements of object around the axis - # @param theObject object which elements should be sweeped + # @param theObject object which elements should be sweeped. + # It can be a mesh, a sub mesh or a group. # @param Axis the axis of rotation, AxisStruct or line(geom object) # @param AngleInRadians the angle of Rotation # @param NbOfSteps number of steps @@ -3177,7 +3220,8 @@ class Mesh: return [] ## Generates new elements by rotation of the elements of object around the axis - # @param theObject object which elements should be sweeped + # @param theObject object which elements should be sweeped. + # It can be a mesh, a sub mesh or a group. # @param Axis the axis of rotation, AxisStruct or line(geom object) # @param AngleInRadians the angle of Rotation # @param NbOfSteps number of steps @@ -3213,7 +3257,7 @@ class Mesh: ## Generates new elements by extrusion of the elements with given ids # @param IDsOfElements the list of elements ids for extrusion - # @param StepVector vector, defining the direction and value of extrusion + # @param StepVector vector or DirStruct, defining the direction and value of extrusion # @param NbOfSteps the number of steps # @param MakeGroups forces the generation of new groups from existing ones # @return the list of created groups (SMESH_GroupBase) if MakeGroups=True, empty list otherwise @@ -3254,7 +3298,8 @@ class Mesh: return [] ## Generates new elements by extrusion of the elements which belong to the object - # @param theObject the object which elements should be processed + # @param theObject the object which elements should be processed. + # It can be a mesh, a sub mesh or a group. # @param StepVector vector, defining the direction and value of extrusion # @param NbOfSteps the number of steps # @param MakeGroups forces the generation of new groups from existing ones @@ -3275,7 +3320,8 @@ class Mesh: return [] ## Generates new elements by extrusion of the elements which belong to the object - # @param theObject object which elements should be processed + # @param theObject object which elements should be processed. + # It can be a mesh, a sub mesh or a group. # @param StepVector vector, defining the direction and value of extrusion # @param NbOfSteps the number of steps # @param MakeGroups to generate new groups from existing ones @@ -3296,7 +3342,8 @@ class Mesh: return [] ## Generates new elements by extrusion of the elements which belong to the object - # @param theObject object which elements should be processed + # @param theObject object which elements should be processed. + # It can be a mesh, a sub mesh or a group. # @param StepVector vector, defining the direction and value of extrusion # @param NbOfSteps the number of steps # @param MakeGroups forces the generation of new groups from existing ones @@ -3320,7 +3367,7 @@ class Mesh: ## Generates new elements by extrusion of the given elements # The path of extrusion must be a meshed edge. - # @param Base mesh or list of ids of elements for extrusion + # @param Base mesh or group, or submesh, or list of ids of elements for extrusion # @param Path - 1D mesh or 1D sub-mesh, along which proceeds the extrusion # @param NodeStart the start node from Path. Defines the direction of extrusion # @param HasAngles allows the shape to be rotated around the path @@ -3347,7 +3394,9 @@ class Mesh: Parameters = AnglesParameters + var_separator + RefPointParameters self.mesh.SetParameters(Parameters) - if isinstance(Base,list): + if (isinstance(Path, Mesh)): Path = Path.GetMesh() + + if isinstance(Base, list): IDsOfElements = [] if Base == []: IDsOfElements = self.GetElementsId() else: IDsOfElements = Base @@ -3355,7 +3404,8 @@ class Mesh: HasAngles, Angles, LinearVariation, HasRefPoint, RefPoint, MakeGroups, ElemType) else: - if isinstance(Base,Mesh): + if isinstance(Base, Mesh): Base = Base.GetMesh() + if isinstance(Base, SMESH._objref_SMESH_Mesh) or isinstance(Base, SMESH._objref_SMESH_Group) or isinstance(Base, SMESH._objref_SMESH_subMesh): return self.editor.ExtrusionAlongPathObjX(Base, Path, NodeStart, HasAngles, Angles, LinearVariation, HasRefPoint, RefPoint, MakeGroups, ElemType) @@ -3407,7 +3457,8 @@ class Mesh: ## Generates new elements by extrusion of the elements which belong to the object # The path of extrusion must be a meshed edge. - # @param theObject the object which elements should be processed + # @param theObject the object which elements should be processed. + # It can be a mesh, a sub mesh or a group. # @param PathMesh mesh containing a 1D sub-mesh on the edge, along which the extrusion proceeds # @param PathShape shape(edge) defines the sub-mesh for the path # @param NodeStart the first or the last node on the edge. Defines the direction of extrusion @@ -3449,7 +3500,8 @@ class Mesh: ## Generates new elements by extrusion of the elements which belong to the object # The path of extrusion must be a meshed edge. - # @param theObject the object which elements should be processed + # @param theObject the object which elements should be processed. + # It can be a mesh, a sub mesh or a group. # @param PathMesh mesh containing a 1D sub-mesh on the edge, along which the extrusion proceeds # @param PathShape shape(edge) defines the sub-mesh for the path # @param NodeStart the first or the last node on the edge. Defines the direction of extrusion @@ -3491,7 +3543,8 @@ class Mesh: ## Generates new elements by extrusion of the elements which belong to the object # The path of extrusion must be a meshed edge. - # @param theObject the object which elements should be processed + # @param theObject the object which elements should be processed. + # It can be a mesh, a sub mesh or a group. # @param PathMesh mesh containing a 1D sub-mesh on the edge, along which the extrusion proceeds # @param PathShape shape(edge) defines the sub-mesh for the path # @param NodeStart the first or the last node on the edge. Defines the direction of extrusion @@ -3700,7 +3753,7 @@ class Mesh: if ( isinstance( theObject, Mesh )): theObject = theObject.GetMesh() if ( isinstance( theObject, list )): - theObject = self.editor.MakeIDSource(theObject, SMESH.ALL) + theObject = self.GetIDSource(theObject, SMESH.ALL) thePoint, Parameters = ParsePointStruct(thePoint) self.mesh.SetParameters(Parameters) @@ -3721,7 +3774,7 @@ class Mesh: if (isinstance(theObject, Mesh)): theObject = theObject.GetMesh() if ( isinstance( theObject, list )): - theObject = self.editor.MakeIDSource(theObject,SMESH.ALL) + theObject = self.GetIDSource(theObject,SMESH.ALL) mesh = self.editor.ScaleMakeMesh(theObject, thePoint, theScaleFact, MakeGroups, NewMeshName) @@ -3855,7 +3908,7 @@ class Mesh: if not isinstance( exceptNodes, list): exceptNodes = [ exceptNodes ] if exceptNodes and isinstance( exceptNodes[0], int): - exceptNodes = [ self.editor.MakeIDSource( exceptNodes, SMESH.NODE)] + exceptNodes = [ self.GetIDSource( exceptNodes, SMESH.NODE)] return self.editor.FindCoincidentNodesOnPartBut(SubMeshOrGroup, Tolerance,exceptNodes) ## Merges nodes @@ -3951,14 +4004,14 @@ class Mesh: ## Creates a hole in a mesh by doubling the nodes of some particular elements # @param theNodes identifiers of nodes to be doubled - # @param theModifiedElems identifiers of elements to be updated by the new (doubled) - # nodes. If list of element identifiers is empty then nodes are doubled but + # @param theModifiedElems identifiers of elements to be updated by the new (doubled) + # nodes. If list of element identifiers is empty then nodes are doubled but # they not assigned to elements # @return TRUE if operation has been completed successfully, FALSE otherwise # @ingroup l2_modif_edit def DoubleNodes(self, theNodes, theModifiedElems): return self.editor.DoubleNodes(theNodes, theModifiedElems) - + ## Creates a hole in a mesh by doubling the nodes of some particular elements # This method provided for convenience works as DoubleNodes() described above. # @param theNodeId identifiers of node to be doubled @@ -3967,7 +4020,7 @@ class Mesh: # @ingroup l2_modif_edit def DoubleNode(self, theNodeId, theModifiedElems): return self.editor.DoubleNode(theNodeId, theModifiedElems) - + ## Creates a hole in a mesh by doubling the nodes of some particular elements # This method provided for convenience works as DoubleNodes() described above. # @param theNodes group of nodes to be doubled @@ -3987,20 +4040,22 @@ class Mesh: # @param theModifiedElems list of groups of elements to be updated. # @return TRUE if operation has been completed successfully, FALSE otherwise # @ingroup l2_modif_edit - def DoubleNodeGroups(self, theNodes, theModifiedElems): + def DoubleNodeGroups(self, theNodes, theModifiedElems, theMakeGroup=False): + if theMakeGroup: + return self.editor.DoubleNodeGroupsNew(theNodes, theModifiedElems) return self.editor.DoubleNodeGroups(theNodes, theModifiedElems) - + ## Creates a hole in a mesh by doubling the nodes of some particular elements # @param theElems - the list of elements (edges or faces) to be replicated # The nodes for duplication could be found from these elements # @param theNodesNot - list of nodes to NOT replicate - # @param theAffectedElems - the list of elements (cells and edges) to which the + # @param theAffectedElems - the list of elements (cells and edges) to which the # replicated nodes should be associated to. # @return TRUE if operation has been completed successfully, FALSE otherwise # @ingroup l2_modif_edit def DoubleNodeElem(self, theElems, theNodesNot, theAffectedElems): return self.editor.DoubleNodeElem(theElems, theNodesNot, theAffectedElems) - + ## Creates a hole in a mesh by doubling the nodes of some particular elements # @param theElems - the list of elements (edges or faces) to be replicated # The nodes for duplication could be found from these elements @@ -4012,7 +4067,7 @@ class Mesh: # @ingroup l2_modif_edit def DoubleNodeElemInRegion(self, theElems, theNodesNot, theShape): return self.editor.DoubleNodeElemInRegion(theElems, theNodesNot, theShape) - + ## Creates a hole in a mesh by doubling the nodes of some particular elements # This method provided for convenience works as DoubleNodes() described above. # @param theElems - group of of elements (edges or faces) to be replicated @@ -4020,6 +4075,8 @@ class Mesh: # @param theAffectedElems - group of elements to which the replicated nodes # should be associated to. # @param theMakeGroup forces the generation of a group containing new elements. + # @return TRUE or a created group if operation has been completed successfully, + # FALSE or None otherwise # @ingroup l2_modif_edit def DoubleNodeElemGroup(self, theElems, theNodesNot, theAffectedElems, theMakeGroup=False): if theMakeGroup: @@ -4036,16 +4093,20 @@ class Mesh: # @ingroup l2_modif_edit def DoubleNodeElemGroupInRegion(self, theElems, theNodesNot, theShape): return self.editor.DoubleNodeElemGroupInRegion(theElems, theNodesNot, theShape) - + ## Creates a hole in a mesh by doubling the nodes of some particular elements # This method provided for convenience works as DoubleNodes() described above. # @param theElems - list of groups of elements (edges or faces) to be replicated # @param theNodesNot - list of groups of nodes not to replicated # @param theAffectedElems - group of elements to which the replicated nodes # should be associated to. - # @return TRUE if operation has been completed successfully, FALSE otherwise + # @param theMakeGroup forces the generation of a group containing new elements. + # @return TRUE or a created group if operation has been completed successfully, + # FALSE or None otherwise # @ingroup l2_modif_edit - def DoubleNodeElemGroups(self, theElems, theNodesNot, theAffectedElems): + def DoubleNodeElemGroups(self, theElems, theNodesNot, theAffectedElems, theMakeGroup=False): + if theMakeGroup: + return self.editor.DoubleNodeElemGroupsNew(theElems, theNodesNot, theAffectedElems) return self.editor.DoubleNodeElemGroups(theElems, theNodesNot, theAffectedElems) ## Creates a hole in a mesh by doubling the nodes of some particular elements @@ -4060,6 +4121,17 @@ class Mesh: def DoubleNodeElemGroupsInRegion(self, theElems, theNodesNot, theShape): return self.editor.DoubleNodeElemGroupsInRegion(theElems, theNodesNot, theShape) + ## Double nodes on shared faces between groups of volumes and create flat elements on demand. + # The list of groups must describe a partition of the mesh volumes. + # The nodes of the internal faces at the boundaries of the groups are doubled. + # In option, the internal faces are replaced by flat elements. + # Triangles are transformed in prisms, and quadrangles in hexahedrons. + # @param theDomains - list of groups of volumes + # @param createJointElems - if TRUE, create the elements + # @return TRUE if operation has been completed successfully, FALSE otherwise + def DoubleNodesOnGroupBoundaries(self, theDomains, createJointElems ): + return self.editor.DoubleNodesOnGroupBoundaries( theDomains, createJointElems ) + def _valueFromFunctor(self, funcType, elemId): fn = self.smeshpyD.GetFunctor(funcType) fn.SetMesh(self.mesh) @@ -4068,27 +4140,27 @@ class Mesh: else: val = 0 return val - + ## Get length of 1D element. # @param elemId mesh element ID # @return element's length value # @ingroup l1_measurements def GetLength(self, elemId): - return self._valueFromFunctor(SMESH.FT_Length, elemId) + return self._valueFromFunctor(SMESH.FT_Length, elemId) ## Get area of 2D element. # @param elemId mesh element ID # @return element's area value # @ingroup l1_measurements def GetArea(self, elemId): - return self._valueFromFunctor(SMESH.FT_Area, elemId) + return self._valueFromFunctor(SMESH.FT_Area, elemId) ## Get volume of 3D element. # @param elemId mesh element ID # @return element's volume value # @ingroup l1_measurements def GetVolume(self, elemId): - return self._valueFromFunctor(SMESH.FT_Volume3D, elemId) + return self._valueFromFunctor(SMESH.FT_Volume3D, elemId) ## Get maximum element length. # @param elemId mesh element ID @@ -4099,7 +4171,7 @@ class Mesh: ftype = SMESH.FT_MaxElementLength3D else: ftype = SMESH.FT_MaxElementLength2D - return self._valueFromFunctor(ftype, elemId) + return self._valueFromFunctor(ftype, elemId) ## Get aspect ratio of 2D or 3D element. # @param elemId mesh element ID @@ -4110,7 +4182,7 @@ class Mesh: ftype = SMESH.FT_AspectRatio3D else: ftype = SMESH.FT_AspectRatio - return self._valueFromFunctor(ftype, elemId) + return self._valueFromFunctor(ftype, elemId) ## Get warping angle of 2D element. # @param elemId mesh element ID @@ -4291,12 +4363,20 @@ class Mesh_Algorithm: name = GetName(geom) pass except: + pass + if not name and geom.GetShapeType() != geompyDC.GEOM.COMPOUND: + # for all groups SubShapeName() returns "Compound_-1" name = mesh.geompyD.SubShapeName(geom, piece) - if not name: - name = "%s_%s"%(geom.GetShapeType(), id(geom%1000)) + if not name: + name = "%s_%s"%(geom.GetShapeType(), id(geom)%10000) + # publish geom of sub-mesh (issue 0021122) + if not self.geom.IsSame( self.mesh.geom ) and not self.geom.GetStudyEntry(): + studyID = self.mesh.smeshpyD.GetCurrentStudy()._get_StudyId() + if studyID != self.mesh.geompyD.myStudyId: + self.mesh.geompyD.init_geom( self.mesh.smeshpyD.GetCurrentStudy()) + self.mesh.geompyD.addToStudyInFather( self.mesh.geom, self.geom, name ) pass self.subm = mesh.mesh.GetSubMesh(geom, algo.GetName()) - self.algo = algo status = mesh.mesh.AddHypothesis(self.geom, self.algo) TreatHypoStatus( status, algo.GetName(), name, True ) @@ -4329,8 +4409,11 @@ class Mesh_Algorithm: pass self.mesh.smeshpyD.SetName(hypo, hyp + a) pass + geomName="" + if self.geom: + geomName = GetName(self.geom) status = self.mesh.mesh.AddHypothesis(self.geom, hypo) - TreatHypoStatus( status, GetName(hypo), GetName(self.geom), 0 ) + TreatHypoStatus( status, GetName(hypo), geomName, 0 ) return hypo ## Returns entry of the shape to mesh in the study @@ -4345,6 +4428,29 @@ class Mesh_Algorithm: if not entry: return "" return entry + ## Defines "ViscousLayers" hypothesis to give parameters of layers of prisms to build + # near mesh boundary. This hypothesis can be used by several 3D algorithms: + # NETGEN 3D, GHS3D, Hexahedron(i,j,k) + # @param thickness total thickness of layers of prisms + # @param numberOfLayers number of layers of prisms + # @param stretchFactor factor (>1.0) of growth of layer thickness towards inside of mesh + # @param ignoreFaces geometrical face (or their ids) not to generate layers on + # @ingroup l3_hypos_additi + def ViscousLayers(self, thickness, numberOfLayers, stretchFactor, ignoreFaces=[]): + if not isinstance(self.algo, SMESH._objref_SMESH_3D_Algo): + raise TypeError, "ViscousLayers are supported by 3D algorithms only" + if not "ViscousLayers" in self.GetCompatibleHypothesis(): + raise TypeError, "ViscousLayers are not supported by %s"%self.algo.GetName() + if ignoreFaces and isinstance( ignoreFaces[0], geompyDC.GEOM._objref_GEOM_Object ): + ignoreFaces = [ self.mesh.geompyD.GetSubShapeID(self.mesh.geom, f) for f in ignoreFaces ] + hyp = self.Hypothesis("ViscousLayers", + [thickness, numberOfLayers, stretchFactor, ignoreFaces]) + hyp.SetTotalThickness(thickness) + hyp.SetNumberLayers(numberOfLayers) + hyp.SetStretchFactor(stretchFactor) + hyp.SetIgnoreFaces(ignoreFaces) + return hyp + # Public class: Mesh_Segment # -------------------------- @@ -4413,7 +4519,7 @@ class Mesh_Segment(Mesh_Algorithm): pass hyp.SetUsePreestimatedLength( length == 0.0 ) return hyp - + ## Defines "NumberOfSegments" hypothesis to cut an edge in a fixed number of segments # @param n for the number of segments that cut an edge # @param s for the scale factor (optional) @@ -4614,7 +4720,7 @@ class Mesh_Segment(Mesh_Algorithm): store_geom = self.geom if type(vertex) is types.IntType: if vertex == 0 or vertex == 1: - vertex = self.mesh.geompyD.SubShapeAllSorted(self.geom, geompyDC.ShapeType["VERTEX"])[vertex] + vertex = self.mesh.geompyD.ExtractShapes(self.geom, geompyDC.ShapeType["VERTEX"],True)[vertex] self.geom = vertex pass pass @@ -4873,20 +4979,31 @@ class Mesh_Triangle(Mesh_Algorithm): self.Parameters().SetOptionValue(optionName,level) ## Sets QuadAllowed flag. - # Only for algoType == NETGEN || NETGEN_2D || BLSURF + # Only for algoType == NETGEN(NETGEN_1D2D) || NETGEN_2D || BLSURF # @ingroup l3_hypos_netgen l3_hypos_blsurf def SetQuadAllowed(self, toAllow=True): if self.algoType == NETGEN_2D: - if toAllow: # add QuadranglePreference - self.Hypothesis("QuadranglePreference", UseExisting=1, CompareMethod=self.CompareEqualHyp) - else: # remove QuadranglePreference + if not self.params: + # use simple hyps + hasSimpleHyps = False + simpleHyps = ["QuadranglePreference","LengthFromEdges","MaxElementArea"] for hyp in self.mesh.GetHypothesisList( self.geom ): - if hyp.GetName() == "QuadranglePreference": - self.mesh.RemoveHypothesis( self.geom, hyp ) + if hyp.GetName() in simpleHyps: + hasSimpleHyps = True + if hyp.GetName() == "QuadranglePreference": + if not toAllow: # remove QuadranglePreference + self.mesh.RemoveHypothesis( self.geom, hyp ) + pass + return pass pass + if hasSimpleHyps: + if toAllow: # add QuadranglePreference + self.Hypothesis("QuadranglePreference", UseExisting=1, CompareMethod=self.CompareEqualHyp) + pass + return pass - return + pass if self.Parameters(): self.params.SetQuadAllowed(toAllow) return @@ -4895,30 +5012,25 @@ class Mesh_Triangle(Mesh_Algorithm): # # @ingroup l3_hypos_netgen def Parameters(self, which=SOLE): - if self.params: - return self.params - if self.algoType == NETGEN: - if which == SIMPLE: - self.params = self.Hypothesis("NETGEN_SimpleParameters_2D", [], + if not self.params: + if self.algoType == NETGEN: + if which == SIMPLE: + self.params = self.Hypothesis("NETGEN_SimpleParameters_2D", [], + "libNETGENEngine.so", UseExisting=0) + else: + self.params = self.Hypothesis("NETGEN_Parameters_2D", [], + "libNETGENEngine.so", UseExisting=0) + elif self.algoType == MEFISTO: + print "Mefisto algo support no multi-parameter hypothesis" + elif self.algoType == NETGEN_2D: + self.params = self.Hypothesis("NETGEN_Parameters_2D_ONLY", [], "libNETGENEngine.so", UseExisting=0) + elif self.algoType == BLSURF: + self.params = self.Hypothesis("BLSURF_Parameters", [], + "libBLSURFEngine.so", UseExisting=0) else: - self.params = self.Hypothesis("NETGEN_Parameters_2D", [], - "libNETGENEngine.so", UseExisting=0) - return self.params - elif self.algoType == MEFISTO: - print "Mefisto algo support no multi-parameter hypothesis" - return None - elif self.algoType == NETGEN_2D: - print "NETGEN_2D_ONLY algo support no multi-parameter hypothesis" - print "NETGEN_2D_ONLY uses 'MaxElementArea' and 'LengthFromEdges' ones" - return None - elif self.algoType == BLSURF: - self.params = self.Hypothesis("BLSURF_Parameters", [], - "libBLSURFEngine.so", UseExisting=0) - return self.params - else: - print "Mesh_Triangle with algo type %s does not have such a parameter, check algo type"%self.algoType - return None + print "Mesh_Triangle with algo type %s does not have such a parameter, check algo type"%self.algoType + return self.params ## Sets MaxSize # @@ -5015,14 +5127,14 @@ class Mesh_Quadrangle(Mesh_Algorithm): # @param quadType defines the algorithm of transition between differently descretized # sides of a geometrical face: # - QUAD_STANDARD - both triangles and quadrangles are possible in the transition - # area along the finer meshed sides. + # area along the finer meshed sides. # - QUAD_TRIANGLE_PREF - only triangles are built in the transition area along the # finer meshed sides. # - QUAD_QUADRANGLE_PREF - only quadrangles are built in the transition area along # the finer meshed sides, iff the total quantity of segments on # all four sides of the face is even (divisible by 2). # - QUAD_QUADRANGLE_PREF_REVERSED - same as QUAD_QUADRANGLE_PREF but the transition - # area is located along the coarser meshed sides. + # area is located along the coarser meshed sides. # - QUAD_REDUCED - only quadrangles are built and the transition between the sides # is made gradually, layer by layer. This type has a limitation on # the number of segments: one pair of opposite sides must have the @@ -5155,33 +5267,34 @@ class Mesh_Tetrahedron(Mesh_Algorithm): # # @ingroup l3_hypos_netgen def Parameters(self, which=SOLE): - if self.params: - return self.params + if not self.params: - if self.algoType == FULL_NETGEN: - if which == SIMPLE: - self.params = self.Hypothesis("NETGEN_SimpleParameters_3D", [], - "libNETGENEngine.so", UseExisting=0) - else: - self.params = self.Hypothesis("NETGEN_Parameters", [], + if self.algoType == FULL_NETGEN: + if which == SIMPLE: + self.params = self.Hypothesis("NETGEN_SimpleParameters_3D", [], + "libNETGENEngine.so", UseExisting=0) + else: + self.params = self.Hypothesis("NETGEN_Parameters", [], + "libNETGENEngine.so", UseExisting=0) + + if self.algoType == NETGEN: + self.params = self.Hypothesis("NETGEN_Parameters_3D", [], "libNETGENEngine.so", UseExisting=0) - return self.params - if self.algoType == GHS3D: - self.params = self.Hypothesis("GHS3D_Parameters", [], - "libGHS3DEngine.so", UseExisting=0) - return self.params + elif self.algoType == GHS3D: + self.params = self.Hypothesis("GHS3D_Parameters", [], + "libGHS3DEngine.so", UseExisting=0) - if self.algoType == GHS3DPRL: - self.params = self.Hypothesis("GHS3DPRL_Parameters", [], - "libGHS3DPRLEngine.so", UseExisting=0) - return self.params + elif self.algoType == GHS3DPRL: + self.params = self.Hypothesis("GHS3DPRL_Parameters", [], + "libGHS3DPRLEngine.so", UseExisting=0) + else: + print "Algo supports no multi-parameter hypothesis" - print "Algo supports no multi-parameter hypothesis" - return None + return self.params ## Sets MaxSize - # Parameter of FULL_NETGEN + # Parameter of FULL_NETGEN and NETGEN # @ingroup l3_hypos_netgen def SetMaxSize(self, theSize): self.Parameters().SetMaxSize(theSize) @@ -5193,7 +5306,7 @@ class Mesh_Tetrahedron(Mesh_Algorithm): self.Parameters().SetSecondOrder(theVal) ## Sets Optimize flag - # Parameter of FULL_NETGEN + # Parameter of FULL_NETGEN and NETGEN # @ingroup l3_hypos_netgen def SetOptimize(self, theVal): self.Parameters().SetOptimize(theVal) @@ -5900,7 +6013,7 @@ omniORB.registerObjref(StdMeshers._objref_StdMeshers_LocalLength._NP_RepositoryI #Wrapper class for StdMeshers_LayerDistribution hypothesis class LayerDistribution(StdMeshers._objref_StdMeshers_LayerDistribution): - + def SetLayerDistribution(self, hypo): StdMeshers._objref_StdMeshers_LayerDistribution.SetParameters(self,hypo.GetParameters()) hypo.ClearParameters(); @@ -5911,9 +6024,9 @@ omniORB.registerObjref(StdMeshers._objref_StdMeshers_LayerDistribution._NP_Repos #Wrapper class for StdMeshers_SegmentLengthAroundVertex hypothesis class SegmentLengthAroundVertex(StdMeshers._objref_StdMeshers_SegmentLengthAroundVertex): - + ## Set Length parameter value - # @param length numerical value or name of variable from notebook + # @param length numerical value or name of variable from notebook def SetLength(self, length): length,parameters = ParseParameters(StdMeshers._objref_StdMeshers_SegmentLengthAroundVertex.GetLastParameters(self),1,1,length) StdMeshers._objref_StdMeshers_SegmentLengthAroundVertex.SetParameters(self,parameters) @@ -5925,7 +6038,7 @@ omniORB.registerObjref(StdMeshers._objref_StdMeshers_SegmentLengthAroundVertex._ #Wrapper class for StdMeshers_Arithmetic1D hypothesis class Arithmetic1D(StdMeshers._objref_StdMeshers_Arithmetic1D): - + ## Set Length parameter value # @param length numerical value or name of variable from notebook # @param isStart true is length is Start Length, otherwise false @@ -5936,15 +6049,15 @@ class Arithmetic1D(StdMeshers._objref_StdMeshers_Arithmetic1D): length,parameters = ParseParameters(StdMeshers._objref_StdMeshers_Arithmetic1D.GetLastParameters(self),2,nb,length) StdMeshers._objref_StdMeshers_Arithmetic1D.SetParameters(self,parameters) StdMeshers._objref_StdMeshers_Arithmetic1D.SetLength(self,length,isStart) - + #Registering the new proxy for Arithmetic1D omniORB.registerObjref(StdMeshers._objref_StdMeshers_Arithmetic1D._NP_RepositoryId, Arithmetic1D) #Wrapper class for StdMeshers_Deflection1D hypothesis class Deflection1D(StdMeshers._objref_StdMeshers_Deflection1D): - + ## Set Deflection parameter value - # @param deflection numerical value or name of variable from notebook + # @param deflection numerical value or name of variable from notebook def SetDeflection(self, deflection): deflection,parameters = ParseParameters(StdMeshers._objref_StdMeshers_Deflection1D.GetLastParameters(self),1,1,deflection) StdMeshers._objref_StdMeshers_Deflection1D.SetParameters(self,parameters) @@ -5955,7 +6068,7 @@ omniORB.registerObjref(StdMeshers._objref_StdMeshers_Deflection1D._NP_Repository #Wrapper class for StdMeshers_StartEndLength hypothesis class StartEndLength(StdMeshers._objref_StdMeshers_StartEndLength): - + ## Set Length parameter value # @param length numerical value or name of variable from notebook # @param isStart true is length is Start Length, otherwise false @@ -5966,54 +6079,54 @@ class StartEndLength(StdMeshers._objref_StdMeshers_StartEndLength): length,parameters = ParseParameters(StdMeshers._objref_StdMeshers_StartEndLength.GetLastParameters(self),2,nb,length) StdMeshers._objref_StdMeshers_StartEndLength.SetParameters(self,parameters) StdMeshers._objref_StdMeshers_StartEndLength.SetLength(self,length,isStart) - + #Registering the new proxy for StartEndLength omniORB.registerObjref(StdMeshers._objref_StdMeshers_StartEndLength._NP_RepositoryId, StartEndLength) #Wrapper class for StdMeshers_MaxElementArea hypothesis class MaxElementArea(StdMeshers._objref_StdMeshers_MaxElementArea): - + ## Set Max Element Area parameter value # @param area numerical value or name of variable from notebook def SetMaxElementArea(self, area): area ,parameters = ParseParameters(StdMeshers._objref_StdMeshers_MaxElementArea.GetLastParameters(self),1,1,area) StdMeshers._objref_StdMeshers_MaxElementArea.SetParameters(self,parameters) StdMeshers._objref_StdMeshers_MaxElementArea.SetMaxElementArea(self,area) - + #Registering the new proxy for MaxElementArea omniORB.registerObjref(StdMeshers._objref_StdMeshers_MaxElementArea._NP_RepositoryId, MaxElementArea) #Wrapper class for StdMeshers_MaxElementVolume hypothesis class MaxElementVolume(StdMeshers._objref_StdMeshers_MaxElementVolume): - + ## Set Max Element Volume parameter value # @param volume numerical value or name of variable from notebook def SetMaxElementVolume(self, volume): volume ,parameters = ParseParameters(StdMeshers._objref_StdMeshers_MaxElementVolume.GetLastParameters(self),1,1,volume) StdMeshers._objref_StdMeshers_MaxElementVolume.SetParameters(self,parameters) StdMeshers._objref_StdMeshers_MaxElementVolume.SetMaxElementVolume(self,volume) - + #Registering the new proxy for MaxElementVolume omniORB.registerObjref(StdMeshers._objref_StdMeshers_MaxElementVolume._NP_RepositoryId, MaxElementVolume) #Wrapper class for StdMeshers_NumberOfLayers hypothesis class NumberOfLayers(StdMeshers._objref_StdMeshers_NumberOfLayers): - + ## Set Number Of Layers parameter value # @param nbLayers numerical value or name of variable from notebook def SetNumberOfLayers(self, nbLayers): nbLayers ,parameters = ParseParameters(StdMeshers._objref_StdMeshers_NumberOfLayers.GetLastParameters(self),1,1,nbLayers) StdMeshers._objref_StdMeshers_NumberOfLayers.SetParameters(self,parameters) StdMeshers._objref_StdMeshers_NumberOfLayers.SetNumberOfLayers(self,nbLayers) - + #Registering the new proxy for NumberOfLayers omniORB.registerObjref(StdMeshers._objref_StdMeshers_NumberOfLayers._NP_RepositoryId, NumberOfLayers) #Wrapper class for StdMeshers_NumberOfSegments hypothesis class NumberOfSegments(StdMeshers._objref_StdMeshers_NumberOfSegments): - + ## Set Number Of Segments parameter value # @param nbSeg numerical value or name of variable from notebook def SetNumberOfSegments(self, nbSeg): @@ -6021,14 +6134,14 @@ class NumberOfSegments(StdMeshers._objref_StdMeshers_NumberOfSegments): nbSeg , parameters = ParseParameters(lastParameters,1,1,nbSeg) StdMeshers._objref_StdMeshers_NumberOfSegments.SetParameters(self,parameters) StdMeshers._objref_StdMeshers_NumberOfSegments.SetNumberOfSegments(self,nbSeg) - + ## Set Scale Factor parameter value # @param factor numerical value or name of variable from notebook def SetScaleFactor(self, factor): factor, parameters = ParseParameters(StdMeshers._objref_StdMeshers_NumberOfSegments.GetLastParameters(self),2,2,factor) StdMeshers._objref_StdMeshers_NumberOfSegments.SetParameters(self,parameters) StdMeshers._objref_StdMeshers_NumberOfSegments.SetScaleFactor(self,factor) - + #Registering the new proxy for NumberOfSegments omniORB.registerObjref(StdMeshers._objref_StdMeshers_NumberOfSegments._NP_RepositoryId, NumberOfSegments) @@ -6099,7 +6212,7 @@ if not noNETGENPlugin: NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetLocalLength(self, length) ## Set Max Element Area parameter value - # @param area numerical value or name of variable from notebook + # @param area numerical value or name of variable from notebook def SetMaxElementArea(self, area): lastParameters = NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.GetLastParameters(self) area, parameters = ParseParameters(lastParameters,2,2,area) @@ -6120,7 +6233,7 @@ if not noNETGENPlugin: #Wrapper class for NETGENPlugin_SimpleHypothesis_3D hypothesis class NETGEN_SimpleParameters_3D(NETGEN_SimpleParameters_2D,NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D): ## Set Max Element Volume parameter value - # @param volume numerical value or name of variable from notebook + # @param volume numerical value or name of variable from notebook def SetMaxElementVolume(self, volume): lastParameters = NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D.GetLastParameters(self) volume, parameters = ParseParameters(lastParameters,3,3,volume)