![]() |
OpenSWMM Engine
6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
|
C API implementation — landuse, buildup, washoff, treatment. More...
Functions | |
| SWMM_ENGINE_API int | swmm_landuse_count (SWMM_Engine engine) |
| Number of land uses defined. | |
| SWMM_ENGINE_API int | swmm_landuse_index (SWMM_Engine engine, const char *id) |
| Look up a land use by name. Returns -1 if not found. | |
| SWMM_ENGINE_API const char * | swmm_landuse_id (SWMM_Engine engine, int idx) |
| Return the name of a land use by index. Returns NULL on error. | |
| SWMM_ENGINE_API int | swmm_landuse_add (SWMM_Engine engine, const char *id) |
| Add a new land use (BUILDING state only). | |
| SWMM_ENGINE_API int | swmm_landuse_set_sweep_interval (SWMM_Engine engine, int idx, double days) |
| Set sweep interval (days between street sweeps). | |
| SWMM_ENGINE_API int | swmm_landuse_get_sweep_interval (SWMM_Engine engine, int idx, double *days) |
| Get sweep interval (days between street sweeps). | |
| SWMM_ENGINE_API int | swmm_landuse_set_sweep_removal (SWMM_Engine engine, int idx, double frac) |
| Set sweep removal fraction (0-1). | |
| SWMM_ENGINE_API int | swmm_landuse_get_sweep_removal (SWMM_Engine engine, int idx, double *frac) |
| Get sweep removal fraction (0-1). | |
| SWMM_ENGINE_API int | swmm_buildup_set (SWMM_Engine engine, int lu_idx, int pollut_idx, int func_type, double c1, double c2, double c3, int normalizer) |
| Set buildup function parameters for a (landuse, pollutant) pair. | |
| SWMM_ENGINE_API int | swmm_buildup_get (SWMM_Engine engine, int lu_idx, int pollut_idx, int *func_type, double *c1, double *c2, double *c3, int *normalizer) |
| Get buildup function parameters for a (landuse, pollutant) pair. | |
| SWMM_ENGINE_API int | swmm_washoff_set (SWMM_Engine engine, int lu_idx, int pollut_idx, int func_type, double coeff, double expon, double sweep_effic, double bmp_effic) |
| Set washoff function parameters for a (landuse, pollutant) pair. | |
| SWMM_ENGINE_API int | swmm_washoff_get (SWMM_Engine engine, int lu_idx, int pollut_idx, int *func_type, double *coeff, double *expon, double *sweep_effic, double *bmp_effic) |
| Get washoff function parameters for a (landuse, pollutant) pair. | |
| SWMM_ENGINE_API int | swmm_treatment_set (SWMM_Engine engine, int node_idx, int pollut_idx, const char *expression) |
| Set a treatment expression for a (node, pollutant) pair. | |
| SWMM_ENGINE_API int | swmm_treatment_get (SWMM_Engine engine, int node_idx, int pollut_idx, char *buf, int buflen) |
| Get a treatment expression for a (node, pollutant) pair. | |
| SWMM_ENGINE_API int | swmm_treatment_clear (SWMM_Engine engine, int node_idx, int pollut_idx) |
| Clear a treatment expression for a (node, pollutant) pair. | |
C API implementation — landuse, buildup, washoff, treatment.
| SWMM_ENGINE_API int swmm_buildup_get | ( | SWMM_Engine | engine, |
| int | lu_idx, | ||
| int | pollut_idx, | ||
| int * | func_type, | ||
| double * | c1, | ||
| double * | c2, | ||
| double * | c3, | ||
| int * | normalizer | ||
| ) |
Get buildup function parameters for a (landuse, pollutant) pair.
| engine | Engine handle. | |
| lu_idx | Landuse index. | |
| pollut_idx | Pollutant index. | |
| [out] | func_type | Buildup function type (0=NONE, 1=POW, 2=EXP, 3=SAT, 4=EXT). |
| [out] | c1 | Coefficient 1. |
| [out] | c2 | Coefficient 2. |
| [out] | c3 | Coefficient 3. |
| [out] | normalizer | Normalizer (0=PER_AREA, 1=PER_CURB). |
| SWMM_ENGINE_API int swmm_buildup_set | ( | SWMM_Engine | engine, |
| int | lu_idx, | ||
| int | pollut_idx, | ||
| int | func_type, | ||
| double | c1, | ||
| double | c2, | ||
| double | c3, | ||
| int | normalizer | ||
| ) |
Set buildup function parameters for a (landuse, pollutant) pair.
| engine | Engine handle. |
| lu_idx | Landuse index. |
| pollut_idx | Pollutant index. |
| func_type | Buildup function type (0=NONE, 1=POW, 2=EXP, 3=SAT, 4=EXT). |
| c1 | Coefficient 1. |
| c2 | Coefficient 2. |
| c3 | Coefficient 3. |
| normalizer | Normalizer (0=PER_AREA, 1=PER_CURB). |
| SWMM_ENGINE_API int swmm_landuse_add | ( | SWMM_Engine | engine, |
| const char * | id | ||
| ) |
Add a new land use (BUILDING state only).
| SWMM_ENGINE_API int swmm_landuse_count | ( | SWMM_Engine | engine | ) |
Number of land uses defined.
| SWMM_ENGINE_API int swmm_landuse_get_sweep_interval | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double * | days | ||
| ) |
Get sweep interval (days between street sweeps).
| SWMM_ENGINE_API int swmm_landuse_get_sweep_removal | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double * | frac | ||
| ) |
Get sweep removal fraction (0-1).
| SWMM_ENGINE_API const char * swmm_landuse_id | ( | SWMM_Engine | engine, |
| int | idx | ||
| ) |
Return the name of a land use by index. Returns NULL on error.
| SWMM_ENGINE_API int swmm_landuse_index | ( | SWMM_Engine | engine, |
| const char * | id | ||
| ) |
Look up a land use by name. Returns -1 if not found.
| SWMM_ENGINE_API int swmm_landuse_set_sweep_interval | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double | days | ||
| ) |
Set sweep interval (days between street sweeps).
| SWMM_ENGINE_API int swmm_landuse_set_sweep_removal | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double | frac | ||
| ) |
Set sweep removal fraction (0-1).
| SWMM_ENGINE_API int swmm_treatment_clear | ( | SWMM_Engine | engine, |
| int | node_idx, | ||
| int | pollut_idx | ||
| ) |
Clear a treatment expression for a (node, pollutant) pair.
| engine | Engine handle. |
| node_idx | Node index. |
| pollut_idx | Pollutant index. |
| SWMM_ENGINE_API int swmm_treatment_get | ( | SWMM_Engine | engine, |
| int | node_idx, | ||
| int | pollut_idx, | ||
| char * | buf, | ||
| int | buflen | ||
| ) |
Get a treatment expression for a (node, pollutant) pair.
| engine | Engine handle. |
| node_idx | Node index. |
| pollut_idx | Pollutant index. |
| buf | Buffer to receive the expression string. |
| buflen | Size of buf. |
| SWMM_ENGINE_API int swmm_treatment_set | ( | SWMM_Engine | engine, |
| int | node_idx, | ||
| int | pollut_idx, | ||
| const char * | expression | ||
| ) |
Set a treatment expression for a (node, pollutant) pair.
| engine | Engine handle. |
| node_idx | Node index. |
| pollut_idx | Pollutant index. |
| expression | Treatment expression string (e.g. "R = 0.5 * exp(-0.1 * DT)"). |
| SWMM_ENGINE_API int swmm_washoff_get | ( | SWMM_Engine | engine, |
| int | lu_idx, | ||
| int | pollut_idx, | ||
| int * | func_type, | ||
| double * | coeff, | ||
| double * | expon, | ||
| double * | sweep_effic, | ||
| double * | bmp_effic | ||
| ) |
Get washoff function parameters for a (landuse, pollutant) pair.
| engine | Engine handle. | |
| lu_idx | Landuse index. | |
| pollut_idx | Pollutant index. | |
| [out] | func_type | Washoff function type (0=NONE, 1=EXP, 2=RC, 3=EMC). |
| [out] | coeff | Washoff coefficient. |
| [out] | expon | Washoff exponent. |
| [out] | sweep_effic | Sweep efficiency (0-100). |
| [out] | bmp_effic | BMP efficiency (0-100). |
| SWMM_ENGINE_API int swmm_washoff_set | ( | SWMM_Engine | engine, |
| int | lu_idx, | ||
| int | pollut_idx, | ||
| int | func_type, | ||
| double | coeff, | ||
| double | expon, | ||
| double | sweep_effic, | ||
| double | bmp_effic | ||
| ) |
Set washoff function parameters for a (landuse, pollutant) pair.
| engine | Engine handle. |
| lu_idx | Landuse index. |
| pollut_idx | Pollutant index. |
| func_type | Washoff function type (0=NONE, 1=EXP, 2=RC, 3=EMC). |
| coeff | Washoff coefficient. |
| expon | Washoff exponent. |
| sweep_effic | Sweep efficiency (0-100). |
| bmp_effic | BMP efficiency (0-100). |