|
Oakfield API Documentation 1.0.0
Numerical core APIs
|
Runtime selection utilities for libsimintegrators. More...
#include "integrator.h"

Go to the source code of this file.
Classes | |
| struct | IntegratorRegistryEntry |
| Entry stored by the registry. More... | |
| struct | IntegratorRegistry |
| Registry container for integrator factories. More... | |
Typedefs | |
| typedef SimResult(* | IntegratorCreateFn) (const IntegratorConfig *config, Integrator *out) |
| Factory function creating an integrator instance. | |
| typedef struct IntegratorRegistryEntry | IntegratorRegistryEntry |
| Entry stored by the registry. | |
| typedef struct IntegratorRegistry | IntegratorRegistry |
| Registry container for integrator factories. | |
Functions | |
| SimResult | integrator_registry_init (IntegratorRegistry *registry) |
| Initialize a registry and register built-in integrator factories. | |
| void | integrator_registry_destroy (IntegratorRegistry *registry) |
| Release registry storage. | |
| SimResult | integrator_registry_register (IntegratorRegistry *registry, const char *name, IntegratorCreateFn create_fn) |
| Add or replace a factory under a registry name. | |
| IntegratorCreateFn | integrator_registry_lookup (const IntegratorRegistry *registry, const char *name) |
| Look up a factory by registry name. | |
| SimResult | integrator_registry_create (const IntegratorRegistry *registry, const char *name, const IntegratorConfig *config, Integrator *out) |
| Create an integrator from a registered factory. | |
| SimResult | integrator_registry_register_builtin (IntegratorRegistry *registry) |
| Register the built-in integrator factory set. | |
Runtime selection utilities for libsimintegrators.
The registry maps stable textual integrator names such as "rk4" and "etdrk4" to factory callbacks. Registry storage is owned by the registry; created Integrator instances are written into caller-provided memory and must later be passed to integrator_destroy().
| typedef SimResult(* IntegratorCreateFn) (const IntegratorConfig *config, Integrator *out) |
Factory function creating an integrator instance.
| config | Optional configuration forwarded to the concrete factory. | |
| [out] | out | Caller-owned integrator storage populated on success. |
| typedef struct IntegratorRegistry IntegratorRegistry |
Registry container for integrator factories.
The entry array is heap-owned after initialization and must be released with integrator_registry_destroy().
| typedef struct IntegratorRegistryEntry IntegratorRegistryEntry |
Entry stored by the registry.
Names are copied into fixed-size storage and compared by their stored byte sequence. Registering an existing name replaces its factory.
| SimResult integrator_registry_create | ( | const IntegratorRegistry * | registry, |
| const char * | name, | ||
| const IntegratorConfig * | config, | ||
| Integrator * | out | ||
| ) |
Create an integrator from a registered factory.
| registry | Registry to inspect. | |
| name | Null-terminated integrator name. | |
| config | Optional configuration forwarded to the factory. | |
| [out] | out | Caller-owned integrator storage populated on success. |
| void integrator_registry_destroy | ( | IntegratorRegistry * | registry | ) |
Release registry storage.
| registry | Registry to destroy; NULL is ignored. |
| SimResult integrator_registry_init | ( | IntegratorRegistry * | registry | ) |
Initialize a registry and register built-in integrator factories.
| [out] | registry | Registry storage to initialize. |
| IntegratorCreateFn integrator_registry_lookup | ( | const IntegratorRegistry * | registry, |
| const char * | name | ||
| ) |
Look up a factory by registry name.
| registry | Registry to inspect. |
| name | Null-terminated integrator name. |
| SimResult integrator_registry_register | ( | IntegratorRegistry * | registry, |
| const char * | name, | ||
| IntegratorCreateFn | create_fn | ||
| ) |
Add or replace a factory under a registry name.
| registry | Registry to mutate. |
| name | Null-terminated integrator name copied into the registry. |
| create_fn | Factory callback for the name. |
| SimResult integrator_registry_register_builtin | ( | IntegratorRegistry * | registry | ) |
Register the built-in integrator factory set.
Built-ins currently include euler, heun, rk4, rkf45, backward_euler, crank_nicolson, etdrk4, and subordination.
| registry | Registry to mutate. |