Muscat.IO.CsvWriter module

CSV file reader

CheckIntegrity(GUI: bool = False) str[source]
class CsvWriter(fileName='')[source]

Bases: WriterBase

Class to writes a CSV file on disk

Close() None[source]
SetETag(string: str) None[source]

Add the tag “string” to the class element filter

Parameters:

string (str) – element tag to add

SetNTag(string: str)[source]

Add the tag “string” to the class node filter

Parameters:

string (str) – node tag to add

Step(dt: float64 = 1.0) None[source]

Function to increase current time by a time increment

Parameters:

dt (int, optional) – time increment, by default 1.

Write(mesh: Mesh, PointFields: List[ndarray] | None = None, CellFields: List[ndarray] | None = None, GridFields: List[float64] | None = None, PointFieldsNames: List[str] | None = None, CellFieldsNames: List[str] | None = None, GridFieldsNames: List[str] | None = None, Time: float64 | None = None, TimeStep: float64 | None = None, domainName: str | None = None)[source]

Function to writes a CSV file on disk

Parameters:
  • fileName (str) – name of the file to be written

  • mesh (Mesh) – support of the data to be written

  • PointFields (list[np.ndarray], optional) – list of fields defined at the vertices of the mesh, by default None

  • CellFields (list[np.ndarray], optional) – list of fields defined at the cells of the mesh, by default None

  • GridFields (list[np.ndarray], optional) – list of grid data, by default None

  • PointFieldsNames (list[str], optional) – list of field names defined at the vertices of the mesh, by default None

  • CellFieldsNames (list[str], optional) – list of field names defined at the cells of the mesh, by default None

  • GridFieldsNames (list[str], optional) – list of grid data names, by default None

  • Time (float, optional) – time at which the data is written, by default None

  • TimeStep (float, optional) – number of the time step at which the data is written, by default None

  • domainName (str, optional) – name of domain to write, by default None

WriteHead(mesh: Mesh, PointFieldsNames: List[str], CellFieldsNames: List[str], GridFieldsNames: List[str]) None[source]

Function to write the header of the output CSV file

Parameters:
  • mesh (Mesh) – support of the data to be written

  • PointFieldsNames (list[str], optional) – list of field names defined at the vertices of the mesh, by default None

  • CellFieldsNames (list[str], optional) – list of field names defined at the cells of the mesh, by default None

  • GridFieldsNames (list[str], optional) – list of grid data names, by default None

WriteMeshToCsv(filename, mesh: Mesh, PointFields: List[ndarray] | None = None, CellFields: List[ndarray] | None = None, GridFields: List[float64] | None = None, PointFieldsNames: List[str] | None = None, CellFieldsNames: List[str] | None = None, GridFieldsNames: List[str] | None = None, nFilter: NodeFilter | None = None, eFilter: ElementFilter | None = None)[source]

Function API for writing data into a CSV file

Parameters:
  • fileName (str) – name of the file to be written

  • mesh (Mesh) – support of the data to be written

  • PointFields (list[np.ndarray], optional) – list of fields defined at the vertices of the mesh, by default None

  • CellFields (list[np.ndarray], optional) – list of fields defined at the cells of the mesh, by default None

  • GridFields (list[np.ndarray], optional) – list of grid data, by default None

  • PointFieldsNames (list[str], optional) – list of field names defined at the vertices of the mesh, by default None

  • CellFieldsNames (list[str], optional) – list of field names defined at the cells of the mesh, by default None

  • GridFieldsNames (list[str], optional) – list of grid data names, by default None

  • nFilter (NodeFilter, optional) – node filter to select a part of baseMeshObject, by default None

  • eFilter (ElementFilter, optional) – element filter to select a part of baseMeshObject, by default None