SWMM  5.2.0
Documentation
Loading...
Searching...
No Matches
swmm5.h File Reference

Prototypes for SWMM5 API functions. More...

#include "swmm5_export.h"
Include dependency graph for swmm5.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef void(* progress_callback) (double progress)
 Callback function for progress reporting.
 

Enumerations

enum  swmm_Object {
  swmm_GAGE ,
  swmm_SUBCATCH ,
  swmm_NODE ,
  swmm_LINK ,
  swmm_POLLUTANT ,
  swmm_LANDUSE ,
  swmm_TIME_PATTERN ,
  swmm_CURVE ,
  swmm_TIMESERIES ,
  swmm_CONTROL_RULE ,
  swmm_TRANSECT ,
  swmm_AQUIFER ,
  swmm_UNIT_HYDROGRAPH ,
  swmm_SNOWPACK ,
  smmm_XSECTION_SHAPE ,
  swmm_LID ,
  swmm_STREET ,
  swmm_INLET ,
  swmm_SYSTEM = 100
}
 Enumeration of object types used in SWMM5. More...
 
enum  swmm_NodeType {
  swmm_JUNCTION = 0 ,
  swmm_OUTFALL = 1 ,
  swmm_STORAGE = 2 ,
  swmm_DIVIDER = 3
}
 Enumeration of node types used in SWMM5. More...
 
enum  swmm_LinkType {
  swmm_CONDUIT = 0 ,
  swmm_PUMP = 1 ,
  swmm_ORIFICE = 2 ,
  swmm_WEIR = 3 ,
  swmm_OUTLET = 4
}
 Enumeration of link types used in SWMM5. More...
 
enum  swmm_GageProperty {
  swmm_GAGE_TOTAL_PRECIPITATION = 100 ,
  swmm_GAGE_RAINFALL = 101 ,
  swmm_GAGE_SNOWFALL = 102
}
 Enumeration of gage properties used in SWMM5. More...
 
enum  swmm_SubcatchProperty {
  swmm_SUBCATCH_AREA = 200 ,
  swmm_SUBCATCH_RAINGAGE = 201 ,
  swmm_SUBCATCH_RAINFALL = 202 ,
  swmm_SUBCATCH_EVAP = 203 ,
  swmm_SUBCATCH_INFIL = 204 ,
  swmm_SUBCATCH_RUNOFF = 205 ,
  swmm_SUBCATCH_RPTFLAG = 206 ,
  swmm_SUBCATCH_WIDTH = 207 ,
  swmm_SUBCATCH_SLOPE = 208 ,
  swmm_SUBCATCH_CURB_LENGTH = 209 ,
  swmm_SUBCATCH_API_RAINFALL = 210 ,
  swmm_SUBCATCH_API_SNOWFALL = 211 ,
  swmm_SUBCATCH_POLLUTANT_BUILDUP = 212 ,
  swmm_SUBCATCH_EXTERNAL_POLLUTANT_BUILDUP = 213 ,
  swmm_SUBCATCH_POLLUTANT_RUNOFF_CONCENTRATION = 214 ,
  swmm_SUBCATCH_POLLUTANT_PONDED_CONCENTRATION = 215 ,
  swmm_SUBCATCH_POLLUTANT_TOTAL_LOAD = 216
}
 Enumeration of subcatchment properties used in SWMM5. More...
 
enum  swmm_NodeProperty {
  swmm_NODE_TYPE = 300 ,
  swmm_NODE_ELEV = 301 ,
  swmm_NODE_MAXDEPTH = 302 ,
  swmm_NODE_DEPTH = 303 ,
  swmm_NODE_HEAD = 304 ,
  swmm_NODE_VOLUME = 305 ,
  swmm_NODE_LATFLOW = 306 ,
  swmm_NODE_INFLOW = 307 ,
  swmm_NODE_OVERFLOW = 308 ,
  swmm_NODE_RPTFLAG = 309 ,
  swmm_NODE_SURCHARGE_DEPTH = 310 ,
  swmm_NODE_PONDED_AREA = 311 ,
  swmm_NODE_INITIAL_DEPTH = 312 ,
  swmm_NODE_POLLUTANT_CONCENTRATION = 313 ,
  swmm_NODE_POLLUTANT_LATMASS_FLUX = 314
}
 Enumeration of node properties used in SWMM5. More...
 
