turbo_moc.io.cgns_adf module#
Small NumPy-only CGNS/ADF container reader and writer.
Extracted from ParaBlade projects/mesh_examples/3D/cgns_adf_3Dto2D.py. This module handles the container; callers construct the CGNS node tree. It supports ADF files, not HDF5 files.
- exception turbo_moc.io.cgns_adf.AdfError[source]#
Bases:
ValueErrorMalformed or unsupported ADF/CGNS content.
- class turbo_moc.io.cgns_adf.AdfNode(name: str, label: str = '', data=None, dtype: str | None = None, children: Iterable[AdfNode] | None = None)[source]#
Bases:
objectOne node of an ADF tree.
labelis the CGNS node type (Zone_t…).dataisNone(data typeMT), astr(data typeC1) or a numpy array whose dtype maps to an ADF data type. Multi-dimensional arrays keep their Fortran (column-major) ordering on disk.- Attributes:
- children
- data
- dtype
- label
- name
textString content of a
C1node (trailing NULs/blanks stripped).
Methods
copy()Deep copy of the sub-tree (array data is shared, never mutated).
get([name, label])set_data(data[, dtype])add
find_all
walk
- data#
- dtype#
- label#
- name#
- property text: str#
String content of a
C1node (trailing NULs/blanks stripped).
- turbo_moc.io.cgns_adf.read_adf(filename: str) AdfNode[source]#
Read a complete ADF (CGNS) file into an
AdfNodetree.
- turbo_moc.io.cgns_adf.read_adf_bytes(data: bytes, filename: str = '<memory>') AdfNode[source]#
Read an ADF image, including a mesh stored inside a project ZIP.