SWMM-Docs  5.2.0.dev5
Stormwater Management Model
Functions
Toolkit Functions

Functions

int DLLEXPORT swmm_getCurrentDateTimeStr (char *dtimestr)
 Get the simulation current datetime as a string. More...
 
int DLLEXPORT swmm_getNodeResult (int index, int type, double *result)
 Get a result value for specified node. More...
 
int DLLEXPORT swmm_getLinkResult (int index, int type, double *result)
 Get a result value for specified link. More...
 
int DLLEXPORT swmm_getSubcatchResult (int index, int type, double *result)
 Get a result value for specified subcatchment. More...
 
int DLLEXPORT swmm_getNodeStats (int index, SM_NodeStats *nodeStats)
 Get a node statistics. More...
 
int DLLEXPORT swmm_getNodeTotalInflow (int index, double *value)
 Get the cumulative inflow for a node. More...
 
int DLLEXPORT swmm_getStorageStats (int index, SM_StorageStats *storageStats)
 Get a storage statistics. More...
 
int DLLEXPORT swmm_getOutfallStats (int index, SM_OutfallStats *outfallStats)
 Get outfall statistics. More...
 
void DLLEXPORT swmm_freeOutfallStats (SM_OutfallStats *outfallStats)
 Free outfall statistics structure. More...
 
int DLLEXPORT swmm_getLinkStats (int index, SM_LinkStats *linkStats)
 Get link statistics. More...
 
int DLLEXPORT swmm_getPumpStats (int index, SM_PumpStats *pumpStats)
 Get pump statistics. More...
 
int DLLEXPORT swmm_getSystemRoutingStats (SM_RoutingTotals *routingTot)
 Get system routing statistics. More...
 
int DLLEXPORT swmm_getSystemRunoffStats (SM_RunoffTotals *runoffTot)
 Get system runoff statistics. More...
 
int DLLEXPORT swmm_setLinkSetting (int index, double setting)
 Set a link setting (pump, orifice, or weir). Setting for an orifice and a weir should be [0, 1]. A setting for a pump can range from [0, inf). However, if a pump is set to 1, it will pump at its maximum curve setting. More...
 
int DLLEXPORT swmm_setNodeInflow (int index, double flowrate)
 Set an inflow rate to a node. The inflow rate is held constant until the caller changes it. More...
 
int DLLEXPORT swmm_setOutfallStage (int index, double stage)
 Set outfall stage. More...
 

Detailed Description

Function Documentation

◆ swmm_freeOutfallStats()

int swmm_freeOutfallStats ( SM_OutfallStats outfallStats)

Free outfall statistics structure.

Parameters
[out]outfallStatsThe outfall Stats struct. This frees any allocated pollutants array.
Returns
Error code

Return: API Error Purpose: Frees Outfall Node Stats and Converts Units Note: API user is responsible for calling swmm_freeOutfallStats since this function performs a memory allocation.

Definition at line 1900 of file toolkitAPI.c.

◆ swmm_getCurrentDateTimeStr()

int swmm_getCurrentDateTimeStr ( char *  dtimestr)

Get the simulation current datetime as a string.

Parameters
[out]dtimestrThe current datetime. dtimestr must be pre-allocated by the caller. This will copy 19 characters.
Returns
Error code

Output: DateTime String Return: API Error Purpose: Get the current simulation time

Definition at line 1517 of file toolkitAPI.c.

◆ swmm_getLinkResult()

int swmm_getLinkResult ( int  index,
int  type,
double *  result 
)

Get a result value for specified link.

Parameters
indexThe index of a link
typeThe property type code (See SM_LinkResult)
[out]resultThe result of the link's property
Returns
Error code

Input: index = Index of desired ID type = Result Type (SM_LinkResult) Output: result = result data desired (byref) Return: API Error Purpose: Gets Link Simulated Value at Current Time

Definition at line 1597 of file toolkitAPI.c.

◆ swmm_getLinkStats()

int swmm_getLinkStats ( int  index,
SM_LinkStats linkStats 
)

Get link statistics.

Parameters
indexThe index of a link
[out]linkStatsThe link Stats struct (see SM_LinkStats). pre-allocated by the caller.
Returns
Error code

Output: Link Stats Structure (SM_LinkStats) Return: API Error Purpose: Gets Link Stats and Converts Units

Definition at line 1912 of file toolkitAPI.c.

◆ swmm_getNodeResult()

int swmm_getNodeResult ( int  index,
int  type,
double *  result 
)

Get a result value for specified node.

Parameters
indexThe index of a node
typeThe property type code (See SM_NodeResult)
[out]resultThe result of the node's property
Returns
Error code

Input: index = Index of desired ID type = Result Type (SM_NodeResult) Output: result = result data desired (byref) Return: API Error Purpose: Gets Node Simulated Value at Current Time

Definition at line 1549 of file toolkitAPI.c.

◆ swmm_getNodeStats()

int swmm_getNodeStats ( int  index,
SM_NodeStats nodeStats 
)

Get a node statistics.

Parameters
indexThe index of a node
[out]nodeStatsThe Node Stats struct (see SM_NodeStats). pre-allocated by the caller.
Returns
Error code

Output: Node Stats Structure (SM_NodeStats) Return: API Error Purpose: Gets Node Stats and Converts Units