enum  swmm_LinkProperty {
  swmm_LINK_TYPE = 400 ,
  swmm_LINK_NODE1 = 401 ,
  swmm_LINK_NODE2 = 402 ,
  swmm_LINK_LENGTH = 403 ,
  swmm_LINK_SLOPE = 404 ,
  swmm_LINK_FULLDEPTH = 405 ,
  swmm_LINK_FULLFLOW = 406 ,
  swmm_LINK_SETTING = 407 ,
  swmm_LINK_TIMEOPEN = 408 ,
  swmm_LINK_TIMECLOSED = 409 ,
  swmm_LINK_FLOW = 410 ,
  swmm_LINK_DEPTH = 411 ,
  swmm_LINK_VELOCITY = 412 ,
  swmm_LINK_TOPWIDTH = 413 ,
  swmm_LINK_VOLUME = 414 ,
  swmm_LINK_CAPACITY = 415 ,
  swmm_LINK_RPTFLAG = 416 ,
  swmm_LINK_OFFSET1 = 417 ,
  swmm_LINK_OFFSET2 = 418 ,
  swmm_LINK_INITIAL_FLOW = 419 ,
  swmm_LINK_FLOW_LIMIT = 420 ,
  swmm_LINK_INLET_LOSS = 421 ,
  swmm_LINK_OUTLET_LOSS = 422 ,
  swmm_LINK_AVERAGE_LOSS = 423 ,
  swmm_LINK_SEEPAGE_RATE = 424 ,
  swmm_LINK_HAS_FLAPGATE = 425 ,
  swmm_LINK_POLLUTANT_CONCENTRATION = 426 ,
  swmm_LINK_POLLUTANT_LOAD = 427 ,
  swmm_LINK_POLLUTANT_LATMASS_FLUX = 428
}
 Enumeration of link properties used in SWMM5. More...
 
enum  swmm_SystemProperty {
  swmm_STARTDATE = 0 ,
  swmm_CURRENTDATE = 1 ,
  swmm_ELAPSEDTIME = 2 ,
  swmm_ROUTESTEP = 3 ,
  swmm_MAXROUTESTEP = 4 ,
  swmm_REPORTSTEP = 5 ,
  swmm_TOTALSTEPS = 6 ,
  swmm_NOREPORT = 7 ,
  swmm_FLOWUNITS = 8 ,
  swmm_ENDDATE = 9 ,
  swmm_REPORTSTART = 10 ,
  swmm_UNITSYSTEM = 11 ,
  swmm_SURCHARGEMETHOD = 12 ,
  swmm_ALLOWPONDING = 13 ,
  swmm_INERTIADAMPING = 14 ,
  swmm_NORMALFLOWLTD = 15 ,
  swmm_SKIPSTEADYSTATE = 16 ,
  swmm_IGNORERAINFALL = 17 ,
  swmm_IGNORERDII = 18 ,
  swmm_IGNORESNOWMELT = 19 ,
  swmm_IGNOREGROUNDWATER = 20 ,
  swmm_IGNOREROUTING = 21 ,
  swmm_IGNOREQUALITY = 22 ,
  swmm_ERROR_CODE = 23 ,
  swmm_RULESTEP = 24 ,
  swmm_SWEEPSTART = 25 ,
  swmm_SWEEPEND = 26 ,
  swmm_MAXTRIALS = 27 ,
  swmm_NUMTHREADS = 28 ,
  swmm_MINROUTESTEP = 29 ,
  swmm_LENGTHENINGSTEP = 30 ,
  swmm_STARTDRYDAYS = 31 ,
  swmm_COURANTFACTOR = 32 ,
  swmm_MINSURFAREA = 33 ,
  swmm_MINSLOPE = 34 ,
  swmm_RUNOFFERROR = 35 ,
  swmm_FLOWERROR = 36 ,
  swmm_QUALERROR = 37 ,
  swmm_HEADTOL = 38 ,
  swmm_SYSFLOWTOL = 39 ,
  swmm_LATFLOWTOL = 40
}
 Enumeration of system properties used in SWMM5. More...
 
enum  swmm_FlowUnitsProperty {
  swmm_CFS = 0 ,
  swmm_GPM = 1 ,
  swmm_MGD = 2 ,
  swmm_CMS = 3 ,
  swmm_LPS = 4 ,
  swmm_MLD = 5
}
 Enumeration of flow units used in SWMM5. More...
 
enum  swmm_API_Errors {
  ERR_API_NOT_OPEN = -999901 ,
  ERR_API_NOT_STARTED = -999902 ,
  ERR_API_NOT_ENDED = -999903 ,
  ERR_API_OBJECT_TYPE = -999904 ,
  ERR_API_OBJECT_INDEX = -999905 ,
  ERR_API_OBJECT_NAME = -999906 ,
  ERR_API_PROPERTY_TYPE = -999907 ,
  ERR_API_PROPERTY_VALUE = -999908 ,
  ERR_API_TIME_PERIOD = -999909 ,
  ERR_API_HOTSTART_FILE_OPEN = -999910 ,
  ERR_API_HOTSTART_FILE_FORMAT = -999911 ,
  ERR_API_IS_RUNNING = -999912
}
 Enumeration of API errors used in SWMM5. More...
 

Functions

int EXPORT_SWMM_SOLVER_API swmm_run (const char *inputFile, const char *reportFile, const char *outputFile)
 Run a SWMM simulation with the given input file, report file, and output file.
 
