Muscat.IO.AnsysWriter module

Ansys CDB format writer

class AnsysWriter[source]

Bases: WriterBase

Ansys CDB format writer

AnsysFormulation

to export element with a specific physics read the file AnsysTools.py (variable MuscatToAnsysFormulation) for more details

Type:

[“SOLID3D”,”SOLID2D”]

Write(mesh: Mesh)[source]
CheckIntegrity(GUI: bool = False) str[source]
ExportElementTagInCDBFormat(mesh: Mesh, tagname: str, filename: str | None = None, append: bool = False, filePointer: TextIOWrapper | None = None)[source]

Functions to export one element tag as Ansys CDB format. It uses the originals ids

Parameters:
  • mesh (Mesh) – mesh from which elements ids for each tag are searched

  • tagname (str) – element tag

  • filename (str, optional) – filename in CDB format where the element ids for the provided tag are exported, by default None

  • append (str, optional) – selects if the info is appended to the file (a+) or overwritten (w or False), by default False

ExportElementTagsInCDBFormat(mesh: Mesh, tagnames: List[str], filename: str | None = None, filePointer: TextIOWrapper | None = None)[source]

Function to export multiple elements tags to Ansys CDB format

Parameters:
  • mesh (Mesh) – mesh from which elements ids for each tag are searched

  • tagnames (list[str]) – list of element tags

  • filename (str, optional) – filename in CDB format where the element ids for each tag are exported, by default None

WriteMeshToCDB(fileName: str, mesh: Mesh) None[source]
Function API for writing mesh in the CDB format file (Ansys).

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 (UnstructuredMesh) – the mesh to be exported