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

Integrator registry and active integrator tracking. More...

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

Go to the source code of this file.

Classes

struct  SimIntegratorState
 Integrator registry container paired with active execution pointers. More...
 

Typedefs

typedef struct SimIntegratorState SimIntegratorState
 Integrator registry container paired with active execution pointers.
 

Functions

SimResult sim_integrator_state_init (SimIntegratorState *state)
 Initialize integrator state and register built-in factories.
 
void sim_integrator_state_destroy (SimIntegratorState *state)
 Destroy integrator state and release registry storage.
 
void sim_integrator_state_set_active (SimIntegratorState *state, struct Integrator *integrator)
 Assign the active integrator pointer.
 
SimResult sim_integrator_state_set_sequence (SimIntegratorState *state, struct Integrator *const *integrators, size_t count)
 Assign an optional ordered integrator sequence.
 
struct Integratorsim_integrator_state_active (const SimIntegratorState *state)
 Retrieve the active integrator pointer.
 
void sim_integrator_state_set_stepping (SimIntegratorState *state, struct Integrator *integrator)
 Mark an integrator as the one currently stepping.
 
struct Integratorsim_integrator_state_stepping (const SimIntegratorState *state)
 Retrieve the integrator currently executing a step, if any.
 
const struct Integrator *const * sim_integrator_state_sequence (const SimIntegratorState *state, size_t *out_count)
 Retrieve the optional integrator sequence.
 
IntegratorRegistrysim_integrator_state_registry (SimIntegratorState *state)
 Access the underlying registry.
 
const IntegratorRegistrysim_integrator_state_registry_const (const SimIntegratorState *state)
 Access the underlying registry (const).
 

Detailed Description

Integrator registry and active integrator tracking.

Function Documentation

◆ sim_integrator_state_active()

struct Integrator * sim_integrator_state_active ( const SimIntegratorState state)

Retrieve the active integrator pointer.

Parameters
stateState object to inspect.
Returns
Active integrator pointer, or NULL when none is set.

◆ sim_integrator_state_destroy()

void sim_integrator_state_destroy ( SimIntegratorState state)

Destroy integrator state and release registry storage.

Parameters
stateState object to destroy; NULL is ignored.

◆ sim_integrator_state_init()

SimResult sim_integrator_state_init ( SimIntegratorState state)

Initialize integrator state and register built-in factories.

Parameters
stateState object to initialize.
Returns
SIM_RESULT_OK or an error from registry initialization.

◆ sim_integrator_state_registry()

IntegratorRegistry * sim_integrator_state_registry ( SimIntegratorState state)

Access the underlying registry.

Parameters
stateState object to inspect.
Returns
Mutable registry pointer, or NULL if unavailable.

◆ sim_integrator_state_registry_const()

const IntegratorRegistry * sim_integrator_state_registry_const ( const SimIntegratorState state)

Access the underlying registry (const).

Parameters
stateState object to inspect.
Returns
Const registry pointer, or NULL if unavailable.

◆ sim_integrator_state_sequence()

const struct Integrator *const * sim_integrator_state_sequence ( const SimIntegratorState state,
size_t *  out_count 
)

Retrieve the optional integrator sequence.

Parameters
stateState object to inspect.
[out]out_countOptional receiver for sequence length.
Returns
Internal sequence pointer, or NULL when no sequence is configured.

◆ sim_integrator_state_set_active()

void sim_integrator_state_set_active ( SimIntegratorState state,
struct Integrator integrator 
)

Assign the active integrator pointer.

Parameters
stateState object to update.
integratorActive integrator pointer; not owned by the state.

◆ sim_integrator_state_set_sequence()

SimResult sim_integrator_state_set_sequence ( SimIntegratorState state,
struct Integrator *const *  integrators,
size_t  count 
)

Assign an optional ordered integrator sequence.

When count is zero, the sequence and active pointer are both cleared. The sequence array is copied, but the Integrator instances remain caller-owned.

Parameters
stateState object to update.
integratorsArray of integrator pointers when count is nonzero.
countNumber of entries in integrators.
Returns
SIM_RESULT_OK, SIM_RESULT_INVALID_ARGUMENT, or SIM_RESULT_OUT_OF_MEMORY.

◆ sim_integrator_state_set_stepping()

void sim_integrator_state_set_stepping ( SimIntegratorState state,
struct Integrator integrator 
)

Mark an integrator as the one currently stepping.

Parameters
stateState object to update.
integratorIntegrator currently executing a step; not owned.

◆ sim_integrator_state_stepping()

struct Integrator * sim_integrator_state_stepping ( const SimIntegratorState state)

Retrieve the integrator currently executing a step, if any.

Parameters
stateState object to inspect.
Returns
Stepping integrator pointer, or NULL.