int EXPORT_SWMM_SOLVER_API swmm_run_with_callback (const char *inputFile, const char *reportFile, const char *outputFile, progress_callback callback)
 Run a SWMM simulation with the given input file, report file, and output file with a progress callback.
 
int EXPORT_SWMM_SOLVER_API swmm_open (const char *inputFile, const char *reportFile, const char *outputFile)
 Open a SWMM simulation with the given input file, report file, and output file.
 
int EXPORT_SWMM_SOLVER_API swmm_start (int saveFlag)
 Start a SWMM simulation with the given save flag.
 
int EXPORT_SWMM_SOLVER_API swmm_step (double *elapsedTime)
 Perform a SWMM simulation step and return the elapsed time.
 
int EXPORT_SWMM_SOLVER_API swmm_stride (int strideStep, double *elapsedTime)
 Perform a SWMM simulation step with a stride step and return the elapsed time.
 
int EXPORT_SWMM_SOLVER_API swmm_useHotStart (const char *hotStartFile)
 Set hotstart file for SWMM simulation.
 
int EXPORT_SWMM_SOLVER_API swmm_saveHotStart (const char *hotStartFile)
 Save hotstart file for SWMM simulation at current time.
 
int EXPORT_SWMM_SOLVER_API swmm_end (void)
 End a SWMM simulation.
 
int EXPORT_SWMM_SOLVER_API swmm_report (void)
 Writes simulation results to the report file.
 
int EXPORT_SWMM_SOLVER_API swmm_close (void)
 Close a SWMM simulation.
 
int EXPORT_SWMM_SOLVER_API swmm_getMassBalErr (float *runoffErr, float *flowErr, float *qualErr)
 Get the mass balance errors for a SWMM simulation.
 
int EXPORT_SWMM_SOLVER_API swmm_getVersion (void)
 Get the version of the SWMM engine.
 
int EXPORT_SWMM_SOLVER_API swmm_getError (char *errMsg, int msgLen)
 Retrieves the code number and text of the error condition that caused SWMM to abort its analysis.
 
int EXPORT_SWMM_SOLVER_API swmm_getErrorFromCode (int error_code, char *outErrMsg[1024])
 Retrieves the text of the error message that corresponds to the error code number.
 
int EXPORT_SWMM_SOLVER_API swmm_getWarnings (void)
 Gets the number of warnings issued during a simulation.
 
int EXPORT_SWMM_SOLVER_API swmm_getCount (int objType)
 Retrieves the number of objects of a specific type.
 
int EXPORT_SWMM_SOLVER_API swmm_getName (int objType, int index, char *name, int size)
 Retrieves the ID name of an object.
 
int EXPORT_SWMM_SOLVER_API swmm_getIndex (int objType, const char *name)
 Retrieves the index of a named object.
 
double EXPORT_SWMM_SOLVER_API swmm_getValue (int property, int index)
 Get the value of a property for an object of a given property in the SWMM model.
 
double EXPORT_SWMM_SOLVER_API swmm_getValueExpanded (int objType, int property, int index, int subIndex)
 Get the value of a property for an object given property, index, and subindex in the SWMM model.
 
int EXPORT_SWMM_SOLVER_API swmm_setValue (int property, int index, double value)
 Set the value of a property for an object of a given property and index in the SWMM model.
 
int EXPORT_SWMM_SOLVER_API swmm_setValueExpanded (int objType, int property, int index, int subIndex, double value)
 Set the value of a property for an object given property, index, and subindex in the SWMM model.
 
double EXPORT_SWMM_SOLVER_API swmm_getSavedValue (int property, int index, int period)
 Get saved value of.
 
void EXPORT_SWMM_SOLVER_API swmm_writeLine (const char *line)
 Write a line of text to the SWMM report file.
 
void EXPORT_SWMM_SOLVER_API swmm_decodeDate (double date, int *year, int *month, int *day, int *hour, int *minute, int *second, int *dayOfWeek)
 Decode double date value into year, month, day, hour, minute, second, and day of week.
 
double EXPORT_SWMM_SOLVER_API swmm_encodeDate (int year, int month, int day, int hour, int minute, int second)
 Encode date values into a double date value.
 

Detailed Description

Prototypes for SWMM5 API functions.

Author
L. Rossman
Date
Created on: 2021-11-01
Last edited on: 2024-12-23 (Build 5.3.0)

This file contains the prototypes for SWMM5 API functions.

Update History

  • Build 5.3.0:
    • Added new functions to support saving hotstart files at specific times.
    • Expansions to the SWMM API to include attributes of more objects and water quality.

Typedef Documentation

◆ progress_callback

progress_callback

Callback function for progress reporting.

Parameters
[in]progressProgress value between 0 and 1

Enumeration Type Documentation

◆ swmm_API_Errors

Enumeration of API errors used in SWMM5.

Enumerator
ERR_API_NOT_OPEN 

API error for file not opened.

