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

Static world container coordinating fields, operators, and universe specification. More...

#include <stdbool.h>
#include <stddef.h>
#include "field.h"
#include "operator.h"
Include dependency graph for sim_world.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SimPole
 Pole singularity specification for universe geometry. More...
 
struct  SimPoleFieldOptions
 Options controlling synthesized pole fields. More...
 
struct  SimUniverseSpec
 Universe/experiment specification defining mathematical structure. More...
 
struct  SimFieldContinuityOverride
 Static world container holding fields, registry, and universe spec. More...
 
struct  SimWorld
 Mutable world container that owns fields, operators, and universe data. More...
 

Macros

#define SIM_WORLD_DEFAULT_Q   1.0f
 
#define SIM_WORLD_DEFAULT_K   20U
 
#define SIM_WORLD_DEFAULT_EPSILON   0.5f
 
#define SIM_WORLD_DEFAULT_SIEVE_SIGMA   0.1f
 

Typedefs

typedef struct SimPole SimPole
 Pole singularity specification for universe geometry.
 
typedef struct SimPoleFieldOptions SimPoleFieldOptions
 Options controlling synthesized pole fields.
 
typedef struct SimUniverseSpec SimUniverseSpec
 Universe/experiment specification defining mathematical structure.
 
typedef struct SimFieldContinuityOverride SimFieldContinuityOverride
 Static world container holding fields, registry, and universe spec.
 
typedef struct SimWorld SimWorld
 Mutable world container that owns fields, operators, and universe data.
 

Functions

SimResult sim_world_init (SimWorld *world, const SimUniverseSpec *universe_spec)
 Initialize world container and copy universe specification.
 
SimResult sim_world_reserve_fields (SimWorld *world, size_t additional)
 Ensure field storage can accommodate additional entries.
 
void sim_world_reset_fields (SimWorld *world)
 Reset owned field storage and release buffers.
 
void sim_world_destroy (SimWorld *world)
 Destroy world container resources.
 
SimResult sim_world_set_field_continuity_override (SimWorld *world, size_t field_index, bool enabled, const SimOperatorConfig *config)
 Assign or clear a per-field continuity override.
 
bool sim_world_field_continuity_override (const SimWorld *world, size_t field_index, SimOperatorConfig *out_config)
 Query the active continuity override for a field, if present.
 

Detailed Description

Static world container coordinating fields, operators, and universe specification.

Typedef Documentation

◆ SimUniverseSpec

Universe/experiment specification defining mathematical structure.

This describes the "physics" of the toy universe - immutable after init.

Function Documentation

◆ sim_world_destroy()

void sim_world_destroy ( SimWorld world)

Destroy world container resources.

Parameters
worldWorld container to destroy; NULL is ignored.

◆ sim_world_field_continuity_override()

bool sim_world_field_continuity_override ( const SimWorld world,
size_t  field_index,
SimOperatorConfig out_config 
)

Query the active continuity override for a field, if present.

Parameters
worldWorld container to inspect.
field_indexField index to query.
[out]out_configOptional receiver for the override config.
Returns
true when an enabled override exists for the field.

◆ sim_world_init()

SimResult sim_world_init ( SimWorld world,
const SimUniverseSpec universe_spec 
)

Initialize world container and copy universe specification.

Parameters
worldWorld container to initialize.
universe_specOptional universe specification; NULL selects defaults.
Returns
SIM_RESULT_OK or an allocation/registry initialization error.

◆ sim_world_reserve_fields()

SimResult sim_world_reserve_fields ( SimWorld world,
size_t  additional 
)

Ensure field storage can accommodate additional entries.

Parameters
worldWorld container to grow.
additionalNumber of additional fields required.
Returns
SIM_RESULT_OK, SIM_RESULT_INVALID_ARGUMENT, or SIM_RESULT_OUT_OF_MEMORY.

◆ sim_world_reset_fields()

void sim_world_reset_fields ( SimWorld world)

Reset owned field storage and release buffers.

Parameters
worldWorld container to reset; NULL is ignored.

◆ sim_world_set_field_continuity_override()

SimResult sim_world_set_field_continuity_override ( SimWorld world,
size_t  field_index,
bool  enabled,
const SimOperatorConfig config 
)

Assign or clear a per-field continuity override.

Parameters
worldWorld container to update.
field_indexField index to configure.
enabledWhether the override should be active.
configContinuity config to copy when enabled; required if enabled.
Returns
SIM_RESULT_OK or SIM_RESULT_INVALID_ARGUMENT.