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

Integer-order cylindrical Bessel beam stimulus. More...

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

Go to the source code of this file.

Classes

struct  SimStimulusBesselBeamConfig
 Configuration for an integer-order cylindrical Bessel beam stimulus. More...
 

Typedefs

typedef struct SimStimulusBesselBeamConfig SimStimulusBesselBeamConfig
 Configuration for an integer-order cylindrical Bessel beam stimulus.
 

Functions

SimResult sim_add_stimulus_bessel_beam_operator (struct SimContext *context, const SimStimulusBesselBeamConfig *config, size_t *out_index)
 Register an integer-order cylindrical Bessel beam stimulus operator.
 
SimResult sim_stimulus_bessel_beam_config (struct SimContext *context, size_t operator_index, SimStimulusBesselBeamConfig *out_config)
 Copy the current Bessel beam configuration from a registered operator.
 
SimResult sim_stimulus_bessel_beam_update (struct SimContext *context, size_t operator_index, const SimStimulusBesselBeamConfig *config)
 Replace or renormalize a registered Bessel beam stimulus configuration.
 

Detailed Description

Integer-order cylindrical Bessel beam stimulus.

Evaluates a local beam frame (u, v) and injects A * J_n(k_r * rho) * exp(i * (n * theta - omega * t + phi)), where rho = hypot(u / s_u, v / s_v) and theta = atan2(v / s_v, u / s_u). The local frame can drift and rotate over time.

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

Function Documentation

◆ sim_add_stimulus_bessel_beam_operator()

SimResult sim_add_stimulus_bessel_beam_operator ( struct SimContext context,
const SimStimulusBesselBeamConfig config,
size_t *  out_index 
)

Register an integer-order cylindrical Bessel beam stimulus operator.

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

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

SimResult sim_stimulus_bessel_beam_config ( struct SimContext context,
size_t  operator_index,
SimStimulusBesselBeamConfig out_config 
)

Copy the current Bessel beam configuration from a registered operator.

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

SimResult sim_stimulus_bessel_beam_update ( struct SimContext context,
size_t  operator_index,
const SimStimulusBesselBeamConfig config 
)

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