ERR_API_NOT_STARTED 

API error for API not started.

ERR_API_NOT_ENDED 

API error for API not ended.

ERR_API_OBJECT_TYPE 

API error for errorneous object type.

ERR_API_OBJECT_INDEX 

API error for errorneous object index.

ERR_API_OBJECT_NAME 

API error for errorneous object name.

ERR_API_PROPERTY_TYPE 

API error for errorneous property type.

ERR_API_PROPERTY_VALUE 

API error for errorneous property value.

ERR_API_TIME_PERIOD 

API error for errorneous time period.

ERR_API_HOTSTART_FILE_OPEN 

API error for errorneous hotstart file open.

ERR_API_HOTSTART_FILE_FORMAT 

API error for errorneous hotstart file format.

ERR_API_IS_RUNNING 

API error for API already running.

◆ swmm_FlowUnitsProperty

Enumeration of flow units used in SWMM5.

Enumerator
swmm_CFS 

Cubic feet per second.

swmm_GPM 

Gallons per minute.

swmm_MGD 

Million gallons per day.

swmm_CMS 

Cubic meters per second.

swmm_LPS 

Liters per second.

swmm_MLD 

Million liters per day.

◆ swmm_GageProperty

Enumeration of gage properties used in SWMM5.

Enumerator
swmm_GAGE_TOTAL_PRECIPITATION 

Total precipitation.

swmm_GAGE_RAINFALL 

Rainfall.

swmm_GAGE_SNOWFALL 

Snowfall.

◆ swmm_LinkProperty

Enumeration of link properties used in SWMM5.

Enumerator
swmm_LINK_TYPE 

Link type.

swmm_LINK_NODE1 

Upstream node.

swmm_LINK_NODE2 

Downstream node.

swmm_LINK_LENGTH 

Length.

swmm_LINK_SLOPE 

Slope.

swmm_LINK_FULLDEPTH 

Full depth.

swmm_LINK_FULLFLOW 

Full flow.

swmm_LINK_SETTING 

Setting.

swmm_LINK_TIMEOPEN 

Time open.

swmm_LINK_TIMECLOSED 

Time closed.

swmm_LINK_FLOW 

Flow.

swmm_LINK_DEPTH 

Depth.

swmm_LINK_VELOCITY 

Velocity.

swmm_LINK_TOPWIDTH 

Top width.

swmm_LINK_VOLUME 

Volume.

swmm_LINK_CAPACITY 

Capacity.

swmm_LINK_RPTFLAG 

Report flag.

swmm_LINK_OFFSET1 

Upstream invert offset.

swmm_LINK_OFFSET2 

Downstream invert offset.

swmm_LINK_INITIAL_FLOW 

Initial flow.

swmm_LINK_FLOW_LIMIT 

Flow limit.

swmm_LINK_INLET_LOSS 

Inlet loss.

swmm_LINK_OUTLET_LOSS 

Outlet loss.

swmm_LINK_AVERAGE_LOSS 

Average loss.

swmm_LINK_SEEPAGE_RATE 

Seepage rate.

swmm_LINK_HAS_FLAPGATE 

Flap gate.

swmm_LINK_POLLUTANT_CONCENTRATION 

Pollutant concentration.

swmm_LINK_POLLUTANT_LOAD 

Pollutant load.

swmm_LINK_POLLUTANT_LATMASS_FLUX 

Pollutant lateral mass flux.

◆ swmm_LinkType

Enumeration of link types used in SWMM5.

Enumerator
swmm_CONDUIT 

Conduit link.

swmm_PUMP 

Pump link.

swmm_ORIFICE 

Orifice link.

swmm_WEIR 

Weir link.

swmm_OUTLET 

Outlet link.

◆ swmm_NodeProperty

Enumeration of node properties used in SWMM5.

Enumerator
swmm_NODE_TYPE 

Node type.

swmm_NODE_ELEV 

Elevation.

swmm_NODE_MAXDEPTH 

Maximum depth.

swmm_NODE_DEPTH 

Depth.

swmm_NODE_HEAD 

Hydraulic head.

swmm_NODE_VOLUME 

Volume.

swmm_NODE_LATFLOW 

Lateral inflow.

swmm_NODE_INFLOW 

Inflow.

swmm_NODE_OVERFLOW 

Overflow.

swmm_NODE_RPTFLAG 

Report flag.

swmm_NODE_SURCHARGE_DEPTH 

Surcharge depth.

swmm_NODE_PONDED_AREA 

Ponded area.

swmm_NODE_INITIAL_DEPTH 

Initial depth.

swmm_NODE_POLLUTANT_CONCENTRATION 

Pollutant concentration.

swmm_NODE_POLLUTANT_LATMASS_FLUX 

Pollutant lateral mass flux inflow.

◆ swmm_NodeType

Enumeration of node types used in SWMM5.

Enumerator
swmm_JUNCTION 

Junction node.

swmm_OUTFALL 

