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

Utility operator that converts fields between physical and spectral domains. More...

Include dependency graph for fft_convert.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef enum SimFFTConvertDirection SimFFTConvertDirection
 Direction of a physical/spectral FFT conversion.
 

Enumerations

enum  SimFFTConvertDirection { SIM_FFT_CONVERT_FORWARD = 0 , SIM_FFT_CONVERT_INVERSE = 1 }
 Direction of a physical/spectral FFT conversion. More...
 

Functions

SimResult sim_add_fft_convert (struct SimContext *context, size_t input_field, SimFFTConvertDirection direction, bool in_place, size_t *out_field_index, size_t *out_operator_index)
 Register an FFT conversion operator and allocate its output field.
 

Detailed Description

Utility operator that converts fields between physical and spectral domains.

FFT conversion is modeled as an explicit graph-IR domain transition. Each conversion allocates a dedicated output field; in-place conversion is not supported.

Enumeration Type Documentation

◆ SimFFTConvertDirection

Direction of a physical/spectral FFT conversion.

Enumerator
SIM_FFT_CONVERT_FORWARD 

Physical-domain input to spectral-domain output.

SIM_FFT_CONVERT_INVERSE 

Spectral-domain input to physical-domain output.

Function Documentation

◆ sim_add_fft_convert()

SimResult sim_add_fft_convert ( struct SimContext context,
size_t  input_field,
SimFFTConvertDirection  direction,
bool  in_place,
size_t *  out_field_index,
size_t *  out_operator_index 
)

Register an FFT conversion operator and allocate its output field.

Forward conversion writes a complex spectral field; real scalar inputs produce a complex-real-constrained spectrum. Inverse conversion writes a physical field and returns real scalar output when the input has the complex-real constraint.

Parameters
contextSimulation context that will own the output field and operator.
input_fieldIndex of the field to transform.
directionForward physical-to-spectral or inverse spectral-to-physical.
in_placeMust be false; true returns SIM_RESULT_NOT_SUPPORTED.
[out]out_field_indexOptional destination for the newly allocated output field index.
[out]out_operator_indexOptional destination for the registered operator index.
Returns
SIM_RESULT_OK on success, SIM_RESULT_INVALID_ARGUMENT for NULL context, missing input, empty input, or allocation-size overflow, SIM_RESULT_NOT_SUPPORTED for in-place conversion, SIM_RESULT_TYPE_MISMATCH for inverse conversion from real scalar input, SIM_RESULT_OUT_OF_MEMORY on allocation failure, or a field/graph/operator registration error.