Muscat.IO.UtWriter module

Ut file writer (Zset mesh files)

CheckIntegrity()[source]
class UtWriter[source]

Bases: WriterBase

Class to write an ut file, and the files of the data defined in this ut file. This class can generate a .ut, .geof, .ctnod, .node, .integ to vizualise finite element computational results

AttachData(data_node, data_ctnod={}, data_integ={}, Nnode=None, Nint=None)[source]

Attach fields to the writer

Parameters:
  • data_node (dict) – primal fields, defined at the vertices of the mesh

  • data_ctnod (dict, optional) – dual fields, defined at the vertices of the mesh, by default {}

  • data_integ (dict, optional) – dual fields, defined at the integration points of the mesh, by default {}

  • Nnode (int, optional) – number of nodes, by default None

  • Nint (int, optional) – number of integration points, by default None

AttachDataFromProblemData(problemData, tag, Nnode=None, Nint=None)[source]

Attach the fields defined in a problemData to the writer

Parameters:
  • problemData (ProblemData) – description of a physical problem

  • tag (str) – solution name to attache to the writer

  • Nnode (int, optional) – number of nodes, by default None

  • Nint (int, optional) – number of integration points, by default None

AttachMesh(mesh)[source]

Attach mesh to writer

Parameters:

mesh (Mesh) – mesh to attach to writer

AttachSequence(timeSequence)[source]

Attach the time sequence to the writer

Parameters:

timeSequence (np.ndarray) – time sequence to attach to the writer

Close()[source]
GetBaseName()[source]

Returns the file name to write without extension

Returns:

file name to write without extension

Return type:

str

GetFolder()[source]

Returns folder where the file is written

Returns:

folder where the file is written

Return type:

str

InitWrite(writeGeof, geofName=None, skipCtnod=False)[source]

Initialize the written files

Parameters:
  • writeGeof (bool) – if True, the mesh is written in Geof format

  • geofName (str, optional) – name of the mesh file, by default None

  • skipCtnod (bool, optional) – if True, the dual quantities will not be exported at the verticies, by default False

Returns:

nodeFile, ctnodFile and integFile initialized

Return type:

_io.TextIOWrapper, _io.TextIOWrapper, _io.TextIOWrapper

Open()[source]
SetFileName(fileName)[source]

Sets the name of ut file to write

Parameters:

fileName (str) – file name to set

Write(outmesh, PointFieldsNames, PointFields, CellFieldsNames=None, CellFields=None)[source]

Initialize writer and write .ut, .geof, .ctnod, .node and .integ files

Parameters:
  • outmesh (Mesh) – the mesh to be written

  • PointFieldsNames (list[str]) – name of the fields to write defined at the vertices of the mesh

  • PointFields (list[np.ndarray]) – fields to write defined at the vertices of the mesh

  • CellFieldsNames (None) – Not Used, by default None

  • CellFields (None) – Not Used, by default None

WriteFiles(writeGeof, geofName=None, skipCtnod=False)[source]

Write .ut, .geof, .ctnod, .node and .integ files

Parameters:
  • writeGeof (bool) – if True, the mesh is written in Geof format

  • geofName (str, optional) – name of the mesh file, by default None

  • skipCtnod (bool, optional) – if True, the dual quantities will not be exported at the verticies, by default False

WriteMesh()[source]

Write mesh to file in Geof format

WriteTimeStep(nodeFile, ctnodFile, integFile, timeSequenceStep, skipCtnod=False)[source]

Write one time step into initialized .ut, .ctnod, .node and .integ files

Parameters:
  • nodeFile (_io.TextIOWrapper) – .node file containing primal fields at verticies

  • ctnodFile (_io.TextIOWrapper) – .ctnod file containing dual fields at verticies

  • integFile (_io.TextIOWrapper) – .ctnod file containing dual fields at integration points

  • timeSequenceStep (np.ndarray) – time step information

  • skipCtnod (bool, optional) – if True, the dual quantities will not be exported at the verticies, by default False