Outfall node.

swmm_STORAGE 

Storage node.

swmm_DIVIDER 

Divider node.

◆ swmm_Object

Enumeration of object types used in SWMM5.

Enumerator
swmm_GAGE 

Rain gages.

swmm_SUBCATCH 

Subcatchments.

swmm_NODE 

Nodes.

swmm_LINK 

Links.

swmm_POLLUTANT 

Pollutants.

swmm_LANDUSE 

Land uses.

swmm_TIME_PATTERN 

Time patterns.

swmm_CURVE 

Curve functions.

swmm_TIMESERIES 

Time series.

swmm_CONTROL_RULE 

Control rules.

swmm_TRANSECT 

Transects.

swmm_AQUIFER 

Aquifers.

swmm_UNIT_HYDROGRAPH 

Unit hydrographs.

swmm_SNOWPACK 

Snow packs.

smmm_XSECTION_SHAPE 

Cross section shape.

swmm_LID 

Low impact development units.

swmm_STREET 

Street.

swmm_INLET 

Inlet.

swmm_SYSTEM 

System.

◆ swmm_SubcatchProperty

Enumeration of subcatchment properties used in SWMM5.

Enumerator
swmm_SUBCATCH_AREA 

Area.

swmm_SUBCATCH_RAINGAGE 

Rain gage.

swmm_SUBCATCH_RAINFALL 

Rainfall.

swmm_SUBCATCH_EVAP 

Evaporation.

swmm_SUBCATCH_INFIL 

Infiltration.

swmm_SUBCATCH_RUNOFF 

Runoff.

swmm_SUBCATCH_RPTFLAG 

Report flag.

swmm_SUBCATCH_WIDTH 

Width.

swmm_SUBCATCH_SLOPE 

Slope.

swmm_SUBCATCH_CURB_LENGTH 

Curb length.

swmm_SUBCATCH_API_RAINFALL 

API provided rainfall.

swmm_SUBCATCH_API_SNOWFALL 

API provided snowfall.

swmm_SUBCATCH_POLLUTANT_BUILDUP 

Pollutant buildup.

swmm_SUBCATCH_EXTERNAL_POLLUTANT_BUILDUP 

External pollutant buildup.

swmm_SUBCATCH_POLLUTANT_RUNOFF_CONCENTRATION 

Runoff concentration.

swmm_SUBCATCH_POLLUTANT_PONDED_CONCENTRATION 

Ponded concentration.

swmm_SUBCATCH_POLLUTANT_TOTAL_LOAD 

Total pollutant load.

◆ swmm_SystemProperty

Enumeration of system properties used in SWMM5.

Enumerator
swmm_STARTDATE 

Start date.

swmm_CURRENTDATE 

Current date.

swmm_ELAPSEDTIME 

Elapsed time.

swmm_ROUTESTEP 

Routing step.

swmm_MAXROUTESTEP 

Maximum routing step.

swmm_REPORTSTEP 

Reporting step.

swmm_TOTALSTEPS 

Total steps.

swmm_NOREPORT 

No report flag.

swmm_FLOWUNITS 

Flow units.

swmm_ENDDATE 

End date.

swmm_REPORTSTART 

Report start.

swmm_UNITSYSTEM 

Unit system.

swmm_SURCHARGEMETHOD 

Surcharge method.

swmm_ALLOWPONDING 

Allow ponding.

swmm_INERTIADAMPING 

Inertia damping.

swmm_NORMALFLOWLTD 

Normal flow limited.

swmm_SKIPSTEADYSTATE 

Skip steady state.

swmm_IGNORERAINFALL 

Ignore rainfall.

swmm_IGNORERDII 

Ignore RDII.

swmm_IGNORESNOWMELT 

Ignore snowmelt.

swmm_IGNOREGROUNDWATER 

Ignore groundwater.

swmm_IGNOREROUTING 

Ignore routing.

swmm_IGNOREQUALITY 

Ignore quality.

swmm_ERROR_CODE 

Error code.

swmm_RULESTEP 

Rule step.

swmm_SWEEPSTART 

Sweep start.

swmm_SWEEPEND 

Sweep end.

swmm_MAXTRIALS 

Maximum trials.

swmm_NUMTHREADS 

Number of threads.

swmm_MINROUTESTEP 

Minimum routing step.

swmm_LENGTHENINGSTEP 

Lengthening step.

swmm_STARTDRYDAYS 

Start dry days.

swmm_COURANTFACTOR 

Courant factor.

swmm_MINSURFAREA 

Minimum surface area.

swmm_MINSLOPE 

Minimum slope.

swmm_RUNOFFERROR 

Runoff error.

swmm_FLOWERROR 

Flow error.

swmm_QUALERROR 

Quality error.

swmm_HEADTOL 

Head tolerance.

swmm_SYSFLOWTOL 

System flow tolerance.

swmm_LATFLOWTOL 

Lateral flow tolerance.

