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

Fractional Laplacian dissipative operator (|k|^alpha spectral damping). More...

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

Go to the source code of this file.

Classes

struct  LinearDissipativeOperatorConfig
 Configuration for the fractional Laplacian dissipative operator. More...
 

Typedefs

typedef struct LinearDissipativeOperatorConfig LinearDissipativeOperatorConfig
 Configuration for the fractional Laplacian dissipative operator.
 

Functions

SimResult sim_add_linear_dissipative_operator (struct SimContext *context, const LinearDissipativeOperatorConfig *config, size_t *out_index)
 Add a fractional Laplacian dissipative operator to the context.
 
SimResult sim_linear_dissipative_config (struct SimContext *context, size_t operator_index, LinearDissipativeOperatorConfig *out_config)
 Copy the current dissipative configuration from a registered operator.
 
SimResult sim_linear_dissipative_update (struct SimContext *context, size_t operator_index, const LinearDissipativeOperatorConfig *config)
 Replace or renormalize a registered dissipative operator configuration.
 
SimResult linear_dissipative_apply (void *state_ptr, struct SimContext *context, struct SimOperator *self, double dt)
 Apply the dissipative split step for an already registered operator state.
 

Detailed Description

Fractional Laplacian dissipative operator (|k|^alpha spectral damping).

Applies dissipative dynamics via a fractional Laplacian term on matching real or complex fields.

Function Documentation

◆ linear_dissipative_apply()

SimResult linear_dissipative_apply ( void *  state_ptr,
struct SimContext context,
struct SimOperator self,
double  dt 
)

Apply the dissipative split step for an already registered operator state.

This is exposed for split descriptors and related operator glue; callers must pass the state object created by sim_add_linear_dissipative_operator().

Parameters
state_ptrInternal LinearDissipativeOperatorState pointer.
contextSimulation context containing the target field.
selfOperator instance invoking the step.
dtSubstep duration.
Returns
SIM_RESULT_OK on success or an error code from state, field, or FFT evaluation.

◆ sim_add_linear_dissipative_operator()

SimResult sim_add_linear_dissipative_operator ( struct SimContext context,
const LinearDissipativeOperatorConfig config,
size_t *  out_index 
)

Add a fractional Laplacian dissipative operator to the context.

Parameters
contextSimulation context that will own the operator.
configOptional operator 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 argument validation, field validation, allocation, FFT plan setup, or registration.

◆ sim_linear_dissipative_config()

SimResult sim_linear_dissipative_config ( struct SimContext context,
size_t  operator_index,
LinearDissipativeOperatorConfig out_config 
)

Copy the current dissipative configuration from a registered operator.

Parameters
contextSimulation context containing the operator.
operator_indexIndex returned by sim_add_linear_dissipative_operator().
[out]out_configReceives the 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 dissipative state.

◆ sim_linear_dissipative_update()

SimResult sim_linear_dissipative_update ( struct SimContext context,
size_t  operator_index,
const LinearDissipativeOperatorConfig config 
)

Replace or renormalize a registered dissipative operator configuration.

Passing NULL for config keeps the current configuration and reapplies normalization. Changes to alpha or spacing mark spectral coefficients dirty.

Parameters
contextSimulation context containing the operator.
operator_indexIndex of the dissipative operator to update.
configOptional replacement configuration.
Returns
SIM_RESULT_OK on success, or an error code from lookup, field validation, cache setup, or state validation.