Back to index

salome-smesh  6.5.0
Functions
Importing and exporting meshes
Creating meshes
Collaboration diagram for Importing and exporting meshes:

Functions

def smeshDC.smeshDC.CreateMeshesFromUNV
 Creates a Mesh object importing data from the given UNV file.
def smeshDC.smeshDC.CreateMeshesFromMED
 Creates a Mesh object(s) importing data from the given MED file.
def smeshDC.smeshDC.CreateMeshesFromSAUV
 Creates a Mesh object(s) importing data from the given SAUV file.
def smeshDC.smeshDC.CreateMeshesFromSTL
 Creates a Mesh object importing data from the given STL file.
def smeshDC.smeshDC.CreateMeshesFromCGNS
 Creates Mesh objects importing data from the given CGNS file.
def smeshDC.Mesh.ExportToMED
 Deprecated, used only for compatibility! Please, use ExportToMEDX() method instead.
def smeshDC.Mesh.ExportMED
 Exports the mesh in a file in MED format and chooses the version of MED format allowing to overwrite the file if it exists or add the exported data to its contents.
def smeshDC.Mesh.ExportSAUV
 Exports the mesh in a file in SAUV format.
def smeshDC.Mesh.ExportDAT
 Exports the mesh in a file in DAT format.
def smeshDC.Mesh.ExportUNV
 Exports the mesh in a file in UNV format.
def smeshDC.Mesh.ExportSTL
 Export the mesh in a file in STL format.
def smeshDC.Mesh.ExportCGNS
 Exports the mesh in a file in CGNS format.

Function Documentation

def smeshDC.smeshDC.CreateMeshesFromCGNS (   self,
  theFileName 
)

Creates Mesh objects importing data from the given CGNS file.

Returns:
an instance of Mesh class

Definition at line 501 of file smeshDC.py.

00501 
00502     def CreateMeshesFromCGNS( self, theFileName ):
00503         aSmeshMeshes, aStatus = SMESH._objref_SMESH_Gen.CreateMeshesFromCGNS(self,theFileName)
00504         aMeshes = []
00505         for iMesh in range(len(aSmeshMeshes)) :
00506             aMesh = Mesh(self, self.geompyD, aSmeshMeshes[iMesh])
00507             aMeshes.append(aMesh)
00508         return aMeshes, aStatus

Here is the call graph for this function:

def smeshDC.smeshDC.CreateMeshesFromMED (   self,
  theFileName 
)

Creates a Mesh object(s) importing data from the given MED file.

Returns:
a list of Mesh class instances

Definition at line 471 of file smeshDC.py.

00471 
00472     def CreateMeshesFromMED( self,theFileName ):
00473         aSmeshMeshes, aStatus = SMESH._objref_SMESH_Gen.CreateMeshesFromMED(self,theFileName)
00474         aMeshes = []
00475         for iMesh in range(len(aSmeshMeshes)) :
00476             aMesh = Mesh(self, self.geompyD, aSmeshMeshes[iMesh])
00477             aMeshes.append(aMesh)
00478         return aMeshes, aStatus

def smeshDC.smeshDC.CreateMeshesFromSAUV (   self,
  theFileName 
)

Creates a Mesh object(s) importing data from the given SAUV file.

Returns:
a list of Mesh class instances

Definition at line 482 of file smeshDC.py.

00482 
00483     def CreateMeshesFromSAUV( self,theFileName ):
00484         aSmeshMeshes, aStatus = SMESH._objref_SMESH_Gen.CreateMeshesFromSAUV(self,theFileName)
00485         aMeshes = []
00486         for iMesh in range(len(aSmeshMeshes)) :
00487             aMesh = Mesh(self, self.geompyD, aSmeshMeshes[iMesh])
00488             aMeshes.append(aMesh)
00489         return aMeshes, aStatus

def smeshDC.smeshDC.CreateMeshesFromSTL (   self,
  theFileName 
)

Creates a Mesh object importing data from the given STL file.

Returns:
an instance of Mesh class

Definition at line 493 of file smeshDC.py.

00493 
00494     def CreateMeshesFromSTL( self, theFileName ):
00495         aSmeshMesh = SMESH._objref_SMESH_Gen.CreateMeshesFromSTL(self,theFileName)
00496         aMesh = Mesh(self, self.geompyD, aSmeshMesh)
00497         return aMesh

def smeshDC.smeshDC.CreateMeshesFromUNV (   self,
  theFileName 
)

Creates a Mesh object importing data from the given UNV file.

Returns:
an instance of Mesh class

Definition at line 463 of file smeshDC.py.

00463 
00464     def CreateMeshesFromUNV( self,theFileName ):
00465         aSmeshMesh = SMESH._objref_SMESH_Gen.CreateMeshesFromUNV(self,theFileName)
00466         aMesh = Mesh(self, self.geompyD, aSmeshMesh)
00467         return aMesh

def smeshDC.Mesh.ExportCGNS (   self,
  f,
  overwrite = 1,
  meshPart = None 
)

Exports the mesh in a file in CGNS format.

Parameters:
fis the file name
overwriteboolean parameter for overwriting/not overwriting the file
meshParta part of mesh (group, sub-mesh) to export instead of the mesh