Function Documentation

◆ swmm_close()

int EXPORT_SWMM_SOLVER_API swmm_close ( void  )

Close a SWMM simulation.

Returns
Error code

Close a SWMM simulation.

Returns
Error code

Close a SWMM simulation.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ swmm_decodeDate()

void EXPORT_SWMM_SOLVER_API swmm_decodeDate ( double  date,
int *  year,
int *  month,
int *  day,
int *  hour,
int *  minute,
int *  second,
int *  dayOfWeek 
)

Decode double date value into year, month, day, hour, minute, second, and day of week.

Parameters
[in]dateDate value
[out]yearYear
[out]monthMonth
[out]dayDay
[out]hourHour
[out]minuteMinute
[out]secondSecond
[out]dayOfWeekDay of week (0=Sunday, 1=Monday, ..., 6=Saturday)

Decode double date value into year, month, day, hour, minute, second, and day of week.

Parameters
[in]dateDate value
[out]yearYear
[out]monthMonth
[out]dayDay
[out]hourHour
[out]minuteMinute
[out]secondSecond
[out]dayOfWeekDay of week (0=Sunday, 1=Monday, ..., 6=Saturday)

Decode double date value into year, month, day, hour, minute, second, and day of week.

Here is the call graph for this function:

◆ swmm_encodeDate()

double EXPORT_SWMM_SOLVER_API swmm_encodeDate ( int  year,
int  month,
int  day,
int  hour,
int  minute,
int  second 
)

Encode date values into a double date value.

Parameters
[in]yearYear
[in]monthMonth
[in]dayDay
[in]hourHour
[in]minuteMinute
[in]secondSecond
Returns
Date value

Encode date values into a double date value.

Parameters
[in]yearYear
[in]monthMonth
[in]dayDay
[in]hourHour
[in]minuteMinute
[in]secondSecond
Returns
Date value

Encode date values into a double date value.

Here is the call graph for this function:

◆ swmm_end()

int EXPORT_SWMM_SOLVER_API swmm_end ( void  )

End a SWMM simulation.

Returns
Error code

End a SWMM simulation.

Returns
Error code

End a SWMM simulation.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ swmm_getCount()

int EXPORT_SWMM_SOLVER_API swmm_getCount ( int  objType)

Retrieves the number of objects of a specific type.

Parameters
[in]objTypeType of SWMM object
Returns
Number of objects or error code

Retrieves the number of objects of a specific type.

Parameters
[in]objTypeType of SWMM object
Returns
Number of objects or error code

Retrieves the number of objects of a specific type.

◆ swmm_getError()

int EXPORT_SWMM_SOLVER_API swmm_getError ( char *  errMsg,
int  msgLen 
)

Retrieves the code number and text of the error condition that caused SWMM to abort its analysis.

Parameters
[out]errMsgError message text
[in]msgLenMaximum size of errMsg
Returns
Error message code number

Retrieves the code number and text of the error condition that caused SWMM to abort its analysis.

Parameters
[out]errMsgError message text
[in]msgLenMaximum size of errMsg
Returns
Error message code number

Retrieves the code number and text of the error condition that caused SWMM to abort its analysis.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ swmm_getErrorFromCode()

int EXPORT_SWMM_SOLVER_API swmm_getErrorFromCode ( int  errorCode,
char *  outErrMsg[1024] 
)

Retrieves the text of the error message that corresponds to the error code number.

Parameters
[in]errorCodeError code number
[out]outErrMsgError message text
Returns
Error code

Retrieves the text of the error message that corresponds to the error code number.

Parameters
[in]errorCodeError code number
[out]outErrMsgError message text
Returns
Error code

Retrieves the text of the error message that corresponds to the error code number.

Here is the call graph for this function:

◆ swmm_getIndex()

int EXPORT_SWMM_SOLVER_API swmm_getIndex ( int  objType,
const char *  name 
)

Retrieves the index of a named object.

Parameters
[in]objTypeType of SWMM object
[in]nameObject name
Returns
Object index or error code

Retrieves the index of a named object.

Parameters
[in]objTypeType of SWMM object
[in]nameObject name
Returns
Object index or error code

Retrieves the index of a named object.

Here is the call graph for this function:

◆ swmm_getMassBalErr()

int EXPORT_SWMM_SOLVER_API swmm_getMassBalErr ( float *  runoffErr,
float *  flowErr,
float *  qualErr 
)

Get the mass balance errors for a SWMM simulation.

Parameters
[out]runoffErrRunoff error (percent)
[out]flowErrFlow error (percent)
[out]qualErrQuality error (percent)
Returns
Error code

Get the mass balance errors for a SWMM simulation.

Parameters
[out]runoffErrRunoff error (percent)
[out]flowErrFlow error (percent)
[out]qualErrQuality error (percent)
Returns
Error code

Get the mass balance errors for a SWMM simulation.

◆ swmm_getName()

