Muscat.IO.DatReader module

Ansys ds.dat reader.

This module provides helpers to extract information from an Ansys ds.dat input file:

CheckIntegrity() str[source]

Check the integrity of the DatReader module.

Every public and private helper of the module is exercised on synthetic ds.dat files created in a temporary directory.

Returns:

"ok" if every assertion succeeds.

Return type:

str

GetPressureLoadingElementalSurface(file: str) Tuple[List[dict], Dict[str, str]] | None[source]

Read the pressure loading surface effect elements of a ds.dat file.

The surface effect elements (SURF154) used to define pressure loadings (or imported loads) are recovered together with their key options and the mapping between an imported pressure load and its table name.

Parameters:

file (str) – Path to a .rst result file, a directory, or a ds.dat file. When a .rst file or a directory is given, the companion ds.dat file located in the same directory is read.

Returns:

A tuple (loadings, surfaceNames) where loadings is a list of dictionaries describing each surface effect element block (keys "load_type_name", "n_elem", "el_type", "surface_elements", "key_opt" and "load_name"), and surfaceNames a mapping from an imported pressure load name to its table name. None is returned when nothing could be read.

Return type:

tuple or None

Raises:

ValueError – If file has an extension other than .dat.

GetRemotePoints(file: str) Dict[int, Dict[str, object]][source]

Read the remote points (pilot nodes) of an Ansys ds.dat file.

Parameters:

file (str) – Path to a .rst result file, a directory, or a ds.dat file. When a .rst file or a directory is given, the companion ds.dat file located in the same directory is read.

Returns:

Mapping from a remote point pilot node id to a dictionary with two keys: "tag" (the named selection of the remote point) and "coords" (a (x, y, z) tuple with its coordinates).

Return type:

dict

Raises:

ValueError – If file has an extension other than .dat.