BasicTools.IO.MeshReader module

Mesh file reader

BasicTools.IO.MeshReader.CheckIntegrity()[source]
class BasicTools.IO.MeshReader.MeshReader[source]

Bases: ReaderBase

Mesh Reader class

Read(out=None)[source]

Function that performs the reading of a Mesh file

Parameters:

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

Returns:

output unstructured mesh object containing reading result

Return type:

UnstructuredMesh

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 (UnstructuredMesh, optional) – output unstructured mesh object containing reading result, by default None

Returns:

output unstructured mesh object containing reading result

Return type:

UnstructuredMesh

ReadMeshBinary(out=None)[source]

Function that performs the reading of a binary Mesh file

Parameters:

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

Returns:

output unstructured mesh object containing reading result

Return type:

UnstructuredMesh

SetFileName(fileName)[source]

Sets the name of the file to read

Parameters:

fileName (str) – name of the file to read

SetReadRefsAsField(val)[source]
class BasicTools.IO.MeshReader.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 (UnstructuredMesh, optional) – output unstructured mesh object containing reading result, by default None

Returns:

output unstructured mesh object containing reading result

Return type:

UnstructuredMesh

SetFileName(fileName)[source]

Sets the name of the file to read

Parameters:

fileName (str) – name of the file to read

BasicTools.IO.MeshReader.ReadMesh(fileName: str | None = None, string: str | None = None, ReadRefsAsField: bool = False) UnstructuredMesh[source]

Function API for reading a Mesh file

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

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

  • ReadRefsAsField (bool, optional) – if true the two fiels will be preset (at the nodes and element) with the nbame 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:

UnstructuredMesh

BasicTools.IO.MeshReader.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 (UnstructuredMesh, optional) – output unstructured mesh object containing reading result, by default None

Returns:

output unstructured mesh object containing reading result

Return type:

UnstructuredMesh