OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
openswmm_mesh_heat_impl.cpp File Reference

Public C API implementation for mesh thermal configuration. More...

Include dependency graph for openswmm_mesh_heat_impl.cpp:

Functions

int swmm_heat_get_channel_ground_status (SWMM_Engine engine, SWMM_ChannelGroundStatus *out)
 Read requested and measured channel-to-ground contact status.
 
int swmm_heat_get_channel_ground_values (SWMM_Engine engine, int kind, int first, int count, double *out)
 Read a contiguous link range of accepted channel-ground values.
 
int swmm_heat_get_channel_ground_contact (SWMM_Engine engine, int index, SWMM_ChannelGroundContact *out)
 Read one initialized channel-to-ground contact interval.
 
int swmm_heat_preview_channel_ground_map (SWMM_Engine engine, int link, SWMM_ChannelGroundPreview *out, SWMM_ChannelGroundContact *contacts, int capacity, int *required)
 Preview complete channel XY coverage on a private mesh copy.
 
int swmm_heat_preview_channel_ground_map_with_progress (SWMM_Engine engine, int link, SWMM_ChannelGroundPreview *out, SWMM_ChannelGroundContact *contacts, int capacity, int *required, SWMM_CancelCallback callback, void *user_data)
 Cancellable variant of the read-only channel-contact preview. The callback may be invoked during mesh indexing and channel mapping. If it returns nonzero, the function returns SWMM_ERR_CANCELLED and leaves out, contacts, and required unchanged.
 
int swmm_heat_preview_channel_ground_map_page (SWMM_Engine engine, int link, SWMM_ChannelGroundPreview *out, int first, SWMM_ChannelGroundContact *contacts, int capacity, int *required, SWMM_CancelCallback callback, void *user_data)
 Bounded, cancellable contact page. first is a zero-based interval offset; at most capacity rows are copied while required reports the total count. The summary counts describe the complete mapping. On cancellation, all output arguments remain unchanged.
 
int swmm_heat_get_2d_status (SWMM_Engine engine, SWMM_Heat2DStatus *out)
 Read requested and initialized coupled surface-heat status.
 
int swmm_heat_get_2d_values (SWMM_Engine engine, int kind, int first, int count, double *out)
 Read a contiguous range of accepted surface-heat runtime values.
 
int swmm_heat_get_ground_status (SWMM_Engine engine, SWMM_GroundHeatStatus *out)
 Read canonical ground thermal ownership and runtime status.
 
int swmm_heat_get_ground_values (SWMM_Engine engine, int kind, int first, int count, double *out)
 Read a contiguous cell range of canonical soil thermal values.
 
int swmm_heat_get_ground_layers (SWMM_Engine engine, int cell, int kind, int first, int count, double *out)
 Zero-based cell/layer ranges. Invalid ranges leave all output untouched.
 

Detailed Description

Public C API implementation for mesh thermal configuration.

Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
License
Apache-2.0

Function Documentation

◆ swmm_heat_get_2d_status()

int swmm_heat_get_2d_status ( SWMM_Engine engine,
SWMM_Heat2DStatus * status )

Read requested and initialized coupled surface-heat status.

Parameters
[in]engineBorrowed live engine handle; not retained by this call.
[in,out]statusRequired caller-owned record with struct_size at least sizeof(SWMM_Heat2DStatus).
Note
Available before initialization; reports requested and measured state separately. Builds without 2D return success with inactive fields and an explanatory reason. Invalid handle/record leaves the output unchanged.
Returns
SWMM_OK, SWMM_ERR_BADHANDLE for a null engine, or SWMM_ERR_BADPARAM for invalid required storage/value.
Here is the call graph for this function:

◆ swmm_heat_get_2d_values()

int swmm_heat_get_2d_values ( SWMM_Engine engine,
int kind,
int first_cell,
int count,
double * values )

Read a contiguous range of accepted surface-heat runtime values.

