Commit Graph

47 Commits

Author SHA1 Message Date
Lew Rossman
67f7d8f76b Merge branch 'dev' into dev_2.3 2020-07-10 14:36:46 -04:00
Lew Rossman
b64e070354 Update project.c 2020-04-13 09:39:58 -04:00
Corey McNeish
ee5e910454 Alloc, free persistent parts of Hydraul in allocdata, rather than in allocmatrix 2020-04-11 11:33:37 -07:00
Lew Rossman
80f9acfe4d Network building enhancements 2020-02-04 10:01:23 -05:00
Lew Rossman
2033ddfc22 Fixed editing errors made to project.c 2019-11-15 12:55:29 -05:00
Lew Rossman
94b6cb28b6 Restored prior update to project.c that got overwritten 2019-11-15 12:50:54 -05:00
Lew Rossman
ce2a27f38e Bug fix for valvecheck function
See issue #561
2019-11-15 11:53:09 -05:00
Sam Hatchett
88e09ba8df fixes a crashing issue in freedata (#559)
The freedata function used cached values for sizes of certain arrays found in the parser struct. However, now that the network is mutable, those values can become invalid. Relying instead on the actual array lengths prevents freeing unallocated memory, or ignoring cleanup on newly created elements.
2019-11-15 09:57:32 -05:00
Lew Rossman
3bd4039d95 Bug fix for EN_setcurve
Adjusts params of any pump that uses the curve whose data is modified by EN_setcurve or EN_setcurvevalue (issue #550 ).
2019-11-02 11:17:25 -04:00
Lew Rossman
7aadc83ddf Adds link vertex get/set functions to the API 2019-10-29 16:33:40 -04:00
Lew Rossman
b640a8685c Adds EN_getresultindex function to the API
See issue #546 . Also fixes a small bug in project.c.
2019-10-26 11:25:09 -04:00
Lew Rossman
38278f7d46 Fixed use of strncpy in xstrcpy() 2019-09-30 15:51:17 -04:00
Lew Rossman
3300ef00cb getTmpName() and xstrcpy() made safer 2019-09-30 14:05:38 -04:00
Lew Rossman
f2ef979d95 Removed dependence on unistd.h in project.c
Travis CI failed because system could not find unistd.h.
2019-09-26 11:18:39 -04:00
Lew Rossman
da1253f4ea Fixes bugs in pump and demand head loss gradients 2019-09-26 11:01:01 -04:00
Sam Hatchett
647abd71c1 fixes mkstemp file handle-leaking behavior (#529) 2019-09-25 10:47:38 -04:00
Lew Rossman
40c39fd3c6 Fixes problem with findpattern() function (issue #498) 2019-05-24 10:33:36 -04:00
Lew Rossman
c9b836973e Removes _DEBUG directives from all source files
This commit removes the #ifdef _DEBUG statements at the top of all source code files per issue #482. It also updates the doc files to stress that the speedup observed for hydraulic analysis with the MMD node re-ordering method only applies to single period runs.
2019-05-13 23:49:19 -04:00
Lew Rossman
365ab00dcb Refactors the API's demand editing functions 2019-05-09 10:26:40 -04:00
Michael Tryby
cf97cf8c9c Work in progress
code cleanup, addressed issue raised in review, and implemented EN_adddemand()
2019-04-23 17:52:11 -04:00
Michael Tryby
5d3eeb91d9 Reverted handling of default pattern
When creating demands, no pattern is marked with a zero. Then when data is adjusted it gets updated to default.
2019-04-23 11:44:02 -04:00
michaeltryby
f19d43d3a4 Merge branch 'dev' of https://github.com/OpenWaterAnalytics/EPANET into dev-list 2019-04-22 13:36:44 -04:00
Lew Rossman
d985a69248 Refactored xstrcpy function 2019-04-20 11:54:33 -04:00
Michael Tryby
e9650d2d6d Work in progress
Fixing memory leaks
Unit tests passing
2019-04-19 21:21:58 -04:00
Lew Rossman
a4ac34d5d6 Updated criteria for valid object ID name 2019-04-18 17:12:56 -04:00
Michael Tryby
bf519fdd94 Work in progress
Fixing problems when demand lists are null
2019-04-18 14:24:30 -04:00
Lew Rossman
1583bea154 Return object index from EN_addnode and EN_addlink (issue #432)
Adds an output argument to EN_addnode and EN_addlink that returns the index of the newly added object.
Also refactors the validity check on object ID names.
2019-04-18 07:00:07 -04:00
Michael Tryby
109276e379 Work in progress
Implementing generic demand pattern lists. Compiles but does not run.
2019-04-17 17:24:34 -04:00
Michael Tryby
9c4665a661 Fixes memory leak in EN_addnode() (#455)
* Fixing memory leak in EN_addnode()

* Separating test_net_builder from test_toolkit

Making test_net_builder a standalone test

* Removing BOOST_TEST_MAIN

* Work in progress
2019-04-11 18:04:20 -04:00
Lew Rossman
edcd4b69c7 Eliminates use of temporary linked lists to process Patterns & Curves (issue #449) 2019-04-05 13:02:39 -04:00
Michael Tryby
84bf6f98d0 Cleaning up include statements adding crtdbg.h 2019-04-03 15:55:23 -04:00
Michael Tryby
9da7e9a81b Cleaning up build on gcc 2019-04-03 10:29:10 -04:00
Lew Rossman
18f65eb8b0 Replace fixed-sized comment strings with dynamic strings 2019-03-17 19:54:51 -04:00
Lew Rossman
6e13d7e3aa Refactoring how the binary output is closed
This change implements the fix suggested by @gonccalo.
2019-03-06 11:14:03 -05:00
Lew Rossman
3ebb1831d7 Another attempt to fix closing/opening of output project 2019-03-06 10:44:03 -05:00
Lew Rossman
8765dfa3ab Initialize all file pointers to NULL in initpointers 2019-03-05 20:50:34 -05:00
Lew Rossman
324487ba86 Opening & closing output file in writeresults 2019-03-05 19:40:30 -05:00
Lew Rossman
f2c0718819 Refactored closing/opening of output file 2019-03-05 16:15:33 -05:00
Lew Rossman
692955e3d2 Give external apps access to binary output file (#407) 2019-03-05 09:23:49 -05:00
Lew Rossman
fcbbbf9b2e Adds new pattern, curve and reporting functions to API 2019-02-20 12:43:32 -05:00
Lew Rossman
3eb9a68783 Fixes win_build and VS/cmake build problems 2019-02-11 14:30:15 -05:00
Lew Rossman
0cfa45e52e New updates to address compiler warnings (issue #370)
In addition to addressing compiler warnings, argument names in the API function prototypes were made more consistent and descriptive. Also additional Doxygen comments were added in preparation for producing a more thorough documentation of the API.
2019-01-19 16:56:19 -05:00
Lew Rossman
628fffc718 Added additional network building features (#367) 2019-01-02 10:33:58 -05:00
Lew Rossman
3ce0361c1d Network validity checks added to openhyd()
Checks on illegal valve connections made whenever API creates a new link, changes its end nodes, or changes its type.
2018-12-20 08:36:05 -05:00
Lew Rossman
f1175b1f92 Error reporting fixes and re-formatting (issue #358) 2018-12-15 15:13:19 -05:00
Lew Rossman
fa80bec8bb Included error number as part of error message (issue #357) 2018-12-06 11:40:59 -05: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