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

Optical vortex beam stimulus with Gaussian envelope and phase singularity. More...

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

Go to the source code of this file.

Classes

struct  SimStimulusOpticalVortexConfig
 Configuration for an optical vortex beam with phase winding. More...
 

Typedefs

typedef struct SimStimulusOpticalVortexConfig SimStimulusOpticalVortexConfig
 Configuration for an optical vortex beam with phase winding.
 

Functions

SimResult sim_add_stimulus_optical_vortex_operator (struct SimContext *context, const SimStimulusOpticalVortexConfig *config, size_t *out_index)
 Register an optical vortex beam stimulus operator.
 
SimResult sim_stimulus_optical_vortex_config (struct SimContext *context, size_t operator_index, SimStimulusOpticalVortexConfig *out_config)
 Copy the current optical-vortex configuration from a registered operator.
 
SimResult sim_stimulus_optical_vortex_update (struct SimContext *context, size_t operator_index, const SimStimulusOpticalVortexConfig *config)
 Replace or renormalize a registered optical-vortex configuration.
 

Detailed Description

Optical vortex beam stimulus with Gaussian envelope and phase singularity.

Synthesizes a vortex beam of the form V(u,v,t) = A * rho^{|l|} * exp(-rho^2 / 2) * exp(i * (l * theta - omega * t + phi)), where rho is the beam radius normalized by the configured waists and l is the topological charge.

For real fields, the real component of the beam is injected. For complex fields, the full complex beam is written with an additional global rotation.

Function Documentation

◆ sim_add_stimulus_optical_vortex_operator()

SimResult sim_add_stimulus_optical_vortex_operator ( struct SimContext context,
const SimStimulusOpticalVortexConfig config,
size_t *  out_index 
)

Register an optical vortex beam stimulus operator.

The implementation copies and normalizes config, then registers a split operator that writes the vortex envelope and phase winding into the target field.

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

SimResult sim_stimulus_optical_vortex_config ( struct SimContext context,
size_t  operator_index,
SimStimulusOpticalVortexConfig out_config 
)

Copy the current optical-vortex configuration from a registered operator.

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

SimResult sim_stimulus_optical_vortex_update ( struct SimContext context,
size_t  operator_index,
const SimStimulusOpticalVortexConfig config 
)

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