int EXPORT_SWMM_SOLVER_API swmm_getName ( int  objType,
int  index,
char *  name,
int  size 
)

Retrieves the ID name of an object.

Parameters
[in]objTypeType of SWMM object
[in]indexObject index
[out]nameObject name
[in]sizeSize of the name array
Returns
Error code

Retrieves the ID name of an object.

Parameters
[in]objTypeType of SWMM object
[in]indexObject index
[out]nameObject name
[in]sizeSize of the name array
Returns
Error code

Retrieves the ID name of an object.

Here is the call graph for this function:

◆ swmm_getSavedValue()

double EXPORT_SWMM_SOLVER_API swmm_getSavedValue ( int  property,
int  index,
int  period 
)

Get saved value of.

Parameters
[in]propertyProperty type
[in]indexObject index
[in]periodTime period index
Returns
Property value

Get saved value of.

Parameters
[in]propertyProperty type
[in]indexObject index
[in]periodTime period index
Returns
Property value

Get saved value of.

◆ swmm_getValue()

double EXPORT_SWMM_SOLVER_API swmm_getValue ( int  property,
int  index 
)

Get the value of a property for an object of a given property in the SWMM model.

Parameters
[in]propertyProperty type
[in]indexObject index
Returns
Property value
Deprecated:
Use swmm_getValueExpanded instead. Function will be changed to swmm_getValueExpanded in future versions.

Get the value of a property for an object of a given property in the SWMM model.

Parameters
[in]propertyProperty type
[in]indexObject index
Returns
Property value
Deprecated:
Use swmm_getValueExpanded instead. Function will be changed to swmm_getValueExpanded in future versions.

Get the value of a property for an object of a given property in the SWMM model.

Here is the call graph for this function:

◆ swmm_getValueExpanded()

double EXPORT_SWMM_SOLVER_API swmm_getValueExpanded ( int  objType,
int  property,
int  index,
int  subIndex 
)

Get the value of a property for an object given property, index, and subindex in the SWMM model.

Parameters
[in]objTypeObject type
[in]propertyProperty type
[in]indexObject index
[in]subIndexOptional Subindex for the property
Returns
Property value

Get the value of a property for an object given property, index, and subindex in the SWMM model.

Parameters
[in]objTypeObject type
[in]propertyProperty type
[in]indexObject index
[in]subIndexOptional Subindex for the property
Returns
Property value

Get the value of a property for an object given property, index, and subindex in the SWMM model.

Here is the call graph for this function:

◆ swmm_getVersion()

int EXPORT_SWMM_SOLVER_API swmm_getVersion ( void  )

Get the version of the SWMM engine.

Returns
Version number

Get the version of the SWMM engine.

Returns
Version number

Get the version of the SWMM engine.

Here is the caller graph for this function:

◆ swmm_getWarnings()

int EXPORT_SWMM_SOLVER_API swmm_getWarnings ( void  )

Gets the number of warnings issued during a simulation.

Returns
Number of warning messages issued

Gets the number of warnings issued during a simulation.

Returns
Number of warning messages issued

Gets the number of warnings issued during a simulation.

Here is the caller graph for this function:

◆ swmm_open()

int EXPORT_SWMM_SOLVER_API swmm_open ( const char *  inputFile,
const char *  reportFile,
const char *  outputFile 
)

Open a SWMM simulation with the given input file, report file, and output file.

Parameters
[in]inputFilePath to the input file
[in]reportFilePath to the report file
[in]outputFilePath to the output file
Returns
Error code

Open a SWMM simulation with the given input file, report file, and output file.

Parameters
[in]inputFilePath to the input file
[in]reportFilePath to the report file
[in]outputFilePath to the output file
Returns
Error code

Open a SWMM simulation with the given input file, report file, and output file.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ swmm_report()

int EXPORT_SWMM_SOLVER_API swmm_report ( void  )

Writes simulation results to the report file.

Returns
Error code

Writes simulation results to the report file.

Returns
Error code

Writes simulation results to the report file.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ swmm_run()

int EXPORT_SWMM_SOLVER_API swmm_run ( const char *  inputFile,
const char *  reportFile,
const char *  outputFile 
)

Run a SWMM simulation with the given input file, report file, and output file.

Parameters
[in]inputFilePath to the input file
[in]reportFilePath to the report file
[in]outputFilePath to the output file
Returns
Error code

Run a SWMM simulation with the given input file, report file, and output file.

Parameters
[in]inputFilePath to the input file
[in]reportFilePath to the report file
[in]outputFilePath to the output file
Returns
Error code

Run a SWMM simulation with the given input file, report file, and output file.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ swmm_run_with_callback()

int EXPORT_SWMM_SOLVER_API swmm_run_with_callback ( const char *  inputFile,
const char *  reportFile,
const char *  outputFile,
progress_callback  callback 
)

Run a SWMM simulation with the given input file, report file, and output file with a progress callback.

