Muscat.IO.DatReader module¶
Ansys ds.dat reader.
This module provides helpers to extract information from an Ansys
ds.dat input file:
GetRemotePoints()recovers the remote points (pilot nodes) together with their named selection and coordinates.GetPressureLoadingElementalSurface()recovers the surface effect elements (SURF154) used to define pressure loadings.
- CheckIntegrity() str[source]¶
Check the integrity of the DatReader module.
Every public and private helper of the module is exercised on synthetic
ds.datfiles 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.datfile.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
.rstresult file, a directory, or ads.datfile. When a.rstfile or a directory is given, the companionds.datfile located in the same directory is read.- Returns:
A tuple
(loadings, surfaceNames)whereloadingsis 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"), andsurfaceNamesa mapping from an imported pressure load name to its table name.Noneis returned when nothing could be read.- Return type:
tuple or None
- Raises:
ValueError – If
filehas an extension other than.dat.
- GetRemotePoints(file: str) Dict[int, Dict[str, object]][source]¶
Read the remote points (pilot nodes) of an Ansys
ds.datfile.- Parameters:
file (str) – Path to a
.rstresult file, a directory, or ads.datfile. When a.rstfile or a directory is given, the companionds.datfile 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
filehas an extension other than.dat.