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

Legacy simple sinusoidal forcing operator (single-mode driver). More...

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

Go to the source code of this file.

Classes

struct  StimulusOperatorConfig
 Configuration parameters for the legacy sinusoidal stimulus operator. More...
 

Typedefs

typedef struct StimulusOperatorConfig StimulusOperatorConfig
 Configuration parameters for the legacy sinusoidal stimulus operator.
 

Functions

SimResult sim_add_stimulus_operator (struct SimContext *context, const StimulusOperatorConfig *config, size_t *out_index)
 Register the legacy single-mode sinusoidal stimulus operator.
 
SimResult sim_stimulus_config (struct SimContext *context, size_t operator_index, StimulusOperatorConfig *out_config)
 Copy the current legacy stimulus configuration from a registered operator.
 
SimResult sim_stimulus_update (struct SimContext *context, size_t operator_index, const StimulusOperatorConfig *config)
 Replace or renormalize a registered legacy stimulus configuration.
 

Detailed Description

Legacy simple sinusoidal forcing operator (single-mode driver).

For richer stimuli (chirp, traveling Gaussian), prefer the operators in sinusoidal.h and gaussian.h. Supports real and complex fields; complex writes can include a phase rotation.

Function Documentation

◆ sim_add_stimulus_operator()

SimResult sim_add_stimulus_operator ( struct SimContext context,
const StimulusOperatorConfig config,
size_t *  out_index 
)

Register the legacy single-mode sinusoidal stimulus operator.

The implementation copies and normalizes config, then registers a split operator that adds a real sinusoidal forcing term to the target field. Complex targets receive the forcing in the real component.

Parameters
contextSimulation context that will own the operator.
configOptional stimulus 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_config()

SimResult sim_stimulus_config ( struct SimContext context,
size_t  operator_index,
StimulusOperatorConfig out_config 
)

Copy the current legacy stimulus configuration from a registered operator.

Parameters
contextSimulation context containing the operator.
operator_indexIndex returned by sim_add_stimulus_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_update()

SimResult sim_stimulus_update ( struct SimContext context,
size_t  operator_index,
const StimulusOperatorConfig config 
)

Replace or renormalize a registered legacy stimulus configuration.

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

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