Definition at line 1780 of file toolkitAPI.c.

◆ swmm_getNodeTotalInflow()

int swmm_getNodeTotalInflow ( int  index,
double *  value 
)

Get the cumulative inflow for a node.

Parameters
indexThe index of a node
[out]valueThe total inflow.
Returns
Error code

Input: Node Index Output: Node Total inflow Volume. Return: API Error Purpose: Get Node Total Inflow Volume.

Definition at line 1816 of file toolkitAPI.c.

◆ swmm_getOutfallStats()

int swmm_getOutfallStats ( int  index,
SM_OutfallStats outfallStats 
)

Get outfall statistics.

Parameters
indexThe index of a outfall node
[out]outfallStatsThe outfall Stats struct (see SM_OutfallStats). pre-allocated by the caller. Caller is also responsible for freeing the SM_OutfallStats structure using swmm_freeOutfallStats(). This frees any pollutants array.
Returns
Error code

Output: Outfall Stats Structure (SM_OutfallStats) Return: API Error Purpose: Gets Outfall Node Stats and Converts Units Note: Caller is responsible for calling swmm_freeOutfallStats to free the pollutants array.

Definition at line 1861 of file toolkitAPI.c.

◆ swmm_getPumpStats()

int swmm_getPumpStats ( int  index,
SM_PumpStats pumpStats 
)

Get pump statistics.

Parameters
indexThe index of a pump
[out]pumpStatsThe link Stats struct (see SM_PumpStats). pre-allocated by the caller.
Returns
Error code

Output: Pump Link Stats Structure (SM_PumpStats) Return: API Error Purpose: Gets Pump Link Stats and Converts Units

Definition at line 1950 of file toolkitAPI.c.

◆ swmm_getStorageStats()

int swmm_getStorageStats ( int  index,
SM_StorageStats storageStats 
)

Get a storage statistics.

Parameters
indexThe index of a storage node
[out]storageStatsThe storage Stats struct (see SM_StorageStats). pre-allocated by the caller.
Returns
Error code

Output: Storage Node Stats Structure (SM_StorageStats) Return: API Error Purpose: Gets Storage Node Stats and Converts Units

Definition at line 1834 of file toolkitAPI.c.

◆ swmm_getSubcatchResult()

int swmm_getSubcatchResult ( int  index,
int  type,
double *  result 
)

Get a result value for specified subcatchment.

Parameters
indexThe index of a subcatchment
typeThe property type code (See SM_SubcResult)
[out]resultThe result of the subcatchment's property
Returns
Error code

Input: index = Index of desired ID type = Result Type (SM_SubcResult) Output: result = result data desired (byref) Return: API Error Purpose: Gets Subcatchment Simulated Value at Current Time

Definition at line 1644 of file toolkitAPI.c.

◆ swmm_getSystemRoutingStats()

int swmm_getSystemRoutingStats ( SM_RoutingTotals routingTot)

Get system routing statistics.

Parameters
[out]routingTotThe system Routing Stats struct (see SM_RoutingTotals). pre-allocated by the caller.
Returns
Error code

Output: System Routing Totals Structure (SM_RoutingTotals) Return: API Error Purpose: Gets System Flow Routing Totals and Converts Units

Definition at line 2034 of file toolkitAPI.c.

◆ swmm_getSystemRunoffStats()

int swmm_getSystemRunoffStats ( SM_RunoffTotals runoffTot)

Get system runoff statistics.

Parameters
[out]runoffTotThe system Runoff Stats struct (see SM_RunoffTotals). pre-allocated by the caller.
Returns
Error code

Output: System Runoff Totals Structure (SM_RunoffTotals) Return: API Error Purpose: Gets System Runoff Totals and Converts Units

Definition at line 2069 of file toolkitAPI.c.

◆ swmm_setLinkSetting()

int swmm_setLinkSetting ( int  index,
double  setting 
)

Set a link setting (pump, orifice, or weir). Setting for an orifice and a weir should be [0, 1]. A setting for a pump can range from [0, inf). However, if a pump is set to 1, it will pump at its maximum curve setting.

Parameters
indexThe link index.
settingThe new setting for the link.
Returns
Error code

Input: index = Index of desired ID value = New Target Setting Output: returns API Error Purpose: Sets Link open fraction (Weir, Orifice, Pump, and Outlet)

Definition at line 2312 of file toolkitAPI.c.

◆ swmm_setNodeInflow()

int swmm_setNodeInflow ( int  index,
double  flowrate 
)

Set an inflow rate to a node. The inflow rate is held constant until the caller changes it.

Parameters
indexThe node index.
flowrateThe new node inflow rate.
Returns
Error code

Input: index = Index of desired ID value = New Inflow Rate Output: returns API Error Purpose: Sets new node inflow rate and holds until set again

Definition at line 2355 of file toolkitAPI.c.

◆ swmm_setOutfallStage()

int swmm_setOutfallStage ( int  index,
double  stage 
)

Set outfall stage.

Parameters
indexThe outfall node index.
stageThe outfall node stage (head).
Returns
Error code

Input: index = Index of desired outfall stage = New outfall stage (head) Output: returns API Error Purpose: Sets new outfall stage and holds until set again.

Definition at line 2416 of file toolkitAPI.c.