Oakfield API Documentation 1.0.0
Numerical core APIs
Loading...
Searching...
No Matches
checkerboard.h File Reference

Checkerboard / stripe pattern stimulus (complex-capable). More...

#include "coords.h"
#include "oakfield/operator_split.h"
#include <stdbool.h>
#include <stddef.h>
Include dependency graph for checkerboard.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SimStimulusCheckerboardConfig
 Configuration for checkerboard or stripe pattern stimulus writes. More...
 

Typedefs

typedef struct SimStimulusCheckerboardConfig SimStimulusCheckerboardConfig
 Configuration for checkerboard or stripe pattern stimulus writes.
 

Functions

SimResult sim_add_stimulus_checkerboard_operator (struct SimContext *context, const SimStimulusCheckerboardConfig *config, size_t *out_index)
 Register a checkerboard or stripe stimulus operator.
 
SimResult sim_stimulus_checkerboard_config (struct SimContext *context, size_t operator_index, SimStimulusCheckerboardConfig *out_config)
 Copy the current checkerboard configuration from a registered operator.
 
SimResult sim_stimulus_checkerboard_update (struct SimContext *context, size_t operator_index, const SimStimulusCheckerboardConfig *config)
 Replace or renormalize a registered checkerboard stimulus configuration.
 

Detailed Description

Checkerboard / stripe pattern stimulus (complex-capable).

Generates a static geometric pattern over 1D or 2D fields: f(i, j) = A · (-1)^{⌊i / Px⌋ + ⌊j / Py⌋} For complex fields, an additional global phase rotation is applied.

Function Documentation

◆ sim_add_stimulus_checkerboard_operator()

SimResult sim_add_stimulus_checkerboard_operator ( struct SimContext context,
const SimStimulusCheckerboardConfig config,
size_t *  out_index 
)

Register a checkerboard or stripe stimulus operator.

The implementation copies and normalizes config, then registers a split operator that writes the geometric pattern into the configured target field.

Parameters
contextSimulation context that will own the operator.
configOptional checkerboard configuration; NULL selects normalized defaults.
[out]out_indexOptional destination for the registered operator index.
Returns
SIM_RESULT_OK on success, or an error code from validation, allocation, or split-operator registration.

◆ sim_stimulus_checkerboard_config()

SimResult sim_stimulus_checkerboard_config ( struct SimContext context,
size_t  operator_index,
SimStimulusCheckerboardConfig out_config 
)

Copy the current checkerboard configuration from a registered operator.

Parameters
contextSimulation context containing the operator.
operator_indexIndex returned by sim_add_stimulus_checkerboard_operator().
[out]out_configReceives the operator's normalized configuration.
Returns
SIM_RESULT_OK on success, SIM_RESULT_INVALID_ARGUMENT for NULL pointers, SIM_RESULT_NOT_FOUND for a missing operator, or SIM_RESULT_INVALID_STATE when the operator has no stimulus state.

◆ sim_stimulus_checkerboard_update()

SimResult sim_stimulus_checkerboard_update ( struct SimContext context,
size_t  operator_index,
const SimStimulusCheckerboardConfig config 
)

Replace or renormalize a registered checkerboard stimulus configuration.

Passing NULL for config keeps the existing configuration and reapplies normalization. A successful update refreshes derived state and invalidates the scheduler plan.

Parameters
contextSimulation context containing the operator.
operator_indexIndex of the checkerboard operator to update.
configOptional replacement configuration.
Returns
SIM_RESULT_OK on success, or an error code if lookup, allocation, or state validation fails.