Parameters
[in]inputFilePath to the input file
[in]reportFilePath to the report file
[in]outputFilePath to the output file
[in]callbackProgress callback function
Returns
Error code

Run a SWMM simulation with the given input file, report file, and output file with a progress callback.

Parameters
[in]inputFilePath to the input file
[in]reportFilePath to the report file
[in]outputFilePath to the output file
[in]callbackProgress callback function
Returns
Error code

Run a SWMM simulation with the given input file, report file, and output file with a progress callback.

Here is the call graph for this function:

◆ swmm_saveHotStart()

int EXPORT_SWMM_SOLVER_API swmm_saveHotStart ( const char *  hotStartFile)

Save hotstart file for SWMM simulation at current time.

Parameters
[in]hotStartFilePath to the hotstart file
Returns
Error code

Save hotstart file for SWMM simulation at current time.

Parameters
[in]hotStartFilePath to the hotstart file
Returns
Error code

Save hotstart file for SWMM simulation at current time.

Here is the call graph for this function:

◆ swmm_setValue()

int EXPORT_SWMM_SOLVER_API swmm_setValue ( int  property,
int  index,
double  value 
)

Set the value of a property for an object of a given property and index in the SWMM model.

Parameters
[in]propertyProperty type
[in]indexObject index
[in]valueProperty value
Returns
Error code
Deprecated:
Use swmm_setValueExpanded instead. Function will be changed to swmm_setValueExpanded in future versions.

Set the value of a property for an object of a given property and index in the SWMM model.

Parameters
[in]propertyProperty type
[in]indexObject index
[in]valueProperty value
Returns
Error code
Deprecated:
Use swmm_setValueExpanded instead. Function will be changed to swmm_setValueExpanded in future versions.

Set the value of a property for an object of a given property and index in the SWMM model.

◆ swmm_setValueExpanded()

int EXPORT_SWMM_SOLVER_API swmm_setValueExpanded ( int  objType,
int  property,
int  index,
int  subIndex,
double  value 
)

Set the value of a property for an object given property, index, and subindex in the SWMM model.

Parameters
[in]objTypeObject type
[in]propertyProperty type
[in]indexObject index
[in]subIndexOptional Subindex for the property
[in]valueProperty value
Returns
Error code

Set the value of a property for an object given property, index, and subindex in the SWMM model.

Parameters
[in]objTypeObject type
[in]propertyProperty type
[in]indexObject index
[in]subIndexOptional Subindex for the property
[in]valueProperty value
Returns
Error code

Set the value of a property for an object given property, index, and subindex in the SWMM model.

◆ swmm_start()

int EXPORT_SWMM_SOLVER_API swmm_start ( int  saveFlag)

Start a SWMM simulation with the given save flag.

Parameters
[in]saveFlagFlag to save simulation
Returns
Error code

Start a SWMM simulation with the given save flag.

Parameters
[in]saveFlagFlag to save simulation
Returns
Error code

Start a SWMM simulation with the given save flag.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ swmm_step()

int EXPORT_SWMM_SOLVER_API swmm_step ( double *  elapsedTime)

Perform a SWMM simulation step and return the elapsed time.

Parameters
[out]elapsedTimeElapsed time in decimal days
Returns
Error code

Perform a SWMM simulation step and return the elapsed time.

Returns
Error code

End a SWMM simulation.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ swmm_stride()

int EXPORT_SWMM_SOLVER_API swmm_stride ( int  strideStep,
double *  elapsedTime 
)

Perform a SWMM simulation step with a stride step and return the elapsed time.

Parameters
[in]strideStepStride step
[out]elapsedTimeElapsed time
Returns
Error code

Perform a SWMM simulation step with a stride step and return the elapsed time.

Parameters
[in]strideStepStride step
[out]elapsedTimeElapsed time
Returns
Error code

Perform a SWMM simulation step with a stride step and return the elapsed time.

Here is the call graph for this function:

◆ swmm_useHotStart()

int EXPORT_SWMM_SOLVER_API swmm_useHotStart ( const char *  hotStartFile)

Set hotstart file for SWMM simulation.

Sets the hotstart file to use for simulation. Errors does not terminate simulation unless there is a prior terminating error.

Parameters
[in]hotStartFilePath to the hotstart file
Returns
Error code

Set hotstart file for SWMM simulation.

Sets the hotstart file to use for simulation. Errors does not terminate simulation unless there is a prior terminating error.

Parameters
[in]hotStartFilePath to the hotstart file
Returns
Error code

Set hotstart file for SWMM simulation.

Here is the call graph for this function:

◆ swmm_writeLine()

void EXPORT_SWMM_SOLVER_API swmm_writeLine ( const char *  line)

Write a line of text to the SWMM report file.

Parameters
[in]lineLine of text

Write a line of text to the SWMM report file.

Parameters
[in]lineLine of text

Write a line of text to the SWMM report file.

Here is the call graph for this function: