gruvoc.ufuncfile: Tools for reading AFLR3 ufunc files¶
One key functionality of this module is to determine the file type of
.ufunc files or determine that they are not recognizable files of
that format.
- cape.gruvoc.ufuncfile.SFUNC_MODE_CHECKERS = {'b4': <function check_sfunc_b>, 'b8': <function check_sfunc_b>, 'lb4': <function check_sfunc_lb>, 'lb8': <function check_sfunc_lb>, 'lr4': <function check_sfunc_lr>, 'lr8': <function check_sfunc_lr>, 'r4': <function check_sfunc_r>, 'r8': <function check_sfunc_r>, None: <function check_sfunc_ascii>}¶
Dictionary of mode checkers
- class cape.gruvoc.ufuncfile.UFUNCFileType(fmt, byteorder, filetype, precision)¶
- byteorder¶
Alias for field number 1
- filetype¶
Alias for field number 2
- fmt¶
Alias for field number 0
- precision¶
Alias for field number 3
- cape.gruvoc.ufuncfile.UFUNC_MODE_CHECKERS = {'b4': <function check_ufunc_b>, 'b8': <function check_ufunc_b>, 'lb4': <function check_ufunc_lb>, 'lb8': <function check_ufunc_lb>, 'lr4': <function check_ufunc_lr>, 'lr8': <function check_ufunc_lr>, 'r4': <function check_ufunc_r>, 'r8': <function check_ufunc_r>, None: <function check_ufunc_ascii>}¶
Dictionary of mode checkers
- cape.gruvoc.ufuncfile.flatten_ufunc_vectors(mesh: UmeshBase, slot: str, shape: Tuple[int, int], order: str | None = 'F')¶
- Convert ufunc vector from more user friendly (nvec, len, nnode)
to expected ufunc formatted vector (nvec, len*nnode) ordered as [(x1,y1,z1), (x2,y2,z2), …] for len = 3
- cape.gruvoc.ufuncfile.get_sfunc_mode(fname_or_fp: IOBase | str, fmt: str | None = None) UFUNCFileType | None¶
Identify UFUNC file format if possible
- Call:
>>> mode = get_ugrid_mode(fname_or_fp, fmt=None)
- Inputs:
- Outputs:
- mode:
None|UFUNCFileType File type, big|little endian, stream|fortran, etc.
- mode:
- cape.gruvoc.ufuncfile.get_ufunc_mode(fname_or_fp: IOBase | str, fmt: str | None = None) UFUNCFileType | None¶
Identify UFUNC file format if possible
- Call:
>>> mode = get_ugrid_mode(fname_or_fp, fmt=None)
- Inputs:
- Outputs:
- mode:
None|UFUNCFileType File type, big|little endian, stream|fortran, etc.
- mode:
- cape.gruvoc.ufuncfile.inflate_ufunc_vectors(mesh: UmeshBase, slot: str, shape: Tuple[int, int, int], order: str | None = 'F')¶
- Convert ufunc formatted vector (nvec, len*nnode) ordered as
[(x1,y1,z1), (x2,y2,z2), …] to more user friendly (nvec, len, nnode) for len = 3
- cape.gruvoc.ufuncfile.read_sfunc(mesh: UmeshBase, fname_or_fp: str | IOBase, fmt: str | None = None)¶
Read data to a mesh object from
.sfuncfile
- cape.gruvoc.ufuncfile.read_ufunc(mesh: UmeshBase, fname_or_fp: str | IOBase, fmt: str | None = None)¶
Read data to a mesh object from
.ufuncfile
- cape.gruvoc.ufuncfile.write_sfunc(mesh: UmeshBase, fname_or_fp: str | IOBase, fmt: str | None = None)¶
Write data from a mesh object to
.sfuncfile