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

Soft energy / lambda regulation (thermostat) operator. More...

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

Go to the source code of this file.

Classes

struct  ThermostatOperatorConfig
 Configuration for the thermostat operator. More...
 

Typedefs

typedef enum ThermostatMode ThermostatMode
 Thermostat regulation mode.
 
typedef struct ThermostatOperatorConfig ThermostatOperatorConfig
 Configuration for the thermostat operator.
 

Enumerations

enum  ThermostatMode { THERMOSTAT_NONE = 0 , THERMOSTAT_SOFT_LAMBDA = 1 , THERMOSTAT_ADD = 2 , THERMOSTAT_MULT = 3 }
 Thermostat regulation mode. More...
 

Functions

SimResult sim_add_thermostat_operator (struct SimContext *context, const ThermostatOperatorConfig *config, size_t *out_index)
 Register a thermostat operator instance.
 
SimResult sim_thermostat_config (struct SimContext *context, size_t operator_index, ThermostatOperatorConfig *out_config)
 Copy the current thermostat configuration from a registered operator.
 
SimResult sim_thermostat_update (struct SimContext *context, size_t operator_index, const ThermostatOperatorConfig *config)
 Replace the configuration of a registered thermostat operator.
 

Detailed Description

Soft energy / lambda regulation (thermostat) operator.

Typedef Documentation

◆ ThermostatMode

Thermostat regulation mode.

THERMOSTAT_SOFT_LAMBDA adjusts lambda_eff from the measured mean energy. THERMOSTAT_ADD and THERMOSTAT_MULT apply additive or multiplicative relaxation toward either E_target or an optional per-point memory field.

◆ ThermostatOperatorConfig

Configuration for the thermostat operator.

The operator updates internal scalars such as lambda_eff and optionally uses a memory target field for additive or multiplicative regulation modes.

Enumeration Type Documentation

◆ ThermostatMode

Thermostat regulation mode.

THERMOSTAT_SOFT_LAMBDA adjusts lambda_eff from the measured mean energy. THERMOSTAT_ADD and THERMOSTAT_MULT apply additive or multiplicative relaxation toward either E_target or an optional per-point memory field.

Enumerator
THERMOSTAT_NONE 

Disable thermostat regulation.

THERMOSTAT_SOFT_LAMBDA 

Adjust lambda_eff from measured mean energy.

THERMOSTAT_ADD 

Additive relaxation toward target or memory field.

THERMOSTAT_MULT 

Multiplicative relaxation toward target or memory field.

Function Documentation

◆ sim_add_thermostat_operator()

SimResult sim_add_thermostat_operator ( struct SimContext context,
const ThermostatOperatorConfig config,
size_t *  out_index 
)

Register a thermostat operator instance.

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

◆ sim_thermostat_config()

SimResult sim_thermostat_config ( struct SimContext context,
size_t  operator_index,
ThermostatOperatorConfig out_config 
)

Copy the current thermostat configuration from a registered operator.

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

◆ sim_thermostat_update()

SimResult sim_thermostat_update ( struct SimContext context,
size_t  operator_index,
const ThermostatOperatorConfig config 
)

Replace the configuration of a registered thermostat operator.

config is required. A successful update normalizes the replacement, resets lambda/cache state, refreshes symbolic metadata, and invalidates the scheduler plan.

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