Parameters
[in]engineBorrowed live engine handle; not retained by this call.
[in]kindSWMM_Heat2DValue selector; units/signs follow the enum member.
[in]first_cellNonnegative zero-based starting cell index.
[in]countNonnegative number of consecutive values to copy; span must fit the model.
[out]valuesCaller-owned count-double destination; may be NULL only when count == 0.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE for a null engine; SWMM_ERR_BADPARAM for invalid selector/count/storage; SWMM_ERR_BADINDEX for an out-of-range span; SWMM_ERR_LIFECYCLE for unavailable runtime; or SWMM_ERR_PLUGIN without 2D.
Note
Accepted spans are validated before writing. Runtime reads remain available after ENDED/REPORTED when the corresponding stored thermal owner exists.
Here is the call graph for this function:

◆ swmm_heat_get_channel_ground_contact()

int swmm_heat_get_channel_ground_contact ( SWMM_Engine engine,
int index,
SWMM_ChannelGroundContact * contact )

Read one initialized channel-to-ground contact interval.

Parameters
[in]engineBorrowed live engine handle; not retained by this call.
[in]indexZero-based initialized contact-interval index.
[in,out]contactRequired record with struct_size at least sizeof(SWMM_ChannelGroundContact).
Note
Output remains unchanged on failure; reads accepted runtime contact geometry.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE for a null engine; SWMM_ERR_BADPARAM for invalid selector/count/storage; SWMM_ERR_BADINDEX for an out-of-range span; SWMM_ERR_LIFECYCLE for unavailable runtime; or SWMM_ERR_PLUGIN without 2D.
Note
Accepted spans are validated before writing. Runtime reads remain available after ENDED/REPORTED when the corresponding stored thermal owner exists.
Here is the call graph for this function:

◆ swmm_heat_get_channel_ground_status()

int swmm_heat_get_channel_ground_status ( SWMM_Engine engine,
SWMM_ChannelGroundStatus * status )

Read requested and measured channel-to-ground contact status.

Parameters
[in]engineBorrowed live engine handle; not retained by this call.
[in,out]statusRequired caller-owned record with struct_size at least sizeof(SWMM_ChannelGroundStatus).
Note
Available before initialization; reports requested and measured state separately. Builds without 2D return success with inactive fields and an explanatory reason. Invalid handle/record leaves the output unchanged.
Returns
SWMM_OK, SWMM_ERR_BADHANDLE for a null engine, or SWMM_ERR_BADPARAM for invalid required storage/value.
Here is the call graph for this function:

◆ swmm_heat_get_channel_ground_values()

int swmm_heat_get_channel_ground_values ( SWMM_Engine engine,
int kind,
int first_link,
int count,
double * values )

Read a contiguous link range of accepted channel-ground values.

Parameters
[in]engineBorrowed live engine handle; not retained by this call.
[in]kindSWMM_ChannelGroundValue selector; units/signs follow the enum member.
[in]first_linkNonnegative zero-based starting link index.
[in]countNonnegative number of consecutive values to copy; span must fit the model.
[out]valuesCaller-owned count-double destination; may be NULL only when count == 0.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE for a null engine; SWMM_ERR_BADPARAM for invalid selector/count/storage; SWMM_ERR_BADINDEX for an out-of-range span; SWMM_ERR_LIFECYCLE for unavailable runtime; or SWMM_ERR_PLUGIN without 2D.
Note
Accepted spans are validated before writing. Runtime reads remain available after ENDED/REPORTED when the corresponding stored thermal owner exists.
Here is the call graph for this function:

◆ swmm_heat_get_ground_layers()

int swmm_heat_get_ground_layers ( SWMM_Engine engine,
int cell,
int kind,
int first_layer,
int count,
double * values )

Zero-based cell/layer ranges. Invalid ranges leave all output untouched.

