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

Finite-difference curl-like scalar operator for two vector components. More...

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

Go to the source code of this file.

Classes

struct  SimCurlOperatorConfig
 Configuration for a finite-difference scalar curl operator. More...
 

Macros

#define SIM_CURL_AXIS_AUTO   ((size_t)SIZE_MAX)
 

Typedefs

typedef enum SimCurlStencil SimCurlStencil
 Finite-difference stencils available for curl derivatives.
 
typedef struct SimCurlOperatorConfig SimCurlOperatorConfig
 Configuration for a finite-difference scalar curl operator.
 

Enumerations

enum  SimCurlStencil {
  SIM_CURL_STENCIL_CENTRAL_2 = 0 , SIM_CURL_STENCIL_CENTRAL_4 , SIM_CURL_STENCIL_FORWARD_1 , SIM_CURL_STENCIL_BACKWARD_1 ,
  SIM_CURL_STENCIL_FORWARD_2 , SIM_CURL_STENCIL_BACKWARD_2
}
 Finite-difference stencils available for curl derivatives. More...
 

Functions

SimResult sim_add_curl_operator (struct SimContext *context, const SimCurlOperatorConfig *config, size_t *out_index)
 Register a finite-difference curl operator.
 
SimResult sim_curl_config (struct SimContext *context, size_t operator_index, SimCurlOperatorConfig *out_config)
 Copy the current curl configuration from a registered operator.
 
SimResult sim_curl_update (struct SimContext *context, size_t operator_index, const SimCurlOperatorConfig *config)
 Replace the configuration of a registered curl operator.
 

Detailed Description

Finite-difference curl-like scalar operator for two vector components.

Enumeration Type Documentation

◆ SimCurlStencil

Finite-difference stencils available for curl derivatives.

Enumerator
SIM_CURL_STENCIL_CENTRAL_2 

Second-order central difference.

SIM_CURL_STENCIL_CENTRAL_4 

Fourth-order central difference.

SIM_CURL_STENCIL_FORWARD_1 

First-order forward difference.

SIM_CURL_STENCIL_BACKWARD_1 

First-order backward difference.

SIM_CURL_STENCIL_FORWARD_2 

Second-order forward difference.

SIM_CURL_STENCIL_BACKWARD_2 

Second-order backward difference.

Function Documentation

◆ sim_add_curl_operator()

SimResult sim_add_curl_operator ( struct SimContext context,
const SimCurlOperatorConfig config,
size_t *  out_index 
)

Register a finite-difference curl operator.

Parameters
contextSimulation context that will own the operator.
configOptional curl 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 compatibility checks, allocation, or split registration.

◆ sim_curl_config()

SimResult sim_curl_config ( struct SimContext context,
size_t  operator_index,
SimCurlOperatorConfig out_config 
)

Copy the current curl configuration from a registered operator.

Parameters
contextSimulation context containing the operator.
operator_indexIndex returned by sim_add_curl_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 curl state.

◆ sim_curl_update()

SimResult sim_curl_update ( struct SimContext context,
size_t  operator_index,
const SimCurlOperatorConfig config 
)

Replace the configuration of a registered curl operator.

config is required. The replacement is normalized and field compatibility is checked before storing it.

Parameters
contextSimulation context containing the operator.
operator_indexIndex of the curl operator to update.
configReplacement curl configuration.
Returns
SIM_RESULT_OK on success, or an error code from argument validation, lookup, state validation, or field compatibility checks.