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
This commit is contained in:
31
README.md
31
README.md
@@ -1,31 +0,0 @@
|
||||
Water-Distribution-Network-Model
|
||||
================================
|
||||
|
||||
ORD Water Distribution Network Model (AKA "EPANET")
|
||||
|
||||
Introduction
|
||||
------------
|
||||
This is the official EPANET source code repository maintained by US EPA ORD, NRMRL, Water Supply and Water Resources Division located in Cincinnati, Ohio.
|
||||
|
||||
EPANET performs extended period simulation of hydraulics and water quality within potable water distribution networks. EPANET source code is written in the C Programming Language and released in the Public Domain.
|
||||
|
||||
Lewis Rossman created EPANET in the early 1990s and actively developed and maintained the project until 2008. Over the intervening years he received support from too many members of the WDS modeling community to name individually.
|
||||
|
||||
Intended Audience
|
||||
-----------------
|
||||
The intended audience for this repository can be divided roughly into two groups:
|
||||
|
||||
- Programmers interested in water distribution system modeling
|
||||
- Engineers working on water distribution system modeling interested in programming
|
||||
|
||||
Git Hub and software repositories are geared towards people with software development experience. If you've ever hacked EPANET or built a Matlab script for running hydraulic simulations, you may find the contents of this repository helpful. We encourage you to fork EPANET and develop a great new feature to share with the community.
|
||||
|
||||
Find Out More
|
||||
-------------
|
||||
The source code distributed here is identical to the code found at the official [EPANET Website](http://www.epa.gov/nrmrl/wswrd/dw/epanet.html).
|
||||
|
||||
Active Development
|
||||
------------------
|
||||
We are actively developing features in the following areas:
|
||||
- Real Time Monitoring
|
||||
- Water Quality
|
||||
0
build/Cyg/CreateMSLib.bat.template
Normal file → Executable file
0
build/Cyg/CreateMSLib.bat.template
Normal file → Executable file
0
build/Cyg/Makefile
Normal file → Executable file
0
build/Cyg/Makefile
Normal file → Executable file
0
build/Cyg/runepanet.sh.template
Normal file → Executable file
0
build/Cyg/runepanet.sh.template
Normal file → Executable file
222
build/Linux/Makefile
Normal file → Executable file
222
build/Linux/Makefile
Normal file → Executable file
@@ -1,111 +1,111 @@
|
||||
# Linux Makefile for EPANET
|
||||
|
||||
# This will build EPANET as a shared object library
|
||||
# (libepanet_gcc_<Rev>.so) under Linux/Unix, and a standalone
|
||||
# executable (epanet_gcc_<Rev>).
|
||||
|
||||
# The following targets are defined:
|
||||
# make
|
||||
# -Builds libepanet_gcc_<Rev>.so, epanet_gcc_<Rev>
|
||||
# make install
|
||||
# -Creates shell wrapper runepanet_<Rev>.sh that executes epanet_gcc_<Rev>.exe.
|
||||
# The runepanet_<Rev>.sh wrapper simply exports
|
||||
# environment variables that help locate the runtime library,
|
||||
# allowing you to specify your own library locations.
|
||||
# -Installs epanet_gcc_<Rev> and runepanet_<Rev>.sh
|
||||
# in <prefix>/bin, where <prefix> defaults to ~ (and can be set
|
||||
# below to something different - see "Install directories")
|
||||
# -Installs libepanet_gcc_<Rev>.so in <prefix>/lib
|
||||
# -Installs epanet2.h in <prefix>/include. This is the required
|
||||
# header file for the EPANET programmer's toolkit, and thus
|
||||
# <prefix>/include should be on your CPP include search path
|
||||
# for subsequent use of the toolkit and linking with the
|
||||
# library libepanet_gcc_<Rev>.so
|
||||
# make clean
|
||||
# -Removes object and library files, returning the build directory
|
||||
# to its pristine state.
|
||||
|
||||
# You may wish to change the install path 'prefix',
|
||||
# or the compiler flags, but these defaults should be fine.
|
||||
|
||||
SHELL = /bin/sh
|
||||
|
||||
# Target filenames
|
||||
# svnname.sh constructs a name: <prefix><root><Rev><postfix>
|
||||
# where <Rev> is the atomic revision number of the svn repo.
|
||||
epanetsvnpath = ../../..
|
||||
epanetrootname := $(shell ../svnname.sh $(epanetsvnpath) "" epanet_gcc_ "")
|
||||
libname := lib$(epanetrootname).so
|
||||
exename := $(epanetrootname)
|
||||
# Shell wrapper
|
||||
runcmdtemplate = runepanet.sh.template
|
||||
runcmdname = $(shell ../svnname.sh $(epanetsvnpath) "" runepanet_ .sh)
|
||||
# Location of EPANET toolkit includes
|
||||
epanetincludedir = ../../include
|
||||
# Search path for sources
|
||||
epanetsrcdir = ../../src
|
||||
VPATH = $(epanetsrcdir):$(epanetincludedir)
|
||||
|
||||
# Install directories
|
||||
prefix = ~
|
||||
exec_prefix = $(prefix)
|
||||
libdir = $(exec_prefix)/lib
|
||||
bindir = $(exec_prefix)/bin
|
||||
includedir = $(prefix)/include
|
||||
datarootdir = $(prefix)/share
|
||||
docdir = $(datarootdir)/doc/epanet
|
||||
|
||||
# Compiler and flags
|
||||
CC = gcc
|
||||
CFLAGS = -g -O -fPIC
|
||||
CPPFLAGS = -I $(epanetincludedir)
|
||||
LDFLAGS = -L . -W1,-rpath,$(libdir) -lm
|
||||
|
||||
# Installer
|
||||
INSTALL = install
|
||||
INSTALL_PROGRAM = $(INSTALL)
|
||||
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
|
||||
# Epanet header files
|
||||
epanet_heads=enumstxt.h funcs.h hash.h mempool.h text.h toolkit.h types.h vars.h
|
||||
# Epanet main program
|
||||
epanet_main=epanet
|
||||
# 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 $^
|
||||
|
||||
$(exename): $(libname) $(epanet_main_heads)
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -D CLE -c $(epanetsrcdir)/$(epanet_main).c
|
||||
$(CC) $(CFLAGS) -o $@ $(epanet_main).o -l$(epanetrootname) $(LDFLAGS)
|
||||
|
||||
$(epanet_objs): $(epanet_heads)
|
||||
|
||||
.PHONY: install
|
||||
install:
|
||||
cat $(runcmdtemplate) | sed 's|libdir|$(libdir)|' \
|
||||
| sed 's|exename|$(bindir)/$(exename)|' \
|
||||
> $(runcmdname)
|
||||
$(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)
|
||||
|
||||
.PHONY: uninstall
|
||||
uninstall:
|
||||
|
||||
.PHONY: check
|
||||
check:
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
-/bin/rm *.o $(libname) $(exename) $(runcmdname)
|
||||
# Linux Makefile for EPANET
|
||||
|
||||
# This will build EPANET as a shared object library
|
||||
# (libepanet_gcc_<Rev>.so) under Linux/Unix, and a standalone
|
||||
# executable (epanet_gcc_<Rev>).
|
||||
|
||||
# The following targets are defined:
|
||||
# make
|
||||
# -Builds libepanet_gcc_<Rev>.so, epanet_gcc_<Rev>
|
||||
# make install
|
||||
# -Creates shell wrapper runepanet_<Rev>.sh that executes epanet_gcc_<Rev>.exe.
|
||||
# The runepanet_<Rev>.sh wrapper simply exports
|
||||
# environment variables that help locate the runtime library,
|
||||
# allowing you to specify your own library locations.
|
||||
# -Installs epanet_gcc_<Rev> and runepanet_<Rev>.sh
|
||||
# in <prefix>/bin, where <prefix> defaults to ~ (and can be set
|
||||
# below to something different - see "Install directories")
|
||||
# -Installs libepanet_gcc_<Rev>.so in <prefix>/lib
|
||||
# -Installs epanet2.h in <prefix>/include. This is the required
|
||||
# header file for the EPANET programmer's toolkit, and thus
|
||||
# <prefix>/include should be on your CPP include search path
|
||||
# for subsequent use of the toolkit and linking with the
|
||||
# library libepanet_gcc_<Rev>.so
|
||||
# make clean
|
||||
# -Removes object and library files, returning the build directory
|
||||
# to its pristine state.
|
||||
|
||||
# You may wish to change the install path 'prefix',
|
||||
# or the compiler flags, but these defaults should be fine.
|
||||
|
||||
SHELL = /bin/sh
|
||||
|
||||
# Target filenames
|
||||
# svnname.sh constructs a name: <prefix><root><Rev><postfix>
|
||||
# where <Rev> is the atomic revision number of the svn repo.
|
||||
epanetsvnpath = ../../..
|
||||
epanetrootname := $(shell ../svnname.sh $(epanetsvnpath) "" epanet_gcc_ "")
|
||||
libname := lib$(epanetrootname).so
|
||||
exename := $(epanetrootname)
|
||||
# Shell wrapper
|
||||
runcmdtemplate = runepanet.sh.template
|
||||
runcmdname = $(shell ../svnname.sh $(epanetsvnpath) "" runepanet_ .sh)
|
||||
# Location of EPANET toolkit includes
|
||||
epanetincludedir = ../../include
|
||||
# Search path for sources
|
||||
epanetsrcdir = ../../src
|
||||
VPATH = $(epanetsrcdir):$(epanetincludedir)
|
||||
|
||||
# Install directories
|
||||
prefix = ~
|
||||
exec_prefix = $(prefix)
|
||||
libdir = $(exec_prefix)/lib
|
||||
bindir = $(exec_prefix)/bin
|
||||
includedir = $(prefix)/include
|
||||
datarootdir = $(prefix)/share
|
||||
docdir = $(datarootdir)/doc/epanet
|
||||
|
||||
# Compiler and flags
|
||||
CC = gcc
|
||||
CFLAGS = -g -O -fPIC
|
||||
CPPFLAGS = -I $(epanetincludedir)
|
||||
LDFLAGS = -L . -W1,-rpath,$(libdir) -lm
|
||||
|
||||
# Installer
|
||||
INSTALL = install
|
||||
INSTALL_PROGRAM = $(INSTALL)
|
||||
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
|
||||
# Epanet header files
|
||||
epanet_heads=enumstxt.h funcs.h hash.h mempool.h text.h toolkit.h types.h vars.h
|
||||
# Epanet main program
|
||||
epanet_main=epanet
|
||||
# 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 $^
|
||||
|
||||
$(exename): $(libname) $(epanet_main_heads)
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -D CLE -c $(epanetsrcdir)/$(epanet_main).c
|
||||
$(CC) $(CFLAGS) -o $@ $(epanet_main).o -l$(epanetrootname) $(LDFLAGS)
|
||||
|
||||
$(epanet_objs): $(epanet_heads)
|
||||
|
||||
.PHONY: install
|
||||
install:
|
||||
cat $(runcmdtemplate) | sed 's|libdir|$(libdir)|' \
|
||||
| sed 's|exename|$(bindir)/$(exename)|' \
|
||||
> $(runcmdname)
|
||||
$(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)
|
||||
|
||||
.PHONY: uninstall
|
||||
uninstall:
|
||||
|
||||
.PHONY: check
|
||||
check:
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
-/bin/rm *.o $(libname) $(exename) $(runcmdname)
|
||||
|
||||
0
build/Linux/runepanet.sh.template
Normal file → Executable file
0
build/Linux/runepanet.sh.template
Normal file → Executable file
0
build/MSVC/Epanet/Epanet.ncb
Normal file → Executable file
0
build/MSVC/Epanet/Epanet.ncb
Normal file → Executable file
60
build/MSVC/Epanet/Epanet.sln
Normal file → Executable file
60
build/MSVC/Epanet/Epanet.sln
Normal file → Executable file
@@ -1,30 +1,30 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 8.00
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EpanetLib", "..\EpanetLib\EpanetLib.vcproj", "{0B2334F0-D2D3-4F11-AA93-D8E2AED5F135}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EpanetRun", "..\EpanetRun\EpanetRun.vcproj", "{11056F72-0330-445F-8DF9-0734DC4F785B}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{0B2334F0-D2D3-4F11-AA93-D8E2AED5F135} = {0B2334F0-D2D3-4F11-AA93-D8E2AED5F135}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfiguration) = preSolution
|
||||
Debug = Debug
|
||||
Release = Release
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfiguration) = postSolution
|
||||
{0B2334F0-D2D3-4F11-AA93-D8E2AED5F135}.Debug.ActiveCfg = Debug|Win32
|
||||
{0B2334F0-D2D3-4F11-AA93-D8E2AED5F135}.Debug.Build.0 = Debug|Win32
|
||||
{0B2334F0-D2D3-4F11-AA93-D8E2AED5F135}.Release.ActiveCfg = Release|Win32
|
||||
{0B2334F0-D2D3-4F11-AA93-D8E2AED5F135}.Release.Build.0 = Release|Win32
|
||||
{11056F72-0330-445F-8DF9-0734DC4F785B}.Debug.ActiveCfg = Debug|Win32
|
||||
{11056F72-0330-445F-8DF9-0734DC4F785B}.Debug.Build.0 = Debug|Win32
|
||||
{11056F72-0330-445F-8DF9-0734DC4F785B}.Release.ActiveCfg = Release|Win32
|
||||
{11056F72-0330-445F-8DF9-0734DC4F785B}.Release.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityAddIns) = postSolution
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
Microsoft Visual Studio Solution File, Format Version 8.00
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EpanetLib", "..\EpanetLib\EpanetLib.vcproj", "{0B2334F0-D2D3-4F11-AA93-D8E2AED5F135}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EpanetRun", "..\EpanetRun\EpanetRun.vcproj", "{11056F72-0330-445F-8DF9-0734DC4F785B}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{0B2334F0-D2D3-4F11-AA93-D8E2AED5F135} = {0B2334F0-D2D3-4F11-AA93-D8E2AED5F135}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfiguration) = preSolution
|
||||
Debug = Debug
|
||||
Release = Release
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfiguration) = postSolution
|
||||
{0B2334F0-D2D3-4F11-AA93-D8E2AED5F135}.Debug.ActiveCfg = Debug|Win32
|
||||
{0B2334F0-D2D3-4F11-AA93-D8E2AED5F135}.Debug.Build.0 = Debug|Win32
|
||||
{0B2334F0-D2D3-4F11-AA93-D8E2AED5F135}.Release.ActiveCfg = Release|Win32
|
||||
{0B2334F0-D2D3-4F11-AA93-D8E2AED5F135}.Release.Build.0 = Release|Win32
|
||||
{11056F72-0330-445F-8DF9-0734DC4F785B}.Debug.ActiveCfg = Debug|Win32
|
||||
{11056F72-0330-445F-8DF9-0734DC4F785B}.Debug.Build.0 = Debug|Win32
|
||||
{11056F72-0330-445F-8DF9-0734DC4F785B}.Release.ActiveCfg = Release|Win32
|
||||
{11056F72-0330-445F-8DF9-0734DC4F785B}.Release.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityAddIns) = postSolution
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
0
build/MSVC/Epanet/Epanet.suo
Normal file → Executable file
0
build/MSVC/Epanet/Epanet.suo
Normal file → Executable file
0
build/MSVC/EpanetLib/EpanetLib.ncb
Normal file → Executable file
0
build/MSVC/EpanetLib/EpanetLib.ncb
Normal file → Executable file
42
build/MSVC/EpanetLib/EpanetLib.sln
Normal file → Executable file
42
build/MSVC/EpanetLib/EpanetLib.sln
Normal file → Executable file
@@ -1,21 +1,21 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 8.00
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EpanetLib", "EpanetLib.vcproj", "{0B2334F0-D2D3-4F11-AA93-D8E2AED5F135}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfiguration) = preSolution
|
||||
Debug = Debug
|
||||
Release = Release
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfiguration) = postSolution
|
||||
{0B2334F0-D2D3-4F11-AA93-D8E2AED5F135}.Debug.ActiveCfg = Debug|Win32
|
||||
{0B2334F0-D2D3-4F11-AA93-D8E2AED5F135}.Debug.Build.0 = Debug|Win32
|
||||
{0B2334F0-D2D3-4F11-AA93-D8E2AED5F135}.Release.ActiveCfg = Release|Win32
|
||||
{0B2334F0-D2D3-4F11-AA93-D8E2AED5F135}.Release.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityAddIns) = postSolution
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
Microsoft Visual Studio Solution File, Format Version 8.00
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EpanetLib", "EpanetLib.vcproj", "{0B2334F0-D2D3-4F11-AA93-D8E2AED5F135}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfiguration) = preSolution
|
||||
Debug = Debug
|
||||
Release = Release
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfiguration) = postSolution
|
||||
{0B2334F0-D2D3-4F11-AA93-D8E2AED5F135}.Debug.ActiveCfg = Debug|Win32
|
||||
{0B2334F0-D2D3-4F11-AA93-D8E2AED5F135}.Debug.Build.0 = Debug|Win32
|
||||
{0B2334F0-D2D3-4F11-AA93-D8E2AED5F135}.Release.ActiveCfg = Release|Win32
|
||||
{0B2334F0-D2D3-4F11-AA93-D8E2AED5F135}.Release.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityAddIns) = postSolution
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
0
build/MSVC/EpanetLib/EpanetLib.suo
Normal file → Executable file
0
build/MSVC/EpanetLib/EpanetLib.suo
Normal file → Executable file
402
build/MSVC/EpanetLib/EpanetLib.vcproj
Normal file → Executable file
402
build/MSVC/EpanetLib/EpanetLib.vcproj
Normal file → Executable file
@@ -1,201 +1,201 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="EpanetLib"
|
||||
ProjectGUID="{0B2334F0-D2D3-4F11-AA93-D8E2AED5F135}"
|
||||
Keyword="Win32Proj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="2"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""C:\Documents and Settings\james\My Documents\ENGCVS\EPANET\BASE\trunk\common""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;EPANETLIB_EXPORTS;DLL"
|
||||
MinimalRebuild="TRUE"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="4"
|
||||
CompileAs="1"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)/epanet_msvc.dll"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile="$(OutDir)/EpanetLib.pdb"
|
||||
SubSystem="2"
|
||||
ImportLibrary="$(OutDir)/epanet_msvc.lib"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="2"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""C:\Documents and Settings\james\My Documents\ENGCVS\EPANET\BASE\trunk\common""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;EPANETLIB_EXPORTS;DLL"
|
||||
RuntimeLibrary="0"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="3"
|
||||
CompileAs="1"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)/epanet_msvc.dll"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="TRUE"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
ImportLibrary="$(OutDir)/epanet_msvc.lib"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
|
||||
<File
|
||||
RelativePath="..\..\..\src\epanet.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\common\hash.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\src\hydraul.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\src\inpfile.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\src\input1.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\src\input2.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\src\input3.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\common\mempool.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\src\output.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\src\quality.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\src\report.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\src\rules.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\src\smatrix.c">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
|
||||
<File
|
||||
RelativePath="..\..\..\src\enumstxt.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\include\epanet2.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\src\funcs.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\common\hash.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\common\mempool.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\src\text.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\src\toolkit.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\src\types.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\src\vars.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="EpanetLib"
|
||||
ProjectGUID="{0B2334F0-D2D3-4F11-AA93-D8E2AED5F135}"
|
||||
Keyword="Win32Proj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="2"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""C:\Documents and Settings\james\My Documents\ENGCVS\EPANET\BASE\trunk\common""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;EPANETLIB_EXPORTS;DLL"
|
||||
MinimalRebuild="TRUE"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="4"
|
||||
CompileAs="1"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)/epanet_msvc.dll"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile="$(OutDir)/EpanetLib.pdb"
|
||||
SubSystem="2"
|
||||
ImportLibrary="$(OutDir)/epanet_msvc.lib"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="2"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""C:\Documents and Settings\james\My Documents\ENGCVS\EPANET\BASE\trunk\common""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;EPANETLIB_EXPORTS;DLL"
|
||||
RuntimeLibrary="0"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="3"
|
||||
CompileAs="1"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)/epanet_msvc.dll"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="TRUE"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
ImportLibrary="$(OutDir)/epanet_msvc.lib"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
|
||||
<File
|
||||
RelativePath="..\..\..\src\epanet.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\common\hash.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\src\hydraul.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\src\inpfile.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\src\input1.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\src\input2.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\src\input3.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\common\mempool.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\src\output.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\src\quality.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\src\report.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\src\rules.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\src\smatrix.c">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
|
||||
<File
|
||||
RelativePath="..\..\..\src\enumstxt.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\include\epanet2.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\src\funcs.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\common\hash.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\common\mempool.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\src\text.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\src\toolkit.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\src\types.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\src\vars.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
|
||||
286
build/MSVC/EpanetRun/EpanetRun.vcproj
Normal file → Executable file
286
build/MSVC/EpanetRun/EpanetRun.vcproj
Normal file → Executable file
@@ -1,143 +1,143 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="EpanetRun"
|
||||
ProjectGUID="{11056F72-0330-445F-8DF9-0734DC4F785B}"
|
||||
Keyword="Win32Proj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""C:\Documents and Settings\james\My Documents\ENGCVS\EPANET\BASE\trunk\include""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
MinimalRebuild="TRUE"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="5"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="4"
|
||||
CompileAs="1"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="epanet_msvc.lib"
|
||||
OutputFile="$(OutDir)/EpanetRun.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories=""C:\Documents and Settings\james\My Documents\ENGCVS\EPANET\BASE\trunk\build\MSVC\EpanetLib\Debug""
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile="$(OutDir)/EpanetRun.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""C:\Documents and Settings\james\My Documents\ENGCVS\EPANET\BASE\trunk\include""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
RuntimeLibrary="4"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="3"
|
||||
CompileAs="1"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="epanet_msvc.lib"
|
||||
OutputFile="$(OutDir)/EpanetRun.exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories=""C:\Documents and Settings\james\My Documents\ENGCVS\EPANET\BASE\trunk\build\MSVC\EpanetLib\Release""
|
||||
GenerateDebugInformation="TRUE"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
|
||||
<File
|
||||
RelativePath="..\..\..\src\epanet.c">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
|
||||
<File
|
||||
RelativePath="..\..\..\include\epanet2.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="EpanetRun"
|
||||
ProjectGUID="{11056F72-0330-445F-8DF9-0734DC4F785B}"
|
||||
Keyword="Win32Proj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""C:\Documents and Settings\james\My Documents\ENGCVS\EPANET\BASE\trunk\include""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
MinimalRebuild="TRUE"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="5"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="4"
|
||||
CompileAs="1"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="epanet_msvc.lib"
|
||||
OutputFile="$(OutDir)/EpanetRun.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories=""C:\Documents and Settings\james\My Documents\ENGCVS\EPANET\BASE\trunk\build\MSVC\EpanetLib\Debug""
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile="$(OutDir)/EpanetRun.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""C:\Documents and Settings\james\My Documents\ENGCVS\EPANET\BASE\trunk\include""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
RuntimeLibrary="4"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="3"
|
||||
CompileAs="1"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="epanet_msvc.lib"
|
||||
OutputFile="$(OutDir)/EpanetRun.exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories=""C:\Documents and Settings\james\My Documents\ENGCVS\EPANET\BASE\trunk\build\MSVC\EpanetLib\Release""
|
||||
GenerateDebugInformation="TRUE"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
|
||||
<File
|
||||
RelativePath="..\..\..\src\epanet.c">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
|
||||
<File
|
||||
RelativePath="..\..\..\include\epanet2.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
|
||||
426
build/MSVC/epanet2.mak
Normal file → Executable file
426
build/MSVC/epanet2.mak
Normal file → Executable file
@@ -1,213 +1,213 @@
|
||||
# Microsoft Developer Studio Generated NMAKE File, Based on epanet2.dsp
|
||||
!IF "$(CFG)" == ""
|
||||
CFG=epanet2 - Win32 Release
|
||||
!MESSAGE No configuration specified. Defaulting to epanet2 - Win32 Release.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" != "epanet2 - Win32 Release"
|
||||
!MESSAGE Invalid configuration "$(CFG)" specified.
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "epanet2.mak" CFG="epanet2 - Win32 Release"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "epanet2 - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE
|
||||
!ERROR An invalid configuration is specified.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(OS)" == "Windows_NT"
|
||||
NULL=
|
||||
!ELSE
|
||||
NULL=nul
|
||||
!ENDIF
|
||||
|
||||
OUTDIR=.\Release
|
||||
INTDIR=.\Release
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Release
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\epanet2.dll"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\epanet.obj"
|
||||
-@erase "$(INTDIR)\hash.obj"
|
||||
-@erase "$(INTDIR)\hydraul.obj"
|
||||
-@erase "$(INTDIR)\inpfile.obj"
|
||||
-@erase "$(INTDIR)\input1.obj"
|
||||
-@erase "$(INTDIR)\input2.obj"
|
||||
-@erase "$(INTDIR)\input3.obj"
|
||||
-@erase "$(INTDIR)\mempool.obj"
|
||||
-@erase "$(INTDIR)\output.obj"
|
||||
-@erase "$(INTDIR)\quality.obj"
|
||||
-@erase "$(INTDIR)\report.obj"
|
||||
-@erase "$(INTDIR)\rules.obj"
|
||||
-@erase "$(INTDIR)\smatrix.obj"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(OUTDIR)\epanet2.dll"
|
||||
-@erase "$(OUTDIR)\epanet2.exp"
|
||||
-@erase "$(OUTDIR)\epanet2.lib"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /MT /W4 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EPANET2_EXPORTS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
MTL=midl.exe
|
||||
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
RSC=rc.exe
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\epanet2.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:no /pdb:"$(OUTDIR)\epanet2.pdb" /machine:I386 /def:"..\epanet2.def" /out:"$(OUTDIR)\epanet2.dll" /implib:"$(OUTDIR)\epanet2.lib"
|
||||
DEF_FILE= \
|
||||
"..\epanet2.def"
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\epanet.obj" \
|
||||
"$(INTDIR)\hash.obj" \
|
||||
"$(INTDIR)\hydraul.obj" \
|
||||
"$(INTDIR)\inpfile.obj" \
|
||||
"$(INTDIR)\input1.obj" \
|
||||
"$(INTDIR)\input2.obj" \
|
||||
"$(INTDIR)\input3.obj" \
|
||||
"$(INTDIR)\mempool.obj" \
|
||||
"$(INTDIR)\output.obj" \
|
||||
"$(INTDIR)\quality.obj" \
|
||||
"$(INTDIR)\report.obj" \
|
||||
"$(INTDIR)\rules.obj" \
|
||||
"$(INTDIR)\smatrix.obj"
|
||||
|
||||
"$(OUTDIR)\epanet2.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
|
||||
!IF "$(NO_EXTERNAL_DEPS)" != "1"
|
||||
!IF EXISTS("epanet2.dep")
|
||||
!INCLUDE "epanet2.dep"
|
||||
!ELSE
|
||||
!MESSAGE Warning: cannot find "epanet2.dep"
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
|
||||
!IF "$(CFG)" == "epanet2 - Win32 Release"
|
||||
SOURCE=..\epanet.c
|
||||
|
||||
"$(INTDIR)\epanet.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=..\hash.c
|
||||
|
||||
"$(INTDIR)\hash.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=..\hydraul.c
|
||||
|
||||
"$(INTDIR)\hydraul.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=..\inpfile.c
|
||||
|
||||
"$(INTDIR)\inpfile.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=..\input1.c
|
||||
|
||||
"$(INTDIR)\input1.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=..\input2.c
|
||||
|
||||
"$(INTDIR)\input2.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=..\input3.c
|
||||
|
||||
"$(INTDIR)\input3.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=..\mempool.c
|
||||
|
||||
"$(INTDIR)\mempool.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=..\output.c
|
||||
|
||||
"$(INTDIR)\output.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=..\quality.c
|
||||
|
||||
"$(INTDIR)\quality.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=..\report.c
|
||||
|
||||
"$(INTDIR)\report.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=..\rules.c
|
||||
|
||||
"$(INTDIR)\rules.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=..\smatrix.c
|
||||
|
||||
"$(INTDIR)\smatrix.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Microsoft Developer Studio Generated NMAKE File, Based on epanet2.dsp
|
||||
!IF "$(CFG)" == ""
|
||||
CFG=epanet2 - Win32 Release
|
||||
!MESSAGE No configuration specified. Defaulting to epanet2 - Win32 Release.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" != "epanet2 - Win32 Release"
|
||||
!MESSAGE Invalid configuration "$(CFG)" specified.
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "epanet2.mak" CFG="epanet2 - Win32 Release"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "epanet2 - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE
|
||||
!ERROR An invalid configuration is specified.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(OS)" == "Windows_NT"
|
||||
NULL=
|
||||
!ELSE
|
||||
NULL=nul
|
||||
!ENDIF
|
||||
|
||||
OUTDIR=.\Release
|
||||
INTDIR=.\Release
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Release
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\epanet2.dll"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\epanet.obj"
|
||||
-@erase "$(INTDIR)\hash.obj"
|
||||
-@erase "$(INTDIR)\hydraul.obj"
|
||||
-@erase "$(INTDIR)\inpfile.obj"
|
||||
-@erase "$(INTDIR)\input1.obj"
|
||||
-@erase "$(INTDIR)\input2.obj"
|
||||
-@erase "$(INTDIR)\input3.obj"
|
||||
-@erase "$(INTDIR)\mempool.obj"
|
||||
-@erase "$(INTDIR)\output.obj"
|
||||
-@erase "$(INTDIR)\quality.obj"
|
||||
-@erase "$(INTDIR)\report.obj"
|
||||
-@erase "$(INTDIR)\rules.obj"
|
||||
-@erase "$(INTDIR)\smatrix.obj"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(OUTDIR)\epanet2.dll"
|
||||
-@erase "$(OUTDIR)\epanet2.exp"
|
||||
-@erase "$(OUTDIR)\epanet2.lib"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /MT /W4 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EPANET2_EXPORTS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
MTL=midl.exe
|
||||
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
RSC=rc.exe
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\epanet2.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:no /pdb:"$(OUTDIR)\epanet2.pdb" /machine:I386 /def:"..\epanet2.def" /out:"$(OUTDIR)\epanet2.dll" /implib:"$(OUTDIR)\epanet2.lib"
|
||||
DEF_FILE= \
|
||||
"..\epanet2.def"
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\epanet.obj" \
|
||||
"$(INTDIR)\hash.obj" \
|
||||
"$(INTDIR)\hydraul.obj" \
|
||||
"$(INTDIR)\inpfile.obj" \
|
||||
"$(INTDIR)\input1.obj" \
|
||||
"$(INTDIR)\input2.obj" \
|
||||
"$(INTDIR)\input3.obj" \
|
||||
"$(INTDIR)\mempool.obj" \
|
||||
"$(INTDIR)\output.obj" \
|
||||
"$(INTDIR)\quality.obj" \
|
||||
"$(INTDIR)\report.obj" \
|
||||
"$(INTDIR)\rules.obj" \
|
||||
"$(INTDIR)\smatrix.obj"
|
||||
|
||||
"$(OUTDIR)\epanet2.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
|
||||
!IF "$(NO_EXTERNAL_DEPS)" != "1"
|
||||
!IF EXISTS("epanet2.dep")
|
||||
!INCLUDE "epanet2.dep"
|
||||
!ELSE
|
||||
!MESSAGE Warning: cannot find "epanet2.dep"
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
|
||||
!IF "$(CFG)" == "epanet2 - Win32 Release"
|
||||
SOURCE=..\epanet.c
|
||||
|
||||
"$(INTDIR)\epanet.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=..\hash.c
|
||||
|
||||
"$(INTDIR)\hash.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=..\hydraul.c
|
||||
|
||||
"$(INTDIR)\hydraul.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=..\inpfile.c
|
||||
|
||||
"$(INTDIR)\inpfile.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=..\input1.c
|
||||
|
||||
"$(INTDIR)\input1.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=..\input2.c
|
||||
|
||||
"$(INTDIR)\input2.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=..\input3.c
|
||||
|
||||
"$(INTDIR)\input3.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=..\mempool.c
|
||||
|
||||
"$(INTDIR)\mempool.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=..\output.c
|
||||
|
||||
"$(INTDIR)\output.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=..\quality.c
|
||||
|
||||
"$(INTDIR)\quality.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=..\report.c
|
||||
|
||||
"$(INTDIR)\report.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=..\rules.c
|
||||
|
||||
"$(INTDIR)\rules.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=..\smatrix.c
|
||||
|
||||
"$(INTDIR)\smatrix.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
||||
0
build/svnname.sh
Normal file → Executable file
0
build/svnname.sh
Normal file → Executable file
108
doc/Readme.txt
Normal file → Executable file
108
doc/Readme.txt
Normal file → Executable file
@@ -1,54 +1,54 @@
|
||||
Contents of EPANET2.ZIP
|
||||
=======================
|
||||
This archive contains the source code for the EPANET 2
|
||||
network hydraulic and water quality solver. The solver
|
||||
provides functions for simulating the extended period
|
||||
hydraulic and water quality behavior of water distribution
|
||||
system pipe networks. It is written in ANSI-compatible C
|
||||
and can be compiled into either a Windows Dynamic Link
|
||||
Library of functions or into a command-line executable.
|
||||
|
||||
The archived code is set up for compilation as a DLL.
|
||||
To compile it as a command line (or console) application
|
||||
simply comment out the "#define DLL" macro statement at
|
||||
the top of EPANET.C and un-comment the "#define CLE" macro.
|
||||
|
||||
The DLL version of the solver (epanet2.dll) is used with
|
||||
the EPANET 2 user interface executable (epanet2w.exe) to
|
||||
form a complete Windows modeling package. It also serves
|
||||
as the function library for the EPANET Programmer's Toolkit,
|
||||
allowing developers to construct their own customized pipe
|
||||
network analysis applications.
|
||||
|
||||
The following C-code files are included in this archive:
|
||||
EPANET.C -- main module providing supervisory control
|
||||
INPUT1.C -- controls processing of input data
|
||||
INPUT2.C -- reads data from input file
|
||||
INPUT3.C -- parses individual lines of input data
|
||||
INPFILE.C -- saves modified input data to a text file
|
||||
RULES.C -- implements rule-based control of piping system
|
||||
HYDRAUL.C -- computes extended period hydraulic behavior
|
||||
QUALITY.C -- tracks transport & fate of water quality
|
||||
OUTPUT.C -- handles transfer of data to and from binary files
|
||||
REPORT.C -- handles reporting of results to text file
|
||||
SMATRIX.C -- sparse matrix linear equation solver routines
|
||||
MEMPOOL.C -- memory pool management routines
|
||||
HASH.C -- hash table routines
|
||||
|
||||
Also included are the following header files:
|
||||
TOOLKIT.H -- function prototypes of exported DLL functions
|
||||
FUNCS.H -- prototypes of all other functions
|
||||
TYPES.H -- declaration of global constants and data structures
|
||||
VARS.H -- declaration of global variables
|
||||
HASH.H -- header file for hash table routines
|
||||
MEMPOOL.H -- header file for memory pool routines
|
||||
ENUMSTXT.H -- string constants for enumerated types
|
||||
TEXT.H -- declaration of all other string constants
|
||||
|
||||
The comments at the top of each file lists the date when the latest
|
||||
update was made, and these updates can be located in the code by
|
||||
searching for comments with the phrase "/*** Updated" or with the
|
||||
release number (e.g., 2.00.12) in them.
|
||||
|
||||
Other useful documentation that can be consulted includes the EPANET
|
||||
Programmers Toolkit Help file and the EPANET Version 2 Users Manual.
|
||||
Contents of EPANET2.ZIP
|
||||
=======================
|
||||
This archive contains the source code for the EPANET 2
|
||||
network hydraulic and water quality solver. The solver
|
||||
provides functions for simulating the extended period
|
||||
hydraulic and water quality behavior of water distribution
|
||||
system pipe networks. It is written in ANSI-compatible C
|
||||
and can be compiled into either a Windows Dynamic Link
|
||||
Library of functions or into a command-line executable.
|
||||
|
||||
The archived code is set up for compilation as a DLL.
|
||||
To compile it as a command line (or console) application
|
||||
simply comment out the "#define DLL" macro statement at
|
||||
the top of EPANET.C and un-comment the "#define CLE" macro.
|
||||
|
||||
The DLL version of the solver (epanet2.dll) is used with
|
||||
the EPANET 2 user interface executable (epanet2w.exe) to
|
||||
form a complete Windows modeling package. It also serves
|
||||
as the function library for the EPANET Programmer's Toolkit,
|
||||
allowing developers to construct their own customized pipe
|
||||
network analysis applications.
|
||||
|
||||
The following C-code files are included in this archive:
|
||||
EPANET.C -- main module providing supervisory control
|
||||
INPUT1.C -- controls processing of input data
|
||||
INPUT2.C -- reads data from input file
|
||||
INPUT3.C -- parses individual lines of input data
|
||||
INPFILE.C -- saves modified input data to a text file
|
||||
RULES.C -- implements rule-based control of piping system
|
||||
HYDRAUL.C -- computes extended period hydraulic behavior
|
||||
QUALITY.C -- tracks transport & fate of water quality
|
||||
OUTPUT.C -- handles transfer of data to and from binary files
|
||||
REPORT.C -- handles reporting of results to text file
|
||||
SMATRIX.C -- sparse matrix linear equation solver routines
|
||||
MEMPOOL.C -- memory pool management routines
|
||||
HASH.C -- hash table routines
|
||||
|
||||
Also included are the following header files:
|
||||
TOOLKIT.H -- function prototypes of exported DLL functions
|
||||
FUNCS.H -- prototypes of all other functions
|
||||
TYPES.H -- declaration of global constants and data structures
|
||||
VARS.H -- declaration of global variables
|
||||
HASH.H -- header file for hash table routines
|
||||
MEMPOOL.H -- header file for memory pool routines
|
||||
ENUMSTXT.H -- string constants for enumerated types
|
||||
TEXT.H -- declaration of all other string constants
|
||||
|
||||
The comments at the top of each file lists the date when the latest
|
||||
update was made, and these updates can be located in the code by
|
||||
searching for comments with the phrase "/*** Updated" or with the
|
||||
release number (e.g., 2.00.12) in them.
|
||||
|
||||
Other useful documentation that can be consulted includes the EPANET
|
||||
Programmers Toolkit Help file and the EPANET Version 2 Users Manual.
|
||||
|
||||
114
doc/changes.txt
Normal file → Executable file
114
doc/changes.txt
Normal file → Executable file
@@ -1,57 +1,57 @@
|
||||
-----------------------
|
||||
Build 2.00.12 (2/25/08)
|
||||
-----------------------
|
||||
|
||||
Computational Engine Changes (epanet2.dll and epanet2d.exe):
|
||||
===============================================================================
|
||||
CODE MODULES CHANGES
|
||||
===============================================================================
|
||||
EPANET.C Temporary files are now written to the users's current working
|
||||
INPUT1.C directory or to the designated Temporary Directory when running
|
||||
VARS.H the Windows GUI, thus avoiding file access problems for users
|
||||
FUNCS.H who do not have administrative privileges on their machine.
|
||||
-------------------------------------------------------------------------------
|
||||
EPANET.C The following tank parameters were made available for retrieval
|
||||
TOOLKIT.H using the Toolkit's ENgetnodevalue function: tank diameter,
|
||||
EPANET2.H minimum volume, index of the tank's volume curve, the initial,
|
||||
minimum, and maximum water levels, the fraction of a 2-compart-
|
||||
ment tank devoted to the mixing zone, and the tank's bulk
|
||||
reaction rate coefficient. These same parameters (with the
|
||||
exception of the volume curve) were made modifiable using the
|
||||
ENsetnodevalue function, as was the choice of mixing model.
|
||||
See the Toolkit Help file for details.
|
||||
-------------------------------------------------------------------------------
|
||||
EPANET.C A new Toolkit function, ENaddpattern, was added that allows
|
||||
TOOLKIT.C programmers to add a new time pattern to the network in any
|
||||
EPANET2.H custom code that they write.
|
||||
-------------------------------------------------------------------------------
|
||||
HYDRAUL.C A DAMPLIMIT parameter was added to control at what point during
|
||||
INPUT1.C the hydraulic solution iterations status checks on PRVs and PSVs
|
||||
INPUT3.C begin and subsequent flow changes are dampened.
|
||||
REPORT.C
|
||||
VARS.H
|
||||
TEXT.H
|
||||
-------------------------------------------------------------------------------
|
||||
HYDRAUL.C Demands for tanks (net inflows/outflows) were not always being
|
||||
set to zero when the tank was full or empty which was causing
|
||||
problems in the water quality routing solutions.
|
||||
-------------------------------------------------------------------------------
|
||||
QUALITY.C The water quality functions for all of the tank mixing models
|
||||
were modified so as to produce more robust results for cases
|
||||
where there is a significant amount of volume exchange over a
|
||||
water quality time step.
|
||||
-------------------------------------------------------------------------------
|
||||
EPANET.C A problem with the system not recognizing that water quality
|
||||
QUALITY.C reactions could begin after some initial period of time when
|
||||
VARS.H the Toolkit was used to modify reaction rate coefficients was
|
||||
fixed.
|
||||
-------------------------------------------------------------------------------
|
||||
INPFILE.C A problem with extraneous lines being written to the [REPORT]
|
||||
section of an EPANET input file created with the ENsaveinpfile
|
||||
function was fixed. Also the number of decimal places for some
|
||||
items written to the saved file, such as nodal demands, was
|
||||
increased.
|
||||
-------------------------------------------------------------------------------
|
||||
TYPES.H The code version was changed to 20012 and INT4 was explicitly
|
||||
defined as an "int" data type.
|
||||
===============================================================================
|
||||
-----------------------
|
||||
Build 2.00.12 (2/25/08)
|
||||
-----------------------
|
||||
|
||||
Computational Engine Changes (epanet2.dll and epanet2d.exe):
|
||||
===============================================================================
|
||||
CODE MODULES CHANGES
|
||||
===============================================================================
|
||||
EPANET.C Temporary files are now written to the users's current working
|
||||
INPUT1.C directory or to the designated Temporary Directory when running
|
||||
VARS.H the Windows GUI, thus avoiding file access problems for users
|
||||
FUNCS.H who do not have administrative privileges on their machine.
|
||||
-------------------------------------------------------------------------------
|
||||
EPANET.C The following tank parameters were made available for retrieval
|
||||
TOOLKIT.H using the Toolkit's ENgetnodevalue function: tank diameter,
|
||||
EPANET2.H minimum volume, index of the tank's volume curve, the initial,
|
||||
minimum, and maximum water levels, the fraction of a 2-compart-
|
||||
ment tank devoted to the mixing zone, and the tank's bulk
|
||||
reaction rate coefficient. These same parameters (with the
|
||||
exception of the volume curve) were made modifiable using the
|
||||
ENsetnodevalue function, as was the choice of mixing model.
|
||||
See the Toolkit Help file for details.
|
||||
-------------------------------------------------------------------------------
|
||||
EPANET.C A new Toolkit function, ENaddpattern, was added that allows
|
||||
TOOLKIT.C programmers to add a new time pattern to the network in any
|
||||
EPANET2.H custom code that they write.
|
||||
-------------------------------------------------------------------------------
|
||||
HYDRAUL.C A DAMPLIMIT parameter was added to control at what point during
|
||||
INPUT1.C the hydraulic solution iterations status checks on PRVs and PSVs
|
||||
INPUT3.C begin and subsequent flow changes are dampened.
|
||||
REPORT.C
|
||||
VARS.H
|
||||
TEXT.H
|
||||
-------------------------------------------------------------------------------
|
||||
HYDRAUL.C Demands for tanks (net inflows/outflows) were not always being
|
||||
set to zero when the tank was full or empty which was causing
|
||||
problems in the water quality routing solutions.
|
||||
-------------------------------------------------------------------------------
|
||||
QUALITY.C The water quality functions for all of the tank mixing models
|
||||
were modified so as to produce more robust results for cases
|
||||
where there is a significant amount of volume exchange over a
|
||||
water quality time step.
|
||||
-------------------------------------------------------------------------------
|
||||
EPANET.C A problem with the system not recognizing that water quality
|
||||
QUALITY.C reactions could begin after some initial period of time when
|
||||
VARS.H the Toolkit was used to modify reaction rate coefficients was
|
||||
fixed.
|
||||
-------------------------------------------------------------------------------
|
||||
INPFILE.C A problem with extraneous lines being written to the [REPORT]
|
||||
section of an EPANET input file created with the ENsaveinpfile
|
||||
function was fixed. Also the number of decimal places for some
|
||||
items written to the saved file, such as nodal demands, was
|
||||
increased.
|
||||
-------------------------------------------------------------------------------
|
||||
TYPES.H The code version was changed to 20012 and INT4 was explicitly
|
||||
defined as an "int" data type.
|
||||
===============================================================================
|
||||
|
||||
458
include/epanet2.h
Normal file → Executable file
458
include/epanet2.h
Normal file → Executable file
@@ -1,229 +1,229 @@
|
||||
/*
|
||||
** EPANET2.H
|
||||
**
|
||||
** C/C++ header file for EPANET Programmers Toolkit
|
||||
**
|
||||
** Last updated on 2/14/08 (2.00.12)
|
||||
*/
|
||||
|
||||
#ifndef EPANET2_H
|
||||
#define EPANET2_H
|
||||
|
||||
// --- Define the EPANET toolkit constants
|
||||
|
||||
#define EN_ELEVATION 0 /* Node parameters */
|
||||
#define EN_BASEDEMAND 1
|
||||
#define EN_PATTERN 2
|
||||
#define EN_EMITTER 3
|
||||
#define EN_INITQUAL 4
|
||||
#define EN_SOURCEQUAL 5
|
||||
#define EN_SOURCEPAT 6
|
||||
#define EN_SOURCETYPE 7
|
||||
#define EN_TANKLEVEL 8
|
||||
#define EN_DEMAND 9
|
||||
#define EN_HEAD 10
|
||||
#define EN_PRESSURE 11
|
||||
#define EN_QUALITY 12
|
||||
#define EN_SOURCEMASS 13
|
||||
#define EN_INITVOLUME 14
|
||||
#define EN_MIXMODEL 15
|
||||
#define EN_MIXZONEVOL 16
|
||||
|
||||
#define EN_TANKDIAM 17
|
||||
#define EN_MINVOLUME 18
|
||||
#define EN_VOLCURVE 19
|
||||
#define EN_MINLEVEL 20
|
||||
#define EN_MAXLEVEL 21
|
||||
#define EN_MIXFRACTION 22
|
||||
#define EN_TANK_KBULK 23
|
||||
|
||||
#define EN_DIAMETER 0 /* Link parameters */
|
||||
#define EN_LENGTH 1
|
||||
#define EN_ROUGHNESS 2
|
||||
#define EN_MINORLOSS 3
|
||||
#define EN_INITSTATUS 4
|
||||
#define EN_INITSETTING 5
|
||||
#define EN_KBULK 6
|
||||
#define EN_KWALL 7
|
||||
#define EN_FLOW 8
|
||||
#define EN_VELOCITY 9
|
||||
#define EN_HEADLOSS 10
|
||||
#define EN_STATUS 11
|
||||
#define EN_SETTING 12
|
||||
#define EN_ENERGY 13
|
||||
|
||||
#define EN_DURATION 0 /* Time parameters */
|
||||
#define EN_HYDSTEP 1
|
||||
#define EN_QUALSTEP 2
|
||||
#define EN_PATTERNSTEP 3
|
||||
#define EN_PATTERNSTART 4
|
||||
#define EN_REPORTSTEP 5
|
||||
#define EN_REPORTSTART 6
|
||||
#define EN_RULESTEP 7
|
||||
#define EN_STATISTIC 8
|
||||
#define EN_PERIODS 9
|
||||
|
||||
#define EN_NODECOUNT 0 /* Component counts */
|
||||
#define EN_TANKCOUNT 1
|
||||
#define EN_LINKCOUNT 2
|
||||
#define EN_PATCOUNT 3
|
||||
#define EN_CURVECOUNT 4
|
||||
#define EN_CONTROLCOUNT 5
|
||||
|
||||
#define EN_JUNCTION 0 /* Node types */
|
||||
#define EN_RESERVOIR 1
|
||||
#define EN_TANK 2
|
||||
|
||||
#define EN_CVPIPE 0 /* Link types */
|
||||
#define EN_PIPE 1
|
||||
#define EN_PUMP 2
|
||||
#define EN_PRV 3
|
||||
#define EN_PSV 4
|
||||
#define EN_PBV 5
|
||||
#define EN_FCV 6
|
||||
#define EN_TCV 7
|
||||
#define EN_GPV 8
|
||||
|
||||
#define EN_NONE 0 /* Quality analysis types */
|
||||
#define EN_CHEM 1
|
||||
#define EN_AGE 2
|
||||
#define EN_TRACE 3
|
||||
|
||||
#define EN_CONCEN 0 /* Source quality types */
|
||||
#define EN_MASS 1
|
||||
#define EN_SETPOINT 2
|
||||
#define EN_FLOWPACED 3
|
||||
|
||||
#define EN_CFS 0 /* Flow units types */
|
||||
#define EN_GPM 1
|
||||
#define EN_MGD 2
|
||||
#define EN_IMGD 3
|
||||
#define EN_AFD 4
|
||||
#define EN_LPS 5
|
||||
#define EN_LPM 6
|
||||
#define EN_MLD 7
|
||||
#define EN_CMH 8
|
||||
#define EN_CMD 9
|
||||
|
||||
#define EN_TRIALS 0 /* Misc. options */
|
||||
#define EN_ACCURACY 1
|
||||
#define EN_TOLERANCE 2
|
||||
#define EN_EMITEXPON 3
|
||||
#define EN_DEMANDMULT 4
|
||||
|
||||
#define EN_LOWLEVEL 0 /* Control types */
|
||||
#define EN_HILEVEL 1
|
||||
#define EN_TIMER 2
|
||||
#define EN_TIMEOFDAY 3
|
||||
|
||||
#define EN_AVERAGE 1 /* Time statistic types. */
|
||||
#define EN_MINIMUM 2
|
||||
#define EN_MAXIMUM 3
|
||||
#define EN_RANGE 4
|
||||
|
||||
#define EN_MIX1 0 /* Tank mixing models */
|
||||
#define EN_MIX2 1
|
||||
#define EN_FIFO 2
|
||||
#define EN_LIFO 3
|
||||
|
||||
#define EN_NOSAVE 0 /* Save-results-to-file flag */
|
||||
#define EN_SAVE 1
|
||||
#define EN_INITFLOW 10 /* Re-initialize flow flag */
|
||||
|
||||
|
||||
|
||||
// --- define WINDOWS
|
||||
|
||||
#undef WINDOWS
|
||||
#ifdef _WIN32
|
||||
#define WINDOWS
|
||||
#endif
|
||||
#ifdef __WIN32__
|
||||
#define WINDOWS
|
||||
#endif
|
||||
|
||||
// --- define DLLEXPORT
|
||||
|
||||
#ifdef WINDOWS
|
||||
#ifdef __cplusplus
|
||||
#define DLLEXPORT extern "C" __declspec(dllexport) __stdcall
|
||||
#else
|
||||
#define DLLEXPORT __declspec(dllexport) __stdcall
|
||||
#endif
|
||||
#else
|
||||
#ifdef __cplusplus
|
||||
#define DLLEXPORT extern "C"
|
||||
#else
|
||||
#define DLLEXPORT
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
// --- declare the EPANET toolkit functions
|
||||
|
||||
int DLLEXPORT ENepanet(char *, char *, char *, void (*) (char *));
|
||||
int DLLEXPORT ENopen(char *, char *, char *);
|
||||
int DLLEXPORT ENsaveinpfile(char *);
|
||||
int DLLEXPORT ENclose(void);
|
||||
|
||||
int DLLEXPORT ENsolveH(void);
|
||||
int DLLEXPORT ENsaveH(void);
|
||||
int DLLEXPORT ENopenH(void);
|
||||
int DLLEXPORT ENinitH(int);
|
||||
int DLLEXPORT ENrunH(long *);
|
||||
int DLLEXPORT ENnextH(long *);
|
||||
int DLLEXPORT ENcloseH(void);
|
||||
int DLLEXPORT ENsavehydfile(char *);
|
||||
int DLLEXPORT ENusehydfile(char *);
|
||||
|
||||
int DLLEXPORT ENsolveQ(void);
|
||||
int DLLEXPORT ENopenQ(void);
|
||||
int DLLEXPORT ENinitQ(int);
|
||||
int DLLEXPORT ENrunQ(long *);
|
||||
int DLLEXPORT ENnextQ(long *);
|
||||
int DLLEXPORT ENstepQ(long *);
|
||||
int DLLEXPORT ENcloseQ(void);
|
||||
|
||||
int DLLEXPORT ENwriteline(char *);
|
||||
int DLLEXPORT ENreport(void);
|
||||
int DLLEXPORT ENresetreport(void);
|
||||
int DLLEXPORT ENsetreport(char *);
|
||||
|
||||
int DLLEXPORT ENgetcontrol(int, int *, int *, float *,
|
||||
int *, float *);
|
||||
int DLLEXPORT ENgetcount(int, int *);
|
||||
int DLLEXPORT ENgetoption(int, float *);
|
||||
int DLLEXPORT ENgettimeparam(int, long *);
|
||||
int DLLEXPORT ENgetflowunits(int *);
|
||||
int DLLEXPORT ENgetpatternindex(char *, int *);
|
||||
int DLLEXPORT ENgetpatternid(int, char *);
|
||||
int DLLEXPORT ENgetpatternlen(int, int *);
|
||||
int DLLEXPORT ENgetpatternvalue(int, int, float *);
|
||||
int DLLEXPORT ENgetqualtype(int *, int *);
|
||||
int DLLEXPORT ENgeterror(int, char *, int);
|
||||
|
||||
int DLLEXPORT ENgetnodeindex(char *, int *);
|
||||
int DLLEXPORT ENgetnodeid(int, char *);
|
||||
int DLLEXPORT ENgetnodetype(int, int *);
|
||||
int DLLEXPORT ENgetnodevalue(int, int, float *);
|
||||
|
||||
int DLLEXPORT ENgetlinkindex(char *, int *);
|
||||
int DLLEXPORT ENgetlinkid(int, char *);
|
||||
int DLLEXPORT ENgetlinktype(int, int *);
|
||||
int DLLEXPORT ENgetlinknodes(int, int *, int *);
|
||||
int DLLEXPORT ENgetlinkvalue(int, int, float *);
|
||||
|
||||
int DLLEXPORT ENgetversion(int *);
|
||||
|
||||
int DLLEXPORT ENsetcontrol(int, int, int, float, int, float);
|
||||
int DLLEXPORT ENsetnodevalue(int, int, float);
|
||||
int DLLEXPORT ENsetlinkvalue(int, int, float);
|
||||
int DLLEXPORT ENaddpattern(char *);
|
||||
int DLLEXPORT ENsetpattern(int, float *, int);
|
||||
int DLLEXPORT ENsetpatternvalue(int, int, float);
|
||||
int DLLEXPORT ENsettimeparam(int, long);
|
||||
int DLLEXPORT ENsetoption(int, float);
|
||||
int DLLEXPORT ENsetstatusreport(int);
|
||||
int DLLEXPORT ENsetqualtype(int, char *, char *, char *);
|
||||
|
||||
#endif
|
||||
/*
|
||||
** EPANET2.H
|
||||
**
|
||||
** C/C++ header file for EPANET Programmers Toolkit
|
||||
**
|
||||
** Last updated on 2/14/08 (2.00.12)
|
||||
*/
|
||||
|
||||
#ifndef EPANET2_H
|
||||
#define EPANET2_H
|
||||
|
||||
// --- Define the EPANET toolkit constants
|
||||
|
||||
#define EN_ELEVATION 0 /* Node parameters */
|
||||
#define EN_BASEDEMAND 1
|
||||
#define EN_PATTERN 2
|
||||
#define EN_EMITTER 3
|
||||
#define EN_INITQUAL 4
|
||||
#define EN_SOURCEQUAL 5
|
||||
#define EN_SOURCEPAT 6
|
||||
#define EN_SOURCETYPE 7
|
||||
#define EN_TANKLEVEL 8
|
||||
#define EN_DEMAND 9
|
||||
#define EN_HEAD 10
|
||||
#define EN_PRESSURE 11
|
||||
#define EN_QUALITY 12
|
||||
#define EN_SOURCEMASS 13
|
||||
#define EN_INITVOLUME 14
|
||||
#define EN_MIXMODEL 15
|
||||
#define EN_MIXZONEVOL 16
|
||||
|
||||
#define EN_TANKDIAM 17
|
||||
#define EN_MINVOLUME 18
|
||||
#define EN_VOLCURVE 19
|
||||
#define EN_MINLEVEL 20
|
||||
#define EN_MAXLEVEL 21
|
||||
#define EN_MIXFRACTION 22
|
||||
#define EN_TANK_KBULK 23
|
||||
|
||||
#define EN_DIAMETER 0 /* Link parameters */
|
||||
#define EN_LENGTH 1
|
||||
#define EN_ROUGHNESS 2
|
||||
#define EN_MINORLOSS 3
|
||||
#define EN_INITSTATUS 4
|
||||
#define EN_INITSETTING 5
|
||||
#define EN_KBULK 6
|
||||
#define EN_KWALL 7
|
||||
#define EN_FLOW 8
|
||||
#define EN_VELOCITY 9
|
||||
#define EN_HEADLOSS 10
|
||||
#define EN_STATUS 11
|
||||
#define EN_SETTING 12
|
||||
#define EN_ENERGY 13
|
||||
|
||||
#define EN_DURATION 0 /* Time parameters */
|
||||
#define EN_HYDSTEP 1
|
||||
#define EN_QUALSTEP 2
|
||||
#define EN_PATTERNSTEP 3
|
||||
#define EN_PATTERNSTART 4
|
||||
#define EN_REPORTSTEP 5
|
||||
#define EN_REPORTSTART 6
|
||||
#define EN_RULESTEP 7
|
||||
#define EN_STATISTIC 8
|
||||
#define EN_PERIODS 9
|
||||
|
||||
#define EN_NODECOUNT 0 /* Component counts */
|
||||
#define EN_TANKCOUNT 1
|
||||
#define EN_LINKCOUNT 2
|
||||
#define EN_PATCOUNT 3
|
||||
#define EN_CURVECOUNT 4
|
||||
#define EN_CONTROLCOUNT 5
|
||||
|
||||
#define EN_JUNCTION 0 /* Node types */
|
||||
#define EN_RESERVOIR 1
|
||||
#define EN_TANK 2
|
||||
|
||||
#define EN_CVPIPE 0 /* Link types */
|
||||
#define EN_PIPE 1
|
||||
#define EN_PUMP 2
|
||||
#define EN_PRV 3
|
||||
#define EN_PSV 4
|
||||
#define EN_PBV 5
|
||||
#define EN_FCV 6
|
||||
#define EN_TCV 7
|
||||
#define EN_GPV 8
|
||||
|
||||
#define EN_NONE 0 /* Quality analysis types */
|
||||
#define EN_CHEM 1
|
||||
#define EN_AGE 2
|
||||
#define EN_TRACE 3
|
||||
|
||||
#define EN_CONCEN 0 /* Source quality types */
|
||||
#define EN_MASS 1
|
||||
#define EN_SETPOINT 2
|
||||
#define EN_FLOWPACED 3
|
||||
|
||||
#define EN_CFS 0 /* Flow units types */
|
||||
#define EN_GPM 1
|
||||
#define EN_MGD 2
|
||||
#define EN_IMGD 3
|
||||
#define EN_AFD 4
|
||||
#define EN_LPS 5
|
||||
#define EN_LPM 6
|
||||
#define EN_MLD 7
|
||||
#define EN_CMH 8
|
||||
#define EN_CMD 9
|
||||
|
||||
#define EN_TRIALS 0 /* Misc. options */
|
||||
#define EN_ACCURACY 1
|
||||
#define EN_TOLERANCE 2
|
||||
#define EN_EMITEXPON 3
|
||||
#define EN_DEMANDMULT 4
|
||||
|
||||
#define EN_LOWLEVEL 0 /* Control types */
|
||||
#define EN_HILEVEL 1
|
||||
#define EN_TIMER 2
|
||||
#define EN_TIMEOFDAY 3
|
||||
|
||||
#define EN_AVERAGE 1 /* Time statistic types. */
|
||||
#define EN_MINIMUM 2
|
||||
#define EN_MAXIMUM 3
|
||||
#define EN_RANGE 4
|
||||
|
||||
#define EN_MIX1 0 /* Tank mixing models */
|
||||
#define EN_MIX2 1
|
||||
#define EN_FIFO 2
|
||||
#define EN_LIFO 3
|
||||
|
||||
#define EN_NOSAVE 0 /* Save-results-to-file flag */
|
||||
#define EN_SAVE 1
|
||||
#define EN_INITFLOW 10 /* Re-initialize flow flag */
|
||||
|
||||
|
||||
|
||||
// --- define WINDOWS
|
||||
|
||||
#undef WINDOWS
|
||||
#ifdef _WIN32
|
||||
#define WINDOWS
|
||||
#endif
|
||||
#ifdef __WIN32__
|
||||
#define WINDOWS
|
||||
#endif
|
||||
|
||||
// --- define DLLEXPORT
|
||||
|
||||
#ifdef WINDOWS
|
||||
#ifdef __cplusplus
|
||||
#define DLLEXPORT extern "C" __declspec(dllexport) __stdcall
|
||||
#else
|
||||
#define DLLEXPORT __declspec(dllexport) __stdcall
|
||||
#endif
|
||||
#else
|
||||
#ifdef __cplusplus
|
||||
#define DLLEXPORT extern "C"
|
||||
#else
|
||||
#define DLLEXPORT
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
// --- declare the EPANET toolkit functions
|
||||
|
||||
int DLLEXPORT ENepanet(char *, char *, char *, void (*) (char *));
|
||||
int DLLEXPORT ENopen(char *, char *, char *);
|
||||
int DLLEXPORT ENsaveinpfile(char *);
|
||||
int DLLEXPORT ENclose(void);
|
||||
|
||||
int DLLEXPORT ENsolveH(void);
|
||||
int DLLEXPORT ENsaveH(void);
|
||||
int DLLEXPORT ENopenH(void);
|
||||
int DLLEXPORT ENinitH(int);
|
||||
int DLLEXPORT ENrunH(long *);
|
||||
int DLLEXPORT ENnextH(long *);
|
||||
int DLLEXPORT ENcloseH(void);
|
||||
int DLLEXPORT ENsavehydfile(char *);
|
||||
int DLLEXPORT ENusehydfile(char *);
|
||||
|
||||
int DLLEXPORT ENsolveQ(void);
|
||||
int DLLEXPORT ENopenQ(void);
|
||||
int DLLEXPORT ENinitQ(int);
|
||||
int DLLEXPORT ENrunQ(long *);
|
||||
int DLLEXPORT ENnextQ(long *);
|
||||
int DLLEXPORT ENstepQ(long *);
|
||||
int DLLEXPORT ENcloseQ(void);
|
||||
|
||||
int DLLEXPORT ENwriteline(char *);
|
||||
int DLLEXPORT ENreport(void);
|
||||
int DLLEXPORT ENresetreport(void);
|
||||
int DLLEXPORT ENsetreport(char *);
|
||||
|
||||
int DLLEXPORT ENgetcontrol(int, int *, int *, float *,
|
||||
int *, float *);
|
||||
int DLLEXPORT ENgetcount(int, int *);
|
||||
int DLLEXPORT ENgetoption(int, float *);
|
||||
int DLLEXPORT ENgettimeparam(int, long *);
|
||||
int DLLEXPORT ENgetflowunits(int *);
|
||||
int DLLEXPORT ENgetpatternindex(char *, int *);
|
||||
int DLLEXPORT ENgetpatternid(int, char *);
|
||||
int DLLEXPORT ENgetpatternlen(int, int *);
|
||||
int DLLEXPORT ENgetpatternvalue(int, int, float *);
|
||||
int DLLEXPORT ENgetqualtype(int *, int *);
|
||||
int DLLEXPORT ENgeterror(int, char *, int);
|
||||
|
||||
int DLLEXPORT ENgetnodeindex(char *, int *);
|
||||
int DLLEXPORT ENgetnodeid(int, char *);
|
||||
int DLLEXPORT ENgetnodetype(int, int *);
|
||||
int DLLEXPORT ENgetnodevalue(int, int, float *);
|
||||
|
||||
int DLLEXPORT ENgetlinkindex(char *, int *);
|
||||
int DLLEXPORT ENgetlinkid(int, char *);
|
||||
int DLLEXPORT ENgetlinktype(int, int *);
|
||||
int DLLEXPORT ENgetlinknodes(int, int *, int *);
|
||||
int DLLEXPORT ENgetlinkvalue(int, int, float *);
|
||||
|
||||
int DLLEXPORT ENgetversion(int *);
|
||||
|
||||
int DLLEXPORT ENsetcontrol(int, int, int, float, int, float);
|
||||
int DLLEXPORT ENsetnodevalue(int, int, float);
|
||||
int DLLEXPORT ENsetlinkvalue(int, int, float);
|
||||
int DLLEXPORT ENaddpattern(char *);
|
||||
int DLLEXPORT ENsetpattern(int, float *, int);
|
||||
int DLLEXPORT ENsetpatternvalue(int, int, float);
|
||||
int DLLEXPORT ENsettimeparam(int, long);
|
||||
int DLLEXPORT ENsetoption(int, float);
|
||||
int DLLEXPORT ENsetstatusreport(int);
|
||||
int DLLEXPORT ENsetqualtype(int, char *, char *, char *);
|
||||
|
||||
#endif
|
||||
|
||||
270
src/enumstxt.h
Normal file → Executable file
270
src/enumstxt.h
Normal file → Executable file
@@ -1,135 +1,135 @@
|
||||
/*
|
||||
***********************************************************************
|
||||
|
||||
ENUMSTXT.H -- Text strings for enumerated data types in EPANET
|
||||
|
||||
VERSION: 2.00
|
||||
DATE: 5/8/00
|
||||
AUTHOR: L. Rossman
|
||||
US EPA - NRMRL
|
||||
|
||||
**********************************************************************
|
||||
*/
|
||||
|
||||
char *NodeTxt[] = {t_JUNCTION,
|
||||
t_RESERVOIR,
|
||||
t_TANK};
|
||||
|
||||
char *LinkTxt[] = {w_CV,
|
||||
w_PIPE,
|
||||
w_PUMP,
|
||||
w_PRV,
|
||||
w_PSV,
|
||||
w_PBV,
|
||||
w_FCV,
|
||||
w_TCV,
|
||||
w_GPV};
|
||||
|
||||
char *StatTxt[] = {t_XHEAD,
|
||||
t_TEMPCLOSED,
|
||||
t_CLOSED,
|
||||
t_OPEN,
|
||||
t_ACTIVE,
|
||||
t_XFLOW,
|
||||
t_XFCV,
|
||||
t_XPRESSURE,
|
||||
t_FILLING,
|
||||
t_EMPTYING};
|
||||
|
||||
char *FormTxt[] = {w_HW,
|
||||
w_DW,
|
||||
w_CM};
|
||||
|
||||
char *RptFormTxt[] = {t_HW,
|
||||
t_DW,
|
||||
t_CM};
|
||||
|
||||
char *RptFlowUnitsTxt[] = {u_CFS,
|
||||
u_GPM,
|
||||
u_MGD,
|
||||
u_IMGD,
|
||||
u_AFD,
|
||||
u_LPS,
|
||||
u_LPM,
|
||||
u_MLD,
|
||||
u_CMH,
|
||||
u_CMD};
|
||||
|
||||
char *FlowUnitsTxt[] = {w_CFS,
|
||||
w_GPM,
|
||||
w_MGD,
|
||||
w_IMGD,
|
||||
w_AFD,
|
||||
w_LPS,
|
||||
w_LPM,
|
||||
w_MLD,
|
||||
w_CMH,
|
||||
w_CMD};
|
||||
|
||||
char *PressUnitsTxt[] = {w_PSI,
|
||||
w_KPA,
|
||||
w_METERS};
|
||||
|
||||
char *QualTxt[] = {w_NONE,
|
||||
w_CHEM,
|
||||
w_AGE,
|
||||
w_TRACE};
|
||||
|
||||
|
||||
char *SourceTxt[] = {w_CONCEN,
|
||||
w_MASS,
|
||||
w_SETPOINT,
|
||||
w_FLOWPACED};
|
||||
|
||||
char *ControlTxt[] = {w_BELOW,
|
||||
w_ABOVE,
|
||||
w_TIME,
|
||||
w_CLOCKTIME};
|
||||
|
||||
char *TstatTxt[] = {w_NONE,
|
||||
w_AVG,
|
||||
w_MIN,
|
||||
w_MAX,
|
||||
w_RANGE};
|
||||
|
||||
char *MixTxt[] = {w_MIXED,
|
||||
w_2COMP,
|
||||
w_FIFO,
|
||||
w_LIFO,
|
||||
NULL};
|
||||
|
||||
char *RptFlagTxt[] = {w_NO,
|
||||
w_YES,
|
||||
w_FULL};
|
||||
|
||||
char *SectTxt[] = {s_TITLE, s_JUNCTIONS, s_RESERVOIRS,
|
||||
s_TANKS, s_PIPES, s_PUMPS,
|
||||
s_VALVES, s_CONTROLS, s_RULES,
|
||||
s_DEMANDS, s_SOURCES, s_EMITTERS,
|
||||
s_PATTERNS, s_CURVES, s_QUALITY,
|
||||
s_STATUS, s_ROUGHNESS, s_ENERGY,
|
||||
s_REACTIONS, s_MIXING, s_REPORT,
|
||||
s_TIMES, s_OPTIONS, s_COORDS,
|
||||
s_VERTICES, s_LABELS, s_BACKDROP,
|
||||
s_TAGS, s_END,
|
||||
NULL};
|
||||
|
||||
char *RptSectTxt[] = {NULL, t_JUNCTION, t_RESERVOIR,
|
||||
t_TANK, t_PIPE, t_PUMP,
|
||||
t_VALVE, t_CONTROL, t_RULE,
|
||||
t_DEMANDFOR,t_SOURCE, t_EMITTER,
|
||||
t_PATTERN, t_CURVE, t_QUALITY,
|
||||
t_STATUS, t_ROUGHNESS,t_ENERGY,
|
||||
t_REACTION, t_MIXING, t_REPORT,
|
||||
t_TIME, t_OPTION};
|
||||
|
||||
char *Fldname[] = {t_ELEV, t_DEMAND, t_HEAD,
|
||||
t_PRESSURE, t_QUALITY, t_LENGTH,
|
||||
t_DIAM, t_FLOW, t_VELOCITY,
|
||||
t_HEADLOSS, t_LINKQUAL, t_LINKSTATUS,
|
||||
t_SETTING, t_REACTRATE, t_FRICTION,
|
||||
"", "", "", "", "", "", NULL};
|
||||
|
||||
char *LogoTxt[] = {LOGO1,LOGO2,LOGO3,LOGO4,LOGO5,LOGO6,NULL};
|
||||
|
||||
|
||||
/*
|
||||
***********************************************************************
|
||||
|
||||
ENUMSTXT.H -- Text strings for enumerated data types in EPANET
|
||||
|
||||
VERSION: 2.00
|
||||
DATE: 5/8/00
|
||||
AUTHOR: L. Rossman
|
||||
US EPA - NRMRL
|
||||
|
||||
**********************************************************************
|
||||
*/
|
||||
|
||||
char *NodeTxt[] = {t_JUNCTION,
|
||||
t_RESERVOIR,
|
||||
t_TANK};
|
||||
|
||||
char *LinkTxt[] = {w_CV,
|
||||
w_PIPE,
|
||||
w_PUMP,
|
||||
w_PRV,
|
||||
w_PSV,
|
||||
w_PBV,
|
||||
w_FCV,
|
||||
w_TCV,
|
||||
w_GPV};
|
||||
|
||||
char *StatTxt[] = {t_XHEAD,
|
||||
t_TEMPCLOSED,
|
||||
t_CLOSED,
|
||||
t_OPEN,
|
||||
t_ACTIVE,
|
||||
t_XFLOW,
|
||||
t_XFCV,
|
||||
t_XPRESSURE,
|
||||
t_FILLING,
|
||||
t_EMPTYING};
|
||||
|
||||
char *FormTxt[] = {w_HW,
|
||||
w_DW,
|
||||
w_CM};
|
||||
|
||||
char *RptFormTxt[] = {t_HW,
|
||||
t_DW,
|
||||
t_CM};
|
||||
|
||||
char *RptFlowUnitsTxt[] = {u_CFS,
|
||||
u_GPM,
|
||||
u_MGD,
|
||||
u_IMGD,
|
||||
u_AFD,
|
||||
u_LPS,
|
||||
u_LPM,
|
||||
u_MLD,
|
||||
u_CMH,
|
||||
u_CMD};
|
||||
|
||||
char *FlowUnitsTxt[] = {w_CFS,
|
||||
w_GPM,
|
||||
w_MGD,
|
||||
w_IMGD,
|
||||
w_AFD,
|
||||
w_LPS,
|
||||
w_LPM,
|
||||
w_MLD,
|
||||
w_CMH,
|
||||
w_CMD};
|
||||
|
||||
char *PressUnitsTxt[] = {w_PSI,
|
||||
w_KPA,
|
||||
w_METERS};
|
||||
|
||||
char *QualTxt[] = {w_NONE,
|
||||
w_CHEM,
|
||||
w_AGE,
|
||||
w_TRACE};
|
||||
|
||||
|
||||
char *SourceTxt[] = {w_CONCEN,
|
||||
w_MASS,
|
||||
w_SETPOINT,
|
||||
w_FLOWPACED};
|
||||
|
||||
char *ControlTxt[] = {w_BELOW,
|
||||
w_ABOVE,
|
||||
w_TIME,
|
||||
w_CLOCKTIME};
|
||||
|
||||
char *TstatTxt[] = {w_NONE,
|
||||
w_AVG,
|
||||
w_MIN,
|
||||
w_MAX,
|
||||
w_RANGE};
|
||||
|
||||
char *MixTxt[] = {w_MIXED,
|
||||
w_2COMP,
|
||||
w_FIFO,
|
||||
w_LIFO,
|
||||
NULL};
|
||||
|
||||
char *RptFlagTxt[] = {w_NO,
|
||||
w_YES,
|
||||
w_FULL};
|
||||
|
||||
char *SectTxt[] = {s_TITLE, s_JUNCTIONS, s_RESERVOIRS,
|
||||
s_TANKS, s_PIPES, s_PUMPS,
|
||||
s_VALVES, s_CONTROLS, s_RULES,
|
||||
s_DEMANDS, s_SOURCES, s_EMITTERS,
|
||||
s_PATTERNS, s_CURVES, s_QUALITY,
|
||||
s_STATUS, s_ROUGHNESS, s_ENERGY,
|
||||
s_REACTIONS, s_MIXING, s_REPORT,
|
||||
s_TIMES, s_OPTIONS, s_COORDS,
|
||||
s_VERTICES, s_LABELS, s_BACKDROP,
|
||||
s_TAGS, s_END,
|
||||
NULL};
|
||||
|
||||
char *RptSectTxt[] = {NULL, t_JUNCTION, t_RESERVOIR,
|
||||
t_TANK, t_PIPE, t_PUMP,
|
||||
t_VALVE, t_CONTROL, t_RULE,
|
||||
t_DEMANDFOR,t_SOURCE, t_EMITTER,
|
||||
t_PATTERN, t_CURVE, t_QUALITY,
|
||||
t_STATUS, t_ROUGHNESS,t_ENERGY,
|
||||
t_REACTION, t_MIXING, t_REPORT,
|
||||
t_TIME, t_OPTION};
|
||||
|
||||
char *Fldname[] = {t_ELEV, t_DEMAND, t_HEAD,
|
||||
t_PRESSURE, t_QUALITY, t_LENGTH,
|
||||
t_DIAM, t_FLOW, t_VELOCITY,
|
||||
t_HEADLOSS, t_LINKQUAL, t_LINKSTATUS,
|
||||
t_SETTING, t_REACTRATE, t_FRICTION,
|
||||
"", "", "", "", "", "", NULL};
|
||||
|
||||
char *LogoTxt[] = {LOGO1,LOGO2,LOGO3,LOGO4,LOGO5,LOGO6,NULL};
|
||||
|
||||
|
||||
|
||||
6246
src/epanet.c
Normal file → Executable file
6246
src/epanet.c
Normal file → Executable file
File diff suppressed because it is too large
Load Diff
562
src/funcs.h
Normal file → Executable file
562
src/funcs.h
Normal file → Executable file
@@ -1,281 +1,281 @@
|
||||
/*
|
||||
**************************************************************************
|
||||
|
||||
FUNCS.H -- Function Prototypes for EPANET Program
|
||||
|
||||
VERSION: 2.00
|
||||
DATE: 5/8/00
|
||||
9/25/00
|
||||
10/25/00
|
||||
12/29/00
|
||||
3/1/01
|
||||
2/14/08 (2.00.12)
|
||||
AUTHOR: L. Rossman
|
||||
US EPA - NRMRL
|
||||
|
||||
**************************************************************************
|
||||
*/
|
||||
|
||||
/*****************************************************************/
|
||||
/* Most float arguments have been changed to double - 7/3/07 */
|
||||
/*****************************************************************/
|
||||
|
||||
/* ------- EPANET.C --------------------*/
|
||||
/*
|
||||
** NOTE: The exportable functions that can be called
|
||||
** via the DLL are prototyped in TOOLKIT.H.
|
||||
*/
|
||||
void initpointers(void); /* Initializes pointers */
|
||||
int allocdata(void); /* Allocates memory */
|
||||
void freeTmplist(STmplist *); /* Frees items in linked list */
|
||||
void freeFloatlist(SFloatlist *); /* Frees list of floats */
|
||||
void freedata(void); /* Frees allocated memory */
|
||||
int openfiles(char *,char *,char *); /* Opens input & report files */
|
||||
int openhydfile(void); /* Opens hydraulics file */
|
||||
int openoutfile(void); /* Opens binary output file */
|
||||
int strcomp(char *, char *); /* Compares two strings */
|
||||
char* getTmpName(char* fname); /* Gets temporary file name */ //(2.00.12 - LR)
|
||||
double interp(int, double *, /* Interpolates a data curve */
|
||||
double *, double);
|
||||
int findnode(char *); /* Finds node's index from ID */
|
||||
int findlink(char *); /* Finds link's index from ID */
|
||||
char* geterrmsg(int); /* Gets text of error message */
|
||||
void errmsg(int); /* Reports program error */
|
||||
void writecon(char *); /* Writes text to console */
|
||||
void writewin(char *); /* Passes text to calling app */
|
||||
|
||||
/* ------- INPUT1.C --------------------*/
|
||||
int getdata(void); /* Gets network data */
|
||||
void setdefaults(void); /* Sets default values */
|
||||
void initreport(void); /* Initializes report options */
|
||||
void adjustdata(void); /* Adjusts input data */
|
||||
int inittanks(void); /* Initializes tank levels */
|
||||
void initunits(void); /* Determines reporting units */
|
||||
void convertunits(void); /* Converts data to std. units*/
|
||||
|
||||
/* -------- INPUT2.C -------------------*/
|
||||
int netsize(void); /* Determines network size */
|
||||
int readdata(void); /* Reads in network data */
|
||||
int newline(int, char *); /* Processes new line of data */
|
||||
int addnodeID(int, char *); /* Adds node ID to data base */
|
||||
int addlinkID(int, char *); /* Adds link ID to data base */
|
||||
int addpattern(char *); /* Adds pattern to data base */
|
||||
int addcurve(char *); /* Adds curve to data base */
|
||||
STmplist *findID(char *, STmplist *); /* Locates ID on linked list */
|
||||
int unlinked(void); /* Checks for unlinked nodes */
|
||||
int getpumpparams(void); /* Computes pump curve coeffs.*/
|
||||
int getpatterns(void); /* Gets pattern data from list*/
|
||||
int getcurves(void); /* Gets curve data from list */
|
||||
int findmatch(char *,char *[]); /* Finds keyword in line */
|
||||
int match(char *, char *); /* Checks for word match */
|
||||
int gettokens(char *); /* Tokenizes input line */
|
||||
int getfloat(char *, double *); /* Converts string to double */
|
||||
double hour(char *, char *); /* Converts time to hours */
|
||||
int setreport(char *); /* Processes reporting command*/
|
||||
void inperrmsg(int,int,char *); /* Input error message */
|
||||
|
||||
/* ---------- INPUT3.C -----------------*/
|
||||
int juncdata(void); /* Processes junction data */
|
||||
int tankdata(void); /* Processes tank data */
|
||||
int pipedata(void); /* Processes pipe data */
|
||||
int pumpdata(void); /* Processes pump data */
|
||||
int valvedata(void); /* Processes valve data */
|
||||
int patterndata(void); /* Processes pattern data */
|
||||
int curvedata(void); /* Processes curve data */
|
||||
int demanddata(void); /* Processes demand data */
|
||||
int controldata(void); /* Processes simple controls */
|
||||
int energydata(void); /* Processes energy data */
|
||||
int sourcedata(void); /* Processes source data */
|
||||
int emitterdata(void); /* Processes emitter data */
|
||||
int qualdata(void); /* Processes quality data */
|
||||
int reactdata(void); /* Processes reaction data */
|
||||
int mixingdata(void); /* Processes tank mixing data */
|
||||
int statusdata(void); /* Processes link status data */
|
||||
int reportdata(void); /* Processes report options */
|
||||
int timedata(void); /* Processes time options */
|
||||
int optiondata(void); /* Processes analysis options */
|
||||
int optionchoice(int); /* Processes option choices */
|
||||
int optionvalue(int); /* Processes option values */
|
||||
int getpumpcurve(int); /* Constructs a pump curve */
|
||||
int powercurve(double, double, double,/* Coeffs. of power pump curve*/
|
||||
double, double, double *,
|
||||
double *, double *);
|
||||
int valvecheck(int, int, int); /* Checks valve placement */
|
||||
void changestatus(int, char, double); /* Changes status of a link */
|
||||
|
||||
/* -------------- RULES.C --------------*/
|
||||
void initrules(void); /* Initializes rule base */
|
||||
void addrule(char *); /* Adds rule to rule base */
|
||||
int allocrules(void); /* Allocates memory for rule */
|
||||
int ruledata(void); /* Processes rule input data */
|
||||
int checkrules(long); /* Checks all rules */
|
||||
void freerules(void); /* Frees rule base memory */
|
||||
|
||||
/* ------------- REPORT.C --------------*/
|
||||
int writereport(void); /* Writes formatted report */
|
||||
void writelogo(void); /* Writes program logo */
|
||||
void writesummary(void); /* Writes network summary */
|
||||
void writehydstat(int,double); /* Writes hydraulic status */
|
||||
void writeenergy(void); /* Writes energy usage */
|
||||
int writeresults(void); /* Writes node/link results */
|
||||
void writeheader(int,int); /* Writes heading on report */
|
||||
void writeline(char *); /* Writes line to report file */
|
||||
void writerelerr(int, double); /* Writes convergence error */
|
||||
void writestatchange(int,char,char); /* Writes link status change */
|
||||
void writecontrolaction(int, int); /* Writes control action taken*/
|
||||
void writeruleaction(int, char *); /* Writes rule action taken */
|
||||
int writehydwarn(int,double); /* Writes hydraulic warnings */
|
||||
void writehyderr(int); /* Writes hydraulic error msg.*/
|
||||
int disconnected(void); /* Checks for disconnections */
|
||||
void marknodes(int, int *, char *); /* Identifies connected nodes */
|
||||
void getclosedlink(int, char *); /* Finds a disconnecting link */
|
||||
void writelimits(int,int); /* Writes reporting limits */
|
||||
int checklimits(double *,int,int); /* Checks variable limits */
|
||||
void writetime(char *); /* Writes current clock time */
|
||||
char *clocktime(char *, long); /* Converts time to hrs:min */
|
||||
char *fillstr(char *, char, int); /* Fills string with character*/
|
||||
int getnodetype(int); /* Determines node type */
|
||||
|
||||
/* --------- HYDRAUL.C -----------------*/
|
||||
int openhyd(void); /* Opens hydraulics solver */
|
||||
|
||||
/*** Updated 3/1/01 ***/
|
||||
void inithyd(int); /* Re-sets initial conditions */
|
||||
|
||||
int runhyd(long *); /* Solves 1-period hydraulics */
|
||||
int nexthyd(long *); /* Moves to next time period */
|
||||
void closehyd(void); /* Closes hydraulics solver */
|
||||
int allocmatrix(void); /* Allocates matrix coeffs. */
|
||||
void freematrix(void); /* Frees matrix coeffs. */
|
||||
void initlinkflow(int, char, double); /* Initializes link flow */
|
||||
void setlinkflow(int, double); /* Sets link flow via headloss*/
|
||||
void setlinkstatus(int, char, char *, /* Sets link status */
|
||||
double *);
|
||||
void setlinksetting(int, double, /* Sets pump/valve setting */
|
||||
char *, double *);
|
||||
void resistance(int); /* Computes resistance coeff. */
|
||||
void demands(void); /* Computes current demands */
|
||||
int controls(void); /* Controls link settings */
|
||||
long timestep(void); /* Computes new time step */
|
||||
void tanktimestep(long *); /* Time till tanks fill/drain */
|
||||
void controltimestep(long *); /* Time till control action */
|
||||
void ruletimestep(long *); /* Time till rule action */
|
||||
void addenergy(long); /* Accumulates energy usage */
|
||||
void getenergy(int, double *, double *); /* Computes link energy use */
|
||||
void tanklevels(long); /* Computes new tank levels */
|
||||
double tankvolume(int,double); /* Finds tank vol. from grade */
|
||||
double tankgrade(int,double); /* Finds tank grade from vol. */
|
||||
int netsolve(int *,double *); /* Solves network equations */
|
||||
int badvalve(int); /* Checks for bad valve */
|
||||
int valvestatus(void); /* Updates valve status */
|
||||
int linkstatus(void); /* Updates link status */
|
||||
char cvstatus(char,double,double); /* Updates CV status */
|
||||
char pumpstatus(int,double); /* Updates pump status */
|
||||
char prvstatus(int,char,double, /* Updates PRV status */
|
||||
double,double);
|
||||
char psvstatus(int,char,double, /* Updates PSV status */
|
||||
double,double);
|
||||
char fcvstatus(int,char,double, /* Updates FCV status */
|
||||
double);
|
||||
void tankstatus(int,int,int); /* Checks if tank full/empty */
|
||||
int pswitch(void); /* Pressure switch controls */
|
||||
double newflows(void); /* Updates link flows */
|
||||
void newcoeffs(void); /* Computes matrix coeffs. */
|
||||
void linkcoeffs(void); /* Computes link coeffs. */
|
||||
void nodecoeffs(void); /* Computes node coeffs. */
|
||||
void valvecoeffs(void); /* Computes valve coeffs. */
|
||||
void pipecoeff(int); /* Computes pipe coeff. */
|
||||
double DWcoeff(int, double *); /* Computes D-W coeff. */
|
||||
void pumpcoeff(int); /* Computes pump coeff. */
|
||||
|
||||
/*** Updated 10/25/00 ***/
|
||||
/*** Updated 12/29/00 ***/
|
||||
void curvecoeff(int,double,double *, /* Computes curve coeffs. */
|
||||
double *);
|
||||
|
||||
void gpvcoeff(int); /* Computes GPV coeff. */
|
||||
void pbvcoeff(int); /* Computes PBV coeff. */
|
||||
void tcvcoeff(int); /* Computes TCV coeff. */
|
||||
void prvcoeff(int,int,int); /* Computes PRV coeff. */
|
||||
void psvcoeff(int,int,int); /* Computes PSV coeff. */
|
||||
void fcvcoeff(int,int,int); /* Computes FCV coeff. */
|
||||
void emittercoeffs(void); /* Computes emitter coeffs. */
|
||||
double emitflowchange(int); /* Computes new emitter flow */
|
||||
|
||||
/* ----------- SMATRIX.C ---------------*/
|
||||
int createsparse(void); /* Creates sparse matrix */
|
||||
int allocsparse(void); /* Allocates matrix memory */
|
||||
void freesparse(void); /* Frees matrix memory */
|
||||
int buildlists(int); /* Builds adjacency lists */
|
||||
int paralink(int, int, int); /* Checks for parallel links */
|
||||
void xparalinks(void); /* Removes parallel links */
|
||||
void freelists(void); /* Frees adjacency lists */
|
||||
void countdegree(void); /* Counts links at each node */
|
||||
int reordernodes(void); /* Finds a node re-ordering */
|
||||
int mindegree(int, int); /* Finds min. degree node */
|
||||
int growlist(int); /* Augments adjacency list */
|
||||
int newlink(Padjlist); /* Adds fill-ins for a node */
|
||||
int linked(int, int); /* Checks if 2 nodes linked */
|
||||
int addlink(int, int, int); /* Creates new fill-in */
|
||||
int storesparse(int); /* Stores sparse matrix */
|
||||
int ordersparse(int); /* Orders matrix storage */
|
||||
void transpose(int,int *,int *, /* Transposes sparse matrix */
|
||||
int *,int *,int *,int *,int *);
|
||||
int linsolve(int, double *, double *, /* Solution of linear eqns. */
|
||||
double *); /* via Cholesky factorization */
|
||||
|
||||
/* ----------- QUALITY.C ---------------*/
|
||||
int openqual(void); /* Opens WQ solver system */
|
||||
void initqual(void); /* Initializes WQ solver */
|
||||
int runqual(long *); /* Gets current WQ results */
|
||||
int nextqual(long *); /* Updates WQ by hyd.timestep */
|
||||
int stepqual(long *); /* Updates WQ by WQ time step */
|
||||
int closequal(void); /* Closes WQ solver system */
|
||||
int gethyd(long *, long *); /* Gets next hyd. results */
|
||||
char setReactflag(void); /* Checks for reactive chem. */
|
||||
void transport(long); /* Transports mass in network */
|
||||
void initsegs(void); /* Initializes WQ segments */
|
||||
void reorientsegs(void); /* Re-orients WQ segments */
|
||||
void updatesegs(long); /* Updates quality in segments*/
|
||||
void removesegs(int); /* Removes a WQ segment */
|
||||
void addseg(int,double,double); /* Adds a WQ segment to pipe */
|
||||
void accumulate(long); /* Sums mass flow into node */
|
||||
void updatenodes(long); /* Updates WQ at nodes */
|
||||
void sourceinput(long); /* Computes source inputs */
|
||||
void release(long); /* Releases mass from nodes */
|
||||
void updatetanks(long); /* Updates WQ in tanks */
|
||||
void updatesourcenodes(long); /* Updates WQ at source nodes */
|
||||
void tankmix1(int, long); /* Complete mix tank model */
|
||||
void tankmix2(int, long); /* 2-compartment tank model */
|
||||
void tankmix3(int, long); /* FIFO tank model */
|
||||
void tankmix4(int, long); /* LIFO tank model */
|
||||
double sourcequal(Psource); /* Finds WQ input from source */
|
||||
double avgqual(int); /* Finds avg. quality in pipe */
|
||||
void ratecoeffs(void); /* Finds wall react. coeffs. */
|
||||
double piperate(int); /* Finds wall react. coeff. */
|
||||
double pipereact(int,double,double,long);/* Reacts water in a pipe */
|
||||
double tankreact(double,double,double,
|
||||
long); /* Reacts water in a tank */
|
||||
double bulkrate(double,double,double); /* Finds bulk reaction rate */
|
||||
double wallrate(double,double,double,double);/* Finds wall reaction rate */
|
||||
|
||||
|
||||
/* ------------ OUTPUT.C ---------------*/
|
||||
int savenetdata(void); /* Saves basic data to file */
|
||||
int savehyd(long *); /* Saves hydraulic solution */
|
||||
int savehydstep(long *); /* Saves hydraulic timestep */
|
||||
int saveenergy(void); /* Saves energy usage */
|
||||
int readhyd(long *); /* Reads hydraulics from file */
|
||||
int readhydstep(long *); /* Reads time step from file */
|
||||
int saveoutput(void); /* Saves results to file */
|
||||
int nodeoutput(int, REAL4 *, double); /* Saves node results to file */
|
||||
int linkoutput(int, REAL4 *, double); /* Saves link results to file */
|
||||
int savefinaloutput(void); /* Finishes saving output */
|
||||
int savetimestat(REAL4 *, char); /* Saves time stats to file */
|
||||
int savenetreacts(double, double,
|
||||
double, double); /* Saves react. rates to file */
|
||||
int saveepilog(void); /* Saves output file epilog */
|
||||
|
||||
|
||||
/* ------------ INPFILE.C --------------*/
|
||||
int saveinpfile(char *); /* Saves network to text file */
|
||||
/*
|
||||
**************************************************************************
|
||||
|
||||
FUNCS.H -- Function Prototypes for EPANET Program
|
||||
|
||||
VERSION: 2.00
|
||||
DATE: 5/8/00
|
||||
9/25/00
|
||||
10/25/00
|
||||
12/29/00
|
||||
3/1/01
|
||||
2/14/08 (2.00.12)
|
||||
AUTHOR: L. Rossman
|
||||
US EPA - NRMRL
|
||||
|
||||
**************************************************************************
|
||||
*/
|
||||
|
||||
/*****************************************************************/
|
||||
/* Most float arguments have been changed to double - 7/3/07 */
|
||||
/*****************************************************************/
|
||||
|
||||
/* ------- EPANET.C --------------------*/
|
||||
/*
|
||||
** NOTE: The exportable functions that can be called
|
||||
** via the DLL are prototyped in TOOLKIT.H.
|
||||
*/
|
||||
void initpointers(void); /* Initializes pointers */
|
||||
int allocdata(void); /* Allocates memory */
|
||||
void freeTmplist(STmplist *); /* Frees items in linked list */
|
||||
void freeFloatlist(SFloatlist *); /* Frees list of floats */
|
||||
void freedata(void); /* Frees allocated memory */
|
||||
int openfiles(char *,char *,char *); /* Opens input & report files */
|
||||
int openhydfile(void); /* Opens hydraulics file */
|
||||
int openoutfile(void); /* Opens binary output file */
|
||||
int strcomp(char *, char *); /* Compares two strings */
|
||||
char* getTmpName(char* fname); /* Gets temporary file name */ //(2.00.12 - LR)
|
||||
double interp(int, double *, /* Interpolates a data curve */
|
||||
double *, double);
|
||||
int findnode(char *); /* Finds node's index from ID */
|
||||
int findlink(char *); /* Finds link's index from ID */
|
||||
char* geterrmsg(int); /* Gets text of error message */
|
||||
void errmsg(int); /* Reports program error */
|
||||
void writecon(char *); /* Writes text to console */
|
||||
void writewin(char *); /* Passes text to calling app */
|
||||
|
||||
/* ------- INPUT1.C --------------------*/
|
||||
int getdata(void); /* Gets network data */
|
||||
void setdefaults(void); /* Sets default values */
|
||||
void initreport(void); /* Initializes report options */
|
||||
void adjustdata(void); /* Adjusts input data */
|
||||
int inittanks(void); /* Initializes tank levels */
|
||||
void initunits(void); /* Determines reporting units */
|
||||
void convertunits(void); /* Converts data to std. units*/
|
||||
|
||||
/* -------- INPUT2.C -------------------*/
|
||||
int netsize(void); /* Determines network size */
|
||||
int readdata(void); /* Reads in network data */
|
||||
int newline(int, char *); /* Processes new line of data */
|
||||
int addnodeID(int, char *); /* Adds node ID to data base */
|
||||
int addlinkID(int, char *); /* Adds link ID to data base */
|
||||
int addpattern(char *); /* Adds pattern to data base */
|
||||
int addcurve(char *); /* Adds curve to data base */
|
||||
STmplist *findID(char *, STmplist *); /* Locates ID on linked list */
|
||||
int unlinked(void); /* Checks for unlinked nodes */
|
||||
int getpumpparams(void); /* Computes pump curve coeffs.*/
|
||||
int getpatterns(void); /* Gets pattern data from list*/
|
||||
int getcurves(void); /* Gets curve data from list */
|
||||
int findmatch(char *,char *[]); /* Finds keyword in line */
|
||||
int match(char *, char *); /* Checks for word match */
|
||||
int gettokens(char *); /* Tokenizes input line */
|
||||
int getfloat(char *, double *); /* Converts string to double */
|
||||
double hour(char *, char *); /* Converts time to hours */
|
||||
int setreport(char *); /* Processes reporting command*/
|
||||
void inperrmsg(int,int,char *); /* Input error message */
|
||||
|
||||
/* ---------- INPUT3.C -----------------*/
|
||||
int juncdata(void); /* Processes junction data */
|
||||
int tankdata(void); /* Processes tank data */
|
||||
int pipedata(void); /* Processes pipe data */
|
||||
int pumpdata(void); /* Processes pump data */
|
||||
int valvedata(void); /* Processes valve data */
|
||||
int patterndata(void); /* Processes pattern data */
|
||||
int curvedata(void); /* Processes curve data */
|
||||
int demanddata(void); /* Processes demand data */
|
||||
int controldata(void); /* Processes simple controls */
|
||||
int energydata(void); /* Processes energy data */
|
||||
int sourcedata(void); /* Processes source data */
|
||||
int emitterdata(void); /* Processes emitter data */
|
||||
int qualdata(void); /* Processes quality data */
|
||||
int reactdata(void); /* Processes reaction data */
|
||||
int mixingdata(void); /* Processes tank mixing data */
|
||||
int statusdata(void); /* Processes link status data */
|
||||
int reportdata(void); /* Processes report options */
|
||||
int timedata(void); /* Processes time options */
|
||||
int optiondata(void); /* Processes analysis options */
|
||||
int optionchoice(int); /* Processes option choices */
|
||||
int optionvalue(int); /* Processes option values */
|
||||
int getpumpcurve(int); /* Constructs a pump curve */
|
||||
int powercurve(double, double, double,/* Coeffs. of power pump curve*/
|
||||
double, double, double *,
|
||||
double *, double *);
|
||||
int valvecheck(int, int, int); /* Checks valve placement */
|
||||
void changestatus(int, char, double); /* Changes status of a link */
|
||||
|
||||
/* -------------- RULES.C --------------*/
|
||||
void initrules(void); /* Initializes rule base */
|
||||
void addrule(char *); /* Adds rule to rule base */
|
||||
int allocrules(void); /* Allocates memory for rule */
|
||||
int ruledata(void); /* Processes rule input data */
|
||||
int checkrules(long); /* Checks all rules */
|
||||
void freerules(void); /* Frees rule base memory */
|
||||
|
||||
/* ------------- REPORT.C --------------*/
|
||||
int writereport(void); /* Writes formatted report */
|
||||
void writelogo(void); /* Writes program logo */
|
||||
void writesummary(void); /* Writes network summary */
|
||||
void writehydstat(int,double); /* Writes hydraulic status */
|
||||
void writeenergy(void); /* Writes energy usage */
|
||||
int writeresults(void); /* Writes node/link results */
|
||||
void writeheader(int,int); /* Writes heading on report */
|
||||
void writeline(char *); /* Writes line to report file */
|
||||
void writerelerr(int, double); /* Writes convergence error */
|
||||
void writestatchange(int,char,char); /* Writes link status change */
|
||||
void writecontrolaction(int, int); /* Writes control action taken*/
|
||||
void writeruleaction(int, char *); /* Writes rule action taken */
|
||||
int writehydwarn(int,double); /* Writes hydraulic warnings */
|
||||
void writehyderr(int); /* Writes hydraulic error msg.*/
|
||||
int disconnected(void); /* Checks for disconnections */
|
||||
void marknodes(int, int *, char *); /* Identifies connected nodes */
|
||||
void getclosedlink(int, char *); /* Finds a disconnecting link */
|
||||
void writelimits(int,int); /* Writes reporting limits */
|
||||
int checklimits(double *,int,int); /* Checks variable limits */
|
||||
void writetime(char *); /* Writes current clock time */
|
||||
char *clocktime(char *, long); /* Converts time to hrs:min */
|
||||
char *fillstr(char *, char, int); /* Fills string with character*/
|
||||
int getnodetype(int); /* Determines node type */
|
||||
|
||||
/* --------- HYDRAUL.C -----------------*/
|
||||
int openhyd(void); /* Opens hydraulics solver */
|
||||
|
||||
/*** Updated 3/1/01 ***/
|
||||
void inithyd(int); /* Re-sets initial conditions */
|
||||
|
||||
int runhyd(long *); /* Solves 1-period hydraulics */
|
||||
int nexthyd(long *); /* Moves to next time period */
|
||||
void closehyd(void); /* Closes hydraulics solver */
|
||||
int allocmatrix(void); /* Allocates matrix coeffs. */
|
||||
void freematrix(void); /* Frees matrix coeffs. */
|
||||
void initlinkflow(int, char, double); /* Initializes link flow */
|
||||
void setlinkflow(int, double); /* Sets link flow via headloss*/
|
||||
void setlinkstatus(int, char, char *, /* Sets link status */
|
||||
double *);
|
||||
void setlinksetting(int, double, /* Sets pump/valve setting */
|
||||
char *, double *);
|
||||
void resistance(int); /* Computes resistance coeff. */
|
||||
void demands(void); /* Computes current demands */
|
||||
int controls(void); /* Controls link settings */
|
||||
long timestep(void); /* Computes new time step */
|
||||
void tanktimestep(long *); /* Time till tanks fill/drain */
|
||||
void controltimestep(long *); /* Time till control action */
|
||||
void ruletimestep(long *); /* Time till rule action */
|
||||
void addenergy(long); /* Accumulates energy usage */
|
||||
void getenergy(int, double *, double *); /* Computes link energy use */
|
||||
void tanklevels(long); /* Computes new tank levels */
|
||||
double tankvolume(int,double); /* Finds tank vol. from grade */
|
||||
double tankgrade(int,double); /* Finds tank grade from vol. */
|
||||
int netsolve(int *,double *); /* Solves network equations */
|
||||
int badvalve(int); /* Checks for bad valve */
|
||||
int valvestatus(void); /* Updates valve status */
|
||||
int linkstatus(void); /* Updates link status */
|
||||
char cvstatus(char,double,double); /* Updates CV status */
|
||||
char pumpstatus(int,double); /* Updates pump status */
|
||||
char prvstatus(int,char,double, /* Updates PRV status */
|
||||
double,double);
|
||||
char psvstatus(int,char,double, /* Updates PSV status */
|
||||
double,double);
|
||||
char fcvstatus(int,char,double, /* Updates FCV status */
|
||||
double);
|
||||
void tankstatus(int,int,int); /* Checks if tank full/empty */
|
||||
int pswitch(void); /* Pressure switch controls */
|
||||
double newflows(void); /* Updates link flows */
|
||||
void newcoeffs(void); /* Computes matrix coeffs. */
|
||||
void linkcoeffs(void); /* Computes link coeffs. */
|
||||
void nodecoeffs(void); /* Computes node coeffs. */
|
||||
void valvecoeffs(void); /* Computes valve coeffs. */
|
||||
void pipecoeff(int); /* Computes pipe coeff. */
|
||||
double DWcoeff(int, double *); /* Computes D-W coeff. */
|
||||
void pumpcoeff(int); /* Computes pump coeff. */
|
||||
|
||||
/*** Updated 10/25/00 ***/
|
||||
/*** Updated 12/29/00 ***/
|
||||
void curvecoeff(int,double,double *, /* Computes curve coeffs. */
|
||||
double *);
|
||||
|
||||
void gpvcoeff(int); /* Computes GPV coeff. */
|
||||
void pbvcoeff(int); /* Computes PBV coeff. */
|
||||
void tcvcoeff(int); /* Computes TCV coeff. */
|
||||
void prvcoeff(int,int,int); /* Computes PRV coeff. */
|
||||
void psvcoeff(int,int,int); /* Computes PSV coeff. */
|
||||
void fcvcoeff(int,int,int); /* Computes FCV coeff. */
|
||||
void emittercoeffs(void); /* Computes emitter coeffs. */
|
||||
double emitflowchange(int); /* Computes new emitter flow */
|
||||
|
||||
/* ----------- SMATRIX.C ---------------*/
|
||||
int createsparse(void); /* Creates sparse matrix */
|
||||
int allocsparse(void); /* Allocates matrix memory */
|
||||
void freesparse(void); /* Frees matrix memory */
|
||||
int buildlists(int); /* Builds adjacency lists */
|
||||
int paralink(int, int, int); /* Checks for parallel links */
|
||||
void xparalinks(void); /* Removes parallel links */
|
||||
void freelists(void); /* Frees adjacency lists */
|
||||
void countdegree(void); /* Counts links at each node */
|
||||
int reordernodes(void); /* Finds a node re-ordering */
|
||||
int mindegree(int, int); /* Finds min. degree node */
|
||||
int growlist(int); /* Augments adjacency list */
|
||||
int newlink(Padjlist); /* Adds fill-ins for a node */
|
||||
int linked(int, int); /* Checks if 2 nodes linked */
|
||||
int addlink(int, int, int); /* Creates new fill-in */
|
||||
int storesparse(int); /* Stores sparse matrix */
|
||||
int ordersparse(int); /* Orders matrix storage */
|
||||
void transpose(int,int *,int *, /* Transposes sparse matrix */
|
||||
int *,int *,int *,int *,int *);
|
||||
int linsolve(int, double *, double *, /* Solution of linear eqns. */
|
||||
double *); /* via Cholesky factorization */
|
||||
|
||||
/* ----------- QUALITY.C ---------------*/
|
||||
int openqual(void); /* Opens WQ solver system */
|
||||
void initqual(void); /* Initializes WQ solver */
|
||||
int runqual(long *); /* Gets current WQ results */
|
||||
int nextqual(long *); /* Updates WQ by hyd.timestep */
|
||||
int stepqual(long *); /* Updates WQ by WQ time step */
|
||||
int closequal(void); /* Closes WQ solver system */
|
||||
int gethyd(long *, long *); /* Gets next hyd. results */
|
||||
char setReactflag(void); /* Checks for reactive chem. */
|
||||
void transport(long); /* Transports mass in network */
|
||||
void initsegs(void); /* Initializes WQ segments */
|
||||
void reorientsegs(void); /* Re-orients WQ segments */
|
||||
void updatesegs(long); /* Updates quality in segments*/
|
||||
void removesegs(int); /* Removes a WQ segment */
|
||||
void addseg(int,double,double); /* Adds a WQ segment to pipe */
|
||||
void accumulate(long); /* Sums mass flow into node */
|
||||
void updatenodes(long); /* Updates WQ at nodes */
|
||||
void sourceinput(long); /* Computes source inputs */
|
||||
void release(long); /* Releases mass from nodes */
|
||||
void updatetanks(long); /* Updates WQ in tanks */
|
||||
void updatesourcenodes(long); /* Updates WQ at source nodes */
|
||||
void tankmix1(int, long); /* Complete mix tank model */
|
||||
void tankmix2(int, long); /* 2-compartment tank model */
|
||||
void tankmix3(int, long); /* FIFO tank model */
|
||||
void tankmix4(int, long); /* LIFO tank model */
|
||||
double sourcequal(Psource); /* Finds WQ input from source */
|
||||
double avgqual(int); /* Finds avg. quality in pipe */
|
||||
void ratecoeffs(void); /* Finds wall react. coeffs. */
|
||||
double piperate(int); /* Finds wall react. coeff. */
|
||||
double pipereact(int,double,double,long);/* Reacts water in a pipe */
|
||||
double tankreact(double,double,double,
|
||||
long); /* Reacts water in a tank */
|
||||
double bulkrate(double,double,double); /* Finds bulk reaction rate */
|
||||
double wallrate(double,double,double,double);/* Finds wall reaction rate */
|
||||
|
||||
|
||||
/* ------------ OUTPUT.C ---------------*/
|
||||
int savenetdata(void); /* Saves basic data to file */
|
||||
int savehyd(long *); /* Saves hydraulic solution */
|
||||
int savehydstep(long *); /* Saves hydraulic timestep */
|
||||
int saveenergy(void); /* Saves energy usage */
|
||||
int readhyd(long *); /* Reads hydraulics from file */
|
||||
int readhydstep(long *); /* Reads time step from file */
|
||||
int saveoutput(void); /* Saves results to file */
|
||||
int nodeoutput(int, REAL4 *, double); /* Saves node results to file */
|
||||
int linkoutput(int, REAL4 *, double); /* Saves link results to file */
|
||||
int savefinaloutput(void); /* Finishes saving output */
|
||||
int savetimestat(REAL4 *, char); /* Saves time stats to file */
|
||||
int savenetreacts(double, double,
|
||||
double, double); /* Saves react. rates to file */
|
||||
int saveepilog(void); /* Saves output file epilog */
|
||||
|
||||
|
||||
/* ------------ INPFILE.C --------------*/
|
||||
int saveinpfile(char *); /* Saves network to text file */
|
||||
|
||||
220
src/hash.c
Normal file → Executable file
220
src/hash.c
Normal file → Executable file
@@ -1,110 +1,110 @@
|
||||
/*-----------------------------------------------------------------------------
|
||||
** hash.c
|
||||
**
|
||||
** Implementation of a simple Hash Table for string storage & retrieval
|
||||
**
|
||||
** Written by L. Rossman
|
||||
** Last Updated on 6/19/03
|
||||
**
|
||||
** The hash table data structure (HTable) is defined in "hash.h".
|
||||
** Interface Functions:
|
||||
** HTcreate() - creates a hash table
|
||||
** HTinsert() - inserts a string & its index value into a hash table
|
||||
** HTfind() - retrieves the index value of a string from a table
|
||||
** HTfree() - frees a hash table
|
||||
**
|
||||
*********************************************************************
|
||||
** NOTE: This is a modified version of the original HASH.C module.
|
||||
*********************************************************************
|
||||
*/
|
||||
|
||||
#include <malloc.h>
|
||||
#include <string.h>
|
||||
#include "hash.h"
|
||||
|
||||
/* Use Fletcher's checksum to compute 2-byte hash of string */
|
||||
unsigned int hash(char *str)
|
||||
{
|
||||
unsigned int sum1= 0, check1;
|
||||
unsigned long sum2= 0L;
|
||||
while( '\0' != *str )
|
||||
{
|
||||
sum1 += (*str);
|
||||
str++;
|
||||
if ( 255 <= sum1 ) sum1 -= 255;
|
||||
sum2 += sum1;
|
||||
}
|
||||
check1= sum2;
|
||||
check1 %= 255;
|
||||
check1= 255 - (sum1+check1) % 255;
|
||||
sum1= 255 - (sum1+check1) % 255;
|
||||
return( ( ( check1 << 8 ) | sum1 ) % HTMAXSIZE);
|
||||
}
|
||||
|
||||
HTtable *HTcreate()
|
||||
{
|
||||
int i;
|
||||
HTtable *ht = (HTtable *) calloc(HTMAXSIZE, sizeof(HTtable));
|
||||
if (ht != NULL) for (i=0; i<HTMAXSIZE; i++) ht[i] = NULL;
|
||||
return(ht);
|
||||
}
|
||||
|
||||
int HTinsert(HTtable *ht, char *key, int data)
|
||||
{
|
||||
unsigned int i = hash(key);
|
||||
struct HTentry *entry;
|
||||
if ( i >= HTMAXSIZE ) return(0);
|
||||
entry = (struct HTentry *) malloc(sizeof(struct HTentry));
|
||||
if (entry == NULL) return(0);
|
||||
entry->key = key;
|
||||
entry->data = data;
|
||||
entry->next = ht[i];
|
||||
ht[i] = entry;
|
||||
return(1);
|
||||
}
|
||||
|
||||
int HTfind(HTtable *ht, char *key)
|
||||
{
|
||||
unsigned int i = hash(key);
|
||||
struct HTentry *entry;
|
||||
if ( i >= HTMAXSIZE ) return(NOTFOUND);
|
||||
entry = ht[i];
|
||||
while (entry != NULL)
|
||||
{
|
||||
if ( strcmp(entry->key,key) == 0 ) return(entry->data);
|
||||
entry = entry->next;
|
||||
}
|
||||
return(NOTFOUND);
|
||||
}
|
||||
|
||||
char *HTfindKey(HTtable *ht, char *key)
|
||||
{
|
||||
unsigned int i = hash(key);
|
||||
struct HTentry *entry;
|
||||
if ( i >= HTMAXSIZE ) return(NULL);
|
||||
entry = ht[i];
|
||||
while (entry != NULL)
|
||||
{
|
||||
if ( strcmp(entry->key,key) == 0 ) return(entry->key);
|
||||
entry = entry->next;
|
||||
}
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
void HTfree(HTtable *ht)
|
||||
{
|
||||
struct HTentry *entry,
|
||||
*nextentry;
|
||||
int i;
|
||||
for (i=0; i<HTMAXSIZE; i++)
|
||||
{
|
||||
entry = ht[i];
|
||||
while (entry != NULL)
|
||||
{
|
||||
nextentry = entry->next;
|
||||
free(entry);
|
||||
entry = nextentry;
|
||||
}
|
||||
}
|
||||
free(ht);
|
||||
}
|
||||
/*-----------------------------------------------------------------------------
|
||||
** hash.c
|
||||
**
|
||||
** Implementation of a simple Hash Table for string storage & retrieval
|
||||
**
|
||||
** Written by L. Rossman
|
||||
** Last Updated on 6/19/03
|
||||
**
|
||||
** The hash table data structure (HTable) is defined in "hash.h".
|
||||
** Interface Functions:
|
||||
** HTcreate() - creates a hash table
|
||||
** HTinsert() - inserts a string & its index value into a hash table
|
||||
** HTfind() - retrieves the index value of a string from a table
|
||||
** HTfree() - frees a hash table
|
||||
**
|
||||
*********************************************************************
|
||||
** NOTE: This is a modified version of the original HASH.C module.
|
||||
*********************************************************************
|
||||
*/
|
||||
|
||||
#include <malloc.h>
|
||||
#include <string.h>
|
||||
#include "hash.h"
|
||||
|
||||
/* Use Fletcher's checksum to compute 2-byte hash of string */
|
||||
unsigned int hash(char *str)
|
||||
{
|
||||
unsigned int sum1= 0, check1;
|
||||
unsigned long sum2= 0L;
|
||||
while( '\0' != *str )
|
||||
{
|
||||
sum1 += (*str);
|
||||
str++;
|
||||
if ( 255 <= sum1 ) sum1 -= 255;
|
||||
sum2 += sum1;
|
||||
}
|
||||
check1= sum2;
|
||||
check1 %= 255;
|
||||
check1= 255 - (sum1+check1) % 255;
|
||||
sum1= 255 - (sum1+check1) % 255;
|
||||
return( ( ( check1 << 8 ) | sum1 ) % HTMAXSIZE);
|
||||
}
|
||||
|
||||
HTtable *HTcreate()
|
||||
{
|
||||
int i;
|
||||
HTtable *ht = (HTtable *) calloc(HTMAXSIZE, sizeof(HTtable));
|
||||
if (ht != NULL) for (i=0; i<HTMAXSIZE; i++) ht[i] = NULL;
|
||||
return(ht);
|
||||
}
|
||||
|
||||
int HTinsert(HTtable *ht, char *key, int data)
|
||||
{
|
||||
unsigned int i = hash(key);
|
||||
struct HTentry *entry;
|
||||
if ( i >= HTMAXSIZE ) return(0);
|
||||
entry = (struct HTentry *) malloc(sizeof(struct HTentry));
|
||||
if (entry == NULL) return(0);
|
||||
entry->key = key;
|
||||
entry->data = data;
|
||||
entry->next = ht[i];
|
||||
ht[i] = entry;
|
||||
return(1);
|
||||
}
|
||||
|
||||
int HTfind(HTtable *ht, char *key)
|
||||
{
|
||||
unsigned int i = hash(key);
|
||||
struct HTentry *entry;
|
||||
if ( i >= HTMAXSIZE ) return(NOTFOUND);
|
||||
entry = ht[i];
|
||||
while (entry != NULL)
|
||||
{
|
||||
if ( strcmp(entry->key,key) == 0 ) return(entry->data);
|
||||
entry = entry->next;
|
||||
}
|
||||
return(NOTFOUND);
|
||||
}
|
||||
|
||||
char *HTfindKey(HTtable *ht, char *key)
|
||||
{
|
||||
unsigned int i = hash(key);
|
||||
struct HTentry *entry;
|
||||
if ( i >= HTMAXSIZE ) return(NULL);
|
||||
entry = ht[i];
|
||||
while (entry != NULL)
|
||||
{
|
||||
if ( strcmp(entry->key,key) == 0 ) return(entry->key);
|
||||
entry = entry->next;
|
||||
}
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
void HTfree(HTtable *ht)
|
||||
{
|
||||
struct HTentry *entry,
|
||||
*nextentry;
|
||||
int i;
|
||||
for (i=0; i<HTMAXSIZE; i++)
|
||||
{
|
||||
entry = ht[i];
|
||||
while (entry != NULL)
|
||||
{
|
||||
nextentry = entry->next;
|
||||
free(entry);
|
||||
entry = nextentry;
|
||||
}
|
||||
}
|
||||
free(ht);
|
||||
}
|
||||
|
||||
48
src/hash.h
Normal file → Executable file
48
src/hash.h
Normal file → Executable file
@@ -1,24 +1,24 @@
|
||||
/* HASH.H
|
||||
**
|
||||
** Header file for Hash Table module HASH.C
|
||||
**
|
||||
*/
|
||||
|
||||
#define HTMAXSIZE 1999
|
||||
#define NOTFOUND 0
|
||||
|
||||
struct HTentry
|
||||
{
|
||||
char *key;
|
||||
int data;
|
||||
struct HTentry *next;
|
||||
};
|
||||
|
||||
typedef struct HTentry *HTtable;
|
||||
|
||||
HTtable *HTcreate(void);
|
||||
int HTinsert(HTtable *, char *, int);
|
||||
int HTfind(HTtable *, char *);
|
||||
char *HTfindKey(HTtable *, char *);
|
||||
void HTfree(HTtable *);
|
||||
|
||||
/* HASH.H
|
||||
**
|
||||
** Header file for Hash Table module HASH.C
|
||||
**
|
||||
*/
|
||||
|
||||
#define HTMAXSIZE 1999
|
||||
#define NOTFOUND 0
|
||||
|
||||
struct HTentry
|
||||
{
|
||||
char *key;
|
||||
int data;
|
||||
struct HTentry *next;
|
||||
};
|
||||
|
||||
typedef struct HTentry *HTtable;
|
||||
|
||||
HTtable *HTcreate(void);
|
||||
int HTinsert(HTtable *, char *, int);
|
||||
int HTfind(HTtable *, char *);
|
||||
char *HTfindKey(HTtable *, char *);
|
||||
void HTfree(HTtable *);
|
||||
|
||||
|
||||
4972
src/hydraul.c
Normal file → Executable file
4972
src/hydraul.c
Normal file → Executable file
File diff suppressed because it is too large
Load Diff
1242
src/inpfile.c
Normal file → Executable file
1242
src/inpfile.c
Normal file → Executable file
File diff suppressed because it is too large
Load Diff
1278
src/input1.c
Normal file → Executable file
1278
src/input1.c
Normal file → Executable file
File diff suppressed because it is too large
Load Diff
1932
src/input2.c
Normal file → Executable file
1932
src/input2.c
Normal file → Executable file
File diff suppressed because it is too large
Load Diff
3726
src/input3.c
Normal file → Executable file
3726
src/input3.c
Normal file → Executable file
File diff suppressed because it is too large
Load Diff
408
src/mempool.c
Normal file → Executable file
408
src/mempool.c
Normal file → Executable file
@@ -1,204 +1,204 @@
|
||||
/* mempool.c
|
||||
**
|
||||
** A simple fast memory allocation package.
|
||||
**
|
||||
** By Steve Hill in Graphics Gems III, David Kirk (ed.),
|
||||
** Academic Press, Boston, MA, 1992
|
||||
**
|
||||
** Modified by Lew Rossman, 8/13/94.
|
||||
**
|
||||
** AllocInit() - create an alloc pool, returns the old pool handle
|
||||
** Alloc() - allocate memory
|
||||
** AllocReset() - reset the current pool
|
||||
** AllocSetPool() - set the current pool
|
||||
** AllocFree() - free the memory used by the current pool.
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <malloc.h>
|
||||
#include "mempool.h"
|
||||
|
||||
/*
|
||||
** ALLOC_BLOCK_SIZE - adjust this size to suit your installation - it
|
||||
** should be reasonably large otherwise you will be mallocing a lot.
|
||||
*/
|
||||
|
||||
#define ALLOC_BLOCK_SIZE 64000 /*(62*1024)*/
|
||||
|
||||
/*
|
||||
** alloc_hdr_t - Header for each block of memory.
|
||||
*/
|
||||
|
||||
typedef struct alloc_hdr_s
|
||||
{
|
||||
struct alloc_hdr_s *next; /* Next Block */
|
||||
char *block, /* Start of block */
|
||||
*free, /* Next free in block */
|
||||
*end; /* block + block size */
|
||||
} alloc_hdr_t;
|
||||
|
||||
/*
|
||||
** alloc_root_t - Header for the whole pool.
|
||||
*/
|
||||
|
||||
typedef struct alloc_root_s
|
||||
{
|
||||
alloc_hdr_t *first, /* First header in pool */
|
||||
*current; /* Current header */
|
||||
} alloc_root_t;
|
||||
|
||||
/*
|
||||
** root - Pointer to the current pool.
|
||||
*/
|
||||
|
||||
static alloc_root_t *root;
|
||||
|
||||
|
||||
/*
|
||||
** AllocHdr()
|
||||
**
|
||||
** Private routine to allocate a header and memory block.
|
||||
*/
|
||||
|
||||
static alloc_hdr_t *AllocHdr(void);
|
||||
|
||||
static alloc_hdr_t * AllocHdr()
|
||||
{
|
||||
alloc_hdr_t *hdr;
|
||||
char *block;
|
||||
|
||||
block = (char *) malloc(ALLOC_BLOCK_SIZE);
|
||||
hdr = (alloc_hdr_t *) malloc(sizeof(alloc_hdr_t));
|
||||
|
||||
if (hdr == NULL || block == NULL) return(NULL);
|
||||
hdr->block = block;
|
||||
hdr->free = block;
|
||||
hdr->next = NULL;
|
||||
hdr->end = block + ALLOC_BLOCK_SIZE;
|
||||
|
||||
return(hdr);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** AllocInit()
|
||||
**
|
||||
** Create a new memory pool with one block.
|
||||
** Returns pointer to the new pool.
|
||||
*/
|
||||
|
||||
alloc_handle_t * AllocInit()
|
||||
{
|
||||
alloc_handle_t *newpool;
|
||||
|
||||
root = (alloc_root_t *) malloc(sizeof(alloc_root_t));
|
||||
if (root == NULL) return(NULL);
|
||||
if ( (root->first = AllocHdr()) == NULL) return(NULL);
|
||||
root->current = root->first;
|
||||
newpool = (alloc_handle_t *) root;
|
||||
return(newpool);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** Alloc()
|
||||
**
|
||||
** Use as a direct replacement for malloc(). Allocates
|
||||
** memory from the current pool.
|
||||
*/
|
||||
|
||||
char * Alloc(long size)
|
||||
{
|
||||
alloc_hdr_t *hdr = root->current;
|
||||
char *ptr;
|
||||
|
||||
/*
|
||||
** Align to 4 byte boundary - should be ok for most machines.
|
||||
** Change this if your machine has weird alignment requirements.
|
||||
*/
|
||||
size = (size + 3) & 0xfffffffc;
|
||||
|
||||
ptr = hdr->free;
|
||||
hdr->free += size;
|
||||
|
||||
/* Check if the current block is exhausted. */
|
||||
|
||||
if (hdr->free >= hdr->end)
|
||||
{
|
||||
/* Is the next block already allocated? */
|
||||
|
||||
if (hdr->next != NULL)
|
||||
{
|
||||
/* re-use block */
|
||||
hdr->next->free = hdr->next->block;
|
||||
root->current = hdr->next;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* extend the pool with a new block */
|
||||
if ( (hdr->next = AllocHdr()) == NULL) return(NULL);
|
||||
root->current = hdr->next;
|
||||
}
|
||||
|
||||
/* set ptr to the first location in the next block */
|
||||
ptr = root->current->free;
|
||||
root->current->free += size;
|
||||
}
|
||||
|
||||
/* Return pointer to allocated memory. */
|
||||
|
||||
return(ptr);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** AllocSetPool()
|
||||
**
|
||||
** Change the current pool. Return the old pool.
|
||||
*/
|
||||
|
||||
alloc_handle_t * AllocSetPool(alloc_handle_t *newpool)
|
||||
{
|
||||
alloc_handle_t *old = (alloc_handle_t *) root;
|
||||
root = (alloc_root_t *) newpool;
|
||||
return(old);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** AllocReset()
|
||||
**
|
||||
** Reset the current pool for re-use. No memory is freed,
|
||||
** so this is very fast.
|
||||
*/
|
||||
|
||||
void AllocReset()
|
||||
{
|
||||
root->current = root->first;
|
||||
root->current->free = root->current->block;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** AllocFreePool()
|
||||
**
|
||||
** Free the memory used by the current pool.
|
||||
** Don't use where AllocReset() could be used.
|
||||
*/
|
||||
|
||||
void AllocFreePool()
|
||||
{
|
||||
alloc_hdr_t *tmp,
|
||||
*hdr = root->first;
|
||||
|
||||
while (hdr != NULL)
|
||||
{
|
||||
tmp = hdr->next;
|
||||
free((char *) hdr->block);
|
||||
free((char *) hdr);
|
||||
hdr = tmp;
|
||||
}
|
||||
free((char *) root);
|
||||
root = NULL;
|
||||
}
|
||||
/* mempool.c
|
||||
**
|
||||
** A simple fast memory allocation package.
|
||||
**
|
||||
** By Steve Hill in Graphics Gems III, David Kirk (ed.),
|
||||
** Academic Press, Boston, MA, 1992
|
||||
**
|
||||
** Modified by Lew Rossman, 8/13/94.
|
||||
**
|
||||
** AllocInit() - create an alloc pool, returns the old pool handle
|
||||
** Alloc() - allocate memory
|
||||
** AllocReset() - reset the current pool
|
||||
** AllocSetPool() - set the current pool
|
||||
** AllocFree() - free the memory used by the current pool.
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <malloc.h>
|
||||
#include "mempool.h"
|
||||
|
||||
/*
|
||||
** ALLOC_BLOCK_SIZE - adjust this size to suit your installation - it
|
||||
** should be reasonably large otherwise you will be mallocing a lot.
|
||||
*/
|
||||
|
||||
#define ALLOC_BLOCK_SIZE 64000 /*(62*1024)*/
|
||||
|
||||
/*
|
||||
** alloc_hdr_t - Header for each block of memory.
|
||||
*/
|
||||
|
||||
typedef struct alloc_hdr_s
|
||||
{
|
||||
struct alloc_hdr_s *next; /* Next Block */
|
||||
char *block, /* Start of block */
|
||||
*free, /* Next free in block */
|
||||
*end; /* block + block size */
|
||||
} alloc_hdr_t;
|
||||
|
||||
/*
|
||||
** alloc_root_t - Header for the whole pool.
|
||||
*/
|
||||
|
||||
typedef struct alloc_root_s
|
||||
{
|
||||
alloc_hdr_t *first, /* First header in pool */
|
||||
*current; /* Current header */
|
||||
} alloc_root_t;
|
||||
|
||||
/*
|
||||
** root - Pointer to the current pool.
|
||||
*/
|
||||
|
||||
static alloc_root_t *root;
|
||||
|
||||
|
||||
/*
|
||||
** AllocHdr()
|
||||
**
|
||||
** Private routine to allocate a header and memory block.
|
||||
*/
|
||||
|
||||
static alloc_hdr_t *AllocHdr(void);
|
||||
|
||||
static alloc_hdr_t * AllocHdr()
|
||||
{
|
||||
alloc_hdr_t *hdr;
|
||||
char *block;
|
||||
|
||||
block = (char *) malloc(ALLOC_BLOCK_SIZE);
|
||||
hdr = (alloc_hdr_t *) malloc(sizeof(alloc_hdr_t));
|
||||
|
||||
if (hdr == NULL || block == NULL) return(NULL);
|
||||
hdr->block = block;
|
||||
hdr->free = block;
|
||||
hdr->next = NULL;
|
||||
hdr->end = block + ALLOC_BLOCK_SIZE;
|
||||
|
||||
return(hdr);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** AllocInit()
|
||||
**
|
||||
** Create a new memory pool with one block.
|
||||
** Returns pointer to the new pool.
|
||||
*/
|
||||
|
||||
alloc_handle_t * AllocInit()
|
||||
{
|
||||
alloc_handle_t *newpool;
|
||||
|
||||
root = (alloc_root_t *) malloc(sizeof(alloc_root_t));
|
||||
if (root == NULL) return(NULL);
|
||||
if ( (root->first = AllocHdr()) == NULL) return(NULL);
|
||||
root->current = root->first;
|
||||
newpool = (alloc_handle_t *) root;
|
||||
return(newpool);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** Alloc()
|
||||
**
|
||||
** Use as a direct replacement for malloc(). Allocates
|
||||
** memory from the current pool.
|
||||
*/
|
||||
|
||||
char * Alloc(long size)
|
||||
{
|
||||
alloc_hdr_t *hdr = root->current;
|
||||
char *ptr;
|
||||
|
||||
/*
|
||||
** Align to 4 byte boundary - should be ok for most machines.
|
||||
** Change this if your machine has weird alignment requirements.
|
||||
*/
|
||||
size = (size + 3) & 0xfffffffc;
|
||||
|
||||
ptr = hdr->free;
|
||||
hdr->free += size;
|
||||
|
||||
/* Check if the current block is exhausted. */
|
||||
|
||||
if (hdr->free >= hdr->end)
|
||||
{
|
||||
/* Is the next block already allocated? */
|
||||
|
||||
if (hdr->next != NULL)
|
||||
{
|
||||
/* re-use block */
|
||||
hdr->next->free = hdr->next->block;
|
||||
root->current = hdr->next;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* extend the pool with a new block */
|
||||
if ( (hdr->next = AllocHdr()) == NULL) return(NULL);
|
||||
root->current = hdr->next;
|
||||
}
|
||||
|
||||
/* set ptr to the first location in the next block */
|
||||
ptr = root->current->free;
|
||||
root->current->free += size;
|
||||
}
|
||||
|
||||
/* Return pointer to allocated memory. */
|
||||
|
||||
return(ptr);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** AllocSetPool()
|
||||
**
|
||||
** Change the current pool. Return the old pool.
|
||||
*/
|
||||
|
||||
alloc_handle_t * AllocSetPool(alloc_handle_t *newpool)
|
||||
{
|
||||
alloc_handle_t *old = (alloc_handle_t *) root;
|
||||
root = (alloc_root_t *) newpool;
|
||||
return(old);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** AllocReset()
|
||||
**
|
||||
** Reset the current pool for re-use. No memory is freed,
|
||||
** so this is very fast.
|
||||
*/
|
||||
|
||||
void AllocReset()
|
||||
{
|
||||
root->current = root->first;
|
||||
root->current->free = root->current->block;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** AllocFreePool()
|
||||
**
|
||||
** Free the memory used by the current pool.
|
||||
** Don't use where AllocReset() could be used.
|
||||
*/
|
||||
|
||||
void AllocFreePool()
|
||||
{
|
||||
alloc_hdr_t *tmp,
|
||||
*hdr = root->first;
|
||||
|
||||
while (hdr != NULL)
|
||||
{
|
||||
tmp = hdr->next;
|
||||
free((char *) hdr->block);
|
||||
free((char *) hdr);
|
||||
hdr = tmp;
|
||||
}
|
||||
free((char *) root);
|
||||
root = NULL;
|
||||
}
|
||||
|
||||
38
src/mempool.h
Normal file → Executable file
38
src/mempool.h
Normal file → Executable file
@@ -1,19 +1,19 @@
|
||||
/*
|
||||
** mempool.h
|
||||
**
|
||||
** Header for mempool.c
|
||||
**
|
||||
** The type alloc_handle_t provides an opaque reference to the
|
||||
** alloc pool - only the alloc routines know its structure.
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
long dummy;
|
||||
} alloc_handle_t;
|
||||
|
||||
alloc_handle_t *AllocInit(void);
|
||||
char *Alloc(long);
|
||||
alloc_handle_t *AllocSetPool(alloc_handle_t *);
|
||||
void AllocReset(void);
|
||||
void AllocFreePool(void);
|
||||
/*
|
||||
** mempool.h
|
||||
**
|
||||
** Header for mempool.c
|
||||
**
|
||||
** The type alloc_handle_t provides an opaque reference to the
|
||||
** alloc pool - only the alloc routines know its structure.
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
long dummy;
|
||||
} alloc_handle_t;
|
||||
|
||||
alloc_handle_t *AllocInit(void);
|
||||
char *Alloc(long);
|
||||
alloc_handle_t *AllocSetPool(alloc_handle_t *);
|
||||
void AllocReset(void);
|
||||
void AllocFreePool(void);
|
||||
|
||||
1394
src/output.c
Normal file → Executable file
1394
src/output.c
Normal file → Executable file
File diff suppressed because it is too large
Load Diff
3304
src/quality.c
Normal file → Executable file
3304
src/quality.c
Normal file → Executable file
File diff suppressed because it is too large
Load Diff
2444
src/report.c
Normal file → Executable file
2444
src/report.c
Normal file → Executable file
File diff suppressed because it is too large
Load Diff
1934
src/rules.c
Normal file → Executable file
1934
src/rules.c
Normal file → Executable file
File diff suppressed because it is too large
Load Diff
1500
src/smatrix.c
Normal file → Executable file
1500
src/smatrix.c
Normal file → Executable file
File diff suppressed because it is too large
Load Diff
1060
src/text.h
Normal file → Executable file
1060
src/text.h
Normal file → Executable file
File diff suppressed because it is too large
Load Diff
448
src/toolkit.h
Normal file → Executable file
448
src/toolkit.h
Normal file → Executable file
@@ -1,224 +1,224 @@
|
||||
/*
|
||||
*******************************************************************
|
||||
|
||||
TOOLKIT.H - Prototypes for EPANET Functions Exported to DLL Toolkit
|
||||
|
||||
VERSION: 2.00
|
||||
DATE: 5/8/00
|
||||
10/25/00
|
||||
3/1/01
|
||||
8/15/07 (2.00.11)
|
||||
2/14/08 (2.00.12)
|
||||
AUTHOR: L. Rossman
|
||||
US EPA - NRMRL
|
||||
|
||||
*******************************************************************
|
||||
*/
|
||||
|
||||
// --- Define DLLEXPORT
|
||||
|
||||
#ifdef DLL
|
||||
#ifdef __cplusplus
|
||||
#define DLLEXPORT extern "C" __declspec(dllexport) __stdcall
|
||||
#else
|
||||
#define DLLEXPORT __declspec(dllexport) __stdcall
|
||||
#endif
|
||||
#else
|
||||
#ifdef __cplusplus
|
||||
#define DLLEXPORT extern "C"
|
||||
#else
|
||||
#define DLLEXPORT
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// --- Define the EPANET toolkit constants
|
||||
|
||||
#define EN_ELEVATION 0 /* Node parameters */
|
||||
#define EN_BASEDEMAND 1
|
||||
#define EN_PATTERN 2
|
||||
#define EN_EMITTER 3
|
||||
#define EN_INITQUAL 4
|
||||
#define EN_SOURCEQUAL 5
|
||||
#define EN_SOURCEPAT 6
|
||||
#define EN_SOURCETYPE 7
|
||||
#define EN_TANKLEVEL 8
|
||||
#define EN_DEMAND 9
|
||||
#define EN_HEAD 10
|
||||
#define EN_PRESSURE 11
|
||||
#define EN_QUALITY 12
|
||||
#define EN_SOURCEMASS 13
|
||||
#define EN_INITVOLUME 14
|
||||
#define EN_MIXMODEL 15
|
||||
#define EN_MIXZONEVOL 16
|
||||
|
||||
#define EN_TANKDIAM 17
|
||||
#define EN_MINVOLUME 18
|
||||
#define EN_VOLCURVE 19
|
||||
#define EN_MINLEVEL 20
|
||||
#define EN_MAXLEVEL 21
|
||||
#define EN_MIXFRACTION 22
|
||||
#define EN_TANK_KBULK 23
|
||||
|
||||
#define EN_DIAMETER 0 /* Link parameters */
|
||||
#define EN_LENGTH 1
|
||||
#define EN_ROUGHNESS 2
|
||||
#define EN_MINORLOSS 3
|
||||
#define EN_INITSTATUS 4
|
||||
#define EN_INITSETTING 5
|
||||
#define EN_KBULK 6
|
||||
#define EN_KWALL 7
|
||||
#define EN_FLOW 8
|
||||
#define EN_VELOCITY 9
|
||||
#define EN_HEADLOSS 10
|
||||
#define EN_STATUS 11
|
||||
#define EN_SETTING 12
|
||||
#define EN_ENERGY 13
|
||||
|
||||
#define EN_DURATION 0 /* Time parameters */
|
||||
#define EN_HYDSTEP 1
|
||||
#define EN_QUALSTEP 2
|
||||
#define EN_PATTERNSTEP 3
|
||||
#define EN_PATTERNSTART 4
|
||||
#define EN_REPORTSTEP 5
|
||||
#define EN_REPORTSTART 6
|
||||
#define EN_RULESTEP 7
|
||||
#define EN_STATISTIC 8
|
||||
#define EN_PERIODS 9
|
||||
|
||||
#define EN_NODECOUNT 0 /* Component counts */
|
||||
#define EN_TANKCOUNT 1
|
||||
#define EN_LINKCOUNT 2
|
||||
#define EN_PATCOUNT 3
|
||||
#define EN_CURVECOUNT 4
|
||||
#define EN_CONTROLCOUNT 5
|
||||
|
||||
#define EN_JUNCTION 0 /* Node types */
|
||||
#define EN_RESERVOIR 1
|
||||
#define EN_TANK 2
|
||||
|
||||
#define EN_CVPIPE 0 /* Link types. */
|
||||
#define EN_PIPE 1 /* See LinkType in TYPES.H */
|
||||
#define EN_PUMP 2
|
||||
#define EN_PRV 3
|
||||
#define EN_PSV 4
|
||||
#define EN_PBV 5
|
||||
#define EN_FCV 6
|
||||
#define EN_TCV 7
|
||||
#define EN_GPV 8
|
||||
|
||||
#define EN_NONE 0 /* Quality analysis types. */
|
||||
#define EN_CHEM 1 /* See QualType in TYPES.H */
|
||||
#define EN_AGE 2
|
||||
#define EN_TRACE 3
|
||||
|
||||
#define EN_CONCEN 0 /* Source quality types. */
|
||||
#define EN_MASS 1 /* See SourceType in TYPES.H. */
|
||||
#define EN_SETPOINT 2
|
||||
#define EN_FLOWPACED 3
|
||||
|
||||
#define EN_CFS 0 /* Flow units types. */
|
||||
#define EN_GPM 1 /* See FlowUnitsType */
|
||||
#define EN_MGD 2 /* in TYPES.H. */
|
||||
#define EN_IMGD 3
|
||||
#define EN_AFD 4
|
||||
#define EN_LPS 5
|
||||
#define EN_LPM 6
|
||||
#define EN_MLD 7
|
||||
#define EN_CMH 8
|
||||
#define EN_CMD 9
|
||||
|
||||
#define EN_TRIALS 0 /* Misc. options */
|
||||
#define EN_ACCURACY 1
|
||||
#define EN_TOLERANCE 2
|
||||
#define EN_EMITEXPON 3
|
||||
#define EN_DEMANDMULT 4
|
||||
|
||||
#define EN_LOWLEVEL 0 /* Control types. */
|
||||
#define EN_HILEVEL 1 /* See ControlType */
|
||||
#define EN_TIMER 2 /* in TYPES.H. */
|
||||
#define EN_TIMEOFDAY 3
|
||||
|
||||
#define EN_AVERAGE 1 /* Time statistic types. */
|
||||
#define EN_MINIMUM 2 /* See TstatType in TYPES.H */
|
||||
#define EN_MAXIMUM 3
|
||||
#define EN_RANGE 4
|
||||
|
||||
#define EN_MIX1 0 /* Tank mixing models */
|
||||
#define EN_MIX2 1
|
||||
#define EN_FIFO 2
|
||||
#define EN_LIFO 3
|
||||
|
||||
#define EN_NOSAVE 0 /* Save-results-to-file flag */
|
||||
#define EN_SAVE 1
|
||||
|
||||
#define EN_INITFLOW 10 /* Re-initialize flows flag */
|
||||
|
||||
|
||||
// --- Declare the EPANET toolkit functions
|
||||
|
||||
int DLLEXPORT ENepanet(char *, char *, char *, void (*) (char *));
|
||||
|
||||
int DLLEXPORT ENopen(char *, char *, char *);
|
||||
int DLLEXPORT ENsaveinpfile(char *);
|
||||
int DLLEXPORT ENclose(void);
|
||||
|
||||
int DLLEXPORT ENsolveH(void);
|
||||
int DLLEXPORT ENsaveH(void);
|
||||
int DLLEXPORT ENopenH(void);
|
||||
int DLLEXPORT ENinitH(int);
|
||||
int DLLEXPORT ENrunH(long *);
|
||||
int DLLEXPORT ENnextH(long *);
|
||||
int DLLEXPORT ENcloseH(void);
|
||||
int DLLEXPORT ENsavehydfile(char *);
|
||||
int DLLEXPORT ENusehydfile(char *);
|
||||
|
||||
int DLLEXPORT ENsolveQ(void);
|
||||
int DLLEXPORT ENopenQ(void);
|
||||
int DLLEXPORT ENinitQ(int);
|
||||
int DLLEXPORT ENrunQ(long *);
|
||||
int DLLEXPORT ENnextQ(long *);
|
||||
int DLLEXPORT ENstepQ(long *);
|
||||
int DLLEXPORT ENcloseQ(void);
|
||||
|
||||
int DLLEXPORT ENwriteline(char *);
|
||||
int DLLEXPORT ENreport(void);
|
||||
int DLLEXPORT ENresetreport(void);
|
||||
int DLLEXPORT ENsetreport(char *);
|
||||
|
||||
int DLLEXPORT ENgetcontrol(int, int *, int *, float *,
|
||||
int *, float *);
|
||||
int DLLEXPORT ENgetcount(int, int *);
|
||||
int DLLEXPORT ENgetoption(int, float *);
|
||||
int DLLEXPORT ENgettimeparam(int, long *);
|
||||
int DLLEXPORT ENgetflowunits(int *);
|
||||
int DLLEXPORT ENgetpatternindex(char *, int *);
|
||||
int DLLEXPORT ENgetpatternid(int, char *);
|
||||
int DLLEXPORT ENgetpatternlen(int, int *);
|
||||
int DLLEXPORT ENgetpatternvalue(int, int, float *);
|
||||
int DLLEXPORT ENgetqualtype(int *, int *);
|
||||
int DLLEXPORT ENgeterror(int, char *, int);
|
||||
|
||||
int DLLEXPORT ENgetnodeindex(char *, int *);
|
||||
int DLLEXPORT ENgetnodeid(int, char *);
|
||||
int DLLEXPORT ENgetnodetype(int, int *);
|
||||
int DLLEXPORT ENgetnodevalue(int, int, float *);
|
||||
|
||||
int DLLEXPORT ENgetlinkindex(char *, int *);
|
||||
int DLLEXPORT ENgetlinkid(int, char *);
|
||||
int DLLEXPORT ENgetlinktype(int, int *);
|
||||
int DLLEXPORT ENgetlinknodes(int, int *, int *);
|
||||
int DLLEXPORT ENgetlinkvalue(int, int, float *);
|
||||
|
||||
int DLLEXPORT ENgetversion(int *);
|
||||
|
||||
int DLLEXPORT ENsetcontrol(int, int, int, float, int, float);
|
||||
int DLLEXPORT ENsetnodevalue(int, int, float);
|
||||
int DLLEXPORT ENsetlinkvalue(int, int, float);
|
||||
int DLLEXPORT ENaddpattern(char *);
|
||||
int DLLEXPORT ENsetpattern(int, float *, int);
|
||||
int DLLEXPORT ENsetpatternvalue(int, int, float);
|
||||
int DLLEXPORT ENsettimeparam(int, long);
|
||||
int DLLEXPORT ENsetoption(int, float);
|
||||
int DLLEXPORT ENsetstatusreport(int);
|
||||
int DLLEXPORT ENsetqualtype(int, char *, char *, char *);
|
||||
|
||||
/*
|
||||
*******************************************************************
|
||||
|
||||
TOOLKIT.H - Prototypes for EPANET Functions Exported to DLL Toolkit
|
||||
|
||||
VERSION: 2.00
|
||||
DATE: 5/8/00
|
||||
10/25/00
|
||||
3/1/01
|
||||
8/15/07 (2.00.11)
|
||||
2/14/08 (2.00.12)
|
||||
AUTHOR: L. Rossman
|
||||
US EPA - NRMRL
|
||||
|
||||
*******************************************************************
|
||||
*/
|
||||
|
||||
// --- Define DLLEXPORT
|
||||
|
||||
#ifdef DLL
|
||||
#ifdef __cplusplus
|
||||
#define DLLEXPORT extern "C" __declspec(dllexport) __stdcall
|
||||
#else
|
||||
#define DLLEXPORT __declspec(dllexport) __stdcall
|
||||
#endif
|
||||
#else
|
||||
#ifdef __cplusplus
|
||||
#define DLLEXPORT extern "C"
|
||||
#else
|
||||
#define DLLEXPORT
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// --- Define the EPANET toolkit constants
|
||||
|
||||
#define EN_ELEVATION 0 /* Node parameters */
|
||||
#define EN_BASEDEMAND 1
|
||||
#define EN_PATTERN 2
|
||||
#define EN_EMITTER 3
|
||||
#define EN_INITQUAL 4
|
||||
#define EN_SOURCEQUAL 5
|
||||
#define EN_SOURCEPAT 6
|
||||
#define EN_SOURCETYPE 7
|
||||
#define EN_TANKLEVEL 8
|
||||
#define EN_DEMAND 9
|
||||
#define EN_HEAD 10
|
||||
#define EN_PRESSURE 11
|
||||
#define EN_QUALITY 12
|
||||
#define EN_SOURCEMASS 13
|
||||
#define EN_INITVOLUME 14
|
||||
#define EN_MIXMODEL 15
|
||||
#define EN_MIXZONEVOL 16
|
||||
|
||||
#define EN_TANKDIAM 17
|
||||
#define EN_MINVOLUME 18
|
||||
#define EN_VOLCURVE 19
|
||||
#define EN_MINLEVEL 20
|
||||
#define EN_MAXLEVEL 21
|
||||
#define EN_MIXFRACTION 22
|
||||
#define EN_TANK_KBULK 23
|
||||
|
||||
#define EN_DIAMETER 0 /* Link parameters */
|
||||
#define EN_LENGTH 1
|
||||
#define EN_ROUGHNESS 2
|
||||
#define EN_MINORLOSS 3
|
||||
#define EN_INITSTATUS 4
|
||||
#define EN_INITSETTING 5
|
||||
#define EN_KBULK 6
|
||||
#define EN_KWALL 7
|
||||
#define EN_FLOW 8
|
||||
#define EN_VELOCITY 9
|
||||
#define EN_HEADLOSS 10
|
||||
#define EN_STATUS 11
|
||||
#define EN_SETTING 12
|
||||
#define EN_ENERGY 13
|
||||
|
||||
#define EN_DURATION 0 /* Time parameters */
|
||||
#define EN_HYDSTEP 1
|
||||
#define EN_QUALSTEP 2
|
||||
#define EN_PATTERNSTEP 3
|
||||
#define EN_PATTERNSTART 4
|
||||
#define EN_REPORTSTEP 5
|
||||
#define EN_REPORTSTART 6
|
||||
#define EN_RULESTEP 7
|
||||
#define EN_STATISTIC 8
|
||||
#define EN_PERIODS 9
|
||||
|
||||
#define EN_NODECOUNT 0 /* Component counts */
|
||||
#define EN_TANKCOUNT 1
|
||||
#define EN_LINKCOUNT 2
|
||||
#define EN_PATCOUNT 3
|
||||
#define EN_CURVECOUNT 4
|
||||
#define EN_CONTROLCOUNT 5
|
||||
|
||||
#define EN_JUNCTION 0 /* Node types */
|
||||
#define EN_RESERVOIR 1
|
||||
#define EN_TANK 2
|
||||
|
||||
#define EN_CVPIPE 0 /* Link types. */
|
||||
#define EN_PIPE 1 /* See LinkType in TYPES.H */
|
||||
#define EN_PUMP 2
|
||||
#define EN_PRV 3
|
||||
#define EN_PSV 4
|
||||
#define EN_PBV 5
|
||||
#define EN_FCV 6
|
||||
#define EN_TCV 7
|
||||
#define EN_GPV 8
|
||||
|
||||
#define EN_NONE 0 /* Quality analysis types. */
|
||||
#define EN_CHEM 1 /* See QualType in TYPES.H */
|
||||
#define EN_AGE 2
|
||||
#define EN_TRACE 3
|
||||
|
||||
#define EN_CONCEN 0 /* Source quality types. */
|
||||
#define EN_MASS 1 /* See SourceType in TYPES.H. */
|
||||
#define EN_SETPOINT 2
|
||||
#define EN_FLOWPACED 3
|
||||
|
||||
#define EN_CFS 0 /* Flow units types. */
|
||||
#define EN_GPM 1 /* See FlowUnitsType */
|
||||
#define EN_MGD 2 /* in TYPES.H. */
|
||||
#define EN_IMGD 3
|
||||
#define EN_AFD 4
|
||||
#define EN_LPS 5
|
||||
#define EN_LPM 6
|
||||
#define EN_MLD 7
|
||||
#define EN_CMH 8
|
||||
#define EN_CMD 9
|
||||
|
||||
#define EN_TRIALS 0 /* Misc. options */
|
||||
#define EN_ACCURACY 1
|
||||
#define EN_TOLERANCE 2
|
||||
#define EN_EMITEXPON 3
|
||||
#define EN_DEMANDMULT 4
|
||||
|
||||
#define EN_LOWLEVEL 0 /* Control types. */
|
||||
#define EN_HILEVEL 1 /* See ControlType */
|
||||
#define EN_TIMER 2 /* in TYPES.H. */
|
||||
#define EN_TIMEOFDAY 3
|
||||
|
||||
#define EN_AVERAGE 1 /* Time statistic types. */
|
||||
#define EN_MINIMUM 2 /* See TstatType in TYPES.H */
|
||||
#define EN_MAXIMUM 3
|
||||
#define EN_RANGE 4
|
||||
|
||||
#define EN_MIX1 0 /* Tank mixing models */
|
||||
#define EN_MIX2 1
|
||||
#define EN_FIFO 2
|
||||
#define EN_LIFO 3
|
||||
|
||||
#define EN_NOSAVE 0 /* Save-results-to-file flag */
|
||||
#define EN_SAVE 1
|
||||
|
||||
#define EN_INITFLOW 10 /* Re-initialize flows flag */
|
||||
|
||||
|
||||
// --- Declare the EPANET toolkit functions
|
||||
|
||||
int DLLEXPORT ENepanet(char *, char *, char *, void (*) (char *));
|
||||
|
||||
int DLLEXPORT ENopen(char *, char *, char *);
|
||||
int DLLEXPORT ENsaveinpfile(char *);
|
||||
int DLLEXPORT ENclose(void);
|
||||
|
||||
int DLLEXPORT ENsolveH(void);
|
||||
int DLLEXPORT ENsaveH(void);
|
||||
int DLLEXPORT ENopenH(void);
|
||||
int DLLEXPORT ENinitH(int);
|
||||
int DLLEXPORT ENrunH(long *);
|
||||
int DLLEXPORT ENnextH(long *);
|
||||
int DLLEXPORT ENcloseH(void);
|
||||
int DLLEXPORT ENsavehydfile(char *);
|
||||
int DLLEXPORT ENusehydfile(char *);
|
||||
|
||||
int DLLEXPORT ENsolveQ(void);
|
||||
int DLLEXPORT ENopenQ(void);
|
||||
int DLLEXPORT ENinitQ(int);
|
||||
int DLLEXPORT ENrunQ(long *);
|
||||
int DLLEXPORT ENnextQ(long *);
|
||||
int DLLEXPORT ENstepQ(long *);
|
||||
int DLLEXPORT ENcloseQ(void);
|
||||
|
||||
int DLLEXPORT ENwriteline(char *);
|
||||
int DLLEXPORT ENreport(void);
|
||||
int DLLEXPORT ENresetreport(void);
|
||||
int DLLEXPORT ENsetreport(char *);
|
||||
|
||||
int DLLEXPORT ENgetcontrol(int, int *, int *, float *,
|
||||
int *, float *);
|
||||
int DLLEXPORT ENgetcount(int, int *);
|
||||
int DLLEXPORT ENgetoption(int, float *);
|
||||
int DLLEXPORT ENgettimeparam(int, long *);
|
||||
int DLLEXPORT ENgetflowunits(int *);
|
||||
int DLLEXPORT ENgetpatternindex(char *, int *);
|
||||
int DLLEXPORT ENgetpatternid(int, char *);
|
||||
int DLLEXPORT ENgetpatternlen(int, int *);
|
||||
int DLLEXPORT ENgetpatternvalue(int, int, float *);
|
||||
int DLLEXPORT ENgetqualtype(int *, int *);
|
||||
int DLLEXPORT ENgeterror(int, char *, int);
|
||||
|
||||
int DLLEXPORT ENgetnodeindex(char *, int *);
|
||||
int DLLEXPORT ENgetnodeid(int, char *);
|
||||
int DLLEXPORT ENgetnodetype(int, int *);
|
||||
int DLLEXPORT ENgetnodevalue(int, int, float *);
|
||||
|
||||
int DLLEXPORT ENgetlinkindex(char *, int *);
|
||||
int DLLEXPORT ENgetlinkid(int, char *);
|
||||
int DLLEXPORT ENgetlinktype(int, int *);
|
||||
int DLLEXPORT ENgetlinknodes(int, int *, int *);
|
||||
int DLLEXPORT ENgetlinkvalue(int, int, float *);
|
||||
|
||||
int DLLEXPORT ENgetversion(int *);
|
||||
|
||||
int DLLEXPORT ENsetcontrol(int, int, int, float, int, float);
|
||||
int DLLEXPORT ENsetnodevalue(int, int, float);
|
||||
int DLLEXPORT ENsetlinkvalue(int, int, float);
|
||||
int DLLEXPORT ENaddpattern(char *);
|
||||
int DLLEXPORT ENsetpattern(int, float *, int);
|
||||
int DLLEXPORT ENsetpatternvalue(int, int, float);
|
||||
int DLLEXPORT ENsettimeparam(int, long);
|
||||
int DLLEXPORT ENsetoption(int, float);
|
||||
int DLLEXPORT ENsetstatusreport(int);
|
||||
int DLLEXPORT ENsetqualtype(int, char *, char *, char *);
|
||||
|
||||
|
||||
906
src/types.h
Normal file → Executable file
906
src/types.h
Normal file → Executable file
@@ -1,453 +1,453 @@
|
||||
/*
|
||||
***********************************************************************
|
||||
|
||||
TYPES.H -- Global constants and data types for EPANET program
|
||||
|
||||
VERSION: 2.00
|
||||
DATE: 5/8/00
|
||||
9/7/00
|
||||
10/25/00
|
||||
3/1/01
|
||||
12/6/01
|
||||
6/24/02
|
||||
8/15/07 (2.00.11)
|
||||
2/14/08 (2.00.12)
|
||||
AUTHOR: L. Rossman
|
||||
US EPA - NRMRL
|
||||
|
||||
**********************************************************************
|
||||
*/
|
||||
|
||||
/*********************************************************/
|
||||
/* All floats have been re-declared as doubles (7/3/07). */
|
||||
/*********************************************************/
|
||||
/*
|
||||
-------------------------------------------
|
||||
Definition of 4-byte integers & reals
|
||||
-------------------------------------------
|
||||
*/
|
||||
typedef float REAL4; //(2.00.11 - LR)
|
||||
typedef int INT4; //(2.00.12 - LR)
|
||||
|
||||
/*
|
||||
-----------------------------
|
||||
Global Constants
|
||||
-----------------------------
|
||||
*/
|
||||
/*** Updated ***/
|
||||
#define CODEVERSION 20012 //(2.00.12 - LR)
|
||||
#define MAGICNUMBER 516114521
|
||||
#define VERSION 200
|
||||
#define EOFMARK 0x1A /* Use 0x04 for UNIX systems */
|
||||
#define MAXTITLE 3 /* Max. # title lines */
|
||||
#define MAXID 31 /* Max. # characters in ID name */ //(2.00.11 - LR)
|
||||
#define MAXMSG 79 /* Max. # characters in message text */
|
||||
#define MAXLINE 255 /* Max. # characters read from input line */
|
||||
#define MAXFNAME 259 /* Max. # characters in file name */
|
||||
#define MAXTOKS 40 /* Max. items per line of input */
|
||||
#define TZERO 1.E-4 /* Zero time tolerance */
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
#define FULL 2
|
||||
#define BIG 1.E10
|
||||
#define TINY 1.E-6
|
||||
#define MISSING -1.E10
|
||||
#define PI 3.141592654
|
||||
|
||||
/*** Updated 9/7/00 ***/
|
||||
/* Various conversion factors */
|
||||
#define GPMperCFS 448.831
|
||||
#define AFDperCFS 1.9837
|
||||
#define MGDperCFS 0.64632
|
||||
#define IMGDperCFS 0.5382
|
||||
#define LPSperCFS 28.317
|
||||
#define LPMperCFS 1699.0
|
||||
#define CMHperCFS 101.94
|
||||
#define CMDperCFS 2446.6
|
||||
#define MLDperCFS 2.4466
|
||||
#define M3perFT3 0.028317
|
||||
#define LperFT3 28.317
|
||||
#define MperFT 0.3048
|
||||
#define PSIperFT 0.4333
|
||||
#define KPAperPSI 6.895
|
||||
#define KWperHP 0.7457
|
||||
#define SECperDAY 86400
|
||||
|
||||
#define DIFFUS 1.3E-8 /* Diffusivity of chlorine */
|
||||
/* @ 20 deg C (sq ft/sec) */
|
||||
#define VISCOS 1.1E-5 /* Kinematic viscosity of water */
|
||||
/* @ 20 deg C (sq ft/sec) */
|
||||
|
||||
#define SEPSTR " \t\n\r" /* Token separator characters */
|
||||
|
||||
/*
|
||||
---------------------------------------------------------------------
|
||||
Macro to test for successful allocation of memory
|
||||
---------------------------------------------------------------------
|
||||
*/
|
||||
#define MEMCHECK(x) (((x) == NULL) ? 101 : 0 )
|
||||
#define FREE(x) (free((x)))
|
||||
|
||||
/*
|
||||
---------------------------------------------------------------------
|
||||
Conversion macros to be used in place of functions
|
||||
---------------------------------------------------------------------
|
||||
*/
|
||||
#define INT(x) ((int)(x)) /* integer portion of x */
|
||||
#define FRAC(x) ((x)-(int)(x)) /* fractional part of x */
|
||||
#define ABS(x) (((x)<0) ? -(x) : (x)) /* absolute value of x */
|
||||
#define MIN(x,y) (((x)<=(y)) ? (x) : (y)) /* minimum of x and y */
|
||||
#define MAX(x,y) (((x)>=(y)) ? (x) : (y)) /* maximum of x and y */
|
||||
#define ROUND(x) (((x)>=0) ? (int)((x)+.5) : (int)((x)-.5))
|
||||
/* round-off of x */
|
||||
#define MOD(x,y) ((x)%(y)) /* x modulus y */
|
||||
#define SQR(x) ((x)*(x)) /* x-squared */
|
||||
#define SGN(x) (((x)<0) ? (-1) : (1)) /* sign of x */
|
||||
#define UCHAR(x) (((x) >= 'a' && (x) <= 'z') ? ((x)&~32) : (x))
|
||||
/* uppercase char of x */
|
||||
/*
|
||||
------------------------------------------------------
|
||||
Macro to evaluate function x with error checking
|
||||
(Fatal errors are numbered higher than 100)
|
||||
------------------------------------------------------
|
||||
*/
|
||||
#define ERRCODE(x) (errcode = ((errcode>100) ? (errcode) : (x)))
|
||||
|
||||
/*
|
||||
------------------------------------------------------
|
||||
Macro to find Pump index of Link[x]
|
||||
(Diameter = pump index for pump links)
|
||||
------------------------------------------------------
|
||||
*/
|
||||
#define PUMPINDEX(x) (ROUND(Link[(x)].Diam))
|
||||
|
||||
/*
|
||||
------------------------------------------------------
|
||||
Global Data Structures
|
||||
------------------------------------------------------
|
||||
*/
|
||||
|
||||
struct IDstring /* Holds component ID labels */
|
||||
{
|
||||
char ID[MAXID+1];
|
||||
};
|
||||
|
||||
struct Floatlist /* Element of list of floats */
|
||||
{
|
||||
double value;
|
||||
struct Floatlist *next;
|
||||
};
|
||||
typedef struct Floatlist SFloatlist;
|
||||
|
||||
struct Tmplist /* Element of temp list for Pattern & Curve data */
|
||||
{
|
||||
int i;
|
||||
char ID[MAXID+1];
|
||||
SFloatlist *x;
|
||||
SFloatlist *y;
|
||||
struct Tmplist *next;
|
||||
};
|
||||
typedef struct Tmplist STmplist;
|
||||
|
||||
typedef struct /* TIME PATTERN OBJECT */
|
||||
{
|
||||
char ID[MAXID+1]; /* Pattern ID */
|
||||
int Length; /* Pattern length */
|
||||
double *F; /* Pattern factors */
|
||||
} Spattern;
|
||||
|
||||
typedef struct /* CURVE OBJECT */
|
||||
{
|
||||
char ID[MAXID+1]; /* Curve ID */
|
||||
int Type; /* Curve type */
|
||||
int Npts; /* Number of points */
|
||||
double *X; /* X-values */
|
||||
double *Y; /* Y-values */
|
||||
} Scurve;
|
||||
|
||||
struct Sdemand /* DEMAND CATEGORY OBJECT */
|
||||
{
|
||||
double Base; /* Baseline demand */
|
||||
int Pat; /* Pattern index */
|
||||
struct Sdemand *next; /* Next record */
|
||||
};
|
||||
typedef struct Sdemand *Pdemand; /* Pointer to demand object */
|
||||
|
||||
struct Ssource /* WQ SOURCE OBJECT */
|
||||
{
|
||||
/*int Node;*/ /* Node index of source */
|
||||
double C0; /* Base concentration/mass */
|
||||
int Pat; /* Pattern index */
|
||||
double Smass; /* Actual mass flow rate */
|
||||
char Type; /* SourceType (see below) */
|
||||
};
|
||||
typedef struct Ssource *Psource; /* Pointer to WQ source object */
|
||||
|
||||
typedef struct /* NODE OBJECT */
|
||||
{
|
||||
char ID[MAXID+1]; /* Node ID */
|
||||
double El; /* Elevation */
|
||||
Pdemand D; /* Demand pointer */
|
||||
Psource S; /* Source pointer */
|
||||
double C0; /* Initial quality */
|
||||
double Ke; /* Emitter coeff. */
|
||||
char Rpt; /* Reporting flag */
|
||||
} Snode;
|
||||
|
||||
typedef struct /* LINK OBJECT */
|
||||
{
|
||||
char ID[MAXID+1]; /* Link ID */
|
||||
int N1; /* Start node index */
|
||||
int N2; /* End node index */
|
||||
double Diam; /* Diameter */
|
||||
double Len; /* Length */
|
||||
double Kc; /* Roughness */
|
||||
double Km; /* Minor loss coeff. */
|
||||
double Kb; /* Bulk react. coeff */
|
||||
double Kw; /* Wall react. coeff */
|
||||
double R; /* Flow resistance */
|
||||
char Type; /* Link type */
|
||||
char Stat; /* Initial status */
|
||||
char Rpt; /* Reporting flag */
|
||||
} Slink;
|
||||
|
||||
typedef struct /* TANK OBJECT */
|
||||
{
|
||||
int Node; /* Node index of tank */
|
||||
double A; /* Tank area */
|
||||
double Hmin; /* Minimum water elev */
|
||||
double Hmax; /* Maximum water elev */
|
||||
double H0; /* Initial water elev */
|
||||
double Vmin; /* Minimum volume */
|
||||
double Vmax; /* Maximum volume */
|
||||
double V0; /* Initial volume */
|
||||
double Kb; /* Reaction coeff. (1/days) */
|
||||
double V; /* Tank volume */
|
||||
double C; /* Concentration */
|
||||
int Pat; /* Fixed grade time pattern */
|
||||
int Vcurve; /* Vol.- elev. curve index */
|
||||
char MixModel; /* Type of mixing model */
|
||||
/* (see MixType below) */
|
||||
double V1max; /* Mixing compartment size */
|
||||
} Stank;
|
||||
|
||||
typedef struct /* PUMP OBJECT */
|
||||
{
|
||||
int Link; /* Link index of pump */
|
||||
int Ptype; /* Pump curve type */
|
||||
/* (see PumpType below) */
|
||||
double Q0; /* Initial flow */
|
||||
double Qmax; /* Maximum flow */
|
||||
double Hmax; /* Maximum head */
|
||||
double H0; /* Shutoff head */
|
||||
double R; /* Flow coeffic. */
|
||||
double N; /* Flow exponent */
|
||||
int Hcurve; /* Head v. flow curve index */
|
||||
int Ecurve; /* Effic. v. flow curve index */
|
||||
int Upat; /* Utilization pattern index */
|
||||
int Epat; /* Energy cost pattern index */
|
||||
double Ecost; /* Unit energy cost */
|
||||
double Energy[6]; /* Energy usage statistics: */
|
||||
/* 0 = pump utilization */
|
||||
/* 1 = avg. efficiency */
|
||||
/* 2 = avg. kW/flow */
|
||||
/* 3 = avg. kwatts */
|
||||
/* 4 = peak kwatts */
|
||||
/* 5 = cost/day */
|
||||
} Spump;
|
||||
|
||||
typedef struct /* VALVE OBJECT */
|
||||
{
|
||||
int Link; /* Link index of valve */
|
||||
} Svalve;
|
||||
|
||||
typedef struct /* CONTROL STATEMENT */
|
||||
{
|
||||
int Link; /* Link index */
|
||||
int Node; /* Control node index */
|
||||
long Time; /* Control time */
|
||||
double Grade; /* Control grade */
|
||||
double Setting; /* New link setting */
|
||||
char Status; /* New link status */
|
||||
char Type; /* Control type */
|
||||
/* (see ControlType below) */
|
||||
} Scontrol;
|
||||
|
||||
struct Sadjlist /* NODE ADJACENCY LIST ITEM */
|
||||
{
|
||||
int node; /* Index of connecting node */
|
||||
int link; /* Index of connecting link */
|
||||
struct Sadjlist *next; /* Next item in list */
|
||||
};
|
||||
/* Pointer to adjacency list item */
|
||||
typedef struct Sadjlist *Padjlist;
|
||||
|
||||
struct Sseg /* PIPE SEGMENT record used */
|
||||
{ /* for WQ routing */
|
||||
double v; /* Segment volume */
|
||||
double c; /* Water quality value */
|
||||
struct Sseg *prev; /* Record for previous segment */
|
||||
};
|
||||
typedef struct Sseg *Pseg; /* Pointer to pipe segment */
|
||||
|
||||
typedef struct /* FIELD OBJECT of report table */
|
||||
{
|
||||
char Name[MAXID+1]; /* Name of reported variable */
|
||||
char Units[MAXID+1]; /* Units of reported variable */
|
||||
char Enabled; /* Enabled if in table */
|
||||
int Precision; /* Number of decimal places */
|
||||
double RptLim[2]; /* Lower/upper report limits */
|
||||
} SField;
|
||||
|
||||
|
||||
/*
|
||||
----------------------------------------------
|
||||
Global Enumeration Variables
|
||||
----------------------------------------------
|
||||
*/
|
||||
enum Hydtype /* Hydraulics solution option: */
|
||||
{USE, /* use from previous run */
|
||||
SAVE, /* save after current run */
|
||||
SCRATCH}; /* use temporary file */
|
||||
|
||||
enum QualType /* Water quality analysis option: */
|
||||
{NONE, /* no quality analysis */
|
||||
CHEM, /* analyze a chemical */
|
||||
AGE, /* analyze water age */
|
||||
TRACE}; /* trace % of flow from a source */
|
||||
|
||||
enum NodeType /* Type of node: */
|
||||
{JUNC, /* junction */
|
||||
RESERV, /* reservoir */
|
||||
TANK}; /* tank */
|
||||
|
||||
enum LinkType /* Type of link: */
|
||||
{CV, /* pipe with check valve */
|
||||
PIPE, /* regular pipe */
|
||||
PUMP, /* pump */
|
||||
PRV, /* pressure reducing valve */
|
||||
PSV, /* pressure sustaining valve */
|
||||
PBV, /* pressure breaker valve */
|
||||
FCV, /* flow control valve */
|
||||
TCV, /* throttle control valve */
|
||||
GPV}; /* general purpose valve */
|
||||
|
||||
enum CurveType /* Type of curve: */
|
||||
{V_CURVE, /* volume curve */
|
||||
P_CURVE, /* pump curve */
|
||||
E_CURVE, /* efficiency curve */
|
||||
H_CURVE}; /* head loss curve */
|
||||
|
||||
enum PumpType /* Type of pump curve: */
|
||||
{CONST_HP, /* constant horsepower */
|
||||
POWER_FUNC, /* power function */
|
||||
CUSTOM, /* user-defined custom curve */
|
||||
NOCURVE};
|
||||
|
||||
enum SourceType /* Type of source quality input */
|
||||
{CONCEN, /* inflow concentration */
|
||||
MASS, /* mass inflow booster */
|
||||
SETPOINT, /* setpoint booster */
|
||||
FLOWPACED}; /* flow paced booster */
|
||||
|
||||
enum ControlType /* Control condition type: */
|
||||
{LOWLEVEL, /* act when grade below set level */
|
||||
HILEVEL, /* act when grade above set level */
|
||||
TIMER, /* act when set time reached */
|
||||
TIMEOFDAY}; /* act when time of day occurs */
|
||||
|
||||
enum StatType /* Link/Tank status: */
|
||||
{XHEAD, /* pump cannot deliver head (closed) */
|
||||
TEMPCLOSED, /* temporarily closed */
|
||||
CLOSED, /* closed */
|
||||
OPEN, /* open */
|
||||
ACTIVE, /* valve active (partially open) */
|
||||
XFLOW, /* pump exceeds maximum flow */
|
||||
XFCV, /* FCV cannot supply flow */
|
||||
XPRESSURE, /* valve cannot supply pressure */
|
||||
FILLING, /* tank filling */
|
||||
EMPTYING}; /* tank emptying */
|
||||
|
||||
enum FormType /* Head loss formula: */
|
||||
{HW, /* Hazen-Williams */
|
||||
DW, /* Darcy-Weisbach */
|
||||
CM}; /* Chezy-Manning */
|
||||
|
||||
enum UnitsType /* Unit system: */
|
||||
{US, /* US */
|
||||
SI}; /* SI (metric) */
|
||||
|
||||
enum FlowUnitsType /* Flow units: */
|
||||
{CFS, /* cubic feet per second */
|
||||
GPM, /* gallons per minute */
|
||||
MGD, /* million gallons per day */
|
||||
IMGD, /* imperial million gal. per day */
|
||||
AFD, /* acre-feet per day */
|
||||
LPS, /* liters per second */
|
||||
LPM, /* liters per minute */
|
||||
MLD, /* megaliters per day */
|
||||
CMH, /* cubic meters per hour */
|
||||
CMD}; /* cubic meters per day */
|
||||
|
||||
enum PressUnitsType /* Pressure units: */
|
||||
{PSI, /* pounds per square inch */
|
||||
KPA, /* kiloPascals */
|
||||
METERS}; /* meters */
|
||||
|
||||
enum RangeType /* Range limits: */
|
||||
{LOW, /* lower limit */
|
||||
HI, /* upper limit */
|
||||
PREC}; /* precision */
|
||||
|
||||
enum MixType /* Tank mixing regimes */
|
||||
{MIX1, /* 1-compartment model */
|
||||
MIX2, /* 2-compartment model */
|
||||
FIFO, /* First in, first out model */
|
||||
LIFO}; /* Last in, first out model */
|
||||
|
||||
enum TstatType /* Time series statistics */
|
||||
{SERIES, /* none */
|
||||
AVG, /* time-averages */
|
||||
MIN, /* minimum values */
|
||||
MAX, /* maximum values */
|
||||
RANGE}; /* max - min values */
|
||||
|
||||
#define MAXVAR 21 /* Max. # types of network variables */
|
||||
/* (equals # items enumed below) */
|
||||
enum FieldType /* Network variables: */
|
||||
{ELEV, /* nodal elevation */
|
||||
DEMAND, /* nodal demand flow */
|
||||
HEAD, /* nodal hydraulic head */
|
||||
PRESSURE, /* nodal pressure */
|
||||
QUALITY, /* nodal water quality */
|
||||
|
||||
LENGTH, /* link length */
|
||||
DIAM, /* link diameter */
|
||||
FLOW, /* link flow rate */
|
||||
VELOCITY, /* link flow velocity */
|
||||
HEADLOSS, /* link head loss */
|
||||
LINKQUAL, /* avg. water quality in link */
|
||||
STATUS, /* link status */
|
||||
SETTING, /* pump/valve setting */
|
||||
REACTRATE, /* avg. reaction rate in link */
|
||||
FRICTION, /* link friction factor */
|
||||
|
||||
POWER, /* pump power output */
|
||||
TIME, /* simulation time */
|
||||
VOLUME, /* tank volume */
|
||||
CLOCKTIME, /* simulation time of day */
|
||||
FILLTIME, /* time to fill a tank */
|
||||
DRAINTIME}; /* time to drain a tank */
|
||||
|
||||
enum SectType {_TITLE,_JUNCTIONS,_RESERVOIRS,_TANKS,_PIPES,_PUMPS,
|
||||
_VALVES,_CONTROLS,_RULES,_DEMANDS,_SOURCES,_EMITTERS,
|
||||
_PATTERNS,_CURVES,_QUALITY,_STATUS,_ROUGHNESS,_ENERGY,
|
||||
_REACTIONS,_MIXING,_REPORT,_TIMES,_OPTIONS,
|
||||
_COORDS,_VERTICES,_LABELS,_BACKDROP,_TAGS,_END};
|
||||
|
||||
enum HdrType /* Type of table heading */
|
||||
{STATHDR, /* Hydraulic Status */
|
||||
ENERHDR, /* Energy Usage */
|
||||
NODEHDR, /* Node Results */
|
||||
LINKHDR}; /* Link Results */
|
||||
|
||||
/*
|
||||
***********************************************************************
|
||||
|
||||
TYPES.H -- Global constants and data types for EPANET program
|
||||
|
||||
VERSION: 2.00
|
||||
DATE: 5/8/00
|
||||
9/7/00
|
||||
10/25/00
|
||||
3/1/01
|
||||
12/6/01
|
||||
6/24/02
|
||||
8/15/07 (2.00.11)
|
||||
2/14/08 (2.00.12)
|
||||
AUTHOR: L. Rossman
|
||||
US EPA - NRMRL
|
||||
|
||||
**********************************************************************
|
||||
*/
|
||||
|
||||
/*********************************************************/
|
||||
/* All floats have been re-declared as doubles (7/3/07). */
|
||||
/*********************************************************/
|
||||
/*
|
||||
-------------------------------------------
|
||||
Definition of 4-byte integers & reals
|
||||
-------------------------------------------
|
||||
*/
|
||||
typedef float REAL4; //(2.00.11 - LR)
|
||||
typedef int INT4; //(2.00.12 - LR)
|
||||
|
||||
/*
|
||||
-----------------------------
|
||||
Global Constants
|
||||
-----------------------------
|
||||
*/
|
||||
/*** Updated ***/
|
||||
#define CODEVERSION 20012 //(2.00.12 - LR)
|
||||
#define MAGICNUMBER 516114521
|
||||
#define VERSION 200
|
||||
#define EOFMARK 0x1A /* Use 0x04 for UNIX systems */
|
||||
#define MAXTITLE 3 /* Max. # title lines */
|
||||
#define MAXID 31 /* Max. # characters in ID name */ //(2.00.11 - LR)
|
||||
#define MAXMSG 79 /* Max. # characters in message text */
|
||||
#define MAXLINE 255 /* Max. # characters read from input line */
|
||||
#define MAXFNAME 259 /* Max. # characters in file name */
|
||||
#define MAXTOKS 40 /* Max. items per line of input */
|
||||
#define TZERO 1.E-4 /* Zero time tolerance */
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
#define FULL 2
|
||||
#define BIG 1.E10
|
||||
#define TINY 1.E-6
|
||||
#define MISSING -1.E10
|
||||
#define PI 3.141592654
|
||||
|
||||
/*** Updated 9/7/00 ***/
|
||||
/* Various conversion factors */
|
||||
#define GPMperCFS 448.831
|
||||
#define AFDperCFS 1.9837
|
||||
#define MGDperCFS 0.64632
|
||||
#define IMGDperCFS 0.5382
|
||||
#define LPSperCFS 28.317
|
||||
#define LPMperCFS 1699.0
|
||||
#define CMHperCFS 101.94
|
||||
#define CMDperCFS 2446.6
|
||||
#define MLDperCFS 2.4466
|
||||
#define M3perFT3 0.028317
|
||||
#define LperFT3 28.317
|
||||
#define MperFT 0.3048
|
||||
#define PSIperFT 0.4333
|
||||
#define KPAperPSI 6.895
|
||||
#define KWperHP 0.7457
|
||||
#define SECperDAY 86400
|
||||
|
||||
#define DIFFUS 1.3E-8 /* Diffusivity of chlorine */
|
||||
/* @ 20 deg C (sq ft/sec) */
|
||||
#define VISCOS 1.1E-5 /* Kinematic viscosity of water */
|
||||
/* @ 20 deg C (sq ft/sec) */
|
||||
|
||||
#define SEPSTR " \t\n\r" /* Token separator characters */
|
||||
|
||||
/*
|
||||
---------------------------------------------------------------------
|
||||
Macro to test for successful allocation of memory
|
||||
---------------------------------------------------------------------
|
||||
*/
|
||||
#define MEMCHECK(x) (((x) == NULL) ? 101 : 0 )
|
||||
#define FREE(x) (free((x)))
|
||||
|
||||
/*
|
||||
---------------------------------------------------------------------
|
||||
Conversion macros to be used in place of functions
|
||||
---------------------------------------------------------------------
|
||||
*/
|
||||
#define INT(x) ((int)(x)) /* integer portion of x */
|
||||
#define FRAC(x) ((x)-(int)(x)) /* fractional part of x */
|
||||
#define ABS(x) (((x)<0) ? -(x) : (x)) /* absolute value of x */
|
||||
#define MIN(x,y) (((x)<=(y)) ? (x) : (y)) /* minimum of x and y */
|
||||
#define MAX(x,y) (((x)>=(y)) ? (x) : (y)) /* maximum of x and y */
|
||||
#define ROUND(x) (((x)>=0) ? (int)((x)+.5) : (int)((x)-.5))
|
||||
/* round-off of x */
|
||||
#define MOD(x,y) ((x)%(y)) /* x modulus y */
|
||||
#define SQR(x) ((x)*(x)) /* x-squared */
|
||||
#define SGN(x) (((x)<0) ? (-1) : (1)) /* sign of x */
|
||||
#define UCHAR(x) (((x) >= 'a' && (x) <= 'z') ? ((x)&~32) : (x))
|
||||
/* uppercase char of x */
|
||||
/*
|
||||
------------------------------------------------------
|
||||
Macro to evaluate function x with error checking
|
||||
(Fatal errors are numbered higher than 100)
|
||||
------------------------------------------------------
|
||||
*/
|
||||
#define ERRCODE(x) (errcode = ((errcode>100) ? (errcode) : (x)))
|
||||
|
||||
/*
|
||||
------------------------------------------------------
|
||||
Macro to find Pump index of Link[x]
|
||||
(Diameter = pump index for pump links)
|
||||
------------------------------------------------------
|
||||
*/
|
||||
#define PUMPINDEX(x) (ROUND(Link[(x)].Diam))
|
||||
|
||||
/*
|
||||
------------------------------------------------------
|
||||
Global Data Structures
|
||||
------------------------------------------------------
|
||||
*/
|
||||
|
||||
struct IDstring /* Holds component ID labels */
|
||||
{
|
||||
char ID[MAXID+1];
|
||||
};
|
||||
|
||||
struct Floatlist /* Element of list of floats */
|
||||
{
|
||||
double value;
|
||||
struct Floatlist *next;
|
||||
};
|
||||
typedef struct Floatlist SFloatlist;
|
||||
|
||||
struct Tmplist /* Element of temp list for Pattern & Curve data */
|
||||
{
|
||||
int i;
|
||||
char ID[MAXID+1];
|
||||
SFloatlist *x;
|
||||
SFloatlist *y;
|
||||
struct Tmplist *next;
|
||||
};
|
||||
typedef struct Tmplist STmplist;
|
||||
|
||||
typedef struct /* TIME PATTERN OBJECT */
|
||||
{
|
||||
char ID[MAXID+1]; /* Pattern ID */
|
||||
int Length; /* Pattern length */
|
||||
double *F; /* Pattern factors */
|
||||
} Spattern;
|
||||
|
||||
typedef struct /* CURVE OBJECT */
|
||||
{
|
||||
char ID[MAXID+1]; /* Curve ID */
|
||||
int Type; /* Curve type */
|
||||
int Npts; /* Number of points */
|
||||
double *X; /* X-values */
|
||||
double *Y; /* Y-values */
|
||||
} Scurve;
|
||||
|
||||
struct Sdemand /* DEMAND CATEGORY OBJECT */
|
||||
{
|
||||
double Base; /* Baseline demand */
|
||||
int Pat; /* Pattern index */
|
||||
struct Sdemand *next; /* Next record */
|
||||
};
|
||||
typedef struct Sdemand *Pdemand; /* Pointer to demand object */
|
||||
|
||||
struct Ssource /* WQ SOURCE OBJECT */
|
||||
{
|
||||
/*int Node;*/ /* Node index of source */
|
||||
double C0; /* Base concentration/mass */
|
||||
int Pat; /* Pattern index */
|
||||
double Smass; /* Actual mass flow rate */
|
||||
char Type; /* SourceType (see below) */
|
||||
};
|
||||
typedef struct Ssource *Psource; /* Pointer to WQ source object */
|
||||
|
||||
typedef struct /* NODE OBJECT */
|
||||
{
|
||||
char ID[MAXID+1]; /* Node ID */
|
||||
double El; /* Elevation */
|
||||
Pdemand D; /* Demand pointer */
|
||||
Psource S; /* Source pointer */
|
||||
double C0; /* Initial quality */
|
||||
double Ke; /* Emitter coeff. */
|
||||
char Rpt; /* Reporting flag */
|
||||
} Snode;
|
||||
|
||||
typedef struct /* LINK OBJECT */
|
||||
{
|
||||
char ID[MAXID+1]; /* Link ID */
|
||||
int N1; /* Start node index */
|
||||
int N2; /* End node index */
|
||||
double Diam; /* Diameter */
|
||||
double Len; /* Length */
|
||||
double Kc; /* Roughness */
|
||||
double Km; /* Minor loss coeff. */
|
||||
double Kb; /* Bulk react. coeff */
|
||||
double Kw; /* Wall react. coeff */
|
||||
double R; /* Flow resistance */
|
||||
char Type; /* Link type */
|
||||
char Stat; /* Initial status */
|
||||
char Rpt; /* Reporting flag */
|
||||
} Slink;
|
||||
|
||||
typedef struct /* TANK OBJECT */
|
||||
{
|
||||
int Node; /* Node index of tank */
|
||||
double A; /* Tank area */
|
||||
double Hmin; /* Minimum water elev */
|
||||
double Hmax; /* Maximum water elev */
|
||||
double H0; /* Initial water elev */
|
||||
double Vmin; /* Minimum volume */
|
||||
double Vmax; /* Maximum volume */
|
||||
double V0; /* Initial volume */
|
||||
double Kb; /* Reaction coeff. (1/days) */
|
||||
double V; /* Tank volume */
|
||||
double C; /* Concentration */
|
||||
int Pat; /* Fixed grade time pattern */
|
||||
int Vcurve; /* Vol.- elev. curve index */
|
||||
char MixModel; /* Type of mixing model */
|
||||
/* (see MixType below) */
|
||||
double V1max; /* Mixing compartment size */
|
||||
} Stank;
|
||||
|
||||
typedef struct /* PUMP OBJECT */
|
||||
{
|
||||
int Link; /* Link index of pump */
|
||||
int Ptype; /* Pump curve type */
|
||||
/* (see PumpType below) */
|
||||
double Q0; /* Initial flow */
|
||||
double Qmax; /* Maximum flow */
|
||||
double Hmax; /* Maximum head */
|
||||
double H0; /* Shutoff head */
|
||||
double R; /* Flow coeffic. */
|
||||
double N; /* Flow exponent */
|
||||
int Hcurve; /* Head v. flow curve index */
|
||||
int Ecurve; /* Effic. v. flow curve index */
|
||||
int Upat; /* Utilization pattern index */
|
||||
int Epat; /* Energy cost pattern index */
|
||||
double Ecost; /* Unit energy cost */
|
||||
double Energy[6]; /* Energy usage statistics: */
|
||||
/* 0 = pump utilization */
|
||||
/* 1 = avg. efficiency */
|
||||
/* 2 = avg. kW/flow */
|
||||
/* 3 = avg. kwatts */
|
||||
/* 4 = peak kwatts */
|
||||
/* 5 = cost/day */
|
||||
} Spump;
|
||||
|
||||
typedef struct /* VALVE OBJECT */
|
||||
{
|
||||
int Link; /* Link index of valve */
|
||||
} Svalve;
|
||||
|
||||
typedef struct /* CONTROL STATEMENT */
|
||||
{
|
||||
int Link; /* Link index */
|
||||
int Node; /* Control node index */
|
||||
long Time; /* Control time */
|
||||
double Grade; /* Control grade */
|
||||
double Setting; /* New link setting */
|
||||
char Status; /* New link status */
|
||||
char Type; /* Control type */
|
||||
/* (see ControlType below) */
|
||||
} Scontrol;
|
||||
|
||||
struct Sadjlist /* NODE ADJACENCY LIST ITEM */
|
||||
{
|
||||
int node; /* Index of connecting node */
|
||||
int link; /* Index of connecting link */
|
||||
struct Sadjlist *next; /* Next item in list */
|
||||
};
|
||||
/* Pointer to adjacency list item */
|
||||
typedef struct Sadjlist *Padjlist;
|
||||
|
||||
struct Sseg /* PIPE SEGMENT record used */
|
||||
{ /* for WQ routing */
|
||||
double v; /* Segment volume */
|
||||
double c; /* Water quality value */
|
||||
struct Sseg *prev; /* Record for previous segment */
|
||||
};
|
||||
typedef struct Sseg *Pseg; /* Pointer to pipe segment */
|
||||
|
||||
typedef struct /* FIELD OBJECT of report table */
|
||||
{
|
||||
char Name[MAXID+1]; /* Name of reported variable */
|
||||
char Units[MAXID+1]; /* Units of reported variable */
|
||||
char Enabled; /* Enabled if in table */
|
||||
int Precision; /* Number of decimal places */
|
||||
double RptLim[2]; /* Lower/upper report limits */
|
||||
} SField;
|
||||
|
||||
|
||||
/*
|
||||
----------------------------------------------
|
||||
Global Enumeration Variables
|
||||
----------------------------------------------
|
||||
*/
|
||||
enum Hydtype /* Hydraulics solution option: */
|
||||
{USE, /* use from previous run */
|
||||
SAVE, /* save after current run */
|
||||
SCRATCH}; /* use temporary file */
|
||||
|
||||
enum QualType /* Water quality analysis option: */
|
||||
{NONE, /* no quality analysis */
|
||||
CHEM, /* analyze a chemical */
|
||||
AGE, /* analyze water age */
|
||||
TRACE}; /* trace % of flow from a source */
|
||||
|
||||
enum NodeType /* Type of node: */
|
||||
{JUNC, /* junction */
|
||||
RESERV, /* reservoir */
|
||||
TANK}; /* tank */
|
||||
|
||||
enum LinkType /* Type of link: */
|
||||
{CV, /* pipe with check valve */
|
||||
PIPE, /* regular pipe */
|
||||
PUMP, /* pump */
|
||||
PRV, /* pressure reducing valve */
|
||||
PSV, /* pressure sustaining valve */
|
||||
PBV, /* pressure breaker valve */
|
||||
FCV, /* flow control valve */
|
||||
TCV, /* throttle control valve */
|
||||
GPV}; /* general purpose valve */
|
||||
|
||||
enum CurveType /* Type of curve: */
|
||||
{V_CURVE, /* volume curve */
|
||||
P_CURVE, /* pump curve */
|
||||
E_CURVE, /* efficiency curve */
|
||||
H_CURVE}; /* head loss curve */
|
||||
|
||||
enum PumpType /* Type of pump curve: */
|
||||
{CONST_HP, /* constant horsepower */
|
||||
POWER_FUNC, /* power function */
|
||||
CUSTOM, /* user-defined custom curve */
|
||||
NOCURVE};
|
||||
|
||||
enum SourceType /* Type of source quality input */
|
||||
{CONCEN, /* inflow concentration */
|
||||
MASS, /* mass inflow booster */
|
||||
SETPOINT, /* setpoint booster */
|
||||
FLOWPACED}; /* flow paced booster */
|
||||
|
||||
enum ControlType /* Control condition type: */
|
||||
{LOWLEVEL, /* act when grade below set level */
|
||||
HILEVEL, /* act when grade above set level */
|
||||
TIMER, /* act when set time reached */
|
||||
TIMEOFDAY}; /* act when time of day occurs */
|
||||
|
||||
enum StatType /* Link/Tank status: */
|
||||
{XHEAD, /* pump cannot deliver head (closed) */
|
||||
TEMPCLOSED, /* temporarily closed */
|
||||
CLOSED, /* closed */
|
||||
OPEN, /* open */
|
||||
ACTIVE, /* valve active (partially open) */
|
||||
XFLOW, /* pump exceeds maximum flow */
|
||||
XFCV, /* FCV cannot supply flow */
|
||||
XPRESSURE, /* valve cannot supply pressure */
|
||||
FILLING, /* tank filling */
|
||||
EMPTYING}; /* tank emptying */
|
||||
|
||||
enum FormType /* Head loss formula: */
|
||||
{HW, /* Hazen-Williams */
|
||||
DW, /* Darcy-Weisbach */
|
||||
CM}; /* Chezy-Manning */
|
||||
|
||||
enum UnitsType /* Unit system: */
|
||||
{US, /* US */
|
||||
SI}; /* SI (metric) */
|
||||
|
||||
enum FlowUnitsType /* Flow units: */
|
||||
{CFS, /* cubic feet per second */
|
||||
GPM, /* gallons per minute */
|
||||
MGD, /* million gallons per day */
|
||||
IMGD, /* imperial million gal. per day */
|
||||
AFD, /* acre-feet per day */
|
||||
LPS, /* liters per second */
|
||||
LPM, /* liters per minute */
|
||||
MLD, /* megaliters per day */
|
||||
CMH, /* cubic meters per hour */
|
||||
CMD}; /* cubic meters per day */
|
||||
|
||||
enum PressUnitsType /* Pressure units: */
|
||||
{PSI, /* pounds per square inch */
|
||||
KPA, /* kiloPascals */
|
||||
METERS}; /* meters */
|
||||
|
||||
enum RangeType /* Range limits: */
|
||||
{LOW, /* lower limit */
|
||||
HI, /* upper limit */
|
||||
PREC}; /* precision */
|
||||
|
||||
enum MixType /* Tank mixing regimes */
|
||||
{MIX1, /* 1-compartment model */
|
||||
MIX2, /* 2-compartment model */
|
||||
FIFO, /* First in, first out model */
|
||||
LIFO}; /* Last in, first out model */
|
||||
|
||||
enum TstatType /* Time series statistics */
|
||||
{SERIES, /* none */
|
||||
AVG, /* time-averages */
|
||||
MIN, /* minimum values */
|
||||
MAX, /* maximum values */
|
||||
RANGE}; /* max - min values */
|
||||
|
||||
#define MAXVAR 21 /* Max. # types of network variables */
|
||||
/* (equals # items enumed below) */
|
||||
enum FieldType /* Network variables: */
|
||||
{ELEV, /* nodal elevation */
|
||||
DEMAND, /* nodal demand flow */
|
||||
HEAD, /* nodal hydraulic head */
|
||||
PRESSURE, /* nodal pressure */
|
||||
QUALITY, /* nodal water quality */
|
||||
|
||||
LENGTH, /* link length */
|
||||
DIAM, /* link diameter */
|
||||
FLOW, /* link flow rate */
|
||||
VELOCITY, /* link flow velocity */
|
||||
HEADLOSS, /* link head loss */
|
||||
LINKQUAL, /* avg. water quality in link */
|
||||
STATUS, /* link status */
|
||||
SETTING, /* pump/valve setting */
|
||||
REACTRATE, /* avg. reaction rate in link */
|
||||
FRICTION, /* link friction factor */
|
||||
|
||||
POWER, /* pump power output */
|
||||
TIME, /* simulation time */
|
||||
VOLUME, /* tank volume */
|
||||
CLOCKTIME, /* simulation time of day */
|
||||
FILLTIME, /* time to fill a tank */
|
||||
DRAINTIME}; /* time to drain a tank */
|
||||
|
||||
enum SectType {_TITLE,_JUNCTIONS,_RESERVOIRS,_TANKS,_PIPES,_PUMPS,
|
||||
_VALVES,_CONTROLS,_RULES,_DEMANDS,_SOURCES,_EMITTERS,
|
||||
_PATTERNS,_CURVES,_QUALITY,_STATUS,_ROUGHNESS,_ENERGY,
|
||||
_REACTIONS,_MIXING,_REPORT,_TIMES,_OPTIONS,
|
||||
_COORDS,_VERTICES,_LABELS,_BACKDROP,_TAGS,_END};
|
||||
|
||||
enum HdrType /* Type of table heading */
|
||||
{STATHDR, /* Hydraulic Status */
|
||||
ENERHDR, /* Energy Usage */
|
||||
NODEHDR, /* Node Results */
|
||||
LINKHDR}; /* Link Results */
|
||||
|
||||
|
||||
392
src/vars.h
Normal file → Executable file
392
src/vars.h
Normal file → Executable file
@@ -1,196 +1,196 @@
|
||||
/*
|
||||
************************************************************************
|
||||
Global Variables for EPANET Program
|
||||
|
||||
VERSION: 2.00
|
||||
DATE: 5/8/00
|
||||
6/24/02
|
||||
2/14/08 (2.00.12)
|
||||
AUTHOR: L. Rossman
|
||||
US EPA - NRMRL
|
||||
|
||||
************************************************************************
|
||||
*/
|
||||
EXTERN FILE *InFile, /* Input file pointer */
|
||||
*OutFile, /* Output file pointer */
|
||||
*RptFile, /* Report file pointer */
|
||||
*HydFile, /* Hydraulics file pointer */
|
||||
*TmpOutFile; /* Temporary file handle */
|
||||
EXTERN long HydOffset, /* Hydraulics file byte offset */
|
||||
OutOffset1, /* 1st output file byte offset */
|
||||
OutOffset2; /* 2nd output file byte offset */
|
||||
EXTERN char Msg[MAXMSG+1], /* Text of output message */
|
||||
InpFname[MAXFNAME+1], /* Input file name */
|
||||
Rpt1Fname[MAXFNAME+1], /* Primary report file name */
|
||||
Rpt2Fname[MAXFNAME+1], /* Secondary report file name */
|
||||
HydFname[MAXFNAME+1], /* Hydraulics file name */
|
||||
OutFname[MAXFNAME+1], /* Binary output file name */
|
||||
MapFname[MAXFNAME+1], /* Map file name */
|
||||
TmpFname[MAXFNAME+1], /* Temporary file name */ //(2.00.12 - LR)
|
||||
TmpDir[MAXFNAME+1], /* Temporary directory name */ //(2.00.12 - LR)
|
||||
Title[MAXTITLE][MAXMSG+1], /* Problem title */
|
||||
ChemName[MAXID+1], /* Name of chemical */
|
||||
ChemUnits[MAXID+1], /* Units of chemical */
|
||||
DefPatID[MAXID+1], /* Default demand pattern ID */
|
||||
|
||||
/*** Updated 6/24/02 ***/
|
||||
Atime[13], /* Clock time (hrs:min:sec) */
|
||||
|
||||
Outflag, /* Output file flag */ //(2.00.12 - LR)
|
||||
Hydflag, /* Hydraulics flag */
|
||||
Qualflag, /* Water quality flag */
|
||||
Reactflag, /* Reaction indicator */ //(2.00.12 - LR)
|
||||
Unitsflag, /* Unit system flag */
|
||||
Flowflag, /* Flow units flag */
|
||||
Pressflag, /* Pressure units flag */
|
||||
Formflag, /* Hydraulic formula flag */
|
||||
Rptflag, /* Report flag */
|
||||
Summaryflag, /* Report summary flag */
|
||||
Messageflag, /* Error/warning message flag */
|
||||
Statflag, /* Status report flag */
|
||||
Energyflag, /* Energy report flag */
|
||||
Nodeflag, /* Node report flag */
|
||||
Linkflag, /* Link report flag */
|
||||
Tstatflag, /* Time statistics flag */
|
||||
Warnflag, /* Warning flag */
|
||||
Openflag, /* Input processed flag */
|
||||
OpenHflag, /* Hydraul. system opened flag */
|
||||
SaveHflag, /* Hydraul. results saved flag */
|
||||
OpenQflag, /* Quality system opened flag */
|
||||
SaveQflag, /* Quality results saved flag */
|
||||
Saveflag; /* General purpose save flag */
|
||||
EXTERN int MaxNodes, /* Node count from input file */
|
||||
MaxLinks, /* Link count from input file */
|
||||
MaxJuncs, /* Junction count */
|
||||
MaxPipes, /* Pipe count */
|
||||
MaxTanks, /* Tank count */
|
||||
MaxPumps, /* Pump count */
|
||||
MaxValves, /* Valve count */
|
||||
MaxControls, /* Control count */
|
||||
MaxRules, /* Rule count */
|
||||
MaxPats, /* Pattern count */
|
||||
MaxCurves, /* Curve count */
|
||||
Nnodes, /* Number of network nodes */
|
||||
Ntanks, /* Number of tanks */
|
||||
Njuncs, /* Number of junction nodes */
|
||||
Nlinks, /* Number of network links */
|
||||
Npipes, /* Number of pipes */
|
||||
Npumps, /* Number of pumps */
|
||||
Nvalves, /* Number of valves */
|
||||
Ncontrols, /* Number of simple controls */
|
||||
Nrules, /* Number of control rules */
|
||||
Npats, /* Number of time patterns */
|
||||
Ncurves, /* Number of data curves */
|
||||
Nperiods, /* Number of reporting periods */
|
||||
Ncoeffs, /* Number of non-0 matrix coeffs*/
|
||||
DefPat, /* Default demand pattern */
|
||||
Epat, /* Energy cost time pattern */
|
||||
MaxIter, /* Max. hydraulic trials */
|
||||
ExtraIter, /* Extra hydraulic trials */
|
||||
TraceNode, /* Source node for flow tracing */
|
||||
PageSize, /* Lines/page in output report */
|
||||
CheckFreq, /* Hydraulics solver parameter */
|
||||
MaxCheck; /* Hydraulics solver parameter */
|
||||
EXTERN double Ucf[MAXVAR], /* Unit conversion factors */
|
||||
Ctol, /* Water quality tolerance */
|
||||
Htol, /* Hydraulic head tolerance */
|
||||
Qtol, /* Flow rate tolerance */
|
||||
RQtol, /* Flow resistance tolerance */
|
||||
Hexp, /* Exponent in headloss formula */
|
||||
Qexp, /* Exponent in orifice formula */
|
||||
Dmult, /* Demand multiplier */
|
||||
Hacc, /* Hydraulics solution accuracy */
|
||||
DampLimit, /* Solution damping threshold */ //(2.00.12 - LR)
|
||||
BulkOrder, /* Bulk flow reaction order */
|
||||
WallOrder, /* Pipe wall reaction order */
|
||||
TankOrder, /* Tank reaction order */
|
||||
Kbulk, /* Global bulk reaction coeff. */
|
||||
Kwall, /* Global wall reaction coeff. */
|
||||
Climit, /* Limiting potential quality */
|
||||
Rfactor, /* Roughness-reaction factor */
|
||||
Diffus, /* Diffusivity (sq ft/sec) */
|
||||
Viscos, /* Kin. viscosity (sq ft/sec) */
|
||||
SpGrav, /* Specific gravity */
|
||||
Ecost, /* Base energy cost per kwh */
|
||||
Dcost, /* Energy demand charge/kw/day */
|
||||
Epump, /* Global pump efficiency */
|
||||
Emax, /* Peak energy usage */
|
||||
Dsystem, /* Total system demand */
|
||||
Wbulk, /* Avg. bulk reaction rate */
|
||||
Wwall, /* Avg. wall reaction rate */
|
||||
Wtank, /* Avg. tank reaction rate */
|
||||
Wsource; /* Avg. mass inflow */
|
||||
EXTERN long Tstart, /* Starting time of day (sec) */
|
||||
Hstep, /* Nominal hyd. time step (sec) */
|
||||
Qstep, /* Quality time step (sec) */
|
||||
Pstep, /* Time pattern time step (sec) */
|
||||
Pstart, /* Starting pattern time (sec) */
|
||||
Rstep, /* Reporting time step (sec) */
|
||||
Rstart, /* Time when reporting starts */
|
||||
Rtime, /* Next reporting time */
|
||||
Htime, /* Current hyd. time (sec) */
|
||||
Qtime, /* Current quality time (sec) */
|
||||
Hydstep, /* Actual hydraulic time step */
|
||||
Rulestep, /* Rule evaluation time step */
|
||||
Dur; /* Duration of simulation (sec) */
|
||||
EXTERN SField Field[MAXVAR]; /* Output reporting fields */
|
||||
|
||||
/* Array pointers not allocated and freed in same routine */
|
||||
EXTERN char *S, /* Link status */
|
||||
*OldStat; /* Previous link/tank status */
|
||||
EXTERN double *D, /* Node actual demand */
|
||||
*C, /* Node actual quality */
|
||||
*E, /* Emitter flows */
|
||||
*K, /* Link settings */
|
||||
*Q, /* Link flows */
|
||||
*R, /* Pipe reaction rate */
|
||||
*X; /* General purpose array */
|
||||
EXTERN double *H; /* Node heads */
|
||||
EXTERN STmplist *Patlist; /* Temporary time pattern list */
|
||||
EXTERN STmplist *Curvelist; /* Temporary list of curves */
|
||||
EXTERN Spattern *Pattern; /* Time patterns */
|
||||
EXTERN Scurve *Curve; /* Curve data */
|
||||
EXTERN Snode *Node; /* Node data */
|
||||
EXTERN Slink *Link; /* Link data */
|
||||
EXTERN Stank *Tank; /* Tank data */
|
||||
EXTERN Spump *Pump; /* Pump data */
|
||||
EXTERN Svalve *Valve; /* Valve data */
|
||||
EXTERN Scontrol *Control; /* Control data */
|
||||
EXTERN HTtable *Nht, *Lht; /* Hash tables for ID labels */
|
||||
EXTERN Padjlist *Adjlist; /* Node adjacency lists */
|
||||
|
||||
/*
|
||||
** NOTE: Hydraulic analysis of the pipe network at a given point in time
|
||||
** is done by repeatedly solving a linearized version of the
|
||||
** equations for conservation of flow & energy:
|
||||
**
|
||||
** A*H = F
|
||||
**
|
||||
** where H = vector of heads (unknowns) at each node,
|
||||
** F = vector of right-hand side coeffs.
|
||||
** A = square matrix of coeffs.
|
||||
** and both A and F are updated at each iteration until there is
|
||||
** negligible change in pipe flows.
|
||||
**
|
||||
** Each row (or column) of A corresponds to a junction in the pipe
|
||||
** network. Each link (pipe, pump or valve) in the network has a
|
||||
** non-zero entry in the row-column of A that corresponds to its
|
||||
** end points. This results in A being symmetric and very sparse.
|
||||
** The following arrays are used to efficiently manage this sparsity:
|
||||
*/
|
||||
|
||||
EXTERN double *Aii, /* Diagonal coeffs. of A */
|
||||
*Aij, /* Non-zero, off-diagonal coeffs. of A */
|
||||
*F; /* Right hand side coeffs. */
|
||||
EXTERN double *P, /* Inverse headloss derivatives */
|
||||
*Y; /* Flow correction factors */
|
||||
EXTERN int *Order, /* Node-to-row of A */
|
||||
*Row, /* Row-to-node of A */
|
||||
*Ndx; /* Index of link's coeff. in Aij */
|
||||
/*
|
||||
** The following arrays store the positions of the non-zero coeffs.
|
||||
** of the lower triangular portion of A whose values are stored in Aij:
|
||||
*/
|
||||
EXTERN int *XLNZ, /* Start position of each column in NZSUB */
|
||||
*NZSUB, /* Row index of each coeff. in each column */
|
||||
*LNZ; /* Position of each coeff. in Aij array */
|
||||
/*
|
||||
************************************************************************
|
||||
Global Variables for EPANET Program
|
||||
|
||||
VERSION: 2.00
|
||||
DATE: 5/8/00
|
||||
6/24/02
|
||||
2/14/08 (2.00.12)
|
||||
AUTHOR: L. Rossman
|
||||
US EPA - NRMRL
|
||||
|
||||
************************************************************************
|
||||
*/
|
||||
EXTERN FILE *InFile, /* Input file pointer */
|
||||
*OutFile, /* Output file pointer */
|
||||
*RptFile, /* Report file pointer */
|
||||
*HydFile, /* Hydraulics file pointer */
|
||||
*TmpOutFile; /* Temporary file handle */
|
||||
EXTERN long HydOffset, /* Hydraulics file byte offset */
|
||||
OutOffset1, /* 1st output file byte offset */
|
||||
OutOffset2; /* 2nd output file byte offset */
|
||||
EXTERN char Msg[MAXMSG+1], /* Text of output message */
|
||||
InpFname[MAXFNAME+1], /* Input file name */
|
||||
Rpt1Fname[MAXFNAME+1], /* Primary report file name */
|
||||
Rpt2Fname[MAXFNAME+1], /* Secondary report file name */
|
||||
HydFname[MAXFNAME+1], /* Hydraulics file name */
|
||||
OutFname[MAXFNAME+1], /* Binary output file name */
|
||||
MapFname[MAXFNAME+1], /* Map file name */
|
||||
TmpFname[MAXFNAME+1], /* Temporary file name */ //(2.00.12 - LR)
|
||||
TmpDir[MAXFNAME+1], /* Temporary directory name */ //(2.00.12 - LR)
|
||||
Title[MAXTITLE][MAXMSG+1], /* Problem title */
|
||||
ChemName[MAXID+1], /* Name of chemical */
|
||||
ChemUnits[MAXID+1], /* Units of chemical */
|
||||
DefPatID[MAXID+1], /* Default demand pattern ID */
|
||||
|
||||
/*** Updated 6/24/02 ***/
|
||||
Atime[13], /* Clock time (hrs:min:sec) */
|
||||
|
||||
Outflag, /* Output file flag */ //(2.00.12 - LR)
|
||||
Hydflag, /* Hydraulics flag */
|
||||
Qualflag, /* Water quality flag */
|
||||
Reactflag, /* Reaction indicator */ //(2.00.12 - LR)
|
||||
Unitsflag, /* Unit system flag */
|
||||
Flowflag, /* Flow units flag */
|
||||
Pressflag, /* Pressure units flag */
|
||||
Formflag, /* Hydraulic formula flag */
|
||||
Rptflag, /* Report flag */
|
||||
Summaryflag, /* Report summary flag */
|
||||
Messageflag, /* Error/warning message flag */
|
||||
Statflag, /* Status report flag */
|
||||
Energyflag, /* Energy report flag */
|
||||
Nodeflag, /* Node report flag */
|
||||
Linkflag, /* Link report flag */
|
||||
Tstatflag, /* Time statistics flag */
|
||||
Warnflag, /* Warning flag */
|
||||
Openflag, /* Input processed flag */
|
||||
OpenHflag, /* Hydraul. system opened flag */
|
||||
SaveHflag, /* Hydraul. results saved flag */
|
||||
OpenQflag, /* Quality system opened flag */
|
||||
SaveQflag, /* Quality results saved flag */
|
||||
Saveflag; /* General purpose save flag */
|
||||
EXTERN int MaxNodes, /* Node count from input file */
|
||||
MaxLinks, /* Link count from input file */
|
||||
MaxJuncs, /* Junction count */
|
||||
MaxPipes, /* Pipe count */
|
||||
MaxTanks, /* Tank count */
|
||||
MaxPumps, /* Pump count */
|
||||
MaxValves, /* Valve count */
|
||||
MaxControls, /* Control count */
|
||||
MaxRules, /* Rule count */
|
||||
MaxPats, /* Pattern count */
|
||||
MaxCurves, /* Curve count */
|
||||
Nnodes, /* Number of network nodes */
|
||||
Ntanks, /* Number of tanks */
|
||||
Njuncs, /* Number of junction nodes */
|
||||
Nlinks, /* Number of network links */
|
||||
Npipes, /* Number of pipes */
|
||||
Npumps, /* Number of pumps */
|
||||
Nvalves, /* Number of valves */
|
||||
Ncontrols, /* Number of simple controls */
|
||||
Nrules, /* Number of control rules */
|
||||
Npats, /* Number of time patterns */
|
||||
Ncurves, /* Number of data curves */
|
||||
Nperiods, /* Number of reporting periods */
|
||||
Ncoeffs, /* Number of non-0 matrix coeffs*/
|
||||
DefPat, /* Default demand pattern */
|
||||
Epat, /* Energy cost time pattern */
|
||||
MaxIter, /* Max. hydraulic trials */
|
||||
ExtraIter, /* Extra hydraulic trials */
|
||||
TraceNode, /* Source node for flow tracing */
|
||||
PageSize, /* Lines/page in output report */
|
||||
CheckFreq, /* Hydraulics solver parameter */
|
||||
MaxCheck; /* Hydraulics solver parameter */
|
||||
EXTERN double Ucf[MAXVAR], /* Unit conversion factors */
|
||||
Ctol, /* Water quality tolerance */
|
||||
Htol, /* Hydraulic head tolerance */
|
||||
Qtol, /* Flow rate tolerance */
|
||||
RQtol, /* Flow resistance tolerance */
|
||||
Hexp, /* Exponent in headloss formula */
|
||||
Qexp, /* Exponent in orifice formula */
|
||||
Dmult, /* Demand multiplier */
|
||||
Hacc, /* Hydraulics solution accuracy */
|
||||
DampLimit, /* Solution damping threshold */ //(2.00.12 - LR)
|
||||
BulkOrder, /* Bulk flow reaction order */
|
||||
WallOrder, /* Pipe wall reaction order */
|
||||
TankOrder, /* Tank reaction order */
|
||||
Kbulk, /* Global bulk reaction coeff. */
|
||||
Kwall, /* Global wall reaction coeff. */
|
||||
Climit, /* Limiting potential quality */
|
||||
Rfactor, /* Roughness-reaction factor */
|
||||
Diffus, /* Diffusivity (sq ft/sec) */
|
||||
Viscos, /* Kin. viscosity (sq ft/sec) */
|
||||
SpGrav, /* Specific gravity */
|
||||
Ecost, /* Base energy cost per kwh */
|
||||
Dcost, /* Energy demand charge/kw/day */
|
||||
Epump, /* Global pump efficiency */
|
||||
Emax, /* Peak energy usage */
|
||||
Dsystem, /* Total system demand */
|
||||
Wbulk, /* Avg. bulk reaction rate */
|
||||
Wwall, /* Avg. wall reaction rate */
|
||||
Wtank, /* Avg. tank reaction rate */
|
||||
Wsource; /* Avg. mass inflow */
|
||||
EXTERN long Tstart, /* Starting time of day (sec) */
|
||||
Hstep, /* Nominal hyd. time step (sec) */
|
||||
Qstep, /* Quality time step (sec) */
|
||||
Pstep, /* Time pattern time step (sec) */
|
||||
Pstart, /* Starting pattern time (sec) */
|
||||
Rstep, /* Reporting time step (sec) */
|
||||
Rstart, /* Time when reporting starts */
|
||||
Rtime, /* Next reporting time */
|
||||
Htime, /* Current hyd. time (sec) */
|
||||
Qtime, /* Current quality time (sec) */
|
||||
Hydstep, /* Actual hydraulic time step */
|
||||
Rulestep, /* Rule evaluation time step */
|
||||
Dur; /* Duration of simulation (sec) */
|
||||
EXTERN SField Field[MAXVAR]; /* Output reporting fields */
|
||||
|
||||
/* Array pointers not allocated and freed in same routine */
|
||||
EXTERN char *S, /* Link status */
|
||||
*OldStat; /* Previous link/tank status */
|
||||
EXTERN double *D, /* Node actual demand */
|
||||
*C, /* Node actual quality */
|
||||
*E, /* Emitter flows */
|
||||
*K, /* Link settings */
|
||||
*Q, /* Link flows */
|
||||
*R, /* Pipe reaction rate */
|
||||
*X; /* General purpose array */
|
||||
EXTERN double *H; /* Node heads */
|
||||
EXTERN STmplist *Patlist; /* Temporary time pattern list */
|
||||
EXTERN STmplist *Curvelist; /* Temporary list of curves */
|
||||
EXTERN Spattern *Pattern; /* Time patterns */
|
||||
EXTERN Scurve *Curve; /* Curve data */
|
||||
EXTERN Snode *Node; /* Node data */
|
||||
EXTERN Slink *Link; /* Link data */
|
||||
EXTERN Stank *Tank; /* Tank data */
|
||||
EXTERN Spump *Pump; /* Pump data */
|
||||
EXTERN Svalve *Valve; /* Valve data */
|
||||
EXTERN Scontrol *Control; /* Control data */
|
||||
EXTERN HTtable *Nht, *Lht; /* Hash tables for ID labels */
|
||||
EXTERN Padjlist *Adjlist; /* Node adjacency lists */
|
||||
|
||||
/*
|
||||
** NOTE: Hydraulic analysis of the pipe network at a given point in time
|
||||
** is done by repeatedly solving a linearized version of the
|
||||
** equations for conservation of flow & energy:
|
||||
**
|
||||
** A*H = F
|
||||
**
|
||||
** where H = vector of heads (unknowns) at each node,
|
||||
** F = vector of right-hand side coeffs.
|
||||
** A = square matrix of coeffs.
|
||||
** and both A and F are updated at each iteration until there is
|
||||
** negligible change in pipe flows.
|
||||
**
|
||||
** Each row (or column) of A corresponds to a junction in the pipe
|
||||
** network. Each link (pipe, pump or valve) in the network has a
|
||||
** non-zero entry in the row-column of A that corresponds to its
|
||||
** end points. This results in A being symmetric and very sparse.
|
||||
** The following arrays are used to efficiently manage this sparsity:
|
||||
*/
|
||||
|
||||
EXTERN double *Aii, /* Diagonal coeffs. of A */
|
||||
*Aij, /* Non-zero, off-diagonal coeffs. of A */
|
||||
*F; /* Right hand side coeffs. */
|
||||
EXTERN double *P, /* Inverse headloss derivatives */
|
||||
*Y; /* Flow correction factors */
|
||||
EXTERN int *Order, /* Node-to-row of A */
|
||||
*Row, /* Row-to-node of A */
|
||||
*Ndx; /* Index of link's coeff. in Aij */
|
||||
/*
|
||||
** The following arrays store the positions of the non-zero coeffs.
|
||||
** of the lower triangular portion of A whose values are stored in Aij:
|
||||
*/
|
||||
EXTERN int *XLNZ, /* Start position of each column in NZSUB */
|
||||
*NZSUB, /* Row index of each coeff. in each column */
|
||||
*LNZ; /* Position of each coeff. in Aij array */
|
||||
|
||||
Reference in New Issue
Block a user