Metadata-Version: 2.4
Name: fix-slf-mesh-ot
Version: 0.1.0
Summary: Fix missing IPOBO records in SERAFIN (.slf) mesh files generated by q4ts
License-Expression: MIT
License-File: LICENSE
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# fix-slf-mesh-ot

Fix missing IPOBO (boundary node index) records in SERAFIN (`.slf`) mesh files generated by q4ts. Patches the binary file in-place by reading boundary node numbers from a `.cli` file.

## Installation

```bash
pip install fix-slf-mesh-ot
```

## Usage

```bash
fix-slf-mesh-ot mesh.slf boundary.cli
```

## How it works

1. **`find_ipobo_offset`** — Parses the SERAFIN binary format (tries big/little endian) to locate the IPOBO record offset. Walks the header: title → variable count → variable names → params → geometry (NELEM, NPOIN, NDP) → IKLE → IPOBO position.
2. **`fix_ipobo`** — Reads the `.cli` file to build a boundary-node-to-index mapping, then writes the IPOBO array at the found offset via a temp file + `os.replace`.

The SERAFIN format uses Fortran-style records (4-byte length prefix/suffix around each data block).

## License

MIT