Definition at line 1456 of file smeshDC.py.

01456 
01457     def ExportCGNS(self, f, overwrite=1, meshPart=None):
01458         if isinstance( meshPart, list ):
01459             meshPart = self.GetIDSource( meshPart, SMESH.ALL )
01460         if isinstance( meshPart, Mesh ):
01461             meshPart = meshPart.mesh
01462         elif not meshPart:
01463             meshPart = self.mesh
01464         self.mesh.ExportCGNS(meshPart, f, overwrite)

Here is the call graph for this function:

def smeshDC.Mesh.ExportDAT (   self,
  f,
  meshPart = None 
)

Exports the mesh in a file in DAT format.

Parameters:
fthe file name
meshParta part of mesh (group, sub-mesh) to export instead of the mesh

Definition at line 1418 of file smeshDC.py.

01418 
01419     def ExportDAT(self, f, meshPart=None):
01420         if meshPart:
01421             if isinstance( meshPart, list ):
01422                 meshPart = self.GetIDSource( meshPart, SMESH.ALL )
01423             self.mesh.ExportPartToDAT( meshPart, f )
01424         else:
01425             self.mesh.ExportDAT(f)

Here is the call graph for this function:

def smeshDC.Mesh.ExportMED (   self,
  f,
  auto_groups = 0,
  version = MED_V2_2,
  overwrite = 1,
  meshPart = None 
)

Exports the mesh in a file in MED format and chooses the version of MED format allowing to overwrite the file if it exists or add the exported data to its contents.

Parameters:
fis the file name
auto_groupsboolean parameter for creating/not creating the groups Group_On_All_Nodes, Group_On_All_Faces, ... ; the typical use is auto_groups=false.
versionMED format version(MED_V2_1 or MED_V2_2)
overwriteboolean parameter for overwriting/not overwriting the file
meshParta part of mesh (group, sub-mesh) to export instead of the mesh

Definition at line 1397 of file smeshDC.py.

01397 
01398     def ExportMED(self, f, auto_groups=0, version=MED_V2_2, overwrite=1, meshPart=None):
01399         if meshPart:
01400             if isinstance( meshPart, list ):
01401                 meshPart = self.GetIDSource( meshPart, SMESH.ALL )
01402             self.mesh.ExportPartToMED( meshPart, f, auto_groups, version, overwrite )
01403         else:
01404             self.mesh.ExportToMEDX(f, auto_groups, version, overwrite)

Here is the call graph for this function:

def smeshDC.Mesh.ExportSAUV (   self,
  f,
  auto_groups = 0 
)

Exports the mesh in a file in SAUV format.

Parameters:
fis the file name
auto_groupsboolean parameter for creating/not creating the groups Group_On_All_Nodes, Group_On_All_Faces, ... ; the typical use is auto_groups=false.

Definition at line 1411 of file smeshDC.py.

01411 
01412     def ExportSAUV(self, f, auto_groups=0):
01413         self.mesh.ExportSAUV(f, auto_groups)

def smeshDC.Mesh.ExportSTL (   self,
  f,
  ascii = 1,
  meshPart = None 
)

Export the mesh in a file in STL format.

Parameters:
fthe file name
asciidefines the file encoding
meshParta part of mesh (group, sub-mesh) to export instead of the mesh

Definition at line 1443 of file smeshDC.py.

01443 
01444     def ExportSTL(self, f, ascii=1, meshPart=None):
01445         if meshPart:
01446             if isinstance( meshPart, list ):
01447                 meshPart = self.GetIDSource( meshPart, SMESH.ALL )
01448             self.mesh.ExportPartToSTL( meshPart, f, ascii )
01449         else:
01450             self.mesh.ExportSTL(f, ascii)

Here is the call graph for this function:

def smeshDC.Mesh.ExportToMED (   self,
  f,
  version,
  opt = 0,
  overwrite = 1 
)

Deprecated, used only for compatibility! Please, use ExportToMEDX() method instead.

Exports the mesh in a file in MED format and chooses the version of MED format allowing to overwrite the file if it exists or add the exported data to its contents

Parameters:
fthe file name
versionvalues are SMESH.MED_V2_1, SMESH.MED_V2_2
optboolean parameter for creating/not creating the groups Group_On_All_Nodes, Group_On_All_Faces, ...
overwriteboolean parameter for overwriting/not overwriting the file

Definition at line 1384 of file smeshDC.py.

01384 
01385     def ExportToMED(self, f, version, opt=0, overwrite=1):
01386         self.mesh.ExportToMEDX(f, opt, version, overwrite)

def smeshDC.Mesh.ExportUNV (   self,
  f,
  meshPart = None 
)

Exports the mesh in a file in UNV format.

Parameters:
fthe file name
meshParta part of mesh (group, sub-mesh) to export instead of the mesh

Definition at line 1430 of file smeshDC.py.

01430 
01431     def ExportUNV(self, f, meshPart=None):
01432         if meshPart:
01433             if isinstance( meshPart, list ):
01434                 meshPart = self.GetIDSource( meshPart, SMESH.ALL )
01435             self.mesh.ExportPartToUNV( meshPart, f )
01436         else:
01437             self.mesh.ExportUNV(f)

Here is the call graph for this function: