SWMM-Docs  5.2.0.dev5
Stormwater Management Model
Data Structures | Enumerations | Functions
toolkitAPI.h File Reference

Exportable Functions for Toolkit API. More...

#include "../src/datetime.h"

Go to the source code of this file.

Data Structures

struct  SM_NodeStats
 Node stats structure. More...
 
struct  SM_StorageStats
 Storage Statatistics. More...
 
struct  SM_OutfallStats
 Outfall Statatistics. More...
 
struct  SM_LinkStats
 Link Statatistics. More...
 
struct  SM_PumpStats
 Pump Statistics. More...
 
struct  SM_SubcatchStats
 Subcatchment Statistics. More...
 
struct  SM_RoutingTotals
 System Flow Routing Statistics. More...
 
struct  SM_RunoffTotals
 System runoff stats structure. More...
 

Enumerations

enum  SM_ObjectType {
  SM_GAGE = 0, SM_SUBCATCH = 1, SM_NODE = 2, SM_LINK = 3,
  SM_POLLUT = 4, SM_LANDUSE = 5, SM_TIMEPATTERN = 6, SM_CURVE = 7,
  SM_TSERIES = 8, SM_CONTROL = 9, SM_TRANSECT = 10, SM_AQUIFER = 11,
  SM_UNITHYD = 12, SM_SNOWMELT = 13, SM_SHAPE = 14, SM_LID = 15
}
 Object type codes. More...
 
enum  SM_NodeType { SM_JUNCTION = 0, SM_OUTFALL = 1, SM_STORAGE = 2, SM_DIVIDER = 3 }
 Node object type codes. More...
 
enum  SM_LinkType {
  SM_CONDUIT = 0, SM_PUMP = 1, SM_ORIFICE = 2, SM_WEIR = 3,
  SM_OUTLET = 4
}
 Link object type codes. More...
 
enum  SM_TimePropety { SM_STARTDATE = 0, SM_ENDDATE = 1, SM_REPORTDATE = 2 }
 Simulation Option codes. More...
 
enum  SM_Units { SM_SYSTEMUNIT = 0, SM_FLOWUNIT = 1 }
 Simulation Unit Codes. More...
 
enum  SM_SimOption {
  SM_ALLOWPOND = 0, SM_SKIPSTEADY = 1, SM_IGNORERAIN = 2, SM_IGNORERDII = 3,
  SM_IGNORESNOW = 4, SM_IGNOREGW = 5, SM_IGNOREROUTE = 6, SM_IGNORERQUAL = 7
}
 Simulation Options. More...
 
enum  SM_SimSetting {
  SM_ROUTESTEP = 0, SM_MINROUTESTEP = 1, SM_LENGTHSTEP = 2, SM_STARTDRYDAYS = 3,
  SM_COURANTFACTOR = 4, SM_MINSURFAREA = 5, SM_MINSLOPE = 6, SM_RUNOFFERROR = 7,
  SM_GWERROR = 8, SM_FLOWERROR = 9, SM_QUALERROR = 10, SM_HEADTOL = 11,
  SM_SYSFLOWTOL = 12, SM_LATFLOWTOL = 13
}
 Simulation Settings. More...
 
enum  SM_NodeProperty {
  SM_INVERTEL = 0, SM_FULLDEPTH = 1, SM_SURCHDEPTH = 2, SM_PONDAREA = 3,
  SM_INITDEPTH = 4
}
 Node property codes. More...
 
enum  SM_LinkProperty {
  SM_OFFSET1 = 0, SM_OFFSET2 = 1, SM_INITFLOW = 2, SM_FLOWLIMIT = 3,
  SM_INLETLOSS = 4, SM_OUTLETLOSS = 5, SM_AVELOSS = 6
}
 Link property codes. More...
 
enum  SM_SubcProperty {
  SM_WIDTH = 0, SM_AREA = 1, SM_FRACIMPERV = 2, SM_SLOPE = 3,
  SM_CURBLEN = 4
}
 Subcatchment property codes. More...
 
enum  SM_NodeResult {
  SM_TOTALINFLOW = 0, SM_TOTALOUTFLOW = 1, SM_LOSSES = 2, SM_NODEVOL = 3,
  SM_NODEFLOOD = 4, SM_NODEDEPTH = 5, SM_NODEHEAD = 6, SM_LATINFLOW = 7
}
 Node result property codes. More...
 
enum  SM_LinkResult {
  SM_LINKFLOW = 0, SM_LINKDEPTH = 1, SM_LINKVOL = 2, SM_USSURFAREA = 3,
  SM_DSSURFAREA = 4, SM_SETTING = 5, SM_TARGETSETTING = 6, SM_FROUDE = 7
}
 Link result property codes. More...
 
enum  SM_SubcResult {
  SM_SUBCRAIN = 0, SM_SUBCEVAP = 1, SM_SUBCINFIL = 2, SM_SUBCRUNON = 3,
  SM_SUBCRUNOFF = 4, SM_SUBCSNOW = 5
}
 Subcatchment result property codes. More...
 
enum  SM_SubcPollut { SM_BUILDUP = 0, SM_CPONDED = 1 }
 Subcatchment pollutant result property codes. More...
 
enum  SM_GagePrecip { SM_TOTALPRECIP = 0, SM_RAINFALL = 1, SM_SNOWFALL = 2 }
 Gage precip array property codes. More...
 
enum  SM_LidLayer {
  SM_SURFACE = 0, SM_SOIL = 1, SM_STOR = 2, SM_PAVE = 3,
  SM_DRAIN = 4, SM_DRAINMAT = 5
}
 Lid control layer codes. More...
 
enum  SM_LidLayerProperty {
  SM_THICKNESS = 0, SM_VOIDFRAC = 1, SM_ROUGHNESS = 2, SM_SURFSLOPE = 3,
  SM_SIDESLOPE = 4, SM_ALPHA = 5, SM_POROSITY = 6, SM_FIELDCAP = 7,
  SM_WILTPOINT = 8, SM_SUCTION = 9, SM_KSAT = 10, SM_KSLOPE = 11,
  SM_CLOGFACTOR = 12, SM_IMPERVFRAC = 13, SM_COEFF = 14, SM_EXPON = 15,
  SM_OFFSET = 16, SM_DELAY = 17, SM_HOPEN = 18, SM_HCLOSE = 19,
  SM_QCURVE = 20, SM_REGENDAYS = 21, SM_REGENDEGREE = 22
}
 Lid control layer property codes. More...
 
enum  SM_LidUProperty {
  SM_UNITAREA = 0, SM_FWIDTH = 1, SM_BWIDTH = 2, SM_INITSAT = 3,
  SM_FROMIMPERV = 4, SM_FROMPERV = 5
}
 Lid unit property codes. More...
 
enum  SM_LidUOptions {
  SM_INDEX = 0, SM_NUMBER = 1, SM_TOPERV = 2, SM_DRAINSUB = 3,
  SM_DRAINNODE = 4
}
 Lid unit option codes. More...
 
enum  SM_LidResult {
  SM_INFLOW = 0, SM_EVAP = 1, SM_INFIL = 2, SM_SURFFLOW = 3,
  SM_DRAINFLOW = 4, SM_INITVOL = 5, SM_FINALVOL = 6, SM_SURFDEPTH = 7,
  SM_PAVEDEPTH = 8, SM_SOILMOIST = 9, SM_STORDEPTH = 10, SM_DRYTIME = 11,
  SM_OLDDRAINFLOW = 12, SM_NEWDRAINFLOW = 13, SM_PERVAREA = 14, SM_FLOWTOPERV = 15,
  SM_EVAPRATE = 16, SM_NATIVEINFIL = 17, SM_SURFINFLOW = 18, SM_SURFINFIL = 19,
  SM_SURFEVAP = 20, SM_SURFOUTFLOW = 21, SM_PAVEEVAP = 22, SM_PAVEPERC = 23,
  SM_SOILEVAP = 24, SM_SOILPERC = 25, SM_STORAGEINFLOW = 26, SM_STORAGEEXFIL = 27,
  SM_STORAGEEVAP = 28, SM_STORAGEDRAIN = 29
}
 Lid unit result codes. More...
 

Functions

void DLLEXPORT swmm_getAPIError (int errcode, char *s)
 Get the text of an error code. More...
 
int DLLEXPORT swmm_project_findObject (int type, char *id, int *index)
 Finds the index of an object given its ID. More...
 
int DLLEXPORT swmm_getSimulationUnit (int type, int *value)
 Gets Simulation Unit. More...
 
int DLLEXPORT swmm_getSimulationAnalysisSetting (int type, int *value)
 Gets Simulation Analysis Setting. More...
 
int DLLEXPORT swmm_getSimulationParam (int type, double *value)
 Gets Simulation Analysis Setting. More...
 
int DLLEXPORT swmm_countObjects (int type, int *count)
 Gets Object Count. More...
 
int DLLEXPORT swmm_getObjectId (int type, int index, char *id)
 Gets Object ID. More...
 
int DLLEXPORT swmm_getObjectIndex (SM_ObjectType type, char *id, int *index)
 Gets Object Index. More...
 
int DLLEXPORT swmm_getNodeType (int index, int *Ntype)
 Get the type of node with specified index. More...
 
int DLLEXPORT swmm_getLinkType (int index, int *Ltype)
 Get the type of link with specified index. More...
 
int DLLEXPORT swmm_getLinkConnections (int index, int *Node1, int *Node2)
 Get the link Connection Node Indeces. If the conduit has a negative slope, the dynamic wave solver will automatically reverse the nodes. To check the direction, call swmm_getLinkDirection(). More...
 
int DLLEXPORT swmm_getLinkDirection (int index, signed char *value)
 Get the link flow direction (see swmm_getLinkType() for notes. More...
 
int DLLEXPORT swmm_getSubcatchOutConnection (int index, int *type, int *out_index)
 Get the Subcatchment connection. Subcatchments can load to a node, another subcatchment, or itself. More...
 
int DLLEXPORT swmm_getLidUCount (int index, int *value)
 Get the number of lid units on a subcatchment. More...
 
int DLLEXPORT swmm_getLidUParam (int index, int lidIndex, int Param, double *value)
 Get a property value for a specified lid unit on a specified subcatchment. More...
 
int DLLEXPORT swmm_setLidUParam (int index, int lidIndex, int Param, double value)
 Set a property value for a specified lid unit on a specified subcatchment. More...
 
int DLLEXPORT swmm_getLidUOption (int index, int lidIndex, int Param, int *value)
 Get the lid option for a specified lid unit on a specified subcatchment. More...
 
int DLLEXPORT swmm_setLidUOption (int index, int lidIndex, int Param, int value)
 Set the lid option for a specified lid unit on a specified subcatchment. More...
 
int DLLEXPORT swmm_getLidCOverflow (int lidControlIndex, char *condition)
 Get the lid control surface immediate overflow condition. More...
 
int DLLEXPORT swmm_setLidCOverflow (int lidControlIndex, char condition)
 Set the lid control's surface immediate overflow condition. More...
 
int DLLEXPORT swmm_getLidCParam (int lidControlIndex, int layerIndex, int Param, double *value)
 Get a property value for specified lid control. More...
 
int DLLEXPORT swmm_setLidCParam (int lidControlIndex, int layerIndex, int Param, double value)
 Set a property value for specified lid control. More...
 
int DLLEXPORT swmm_getLidUFluxRates (int index, int lidIndex, int layerIndex, double *result)
 Get the lid unit water balance simulated value at current time. More...
 
int DLLEXPORT swmm_getLidGResult (int index, int type, double *result)
 Get the lid group of a specified subcatchment result at current time. More...
 
int DLLEXPORT swmm_getLidUResult (int index, int lidIndex, int type, double *result)
 Get the lid unit of a specified subcatchment result at current time. More...
 
int DLLEXPORT swmm_getNodeParam (int index, int Param, double *value)
 Get a property value for specified node. More...
 
int DLLEXPORT swmm_setNodeParam (int index, int Param, double value)
 Set a property value for specified node. More...
 
int DLLEXPORT swmm_getLinkParam (int index, int Param, double *value)
 Get a property value for specified link. More...
 
int DLLEXPORT swmm_setLinkParam (int index, int Param, double value)
 Set a property value for specified link. More...
 
int DLLEXPORT swmm_getSubcatchParam (int index, int Param, double *value)
 Get a property value for specified subcatchment. More...
 
int DLLEXPORT swmm_setSubcatchParam (int index, int Param, double value)
 Set a property value for specified subcatchment. More...
 
int DLLEXPORT swmm_getSimulationDateTime (int timetype, int *year, int *month, int *day, int *hour, int *minute, int *second)
 Get the current simulation datetime information. More...
 
int DLLEXPORT swmm_setSimulationDateTime (int timetype, char *dtimestr)
 Set simulation datetime information. More...
 
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_getSubcatchPollut (int index, int type, double **PollutArray)
 Gets pollutant values for a specified subcatchment. More...
 
int DLLEXPORT swmm_getGagePrecip (int index, double **GageArray)
 Get precipitation rates for a gage. 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_getSubcatchStats (int index, SM_SubcatchStats **subcatchStats)
 Get subcatchment 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...
 
int DLLEXPORT swmm_setGagePrecip (int index, double total_precip)
 Set a total precipitation intensity to the gage. More...
 
void DLLEXPORT freeArray (void **array)
 Helper function to free memory array allocated in SWMM. More...
 

Detailed Description

Exportable Functions for Toolkit API.

See also
http://github.com/openwateranalytics/stormwater-management-model

toolkitAPI.h

Date
08/30/2016 (First Contribution)
Authors
B. McDonnell (EmNet LLC), OpenWaterAnalytics members: see AUTHORS.

Definition in file toolkitAPI.h.

Enumeration Type Documentation

◆ SM_GagePrecip

Gage precip array property codes.

Enumerator
SM_TOTALPRECIP 

Total Precipitation Rate

SM_RAINFALL 

Rainfall Rate

SM_SNOWFALL 

Snowfall Rate

Definition at line 182 of file toolkitAPI.h.

◆ SM_LidLayer

Lid control layer codes.

Enumerator
SM_SURFACE 

Lid Surface Layer

SM_SOIL 

Lid Soil Layer

SM_STOR 

Lid Storage Layer

SM_PAVE 

Lid Pavement Layer

SM_DRAIN 

Lid Underdrain Layer

SM_DRAINMAT 

Lid Drainage Mat Layer

Definition at line 189 of file toolkitAPI.h.

◆ SM_LidLayerProperty

Lid control layer property codes.

Enumerator
SM_THICKNESS 

Storage Height

SM_VOIDFRAC 

Available Fraction of Storage Volume

SM_ROUGHNESS 

Manning n

SM_SURFSLOPE 

Surface Slope (fraction)

SM_SIDESLOPE 

Side Slope (run/rise)

SM_ALPHA 

Slope/Roughness Term in Manning Eqn

SM_POROSITY 

Void Volume / Total Volume

SM_FIELDCAP 

Field Capacity

SM_WILTPOINT 

Wilting Point

SM_SUCTION 

Suction Head at Wetting Front

SM_KSAT 

Saturated Hydraulic Conductivity

SM_KSLOPE 

Slope of Log(k) v. Moisture Content Curve

SM_CLOGFACTOR 

Clogging Factor

SM_IMPERVFRAC 

Impervious Area Fraction

SM_COEFF 

Underdrain Flow Coefficient

SM_EXPON 

Underdrain Head Exponent

SM_OFFSET 

Offset Height of Underdrain

SM_DELAY 

Rain Barrel Drain Delay Time

SM_HOPEN 

Head When Drain Opens

SM_HCLOSE 

Head When Drain Closes

SM_QCURVE 

Curve Controlling FLow Rate (Optional)

SM_REGENDAYS 

Clogging Regeneration Interval (Days)

SM_REGENDEGREE 

Degree of Clogging Regeneration

Definition at line 199 of file toolkitAPI.h.

◆ SM_LidResult

Lid unit result codes.

Enumerator
SM_INFLOW 

Total Inflow

SM_EVAP 

Total Evaporation

SM_INFIL 

Total Infiltration

SM_SURFFLOW 

Total Surface runoff

SM_DRAINFLOW 

Total Underdrain flow

SM_INITVOL 

Initial Stored Volume

SM_FINALVOL 

Final Stored Volume

SM_SURFDEPTH 

Depth of Ponded Water on Surface Layer

SM_PAVEDEPTH 

Depth of Water in Porous Pavement Layer

SM_SOILMOIST 

Moisture Content of Biocell Soil Layer

SM_STORDEPTH 

Depth of Water in Storage Layer

SM_DRYTIME 

Time Since Last Rainfall

SM_OLDDRAINFLOW 

Previous Drain Flow (unit and group)

SM_NEWDRAINFLOW 

Current Drain Flow (unit and group)

SM_PERVAREA 

Amount of Pervious Area (group)

SM_FLOWTOPERV 

Total Flow Sent to Pervious Area

SM_EVAPRATE 

Evaporate Rate

SM_NATIVEINFIL 

Native soil infil. rate limit

SM_SURFINFLOW 

Precip. + runon to LID unit

SM_SURFINFIL 

Infil. rate from surface layer

SM_SURFEVAP 

Evaporate rate from surface layer

SM_SURFOUTFLOW 

Outflow from surface layer

SM_PAVEEVAP 

Evaporation from pavement layer

SM_PAVEPERC 

Percolation from pavement layer

SM_SOILEVAP 

Evaporation from soil layer

SM_SOILPERC 

Percolation from soil layer

SM_STORAGEINFLOW 

Inflow rate to storage layer

SM_STORAGEEXFIL 

Exfilration rate from storage layer

SM_STORAGEEVAP 

Evaporation from storage layer

SM_STORAGEDRAIN 

Underdrain flow rate layer

Definition at line 245 of file toolkitAPI.h.

◆ SM_LidUOptions

Lid unit option codes.

Enumerator
SM_INDEX 

Lid Process Index

SM_NUMBER 

Number of Replicate Units

SM_TOPERV 

Outflow to Pervious Area

SM_DRAINSUB 

Subcatchment Recieving Drain Flow

SM_DRAINNODE 

Node Recieving Drain Flow

Definition at line 236 of file toolkitAPI.h.

◆ SM_LidUProperty

Lid unit property codes.

Enumerator
SM_UNITAREA 

Area of Single Replicate Unit

SM_FWIDTH 

Full Top Width of Single Unit

SM_BWIDTH 

Bottom Width of Single Unit

SM_INITSAT 

Initial Saturation of Soil and Storage Layer

SM_FROMIMPERV 

Fraction of Impervious Area Runoff Treated

SM_FROMPERV 

Fraction of Pervious Area Runoff Treated

Definition at line 226 of file toolkitAPI.h.

◆ SM_LinkProperty

Link property codes.

Enumerator
SM_OFFSET1 

Inlet Offset

SM_OFFSET2 

Outlet Offset

SM_INITFLOW 

Initial Flow Rate

SM_FLOWLIMIT 

Flow limit

SM_INLETLOSS 

Inlet Loss

SM_OUTLETLOSS 

Outles Loss

SM_AVELOSS 

Average Loss

Definition at line 122 of file toolkitAPI.h.

◆ SM_LinkResult

Link result property codes.

Enumerator
SM_LINKFLOW 

Flowrate

SM_LINKDEPTH 

Depth

SM_LINKVOL 

Volume

SM_USSURFAREA 

Upstream Surface Area

SM_DSSURFAREA 

Downstream Surface Area

SM_SETTING 

Setting

SM_TARGETSETTING 

Target Setting

SM_FROUDE 

Froude Number

Definition at line 154 of file toolkitAPI.h.

◆ SM_LinkType

Link object type codes.

Enumerator
SM_CONDUIT 

Conduit

SM_PUMP 

Pump

SM_ORIFICE 

Orifice

SM_WEIR 

Weir

SM_OUTLET 

Outlet

Definition at line 61 of file toolkitAPI.h.

◆ SM_NodeProperty

Node property codes.

Enumerator
SM_INVERTEL 

Invert Elevation

SM_FULLDEPTH 

Full Depth

SM_SURCHDEPTH 

Surcharge Depth

SM_PONDAREA 

Ponding Area

SM_INITDEPTH 

Initial Depth

Definition at line 113 of file toolkitAPI.h.

◆ SM_NodeResult

Node result property codes.

Enumerator
SM_TOTALINFLOW 

Total Inflow

SM_TOTALOUTFLOW 

Total Outflow

SM_LOSSES 

Node Losses

SM_NODEVOL 

Stored Volume

SM_NODEFLOOD 

Flooding Rate

SM_NODEDEPTH 

Node Depth

SM_NODEHEAD 

Node Head

SM_LATINFLOW 

Lateral Inflow Rate

Definition at line 142 of file toolkitAPI.h.

◆ SM_NodeType

Node object type codes.

Enumerator
SM_JUNCTION 

Manhole Junction

SM_OUTFALL 

Outfall

SM_STORAGE 

Storage

SM_DIVIDER 

Divider

Definition at line 53 of file toolkitAPI.h.

◆ SM_ObjectType

Object type codes.

Enumerator
SM_GAGE 

Rain gage

SM_SUBCATCH 

Subcatchment

SM_NODE 

Conveyance system node

SM_LINK 

Conveyance system link

SM_POLLUT 

Pollutant

SM_LANDUSE 

Land use category

SM_TIMEPATTERN 

Dry weather flow time pattern

SM_CURVE 

Generic table of values

SM_TSERIES 

Generic time series of values

SM_CONTROL 

Conveyance system control rules

SM_TRANSECT 

Irregular channel cross-section

SM_AQUIFER 

Groundwater aquifer

SM_UNITHYD 

RDII unit hydrograph

SM_SNOWMELT 

Snowmelt parameter set

SM_SHAPE 

Custom conduit shape

SM_LID 

LID treatment units

Definition at line 33 of file toolkitAPI.h.

◆ SM_SimOption

Simulation Options.

Enumerator
SM_ALLOWPOND 

Allow Ponding

SM_SKIPSTEADY 

Skip Steady State

SM_IGNORERAIN 

Ignore Rainfall

SM_IGNORERDII 

Ignore RDII

SM_IGNORESNOW 

Ignore Snowmelt

SM_IGNOREGW 

Ignore Groundwater

SM_IGNOREROUTE 

Ignore Routing

SM_IGNORERQUAL 

Ignore Quality

Definition at line 83 of file toolkitAPI.h.

◆ SM_SimSetting

Simulation Settings.

Enumerator
SM_ROUTESTEP 

Routing Step (sec)

SM_MINROUTESTEP 

Minimum Routing Step (sec)

SM_LENGTHSTEP 

Lengthening Step (sec)

SM_STARTDRYDAYS 

Antecedent dry days

SM_COURANTFACTOR 

Courant time step factor

SM_MINSURFAREA 

Minimum nodal surface area

SM_MINSLOPE 

Minimum conduit slope

SM_RUNOFFERROR 

Runoff continuity error

SM_GWERROR 

Groundwater continuity error

SM_FLOWERROR 

Flow routing error

SM_QUALERROR 

Quality routing error

SM_HEADTOL 

DW routing head tolerance (ft)

SM_SYSFLOWTOL 

Tolerance for steady system flow

SM_LATFLOWTOL 

Tolerance for steady nodal inflow

Definition at line 95 of file toolkitAPI.h.

◆ SM_SubcPollut

Subcatchment pollutant result property codes.

Enumerator
SM_BUILDUP 

Pollutant Buildup Load

SM_CPONDED 

Ponded Pollutant Concentration

Definition at line 176 of file toolkitAPI.h.

◆ SM_SubcProperty

Subcatchment property codes.

Enumerator
SM_WIDTH 

Width

SM_AREA 

Area

SM_FRACIMPERV 

Impervious Fraction

SM_SLOPE 

Slope

SM_CURBLEN 

Curb Length

Definition at line 133 of file toolkitAPI.h.

◆ SM_SubcResult

Subcatchment result property codes.

Enumerator
SM_SUBCRAIN 

Rainfall Rate

SM_SUBCEVAP 

Evaporation Loss

SM_SUBCINFIL 

Infiltration Loss

SM_SUBCRUNON 

Runon Rate

SM_SUBCRUNOFF 

Runoff Rate

SM_SUBCSNOW 

Snow Depth

Definition at line 166 of file toolkitAPI.h.

◆ SM_TimePropety

Simulation Option codes.

Enumerator
SM_STARTDATE 

Simulation Start Date

SM_ENDDATE 

Simulation End Date

SM_REPORTDATE 

Simulation Report Start Date

Definition at line 70 of file toolkitAPI.h.

◆ SM_Units

enum SM_Units

Simulation Unit Codes.

Enumerator
SM_SYSTEMUNIT 

System Units

SM_FLOWUNIT 

Flow Units

Definition at line 77 of file toolkitAPI.h.

Function Documentation

◆ freeArray()

void DLLEXPORT freeArray ( void **  array)

Helper function to free memory array allocated in SWMM.

Parameters
arrayThe pointer to the array
Returns
Void.

Helper function used to free array allocated memory by API.

Definition at line 2502 of file toolkitAPI.c.

◆ swmm_getGagePrecip()

int DLLEXPORT swmm_getGagePrecip ( int  index,
double **  GageArray 
)

Get precipitation rates for a gage.

Parameters
indexThe index of gage
[out]GageArrayprecipitation rates array [total, rainfall, snowfall]
Returns
Error code

Input: index = Index of desired ID Output: GageArray pointer (three elements) Return: API Error Purpose: Gets the precipitation value in the gage.

Definition at line 1741 of file toolkitAPI.c.

◆ swmm_getLidCOverflow()

int DLLEXPORT swmm_getLidCOverflow ( int  lidControlIndex,
char *  condition 
)

Get the lid control surface immediate overflow condition.

Parameters
lidControlIndexThe index of specified lid control
[out]conditionThe value of surface immediate overflow condition
Returns
Error code

Definition at line 1089 of file toolkitAPI.c.

◆ swmm_getLidCParam()

int DLLEXPORT swmm_getLidCParam ( int  lidControlIndex,
int  layerIndex,
int  Param,
double *  value 
)

Get a property value for specified lid control.

Parameters
lidControlIndexThe index of specified lid control
layerIndexThe index of specified lid layer (See SM_LidLayer)
ParamThe property type code (See SM_LidLayerProperty)
[out]valueThe value of lid control's property
Returns
Error code

Definition at line 1121 of file toolkitAPI.c.

◆ swmm_getLidGResult()

int DLLEXPORT swmm_getLidGResult ( int  index,
int  type,
double *  result 
)

Get the lid group of a specified subcatchment result at current time.

Parameters
indexThe index of a subcatchment
typeThe result type code (See SM_LidResult)
[out]resultThe result for the specified lid group
Returns
Error code

Definition at line 2160 of file toolkitAPI.c.

◆ swmm_getLidUCount()

int DLLEXPORT swmm_getLidUCount ( int  index,
int *  value 
)

Get the number of lid units on a subcatchment.

Parameters
indexThe index of a subcatchment
[out]valueThe number of lid units on a subcatchment
Returns
Error code

Definition at line 824 of file toolkitAPI.c.

◆ swmm_getLidUFluxRates()

int DLLEXPORT swmm_getLidUFluxRates ( int  index,
int  lidIndex,
int  layerIndex,
double *  result 
)

Get the lid unit water balance simulated value at current time.

Parameters
indexThe index of a subcatchment
lidIndexThe index of specified lid unit
layerIndexThe index of specified lid layer (See SM_LidLayer)
ParamThe result type code (See SM_LidResult)
[out]resultThe result for the specified lid unit
Returns
Error code

Definition at line 2109 of file toolkitAPI.c.

◆ swmm_getLidUOption()

int DLLEXPORT swmm_getLidUOption ( int  index,
int  lidIndex,
int  Param,
int *  value 
)

Get the lid option for a specified lid unit on a specified subcatchment.

Parameters
indexThe index of a subcatchment
lidIndexThe index of specified lid unit
ParamThe lid option type code (See SM_LidUOptions)
[out]valueThe value of the option for the lid unit
Returns
Error code

Definition at line 970 of file toolkitAPI.c.

◆ swmm_getLidUParam()

int DLLEXPORT swmm_getLidUParam ( int  index,
int  lidIndex,
int  Param,
double *  value 
)

Get a property value for a specified lid unit on a specified subcatchment.

Parameters
indexThe index of a subcatchment
lidIndexThe index of specified lid unit
ParamThe property type code (See SM_LidUProperty)
[out]valueThe value of the lid unit's property
Returns
Error code

Definition at line 851 of file toolkitAPI.c.

◆ swmm_getLidUResult()

int DLLEXPORT swmm_getLidUResult ( int  index,
int  lidIndex,
int  type,
double *  result 
)

Get the lid unit of a specified subcatchment result at current time.

Parameters
indexThe index of a subcatchment
lidIndexThe index of specified lid unit
typeThe result type code (See SM_LidResult)
[out]resultThe result for the specified lid unit
Returns
Error code

Definition at line 2209 of file toolkitAPI.c.

◆ swmm_getObjectIndex()

int DLLEXPORT swmm_getObjectIndex ( SM_ObjectType  type,
char *  id,
int *  index 
)

Gets Object Index.

Parameters
typeOption code (see SM_ObjectType)
[in]idof the Object
[out]indexof the Object
Returns
errcode Error Code

Input: type = object type (Based on SM_ObjectType enum) char* = ID name Output: object index Return: error Purpose: Gets object id index

Definition at line 310 of file toolkitAPI.c.

◆ swmm_getSubcatchPollut()

int DLLEXPORT swmm_getSubcatchPollut ( int  index,
int  type,
double **  PollutArray 
)

Gets pollutant values for a specified subcatchment.

Parameters
indexThe index of a subcatchment
typeThe property type code (see SM_SubcPollut)
[out]PollutArrayresult array
Returns
Error code

Input: index = Index of desired ID type = Result Type (SM_SubcPollut) Output: PollutArray pointer (pollutant data desired, byref) Return: API Error Purpose: Gets Subcatchment Simulated Pollutant Value at Current Time

Definition at line 1687 of file toolkitAPI.c.

◆ swmm_getSubcatchStats()

int DLLEXPORT swmm_getSubcatchStats ( int  index,
SM_SubcatchStats **  subcatchStats 
)

Get subcatchment statistics.

Parameters
indexThe index of a subcatchment
[out]subcatchStatsThe link Stats struct (see SM_SubcatchStats). pre-allocated by the caller. Caller is also responsible for freeing the SM_SubcatchStats structure using swmm_freeSubcatchStats(). This frees any pollutants array.
Returns
Error code

Output: Subcatchment Stats Structure (SM_SubcatchStats) Return: API Error Purpose: Gets Subcatchment Stats and Converts Units

Definition at line 1981 of file toolkitAPI.c.

◆ swmm_project_findObject()

int DLLEXPORT swmm_project_findObject ( int  type,
char *  id,
int *  index 
)

Finds the index of an object given its ID.

Parameters
typeAn object type
idThe object ID
[out]indexThe objects index
Returns
Error code

Definition at line 54 of file toolkitAPI.c.

◆ swmm_setGagePrecip()

int DLLEXPORT swmm_setGagePrecip ( int  index,
double  total_precip 
)

Set a total precipitation intensity to the gage.

Parameters
indexThe gage index.
total_precipThe new total precipitation intensity.
Returns
Error code

Input: index = Index of desired ID total_precip = rainfall intensity to be set Return: API Error Purpose: Sets the precipitation in from the external database

Definition at line 2451 of file toolkitAPI.c.

◆ swmm_setLidCOverflow()

int DLLEXPORT swmm_setLidCOverflow ( int  lidControlIndex,
char  condition 
)

Set the lid control's surface immediate overflow condition.

Parameters
lidControlIndexThe index of specified lid control
conditionThe new value for the surface immediate overflow condition
Returns
Error code

◆ swmm_setLidCParam()

int DLLEXPORT swmm_setLidCParam ( int  lidControlIndex,
int  layerIndex,
int  Param,
double  value 
)

Set a property value for specified lid control.

Parameters
lidControlIndexThe index of specified lid control
layerIndexThe index of specified lid layer (See SM_LidLayer)
ParamThe property type code (See SM_LidLayerProperty)
valueThe new value for the lid control's property
Returns
Error code

Definition at line 1304 of file toolkitAPI.c.

◆ swmm_setLidUOption()

int DLLEXPORT swmm_setLidUOption ( int  index,
int  lidIndex,
int  Param,
int  value 
)

Set the lid option for a specified lid unit on a specified subcatchment.

Parameters
indexThe index of a subcatchment
lidIndexThe index of specified lid unit
ParamThe lid option type code (See SM_LidUOptions)
valueThe new value of the option for the lid unit
Returns
Error code

Definition at line 1022 of file toolkitAPI.c.

◆ swmm_setLidUParam()

int DLLEXPORT swmm_setLidUParam ( int  index,
int  lidIndex,
int  Param,
double  value 
)

Set a property value for a specified lid unit on a specified subcatchment.

Parameters
indexThe index of a subcatchment
lidIndexThe index of specified lid unit
ParamThe property type code (See SM_LidUProperty)
valueThe new value of the lid unit's property
Returns
Error code

Definition at line 905 of file toolkitAPI.c.