mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-25 17:00:34 +05:00
Fix wrong comments indentation
This commit is contained in:
parent
776e25bc46
commit
55a0f35a26
@ -24,28 +24,28 @@ smeshgui = salome.ImportComponentGUI("SMESH")
|
|||||||
smeshgui.Init(salome.myStudyId)
|
smeshgui.Init(salome.myStudyId)
|
||||||
|
|
||||||
class MeshHexaImpl:
|
class MeshHexaImpl:
|
||||||
"""
|
"""
|
||||||
Class MeshHexaImpl for Hexahedrical meshing
|
Class MeshHexaImpl for Hexahedrical meshing
|
||||||
|
|
||||||
Examples: cube2pyGibi.py, lines 270-295
|
Examples: cube2pyGibi.py, lines 270-295
|
||||||
cube2partition.py, lines 72-83
|
cube2partition.py, lines 72-83
|
||||||
"""
|
"""
|
||||||
piece = 0
|
piece = 0
|
||||||
name = 0
|
name = 0
|
||||||
mesh = 0
|
mesh = 0
|
||||||
cpt = 0
|
cpt = 0
|
||||||
|
|
||||||
def Mesh1D(self, shape, n, propagate=0):
|
def Mesh1D(self, shape, n, propagate=0):
|
||||||
"""
|
"""
|
||||||
Define Wires discretization.
|
Define Wires discretization.
|
||||||
Sets algorithm and hypothesis for 1D discretization of \a shape:
|
Sets algorithm and hypothesis for 1D discretization of \a shape:
|
||||||
- algorithm "Regular_1D"
|
- algorithm "Regular_1D"
|
||||||
- hypothesis "NumberOfSegments" with number of segments \a n
|
- hypothesis "NumberOfSegments" with number of segments \a n
|
||||||
\param shape Main shape or sub-shape to define wire discretization of
|
\param shape Main shape or sub-shape to define wire discretization of
|
||||||
\param n Number of segments to split eash wire of the \a shape on
|
\param n Number of segments to split eash wire of the \a shape on
|
||||||
\param propagate Boolean flag. If propagate = 1,
|
\param propagate Boolean flag. If propagate = 1,
|
||||||
"Propagation" hypothesis will be applied also to the \a shape
|
"Propagation" hypothesis will be applied also to the \a shape
|
||||||
"""
|
"""
|
||||||
hyp1D=smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so")
|
hyp1D=smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so")
|
||||||
smeshgui.SetName(salome.ObjectToID(hyp1D), self.name+"/WireDiscretisation/"+str(self.cpt))
|
smeshgui.SetName(salome.ObjectToID(hyp1D), self.name+"/WireDiscretisation/"+str(self.cpt))
|
||||||
self.mesh.AddHypothesis(shape, hyp1D)
|
self.mesh.AddHypothesis(shape, hyp1D)
|
||||||
@ -63,23 +63,23 @@ class MeshHexaImpl:
|
|||||||
self.cpt=self.cpt+1
|
self.cpt=self.cpt+1
|
||||||
|
|
||||||
def __init__(self, piece, n, name):
|
def __init__(self, piece, n, name):
|
||||||
"""
|
"""
|
||||||
Constructor
|
Constructor
|
||||||
|
|
||||||
Creates mesh on the shape \a piece,
|
Creates mesh on the shape \a piece,
|
||||||
sets GUI name of this mesh to \a name. \n
|
sets GUI name of this mesh to \a name. \n
|
||||||
Sets the following global algorithms and hypotheses:
|
Sets the following global algorithms and hypotheses:
|
||||||
- for 1D discretization:
|
- for 1D discretization:
|
||||||
- algorithm "Regular_1D"
|
- algorithm "Regular_1D"
|
||||||
- hypothesis "NumberOfSegments" with number of segments \a n
|
- hypothesis "NumberOfSegments" with number of segments \a n
|
||||||
- for 2D discretization:
|
- for 2D discretization:
|
||||||
- algorithm "Quadrangle_2D"
|
- algorithm "Quadrangle_2D"
|
||||||
- for 3D discretization:
|
- for 3D discretization:
|
||||||
- algorithm "Hexa_3D"
|
- algorithm "Hexa_3D"
|
||||||
\param piece Shape to be meshed
|
\param piece Shape to be meshed
|
||||||
\param n Global number of segments for wires discretization
|
\param n Global number of segments for wires discretization
|
||||||
\param name Name for mesh to be created
|
\param name Name for mesh to be created
|
||||||
"""
|
"""
|
||||||
self.piece = piece
|
self.piece = piece
|
||||||
self.name = name
|
self.name = name
|
||||||
|
|
||||||
@ -97,49 +97,50 @@ class MeshHexaImpl:
|
|||||||
self.mesh.AddHypothesis(piece, hyp3D)
|
self.mesh.AddHypothesis(piece, hyp3D)
|
||||||
|
|
||||||
def local(self, edge, n):
|
def local(self, edge, n):
|
||||||
"""
|
"""
|
||||||
Creates sub-mesh of the mesh, created by constructor.
|
Creates sub-mesh of the mesh, created by constructor.
|
||||||
This sub-mesh will be created on edge \a edge.
|
This sub-mesh will be created on edge \a edge.
|
||||||
Set algorithm and hypothesis for 1D discretization of the \a edge:
|
Set algorithm and hypothesis for 1D discretization of the \a edge:
|
||||||
- algorithm "Regular_1D"
|
- algorithm "Regular_1D"
|
||||||
- hypothesis "NumberOfSegments" with number of segments \a n
|
- hypothesis "NumberOfSegments" with number of segments \a n
|
||||||
\param edge Sub-edge of the main shape
|
\param edge Sub-edge of the main shape
|
||||||
\param n Number of segments to split the \a edge on
|
\param n Number of segments to split the \a edge on
|
||||||
\note: \a edge will be automatically published in study under the shape, given in constructor.
|
\note: \a edge will be automatically published in study under the shape, given in constructor.
|
||||||
"""
|
"""
|
||||||
geompy.addToStudyInFather(self.piece, edge, geompy.SubShapeName(edge, self.piece))
|
geompy.addToStudyInFather(self.piece, edge, geompy.SubShapeName(edge, self.piece))
|
||||||
submesh = self.mesh.GetSubMesh(edge, self.name+"/SubMeshEdge/"+str(self.cpt))
|
submesh = self.mesh.GetSubMesh(edge, self.name+"/SubMeshEdge/"+str(self.cpt))
|
||||||
self.Mesh1D(edge, n)
|
self.Mesh1D(edge, n)
|
||||||
|
|
||||||
def Propagate(self, edge, n):
|
def Propagate(self, edge, n):
|
||||||
"""
|
"""
|
||||||
Creates sub-mesh of the mesh, created by constructor.
|
Creates sub-mesh of the mesh, created by constructor.
|
||||||
This sub-mesh will be created on edge \a edge and propagate the hypothesis on all correspondant edges.
|
This sub-mesh will be created on edge \a edge and
|
||||||
Set algorithm and hypothesis for 1D discretization of the \a edge and all other propagate edges:
|
propagate the hypothesis on all correspondant edges.
|
||||||
- algorithm "Regular_1D"
|
Set algorithm and hypothesis for 1D discretization of the \a edge and all other propagate edges:
|
||||||
- hypothesis "NumberOfSegments" with number of segments \a n
|
- algorithm "Regular_1D"
|
||||||
- hypothesis "Propagation"
|
- hypothesis "NumberOfSegments" with number of segments \a n
|
||||||
\param edge Sub-edge of the main shape
|
- hypothesis "Propagation"
|
||||||
\param n Number of segments to split the \a edge and all other propagate edges on
|
\param edge Sub-edge of the main shape
|
||||||
\note: \a edge will be automatically published in study under the shape, given in constructor.
|
\param n Number of segments to split the \a edge and all other propagate edges on
|
||||||
"""
|
\note: \a edge will be automatically published in study under the shape, given in constructor.
|
||||||
|
"""
|
||||||
geompy.addToStudyInFather(self.piece, edge, geompy.SubShapeName(edge, self.piece))
|
geompy.addToStudyInFather(self.piece, edge, geompy.SubShapeName(edge, self.piece))
|
||||||
submesh = self.mesh.GetSubMesh(edge, self.name+"/SubMeshEdge/"+str(self.cpt))
|
submesh = self.mesh.GetSubMesh(edge, self.name+"/SubMeshEdge/"+str(self.cpt))
|
||||||
self.Mesh1D(edge, n, 1)
|
self.Mesh1D(edge, n, 1)
|
||||||
|
|
||||||
def Compute(self):
|
def Compute(self):
|
||||||
"""
|
"""
|
||||||
Computes mesh, created by constructor.
|
Computes mesh, created by constructor.
|
||||||
"""
|
"""
|
||||||
smesh.Compute(self.mesh, self.piece)
|
smesh.Compute(self.mesh, self.piece)
|
||||||
salome.sg.updateObjBrowser(1)
|
salome.sg.updateObjBrowser(1)
|
||||||
|
|
||||||
def Group(self, grp, name=""):
|
def Group(self, grp, name=""):
|
||||||
"""
|
"""
|
||||||
Creates mesh group based on a geometric group
|
Creates mesh group based on a geometric group
|
||||||
\param grp Geometric group
|
\param grp Geometric group
|
||||||
\param name Name for mesh group to be created
|
\param name Name for mesh group to be created
|
||||||
"""
|
"""
|
||||||
if name == "":
|
if name == "":
|
||||||
name = grp.GetName()
|
name = grp.GetName()
|
||||||
tgeo = geompy.GroupOp.GetType(grp)
|
tgeo = geompy.GroupOp.GetType(grp)
|
||||||
@ -154,11 +155,11 @@ class MeshHexaImpl:
|
|||||||
return self.mesh.CreateGroupFromGEOM(type, name, grp)
|
return self.mesh.CreateGroupFromGEOM(type, name, grp)
|
||||||
|
|
||||||
def ExportMED(self, filename, groups=1):
|
def ExportMED(self, filename, groups=1):
|
||||||
"""
|
"""
|
||||||
Export mesh in a MED file
|
Export mesh in a MED file
|
||||||
\param filename Name for MED file to be created
|
\param filename Name for MED file to be created
|
||||||
\param groups Boolean flag. If groups = 1, mesh groups will be also stored in file
|
\param groups Boolean flag. If groups = 1, mesh groups will be also stored in file
|
||||||
"""
|
"""
|
||||||
self.mesh.ExportMED(filename, groups)
|
self.mesh.ExportMED(filename, groups)
|
||||||
|
|
||||||
MeshHexa = MeshHexaImpl
|
MeshHexa = MeshHexaImpl
|
||||||
|
Loading…
Reference in New Issue
Block a user