Commit Graph

34 Commits

Author SHA1 Message Date
Lew Rossman
6468ba9545 Include curve type in input file 2025-03-11 11:54:12 -04:00
Lew Rossman
70d5483361 Add read/write of disabled controls to input file 2025-02-11 15:38:30 -05:00
Lew Rossman
b0796f346a Adding leakage model 2024-06-26 11:15:01 -04:00
Lew Rossman
7e66114863 Changes EMITTER BACKFLOW keyword
This change avoids a conflict between the EMITTER EXPONENT and EMITTER BACKFLOW keywords when running a v2.3 input file in the v2.2 EPANET GUI.
2024-05-11 12:37:52 -04:00
lbutler
c6ab471b5b Update release notes and remove depreciated constants 2024-01-09 14:14:19 -05:00
Luke Butler
843f1f4e37 Added support for cubic meters per second (CMS) 2023-02-20 09:43:42 -05:00
Lew Rossman
847fa82139 Add emitter backflow option
Adds a global hydraulic option to allow backflow or not through emitter elements. To maintain backward compatibility the default is YES.
2023-02-05 15:16:20 -05:00
Lew Rossman
6db17193f5 New positional control valve added 2022-08-16 11:47:44 -04:00
Lew Rossman
a89f339525 PDA fixes 2019-07-22 09:50:41 -04:00
Lew Rossman
85e2f2c187 Identifies overflowing tank in Status Report 2019-06-20 15:00:18 -04:00
Lew Rossman
9a540cc0f4 Code cleanup
1. Added a standard header to each code module and removed obsolete comments.
2. Re-named several of the sub-structs in the project struct and re-arranged some of their contents.
3. Re-named _defaultModel to _defaultProject.
4. Removed the need to call EN_createproject and EN_deleteproject when working with the default project.
5. Made X & Y coords. part of Snode properties instead of a separate struct.
6. Moved the non-API functions in epanet.c into a new module named project.c.
7. Re-factored the quality module so that it uses the same nodal adjacency lists as the hydraulics solver.
8. Re-factored the sparse matrix module (smatrix.c) to be more memory efficient.
9. Restricted line lengths to < 90 columns.
10. Grouped the placement of functions in EPANET2.H and EPANET.C by category.
2018-11-27 14:22:06 -05:00
Lew Rossman
320dec3ff7 Replaced main() for runnable version of the library 2018-10-27 11:00:00 -04:00
Elad Salomons
13011ae71c Merge pull request #229 from Mariosmsk/dev-issue228
Syntax for the epanet executable, thanks @Mariosmsk
2018-08-27 09:32:49 +03:00
Marios Kyriakou
f4a57a969e delete comment strings 2018-08-25 13:15:33 +03:00
Marios Kyriakou
6d99867af6 update
comment FMT01, FMT03, FMT09, FMT10, FMT11 in text.h
2018-08-23 16:59:02 +03:00
Marios Kyriakou
0e6cc51d81 Revert "remove dublicate definition"
This reverts commit 8808a01641.
2018-08-23 16:47:52 +03:00
Marios Kyriakou
8808a01641 remove dublicate definition
Add include text.h
2018-08-23 14:58:26 +03:00
Marios Kyriakou
29aa45febb Syntax for the epanet executable 2018-08-22 22:32:30 +03:00
Lew Rossman
a73d9235e7 Fixed max. flow change node ID in Status Report 2018-08-13 10:04:24 -04:00
Lew Rossman
b5e3986e6b Pressure Dependent Demands added to address issue 163 2018-08-09 10:42:47 -04:00
Lew Rossman
b3ab8ea2c7 Addresses issue #161
Adds new options HEADERROR and FLOWCHANGE to provide more rigorous criteria for hydraulic convergence. Also breaks HYDRAUL.C into 3 separate files to improve code readability.
2018-06-16 11:02:18 -04:00
Sam Hatchett
f97d837231 Feature wrapper (#136)
this quite sizable commit does several things, but is primarily
focussed on building a toolkit that can run simultaneous
simulations/analyses within a shared memory space. Versions <=2.1 use a
long list of global variables that prevent multiple instantiations on
linux systems without resorting to compilation tricks (like duplicate
binaries or similar via static linkage). This version uses a single "Project" pointer to encapsulate
the network and analysis data. There are no changes to existing algo
implementations other than to accomodate dereferencing of the passed-in
pointers. A more detailed list of major changes below:

- mirrors all “ENxxxx” function calls with “EN_xxxx” versions (note the
underscore) that take an extra first parameter: a pointer to an
EN_Project struct, which contains all network, hydraulic, quality, and
associated data.
- tweaks some code formatting to make it more readable
- removes some deprecated/commented code that was sufficiently old
- fixes implicit type-cast warnings

* Added ENaddnode and ENaddlink functions

* More memory reallocations

* Added ENInit, ENsetheadcurveindex

* Added ENdeletelink and ENdeletenode

* restored default behavior for float types

* fixed type

* Added docstrings for ENinit

* cleanup change

* moves global rule variables to vars.h

* migrates rule structs to typedefs

for better readability

* char types to proper enums

fixes #93

* Change some variable declarations for compatibility

Changes to keep compatibility with C89 compilers: variables must be
declared at the top of the functions. Remove the use of EN_LinkType in
function call as it is not compatible with ENgetnodetype.

* Moved declaration of idstodelete to top of function

* Updated ENinit function and headers

Updated header files with new functions
Updated def file with new functions
For ENinit changes names of parameters #98
Added enum for headloss formula

* Missed these files in 1a033fc

* migrates char types to enums fixes #93,

supports unified link/node type enums, rather than public/private
redefinitions

* removing links in reverse-index order maintains proper indexing fixes #96

* style

* clarifies curve getter units issue (dox)

closes #95

* fixes link/node confusion in ENsetlinktype

partially reverts a3bce95dc330a5a297634a303d438e2e1bc41cc9

* partial compilation fix

* fixes dox issue

* fixes allocation issues with enums

- updates style in various places
- introduces FlowDirection enum
- use snprintf to prevent overflow

* fixes enum type cast

* updated mac project settings

* Use of _snprintf on Windows and remove DLLEXPORT from mempool.h

snprintf it not compatible on Windows so we use _snprintf
mempool gave starnge compilation errors while removing DLLEXPORT worked.
Not sure why these functions needed to be exposed in the DLL?

* Revert "Use of _snprintf on Windows and remove DLLEXPORT from mempool.h"

This reverts commit 6238f77d47fa0feaabe5836043c006937de433a2.

* use of _snprintf instead of snprintf on Windows and removed DLLEXPORT from mempool.h

Had compilation errors on mempool.h. Removed DLLEXPORT so solve it. Not
sure why there was a need to expose these functions?

* Shift indices for Links in ENaddnode

Need to shift indices for Links not just Pipes since a pump could be
connected directly to a reservoir. Also set the defult base demand to
zero (was 5).

* Set defualts for madatory link properties in ENaddlink and small fix for ENsetheadcurveindex

Relates to #102 and closes #103

* wraps globals into structs, duplicates api functions with objective versions



* parse and serialize Comment field for network elements

related to #47

* adds getter for head/efficiency curve

in EN_getlinkvalue

* adds getter for event node index

… to return the index of the junction (tank) that triggered the event.

* fixes edge case in parsing

… where inp files without demands in [JUNCTIONS] and without any
[DEMAND] categories will fail.

* adds freeing function for project pointer

* removes redundant string literals, fixes overrun issue in error message getter function

* check for hydraulics already closed

* moving error definitions to data file

* deprecates ENR err message getter (unused)

* updates location of errors data file

also begins to expose blind structs to curves and patterns,
anticipating buildout of APIs for those.

* updates CLI output to reflect executable name as invoked

relates to #109

* Feature nrtest (#131)

* Initial commit EPANET testing tools.

* Initial commit for epanet-nrtestsuite

* SWIG wrapper for EPANET outputapi (#118)

* Removed pervious version of outputapi and wrapper

* SWIG wrapper for EPANET outputapi

* Patching cmake build script fixed target for outputapi

* Build failing on deprecated test script

* Minor changes. Responding to review comments.

* Feature nrtest (#121)

* Configured python setup to automatically build nrtest tools.

* Working on build / testing automation

* Adding EPANET 2.0.12 benchmark

* Updated Travis yml to run nrtest

* Fixing InsecurePlatformWarning

* Fixing InsecurePlatformWarning again

* Fixing InsecurePlatformWarning

* Fixing InsecurePlatformWarning

* Fixing InsecurePlatformWarning

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* Working on configuring python environment and building test tools under Travis CI.

* Making gen-config.sh and run-nrtest.sh executable

* Debugging .travis.yml

* Debugging .travis.yml

* Debugging .travis.yml again

* Debugging .travis.yml again

* debugging travis setup

* debugging Travis setup

* debugging Travis setup

* debugging Travis setup

* debugging Travis setup

* debugging Travis setup

* debugging Travis setup

* debugging Travis setup

* debugging Travis setup

* debugging Travis setup

* debugging Travis setup

* Fixing bug with __strncpy_chk destlen < len

* nrtesting clean up

* re-implements fixes from:

5eead5ae40
3c788567a4

* removes extraneous build files, moves cmake and updates travis

* mirror of 9b37035560f9683f1514b439f7586a5c17bca5bf

* Move some variable declarations

* More variable declarations

* Fix TmpDir

* Allocate _defaultModel

* Fix EN_addcurve funcrion

* Fix for inpfile

* Fix writeRuleinInp call

* Set MAXMSG to 79 chars

* Fix for flow direction

* Refactoring testing related python packages and SWIG wrapper bug fix (#139)

* Eliminated epanet-reader package. Removed numpy dependency from epanet-output. Fixed reference counting bug in SWIG wrapper. Added error checking to run_nrtest.sh. Added nrtest package to requirements file.

* changing buildhome directory

* Fixing bug related to preprocessor definition of PI
2018-01-09 16:56:42 -05:00
Elad Salomons
e1da9bc9d7 Fix duplicate w_POWER definition
Fix duplicate w_POWER definition and some house keeping. Tested the new
commit by @AngelaMarchi from #87, all results are the same as version
2.1.
2016-11-09 16:37:57 +02:00
AngelaMarchi
83dd6c7b7c ChangingRuleBased_v2
The code has the following modifications:
- RULE section is written just after controls
- SYST is now written SYSTEM (also PRESSURE, DEMAND, POWER, SETTING,
FILLTIME and DRAINTIME have been changed)
- some description to the function writeRuleinInp has been added
- Actions are now written in the correct order
2016-11-08 18:37:54 +10:30
AngelaMarchi
6f8be1be55 ModifyingRuleBaseControls
These modifications allow rule based controls to be modified with the
additional functions added in the dll toolkit
2016-09-23 13:07:06 +09:30
Elad Salomons
395533c53d Remove hard coded version number
This should close #17
2015-11-29 22:33:30 +02:00
Sam Hatchett
cb8dc35cae fixes version numbering 2015-09-15 10:46:18 -04:00
Elad Salomons
2c46a002ba Changed coordinates are saved to INP
Added a flag which controls the loading of coordinates at epanet.c line
213.
When set to TRUE coordinates are loaded and users can use the ENgetcoord
and ENsetcoord functions. Changes are then saved when ENsaveinpfile is
called.
When set to FALSE coordinates are not loaded and can't be retrieved or
changed. When saved, the COORD section is copied from the original INP
file.
2015-09-13 12:56:28 +03:00
Elad Salomons
4d6bcef623 rewrite the coordinate getter
currently controlled from input2.c lines 297-298. will need to add a
flag to not load the coordinates.
2015-09-12 16:34:52 +03:00
Elad Salomons
cdbd08acca Added error code and description for wrong demand category index 2015-06-30 19:39:06 +03:00
sam hatchett
434d78c6ed Lemon Tiger changes 2013-05-23 19:36:03 -04:00
Feng Shang
c38b8d0ac8 Commit the EPANET2.00.12 to trunk, the changes are summarized at \EPANET\BASE\trunk\doc\changes.txt.
git-svn-id: https://epanet.svn.sourceforge.net/svnroot/epanet/BASE/trunk@95 c320cabd-cc23-0410-96d8-e60fbf53ed7f
2008-03-06 20:06:03 +00:00
Michael Tryby
0cd38fd697 New features and bug fixes 2014-05-05 18:07:03 -04:00
Michael Tryby
993cfce8a4 Initial commit 2014-05-05 18:00:25 -04:00