Muscat.IO.MeshWriter module¶
Mesh file writer
- class MeshWriter[source]¶
Bases:
WriterBase
Class to write Unstructured mesh on disk in the mesh format file
- GetDimensionFromMesh(meshObject)[source]¶
Returns dimension of the mesh
- Parameters:
meshObject (Mesh) – mesh for which the dimension is returned
- Returns:
dimension of the mesh
- Return type:
int
- SetFileName(fileName)[source]¶
Sets the name of the output file
- Parameters:
fileName (str) – name of the output file
- SetSinglePrecision(single=True)[source]¶
Sets the output precision to single precision
- Parameters:
single (bool, optional) – if True, output is save in singe precision, by default True
- SetVersion(version: int)[source]¶
Sets the output file format version
- Parameters:
version (int) – format version
- Write(meshObject, PointFields=None, solutionOnOwnFile=False, nodalRefNumber=None, elemRefNumber=None, PointFieldsNames=None, CellFieldsNames=None, CellFields=None)[source]¶
Write mesh to file in mesh format
- Parameters:
meshObject (Mesh) – the mesh to be written
PointFields (list[np.ndarray], optional) – list of fields defined at the vertices of the mesh, to be included in the output file, by default None
solutionOnOwnFile (bool, optional) – if True, the solution is written in a separate file, by default False
nodalRefNumber (np.ndarray, optional) – a provided numbering for the vertices, by default None
elemRefNumber (np.ndarray, optional) – a provided numbering for the elements, by default None
PointFieldsNames (None) – Not Used, by default None
CellFieldsNames (None) – Not Used, by default None
CellFields (None) – Not Used, by default None
- WriteASCII(meshObject, PointFields=None, solutionOnOwnFile=False, nodalRefNumber=None, elemRefNumber=None)[source]¶
Write mesh to file in binary mesh format
- Parameters:
meshObject (Mesh) – the mesh to be written
PointFields (list[np.ndarray], optional) – list of fields defined at the vertices of the mesh, to be included in the output file, by default None
solutionOnOwnFile (bool, optional) – if True, the solution is written in a separate file, by default False
nodalRefNumber (np.ndarray, optional) – a provided numbering for the vertices, by default None
elemRefNumber (np.ndarray, optional) – a provided numbering for the elements, by default None
- WriteBINARY(meshObject, PointFields=None, solutionOnOwnFile=False, nodalRefNumber=None, elemRefNumber=None)[source]¶
Write mesh to file in binary mesh format
- Parameters:
meshObject (Mesh) – the mesh to be written
PointFields (list[np.ndarray], optional) – list of fields defined at the vertices of the mesh, to be included in the output file, by default None
solutionOnOwnFile (bool, optional) – if True, the solution is written in a separate file, by default False
nodalRefNumber (np.ndarray, optional) – a provided numbering for the vertices, by default None
elemRefNumber (np.ndarray, optional) – a provided numbering for the elements, by default None
- WriteSolutionsFields(meshObject, PointFields=None, SolsAtTriangles=None, SolsAtTetrahedra=None)[source]¶
- WriteMesh(fileName, mesh, PointFields=None, solutionOnOwnFile=False, binary=True, nodalRefNumber=None, elemRefNumber=None)[source]¶
- Export Mesh to disk in the mesh format file.
A file is created using the path and name of fileName
- Parameters:
fileName (str) – name with path to the file to be created (relative or absolute)
mesh (Mesh) – the mesh to be written
PointFields (list[np.ndarray], optional) – list of fields defined at the vertices of the mesh, to be included in the output file, by default None
solutionOnOwnFile (bool, optional) – if True, the solution is written in a separate file, by default False
binary (bool, optional) – if True, a binary file is produced, by default True
nodalRefNumber (np.ndarray, optional) – a provided numbering for the vertices, by default None
elemRefNumber (np.ndarray, optional) – a provided numbering for the elements, by default None