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

Rectangular wave-equation standing modes with fixed boundaries. More...

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

Go to the source code of this file.

Classes

struct  SimStimulusWaveModesConfig
 Configuration for rectangular standing wave-equation mode stimuli. More...
 

Typedefs

typedef struct SimStimulusWaveModesConfig SimStimulusWaveModesConfig
 Configuration for rectangular standing wave-equation mode stimuli.
 

Functions

SimResult sim_add_stimulus_wave_modes_operator (struct SimContext *context, const SimStimulusWaveModesConfig *config, size_t *out_index)
 Register a rectangular wave-equation standing-mode stimulus operator.
 
SimResult sim_stimulus_wave_modes_config (struct SimContext *context, size_t operator_index, SimStimulusWaveModesConfig *out_config)
 Copy the current wave-modes configuration from a registered operator.
 
SimResult sim_stimulus_wave_modes_update (struct SimContext *context, size_t operator_index, const SimStimulusWaveModesConfig *config)
 Replace or renormalize a registered wave-modes stimulus configuration.
 

Detailed Description

Rectangular wave-equation standing modes with fixed boundaries.

Evaluates a local chart (u, v) and injects A * Phi_{m,n}(u, v) * exp(i * (-omega_{m,n} * (t + t_0) + phi)), where Phi_{m,n}(u, v) = sin(m * pi * (u / L_u + 1/2)) * sin(n * pi * (v / L_v + 1/2)) and omega_{m,n} = c * pi * sqrt((m / L_u)^2 + (n / L_v)^2).

For rank-1 fields, only the u-mode is used and omega_m = c * pi * m / L_u. Real fields receive the real component. Complex fields receive the full complex mode with an additional global rotation.

Function Documentation

◆ sim_add_stimulus_wave_modes_operator()

SimResult sim_add_stimulus_wave_modes_operator ( struct SimContext context,
const SimStimulusWaveModesConfig config,
size_t *  out_index 
)

Register a rectangular wave-equation standing-mode stimulus operator.

The implementation copies and normalizes config, then registers a split operator that evaluates the fixed-boundary mode on the target field.

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

SimResult sim_stimulus_wave_modes_config ( struct SimContext context,
size_t  operator_index,
SimStimulusWaveModesConfig out_config 
)

Copy the current wave-modes configuration from a registered operator.

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

SimResult sim_stimulus_wave_modes_update ( struct SimContext context,
size_t  operator_index,
const SimStimulusWaveModesConfig config 
)

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