Parameters
[in]engineBorrowed live engine handle; not retained by this call.
[in]cellZero-based mesh cell with an initialized thermal column.
[in]kindSWMM_GroundHeatLayerValue selector; units follow the enum.
[in]first_layerNonnegative zero-based starting thermal layer, surface first.
[in]countNonnegative layer count; the complete span must fit the column.
[out]valuesCaller-owned count-double destination; NULL only when count == 0.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE for a null engine; SWMM_ERR_BADPARAM for invalid selector/count/storage; SWMM_ERR_BADINDEX for an out-of-range span; SWMM_ERR_LIFECYCLE for unavailable runtime; or SWMM_ERR_PLUGIN without 2D.
Note
Accepted spans are validated before writing. Runtime reads remain available after ENDED/REPORTED when the corresponding stored thermal owner exists.
Here is the call graph for this function:

◆ swmm_heat_get_ground_status()

int swmm_heat_get_ground_status ( SWMM_Engine engine,
SWMM_GroundHeatStatus * status )

Read canonical ground thermal ownership and runtime status.

Parameters
[in]engineBorrowed live engine handle; not retained by this call.
[in,out]statusRequired caller-owned record with struct_size at least sizeof(SWMM_GroundHeatStatus).
Note
Available before initialization; reports requested and measured state separately. Builds without 2D return success with inactive fields and an explanatory reason. Invalid handle/record leaves the output unchanged.
Returns
SWMM_OK, SWMM_ERR_BADHANDLE for a null engine, or SWMM_ERR_BADPARAM for invalid required storage/value.
Here is the call graph for this function:

◆ swmm_heat_get_ground_values()

int swmm_heat_get_ground_values ( SWMM_Engine engine,
int kind,
int first_cell,
int count,
double * values )

Read a contiguous cell range of canonical soil thermal values.

Parameters
[in]engineBorrowed live engine handle; not retained by this call.
[in]kindSWMM_GroundHeatValue selector; units/signs follow the enum member.
[in]first_cellNonnegative zero-based starting cell index.
[in]countNonnegative number of consecutive values to copy; span must fit the model.
[out]valuesCaller-owned count-double destination; may be NULL only when count == 0.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE for a null engine; SWMM_ERR_BADPARAM for invalid selector/count/storage; SWMM_ERR_BADINDEX for an out-of-range span; SWMM_ERR_LIFECYCLE for unavailable runtime; or SWMM_ERR_PLUGIN without 2D.
Note
Accepted spans are validated before writing. Runtime reads remain available after ENDED/REPORTED when the corresponding stored thermal owner exists.
Here is the call graph for this function:

◆ swmm_heat_preview_channel_ground_map()

int swmm_heat_preview_channel_ground_map ( SWMM_Engine engine,
int link,
SWMM_ChannelGroundPreview * out,
SWMM_ChannelGroundContact * contacts,
int capacity,
int * required )

Preview complete channel XY coverage on a private mesh copy.

Parameters
[in]engineBorrowed live engine handle; not retained by this call.
[in]linkZero-based existing routed-channel link index.
[in,out]outRequired summary with struct_size at least sizeof(SWMM_ChannelGroundPreview).
[out]contactsCaller-owned array of capacity contact records; NULL only when capacity == 0.
[in]capacityNonnegative contact-record capacity; zero permits a size query.
[out]requiredRequired destination for the complete mapping's interval count.
Note
Requires BUILDING/OPENED and works on a private geometry copy. Missing mesh or ineligible geometry produces SWMM_OK with out->valid == 0 and a reason. No hydraulic or thermal model state is initialized. Cancellation leaves all outputs untouched; a short nonpaged buffer publishes summary/required only.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE for a null engine; SWMM_ERR_BADPARAM for invalid selector/count/storage; SWMM_ERR_BADINDEX for an out-of-range span; SWMM_ERR_LIFECYCLE for unavailable runtime; or SWMM_ERR_PLUGIN without 2D.
Note
Accepted spans are validated before writing. Runtime reads remain available after ENDED/REPORTED when the corresponding stored thermal owner exists. Progress variants additionally return SWMM_ERR_CANCELLED.

◆ swmm_heat_preview_channel_ground_map_page()

