Muscat.IO.MeshReader module

Mesh file reader

CheckIntegrity()[source]
class MeshReader[source]

Bases: ReaderBase

Mesh Reader class

EnsureFileExistence(fileName: str)[source]

Function to verify file to read existence and complete extension if necessary

Parameters:

fileName (str) – file to read

Returns:

existing name of file to read

Return type:

fileName

Read(out=None)[source]

Function that performs the reading of a Mesh file

Parameters:

out (Mesh, optional) – output unstructured mesh object containing reading result, by default None

Returns:

output unstructured mesh object containing reading result

Return type:

Mesh

ReadBinaryHeader()[source]

Function that performs the reading of the header of a binary Mesh file

Returns:

dimension of the read mesh

Return type:

int

ReadBinaryInt()[source]
ReadEndOfInformation()[source]
ReadExtraFields(fileName)[source]
ReadIntArray()[source]
ReadKeyWord()[source]
ReadMeshAscii(_fileName=None, _string=None, fieldFileName=None, out=None)[source]

Function that performs the reading of an ascii Mesh file

Parameters:
  • _fileName (str, optional) – name of the file to be read, by default None

  • _string (str, optional) – data to be read as a string instead of a file, by default None

  • fieldFileName (str, optional) – Not Used, by default None

  • out (Mesh, optional) – output unstructured mesh object containing reading result, by default None

Returns:

output unstructured mesh object containing reading result

Return type:

Mesh

ReadMeshBinary(out=None)[source]

Function that performs the reading of a binary Mesh file

Parameters:

out (Mesh, optional) – output unstructured mesh object containing reading result, by default None

Returns:

output unstructured mesh object containing reading result

Return type:

Mesh

SetFileName(fileName)[source]

Sets the name of the file to read

Parameters:

fileName (str) – name of the file to read

SetReadRefsAsField(val)[source]
class MeshSolutionReaderWrapper[source]

Bases: object

Class to handle a solution file associated to a Mesh file

Read(out=None)[source]

Function that performs the reading of a solution file associated to a Mesh file

Parameters:

out (Mesh, optional) – output unstructured mesh object containing reading result, by default None

Returns:

output unstructured mesh object containing reading result

Return type:

Mesh

SetFileName(fileName)[source]

Sets the name of the file to read

Parameters:

fileName (str) – name of the file to read

ReadMesh(fileName: str = '', string: str = '', ReadRefsAsField: bool = False) Mesh[source]

Function API for reading a Mesh file

Parameters:
  • fileName (str, optional) – file to read, by default “”

  • string (str, optional) – string to convert, by default “”

  • ReadRefsAsField (bool, optional) – if true two extra fields will be preset (at the nodes and the elements) with the name “refs” if false the values of the refs will be converted tags, using the prefix NTag or ETag plus the number of the ref, by default False

Returns:

The mesh with the field present in the file

Return type:

Mesh

ReadSol(fileName, out=None)[source]

Function API for reading a solution file associated to a Mesh file

Parameters:
  • fileName (str, optional) – file to read, by default None

  • out (Mesh, optional) – output unstructured mesh object containing reading result, by default None

Returns:

output unstructured mesh object containing reading result

Return type:

Mesh