|
Oakfield API Documentation 1.0.0
Numerical core APIs
|
Phase-topology extraction helpers for complex simulation fields. More...


Go to the source code of this file.
Classes | |
| struct | SimFieldTopologyCell |
| Per-cell phase-topology measurement. More... | |
| struct | SimFieldTopologySummary |
| Aggregate counts reported by a topology extraction pass. More... | |
| struct | SimFieldTopologyConfig |
| Tunable thresholds used by phase-topology extraction. More... | |
Typedefs | |
| typedef enum SimFieldTopologySeamMask | SimFieldTopologySeamMask |
| Bit mask describing which edges of a cell cross a phase seam. | |
| typedef enum SimFieldTopologyCellFlag | SimFieldTopologyCellFlag |
| Flags describing confidence and validity for a topology cell. | |
| typedef struct SimFieldTopologyCell | SimFieldTopologyCell |
| Per-cell phase-topology measurement. | |
| typedef struct SimFieldTopologySummary | SimFieldTopologySummary |
| Aggregate counts reported by a topology extraction pass. | |
| typedef struct SimFieldTopologyConfig | SimFieldTopologyConfig |
| Tunable thresholds used by phase-topology extraction. | |
Enumerations | |
| enum | SimFieldTopologySeamMask { SIM_FIELD_TOPOLOGY_SEAM_BOTTOM = 1u << 0 , SIM_FIELD_TOPOLOGY_SEAM_RIGHT = 1u << 1 , SIM_FIELD_TOPOLOGY_SEAM_TOP = 1u << 2 , SIM_FIELD_TOPOLOGY_SEAM_LEFT = 1u << 3 } |
| Bit mask describing which edges of a cell cross a phase seam. More... | |
| enum | SimFieldTopologyCellFlag { SIM_FIELD_TOPOLOGY_CELL_VALID = 1u << 0 , SIM_FIELD_TOPOLOGY_CELL_AMBIGUOUS , SIM_FIELD_TOPOLOGY_CELL_CORE_OFFSET_VALID , SIM_FIELD_TOPOLOGY_CELL_NONFINITE = 1u << 3 } |
| Flags describing confidence and validity for a topology cell. More... | |
Functions | |
| void | sim_field_topology_config_default (SimFieldTopologyConfig *out_config) |
| Fill a topology configuration with default thresholds. | |
| bool | sim_field_topology_dimensions (const struct SimField *field, size_t *out_width, size_t *out_height) |
| Resolve the 2D topology dimensions for a field. | |
| bool | sim_field_topology_extract (const struct SimField *field, SimFieldTopologyCell *out_cells, size_t cell_capacity, SimFieldTopologySummary *out_summary, const SimFieldTopologyConfig *config, size_t *out_width, size_t *out_height) |
| Extract phase winding and seam data from a field. | |
| void | sim_field_topology_cell_pack_rgba8 (const SimFieldTopologyCell *cell, uint8_t out_texel[4]) |
| Pack one topology cell into an RGBA8 texel. | |
Phase-topology extraction helpers for complex simulation fields.
The topology pass interprets the fastest-varying field dimension as image width and folds all remaining elements into rows. For complex fields with at least a 2x2 grid, each non-border cell records local phase winding, phase-seam crossings, ambiguity flags, and an optional singularity core estimate.
Flags describing confidence and validity for a topology cell.
Bit mask describing which edges of a cell cross a phase seam.
| void sim_field_topology_cell_pack_rgba8 | ( | const SimFieldTopologyCell * | cell, |
| uint8_t | out_texel[4] | ||
| ) |
Pack one topology cell into an RGBA8 texel.
| cell | Cell to pack; NULL is treated as a zero-valued cell. | |
| [out] | out_texel | Receives charge, seam/flag bits, and core-offset channels. |
R encodes charge mapped from [-1, +1] into [0, 255]. G stores flags in the high nibble and seam bits in the low nibble. B and A store core X/Y offsets biased into [0, 255], or 128 when no core offset is valid.
| void sim_field_topology_config_default | ( | SimFieldTopologyConfig * | out_config | ) |
Fill a topology configuration with default thresholds.
| [out] | out_config | Receives defaults when non-NULL. |
| bool sim_field_topology_dimensions | ( | const struct SimField * | field, |
| size_t * | out_width, | ||
| size_t * | out_height | ||
| ) |
Resolve the 2D topology dimensions for a field.
| field | Field whose layout is inspected. | |
| [out] | out_width | Receives the fastest-varying dimension when non-NULL. |
| [out] | out_height | Receives the flattened row count when non-NULL. |
| bool sim_field_topology_extract | ( | const struct SimField * | field, |
| SimFieldTopologyCell * | out_cells, | ||
| size_t | cell_capacity, | ||
| SimFieldTopologySummary * | out_summary, | ||
| const SimFieldTopologyConfig * | config, | ||
| size_t * | out_width, | ||
| size_t * | out_height | ||
| ) |
Extract phase winding and seam data from a field.
| field | Field to inspect; only complex-double fields produce valid topology. | |
| [out] | out_cells | Optional cell buffer with one entry per resolved field element. |
| cell_capacity | Number of entries available in out_cells. | |
| [out] | out_summary | Optional aggregate topology counts. |
| config | Optional extraction thresholds; defaults are used when NULL. | |
| [out] | out_width | Optional resolved width. |
| [out] | out_height | Optional resolved height. |
The last row and last column do not form full 2x2 cells and are written as zeroed cells when out_cells is provided.