Skip to content

Commit

Permalink
Merge branch 'dev-2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
samhatchett committed Jul 26, 2016
2 parents ab470ba + e2a8e5a commit b750558
Show file tree
Hide file tree
Showing 68 changed files with 7,145 additions and 2,027 deletions.
23 changes: 19 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@
*.slo
*.lo
*.o
*.map
*.exp
*.lib

# Compiled Dynamic libraries
# Compiled Dynamic libraries and executables
*.so
*.dll
*.exe

# Compiled Static libraries
*.lai
Expand Down Expand Up @@ -39,6 +44,11 @@ xcuserdata
*.dat
*.dep

*.xcodeproj/
!*.xcodeproj/project.pbxproj



## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

Expand All @@ -52,6 +62,7 @@ xcuserdata
[Dd]ebug/
[Rr]elease/
x64/
build/
[Bb]in/
[Oo]bj/

Expand Down Expand Up @@ -95,6 +106,7 @@ ipch/
*.psess
*.vsp
*.vspx
*.idb

# Guidance Automation Toolkit
*.gpState
Expand Down Expand Up @@ -184,6 +196,9 @@ Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/

# CMake temp files
build/CMake/*
!build/CMake/CMakeLists.txt

*.xcuserstate

# WindSDK compiled folders
build/WinSDK/32bit/
build/WinSDK/64bit/
9 changes: 9 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Sam Hatchett <[email protected]>
James Uber <[email protected]>
Demetrios Eliades <[email protected]>
Hyoungmin Woo <[email protected]>
Hyoungmin Woo <[email protected]> <[email protected]>
Yunier Soad <[email protected]>
Jinduan Chen <[email protected]>
Maurizio Cingi <[email protected]>
Elad Salomons <[email protected]> <[email protected]>
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
language: c

before_script:
- cd build/CMake
- mkdir buildproducts
- cd buildproducts
- cmake ..

script:
- make
- cd ../../../tests
- ./test_networks.sh
20 changes: 20 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Authors ordered by first contribution.
# Generated by tools/update-authors.sh

Lew Rossman <[email protected]>
Michael Tryby <[email protected]>
Sam Hatchett <[email protected]>
Feng Shang <fshang>
James Uber <[email protected]>
Tom Taxon <[email protected]>
Hyoungmin Woo <[email protected]>
Jinduan Chen <[email protected]>
Yunier Soad <[email protected]>
Mike Kane <[email protected]>
Demetrios Eliades <[email protected]>
Will Furnass <[email protected]>
Steffen Macke <[email protected]>
Mariosmsk <[email protected]>
Elad Salomons <[email protected]>
Maurizio Cingi <[email protected]>
Bryant McDonnell <[email protected]>
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
EPANET
EPANET {#epanet-readme}
======

[![Build Status](https://travis-ci.org/OpenWaterAnalytics/EPANET.svg?branch=dev-2.1)](https://travis-ci.org/OpenWaterAnalytics/EPANET)

The EPANET Library is a pressurized pipe network hydraulic and water quality analysis toolkit written in C.

If you are interested in using/extending EPANET for academic, personal, or commercial use, then you've come to the right place. For community discussion, FAQ, and roadmapping of the project, go to the [Community Forum](http://community.wateranalytics.org/category/epanet).

Please see the [`version 2.1` Roadmap](https://github.com/OpenWaterAnalytics/EPANET/milestones/v2.1) for ongoing areas of development. If you would like to contribute by addressing any of the outstanding [Issues](https://github.com/OpenWaterAnalytics/EPANET/issues), then please comment on the Issue, then Fork this repo to your own account and base your commits on the [`dev-2.1` branch](https://github.com/OpenWaterAnalytics/EPANET/tree/dev-2.1). Once you are finished, you can open a Pull Request to test the code and discuss merging your changes back into the community respository.


__Note:__ This repository is not affiliated with, or endorsed by, the USEPA. For the "official" release of EPANET (2.00.12 UI and Toolkit) please go to the [EPA's GitHub repo](https://github.com/USEPA/Water-Distribution-Network-Model) or [the USEPA website](http://www2.epa.gov/water-research/epanet). It is also not the graphical user interface version. This is the hydraulic and water quality solver engine.

However, if you are interested in extending EPANET for academic, personal, or commercial use, then you've come to the right place. For community discussion, FAQ, and roadmapping of the project, go to the [Community Forum](http://community.wateranalytics.org/category/epanet).

Please see the [`version 2.1` Roadmap](https://github.com/OpenWaterAnalytics/EPANET/milestones/v2.1) for ongoing areas of development. If you would like to contribute by addressing any of the outstanding [Issues](https://github.com/OpenWaterAnalytics/EPANET/issues), then please comment on the Issue, then Fork this repo to your own account and base your commits on the [`dev-2.1` branch](https://github.com/OpenWaterAnalytics/EPANET/tree/dev-2.1). Once you are finished, you can open a Pull Request to test the code and discuss merging your changes back into the community respository.
103 changes: 103 additions & 0 deletions ReleaseNotes2_1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
Release Notes for EPANET 2.1 {#release_2_1}
============================

The last update to the EPANET engine was "Build 2.00.12" in February of 2008. Since that time, a community effort to update and extend the open-source code has emerged. This group has made a number of bug-fixes and API additions that help to improve the EPANET engine for everyone. Version 2.1 is now released after 8.5 years.

Contributors to this version (listed in order of first contribution):

- Lew Rossman
- Michael Tryby
- Feng Shang
- James Uber
- Tom Taxon
- Sam Hatchett
- Hyoungmin Woo
- Jinduan Chen
- Yunier Soad
- Mike Kane
- Demetrios Eliades
- Will Furnass
- Steffen Macke
- Mariosmsk
- Elad Salomons
- Maurizio Cingi
- Bryant McDonnell

##API Additions (new functions):
- `ENgetaveragepatternvalue`
- `ENgetstatistic`
- `ENgetcoord / ENsetcoord`
- `ENgetpumptype`
- `ENgetqualinfo`

###Demands
- `ENgetnumdemands`
- `ENgetbasedemand / ENsetbasedemand`
- `ENgetdemandpattern`

###Curves
- `ENgetcurve`
- `ENgetcurveid`
- `ENgetcurvelen`
- `ENgetcurvevalue`
- `ENsetcurvevalue`
- `ENsetcurve`
- `ENaddcurve`
- `ENgetheadcurveindex`
- `ENgetcurveindex`


##API Extensions (additional parameters)
###node value types:
- `EN_TANKVOLUME`
- `EN_MAXVOLUME`

###link value types:
- `EN_LINKQUAL`
- `EN_LINKPATTERN`

###time parameters:
- `EN_STARTTIME`
- `EN_HTIME`
- `EN_QTIME`
- `EN_HALTFLAG`
- `EN_NEXTEVENT`

###(new) statistic values:
- `EN_ITERATIONS`
- `EN_RELATIVEERROR`

###pump types
- `EN_CONST_HP`
- `EN_POWER_FUNC`
- `EN_CUSTOM`

##Notable Performance Improvements, Bug Fixes, Usage Features, and other notes
- API float type is a compile-time option with the `EN_API_FLOAT_TYPE` definition. Use either `float` or `double` - default if left undefined is `float` to maintain compatibility with 2.0.x
- updated hash table algorithm
- fixed memory leak when saving output
- enables interleaved hydraulic and water quality analysis steps:

```
ENopenH();
ENinitH(0);
ENinitQ(EN_NOSAVE);
do {
ENrunH(&t);
ENrunQ(&qt);
ENnextQ(&qstep);
// collect results
ENnextH(&tstep);
} while (tstep > 0);
ENcloseQ();
ENcloseH();
```

- engine code and command-line executable are now in separate implementation files
- parameter `#define` directives are now enumerated values
- main header now contains doxygen-compatible comment blocks for auto-generated documentation





28 changes: 28 additions & 0 deletions build/CMake/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
## cmake .
## make

cmake_minimum_required (VERSION 2.6)

SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)

project (EPANET)

IF(APPLE)
SET(CMAKE_INSTALL_NAME_DIR @executable_path)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
ENDIF(APPLE)

# the library
include_directories(../../include)
file(GLOB EPANET_SOURCES ../../src/*.c)
add_library(epanet STATIC ${EPANET_SOURCES})

# the standalone executable
include_directories(../../src)
add_executable(runepanet ../../run/main.c)
target_link_libraries (runepanet LINK_PUBLIC epanet m)

# the binary hydraulics file API
include_directories(../../tools/outputapi)
add_library(ENBinaryOut SHARED ../../tools/outputapi/outputapi.c)
21 changes: 11 additions & 10 deletions build/Linux/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,13 @@ runcmdname = runepanet2.sh
epanetincludedir = ../../include
# Search path for sources
epanetsrcdir = ../../src
VPATH = $(epanetsrcdir):$(epanetincludedir)
epanetrundir = ../../run
VPATH = $(epanetsrcdir):$(epanetincludedir):$(epanetrundir)

# Install directories
prefix = ~
#prefix = /usr/local # GNU standard -- requires superuser rights
prefix =~
#
exec_prefix = $(prefix)
libdir = $(exec_prefix)/lib
bindir = $(exec_prefix)/bin
Expand All @@ -66,23 +69,21 @@ INSTALL_DATA = $(INSTALL) -m 644
# Files for the shared object library
epanet_objs=hash.o hydraul.o inpfile.o input1.o input2.o \
input3.o mempool.o output.o quality.o report.o \
rules.o smatrix.o
rules.o smatrix.o epanet.o
# Epanet header files
epanet_heads=enumstxt.h funcs.h hash.h mempool.h text.h toolkit.h types.h vars.h
epanet_heads=enumstxt.h funcs.h hash.h mempool.h text.h types.h vars.h
# Epanet main program
epanet_main=epanet
epanet_main=main
# Epanet main program header files
epanet_main_heads=epanet2.h

.PHONY: all
all: $(libname) $(exename)

$(libname): $(epanet_objs)
$(CC) $(CFLAGS) $(CPPFLAGS) -D SOL -c $(epanetsrcdir)/$(epanet_main).c
$(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $(epanet_main).o $^
$(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^

$(exename): $(libname) $(epanet_main_heads)
$(CC) $(CFLAGS) $(CPPFLAGS) -D CLE -c $(epanetsrcdir)/$(epanet_main).c
$(exename): $(epanet_main).o $(epanet_main_heads)
$(CC) $(CFLAGS) -o $@ $(epanet_main).o -l$(epanetrootname) $(LDFLAGS)

$(epanet_objs): $(epanet_heads)
Expand All @@ -95,7 +96,7 @@ install:
$(INSTALL_PROGRAM) -D $(exename) $(bindir)/$(exename)
$(INSTALL_PROGRAM) -D $(libname) $(libdir)/$(libname)
$(INSTALL_DATA) -D $(epanetincludedir)/epanet2.h $(includedir)/epanet2.h
$(INSTALL_PROGRAM) -D $(runcmdname) $(bindir)/$(runcmdname)
$(INSTALL_PROGRAM) -D $(runcmdname) ~/$(runcmdname)

.PHONY: uninstall
uninstall:
Expand Down
3 changes: 3 additions & 0 deletions build/Linux/runepanet.sh.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
export LD_LIBRARY_PATH=libdir:$LD_LIBRARY_PATH
exec exename $*
20 changes: 0 additions & 20 deletions build/MSVS/LemonTigerJ.sln

This file was deleted.

Loading

0 comments on commit b750558

Please sign in to comment.