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

Gaussian-envelope traveling wave packet stimulus. More...

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

Go to the source code of this file.

Classes

struct  SimStimulusTravelingWavePacketConfig
 Configuration for a drifting Gaussian-envelope traveling wave packet. More...
 

Typedefs

typedef struct SimStimulusTravelingWavePacketConfig SimStimulusTravelingWavePacketConfig
 Configuration for a drifting Gaussian-envelope traveling wave packet.
 

Functions

SimResult sim_add_stimulus_traveling_wave_packet_operator (struct SimContext *context, const SimStimulusTravelingWavePacketConfig *config, size_t *out_index)
 Register a Gaussian-envelope traveling wave packet stimulus operator.
 
SimResult sim_stimulus_traveling_wave_packet_config (struct SimContext *context, size_t operator_index, SimStimulusTravelingWavePacketConfig *out_config)
 Copy the current traveling wave-packet configuration from a registered operator.
 
SimResult sim_stimulus_traveling_wave_packet_update (struct SimContext *context, size_t operator_index, const SimStimulusTravelingWavePacketConfig *config)
 Replace or renormalize a registered traveling wave-packet configuration.
 

Detailed Description

Gaussian-envelope traveling wave packet stimulus.

Evaluates a drifting local packet frame (u, v) and injects A * exp(-0.5 * ((u / sigma_u)^2 + (v / sigma_v)^2))

  • exp(i * (k_u * u + k_v * v - omega * t + phi)), where the packet center and orientation can evolve over time.

Real fields receive the real component. Complex fields receive the full complex packet with an additional global rotation.

Function Documentation

◆ sim_add_stimulus_traveling_wave_packet_operator()

SimResult sim_add_stimulus_traveling_wave_packet_operator ( struct SimContext context,
const SimStimulusTravelingWavePacketConfig config,
size_t *  out_index 
)

Register a Gaussian-envelope traveling wave packet stimulus operator.

The implementation copies and normalizes config, then registers a split operator that writes the drifting packet into the target field.

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

SimResult sim_stimulus_traveling_wave_packet_config ( struct SimContext context,
size_t  operator_index,
SimStimulusTravelingWavePacketConfig out_config 
)

Copy the current traveling wave-packet configuration from a registered operator.

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

SimResult sim_stimulus_traveling_wave_packet_update ( struct SimContext context,
size_t  operator_index,
const SimStimulusTravelingWavePacketConfig config 
)

Replace or renormalize a registered traveling wave-packet 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 traveling wave-packet operator to update.
configOptional replacement configuration.
Returns
SIM_RESULT_OK on success, or an error code if lookup or state validation fails.