pyfebiopt.xplt.dictionary
Dictionary parsing and buffer bootstrap for XPLT.
The FEBio dictionary announces every variable written in the .xplt stream.
Each entry couples a data type (FEDataType) with a storage format
(Storage_Fmt) and a location (nodal, elemental, or facial). This module turns
those announcements into Python structures used everywhere else in xplt:
read_dictionarywalks the binary blocks and yields a mapping such as{"displacement": {"type": "VEC3F", "format": "FMT_NODE"}}plus the original order and location lookup.prepare_field_meta_and_buffersconverts that mapping into lightweight metadata objects and allocates empty buffers keyed by variable and region.
Example.
reader = BinaryReader("run.xplt")
dictionary, order, where = read_dictionary(reader)
field_meta, buffers = prepare_field_meta_and_buffers(dictionary, where)
# buffers now mirrors FEBio streams:
# buffers.node_global["displacement"] -> list of per-time arrays
Notes.
The dictionary order is preserved; consumers can rely on FEBio’s output order.
Per-domain nodal variables create both
node_global(global scope) andnode_regionslots so that later parsing can disambiguate based on region id.
Classes
Typed buffers allocated for each variable kind. |
Functions
|
Return dictionary mapping, order per kind, and location map. |
|
Create field metadata and empty buffers keyed by variable. |
Module Contents
- pyfebiopt.xplt.dictionary.read_dictionary(reader: pyfebiopt.xplt.binary_reader.BinaryReader) tuple[dict[str, dict[str, str]], dict[str, list[str]], dict[str, str]]
Return dictionary mapping, order per kind, and location map.
- class pyfebiopt.xplt.dictionary.BufferStore
Typed buffers allocated for each variable kind.
- node_global: dict[str, list[numpy.ndarray | None]]
- node_region: dict[str, dict[str, list[numpy.ndarray | None]]]
- elem_item: dict[str, dict[str, list[numpy.ndarray | None]]]
- elem_mult: dict[str, dict[str, list[pyfebiopt.xplt.types.MultLike | None]]]
- elem_region: dict[str, dict[str, list[numpy.ndarray | None]]]
- face_item: dict[str, dict[str, list[numpy.ndarray | None]]]
- face_mult: dict[str, dict[str, list[pyfebiopt.xplt.types.MultLike | None]]]
- face_region: dict[str, dict[str, list[numpy.ndarray | None]]]
- pyfebiopt.xplt.dictionary.prepare_field_meta_and_buffers(dictionary: dict[str, dict[str, str]], where: dict[str, str]) tuple[dict[str, pyfebiopt.xplt.views._FieldMeta], BufferStore]
Create field metadata and empty buffers keyed by variable.
- Returns:
Parsed metadata and corresponding buffers.
- Return type:
tuple[dict[str, _FieldMeta], BufferStore]