int swmm_heat_preview_channel_ground_map_page ( SWMM_Engine engine,
int link,
SWMM_ChannelGroundPreview * out,
int first,
SWMM_ChannelGroundContact * contacts,
int capacity,
int * required,
SWMM_CancelCallback callback,
void * user_data )

Bounded, cancellable contact page. first is a zero-based interval offset; at most capacity rows are copied while required reports the total count. The summary counts describe the complete mapping. On cancellation, all output arguments remain unchanged.

Parameters
[in]engineBorrowed live engine handle; not retained by this call.
[in]linkZero-based existing routed-channel link index.
[in,out]outRequired summary with struct_size at least sizeof(SWMM_ChannelGroundPreview).
[out]contactsCaller-owned array of capacity contact records; NULL only when capacity == 0.
[in]capacityNonnegative contact-record capacity; zero permits a size query.
[out]requiredRequired destination for the complete mapping's interval count.
[in]firstZero-based interval offset, at most the complete interval count.
[in]callbackOptional synchronous cancellation/progress callback; receives engine, stage SWMM_HEAT_PREVIEW_STAGE_*, percentage [0,100], and user_data. Nonzero cancels.
[in,out]user_dataOpaque caller-owned callback context; may be NULL and is not retained.
Note
Requires BUILDING/OPENED and works on a private geometry copy. Missing mesh or ineligible geometry produces SWMM_OK with out->valid == 0 and a reason. No hydraulic or thermal model state is initialized. Cancellation leaves all outputs untouched; a short nonpaged buffer publishes summary/required only.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE for a null engine; SWMM_ERR_BADPARAM for invalid selector/count/storage; SWMM_ERR_BADINDEX for an out-of-range span; SWMM_ERR_LIFECYCLE for unavailable runtime; or SWMM_ERR_PLUGIN without 2D.
Note
Accepted spans are validated before writing. Runtime reads remain available after ENDED/REPORTED when the corresponding stored thermal owner exists. Progress variants additionally return SWMM_ERR_CANCELLED.

◆ swmm_heat_preview_channel_ground_map_with_progress()

int swmm_heat_preview_channel_ground_map_with_progress ( SWMM_Engine engine,
int link,
SWMM_ChannelGroundPreview * out,
SWMM_ChannelGroundContact * contacts,
int capacity,
int * required,
SWMM_CancelCallback callback,
void * user_data )

Cancellable variant of the read-only channel-contact preview. The callback may be invoked during mesh indexing and channel mapping. If it returns nonzero, the function returns SWMM_ERR_CANCELLED and leaves out, contacts, and required unchanged.

Parameters
[in]engineBorrowed live engine handle; not retained by this call.
[in]linkZero-based existing routed-channel link index.
[in,out]outRequired summary with struct_size at least sizeof(SWMM_ChannelGroundPreview).
[out]contactsCaller-owned array of capacity contact records; NULL only when capacity == 0.
[in]capacityNonnegative contact-record capacity; zero permits a size query.
[out]requiredRequired destination for the complete mapping's interval count.
[in]callbackOptional synchronous cancellation/progress callback; receives engine, stage SWMM_HEAT_PREVIEW_STAGE_*, percentage [0,100], and user_data. Nonzero cancels.
[in,out]user_dataOpaque caller-owned callback context; may be NULL and is not retained.
Note
Requires BUILDING/OPENED and works on a private geometry copy. Missing mesh or ineligible geometry produces SWMM_OK with out->valid == 0 and a reason. No hydraulic or thermal model state is initialized. Cancellation leaves all outputs untouched; a short nonpaged buffer publishes summary/required only.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE for a null engine; SWMM_ERR_BADPARAM for invalid selector/count/storage; SWMM_ERR_BADINDEX for an out-of-range span; SWMM_ERR_LIFECYCLE for unavailable runtime; or SWMM_ERR_PLUGIN without 2D.
Note
Accepted spans are validated before writing. Runtime reads remain available after ENDED/REPORTED when the corresponding stored thermal owner exists. Progress variants additionally return SWMM_ERR_CANCELLED.