epyt-flow 0.14.1__py3-none-any.whl → 0.14.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- epyt_flow/EPANET/EPANET/SRC_engines/AUTHORS +8 -40
- epyt_flow/EPANET/EPANET/SRC_engines/LICENSE +3 -3
- epyt_flow/EPANET/EPANET/SRC_engines/Readme_SRC_Engines.txt +18 -0
- epyt_flow/EPANET/EPANET/SRC_engines/enumstxt.h +7 -24
- epyt_flow/EPANET/EPANET/SRC_engines/epanet.c +374 -726
- epyt_flow/EPANET/EPANET/SRC_engines/epanet2.c +32 -128
- epyt_flow/EPANET/EPANET/SRC_engines/epanet2.def +131 -0
- epyt_flow/EPANET/EPANET/SRC_engines/errors.dat +1 -7
- epyt_flow/EPANET/EPANET/SRC_engines/funcs.h +14 -40
- epyt_flow/EPANET/EPANET/SRC_engines/hash.c +177 -177
- epyt_flow/EPANET/EPANET/SRC_engines/hash.h +28 -28
- epyt_flow/EPANET/EPANET/SRC_engines/hydcoeffs.c +40 -192
- epyt_flow/EPANET/EPANET/SRC_engines/hydraul.c +46 -101
- epyt_flow/EPANET/EPANET/SRC_engines/hydsolver.c +24 -85
- epyt_flow/EPANET/EPANET/SRC_engines/hydstatus.c +63 -29
- epyt_flow/EPANET/EPANET/SRC_engines/include/epanet2.h +37 -70
- epyt_flow/EPANET/EPANET/SRC_engines/include/epanet2_2.h +234 -408
- epyt_flow/EPANET/EPANET/SRC_engines/include/epanet2_enums.h +37 -87
- epyt_flow/EPANET/EPANET/SRC_engines/inpfile.c +79 -153
- epyt_flow/EPANET/EPANET/SRC_engines/input1.c +94 -59
- epyt_flow/EPANET/EPANET/SRC_engines/input2.c +202 -73
- epyt_flow/EPANET/EPANET/SRC_engines/input3.c +351 -446
- epyt_flow/EPANET/EPANET/SRC_engines/main.c +93 -0
- epyt_flow/EPANET/EPANET/SRC_engines/mempool.c +4 -8
- epyt_flow/EPANET/EPANET/SRC_engines/mempool.h +23 -23
- epyt_flow/EPANET/EPANET/SRC_engines/output.c +4 -5
- epyt_flow/EPANET/EPANET/SRC_engines/project.c +75 -407
- epyt_flow/EPANET/EPANET/SRC_engines/quality.c +2 -12
- epyt_flow/EPANET/EPANET/SRC_engines/qualreact.c +13 -70
- epyt_flow/EPANET/EPANET/SRC_engines/qualroute.c +5 -7
- epyt_flow/EPANET/EPANET/SRC_engines/report.c +20 -88
- epyt_flow/EPANET/EPANET/SRC_engines/rules.c +6 -144
- epyt_flow/EPANET/EPANET/SRC_engines/smatrix.c +19 -19
- epyt_flow/EPANET/EPANET/SRC_engines/text.h +5 -16
- epyt_flow/EPANET/EPANET/SRC_engines/types.h +19 -73
- epyt_flow/EPANET/compile_linux.sh +1 -1
- epyt_flow/EPANET/compile_macos.sh +1 -1
- epyt_flow/VERSION +1 -1
- epyt_flow/simulation/scada/scada_data.py +1 -1
- epyt_flow/utils.py +66 -0
- epyt_flow/visualization/visualization_utils.py +4 -2
- {epyt_flow-0.14.1.dist-info → epyt_flow-0.14.2.dist-info}/METADATA +1 -1
- {epyt_flow-0.14.1.dist-info → epyt_flow-0.14.2.dist-info}/RECORD +46 -52
- epyt_flow/EPANET/EPANET/SRC_engines/flowbalance.c +0 -186
- epyt_flow/EPANET/EPANET/SRC_engines/leakage.c +0 -527
- epyt_flow/EPANET/EPANET/SRC_engines/util/cstr_helper.c +0 -59
- epyt_flow/EPANET/EPANET/SRC_engines/util/cstr_helper.h +0 -38
- epyt_flow/EPANET/EPANET/SRC_engines/util/errormanager.c +0 -92
- epyt_flow/EPANET/EPANET/SRC_engines/util/errormanager.h +0 -39
- epyt_flow/EPANET/EPANET/SRC_engines/util/filemanager.c +0 -212
- epyt_flow/EPANET/EPANET/SRC_engines/util/filemanager.h +0 -81
- epyt_flow/EPANET/EPANET/SRC_engines/validate.c +0 -408
- {epyt_flow-0.14.1.dist-info → epyt_flow-0.14.2.dist-info}/WHEEL +0 -0
- {epyt_flow-0.14.1.dist-info → epyt_flow-0.14.2.dist-info}/licenses/LICENSE +0 -0
- {epyt_flow-0.14.1.dist-info → epyt_flow-0.14.2.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/*
|
|
2
|
+
******************************************************************************
|
|
3
|
+
Project: OWA EPANET
|
|
4
|
+
Version: 2.2
|
|
5
|
+
Module: main.c
|
|
6
|
+
Description: main stub for a command line executable version of EPANET
|
|
7
|
+
Authors: see AUTHORS
|
|
8
|
+
Copyright: see AUTHORS
|
|
9
|
+
License: see LICENSE
|
|
10
|
+
Last Updated: 12/07/2018
|
|
11
|
+
******************************************************************************
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
#include <stdio.h>
|
|
15
|
+
#include "epanet2.h"
|
|
16
|
+
|
|
17
|
+
void writeConsole(char *s)
|
|
18
|
+
{
|
|
19
|
+
fprintf(stdout, "\r%s", s);
|
|
20
|
+
fflush(stdout);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
int main(int argc, char *argv[])
|
|
24
|
+
/*--------------------------------------------------------------
|
|
25
|
+
** Input: argc = number of command line arguments
|
|
26
|
+
** *argv[] = array of command line arguments
|
|
27
|
+
** Output: none
|
|
28
|
+
** Purpose: main program stub for command line EPANET
|
|
29
|
+
**
|
|
30
|
+
** Command line for stand-alone operation is:
|
|
31
|
+
** progname f1 f2 f3
|
|
32
|
+
** where progname = name of executable this code was compiled to,
|
|
33
|
+
** f1 = name of input file,
|
|
34
|
+
** f2 = name of report file
|
|
35
|
+
** f3 = name of binary output file (optional).
|
|
36
|
+
**--------------------------------------------------------------
|
|
37
|
+
*/
|
|
38
|
+
{
|
|
39
|
+
char *f1,*f2,*f3;
|
|
40
|
+
char blank[] = "";
|
|
41
|
+
char errmsg[256] = "";
|
|
42
|
+
int errcode;
|
|
43
|
+
int version;
|
|
44
|
+
int major;
|
|
45
|
+
int minor;
|
|
46
|
+
int patch;
|
|
47
|
+
|
|
48
|
+
// Check for proper number of command line arguments
|
|
49
|
+
if (argc < 3)
|
|
50
|
+
{
|
|
51
|
+
printf(
|
|
52
|
+
"\nUsage:\n %s <input_filename> <report_filename> [<binary_filename>]\n",
|
|
53
|
+
argv[0]);
|
|
54
|
+
return 0;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Get version number and display in Major.Minor.Patch format
|
|
58
|
+
ENgetversion(&version);
|
|
59
|
+
major = version/10000;
|
|
60
|
+
minor = (version%10000)/100;
|
|
61
|
+
patch = version%100;
|
|
62
|
+
printf("\n... Running EPANET Version %d.%d.%d\n", major, minor, patch);
|
|
63
|
+
|
|
64
|
+
// Assign pointers to file names
|
|
65
|
+
f1 = argv[1];
|
|
66
|
+
f2 = argv[2];
|
|
67
|
+
if (argc > 3) f3 = argv[3];
|
|
68
|
+
else f3 = blank;
|
|
69
|
+
|
|
70
|
+
// Run EPANET
|
|
71
|
+
errcode = ENepanet(f1, f2, f3, &writeConsole);
|
|
72
|
+
|
|
73
|
+
// Blank out the last progress message
|
|
74
|
+
printf("\r ");
|
|
75
|
+
|
|
76
|
+
// Check for errors/warnings and report accordingly
|
|
77
|
+
if (errcode == 0)
|
|
78
|
+
{
|
|
79
|
+
printf("\n... EPANET ran successfully.\n");
|
|
80
|
+
return 0;
|
|
81
|
+
}
|
|
82
|
+
else if (errcode < 100)
|
|
83
|
+
{
|
|
84
|
+
printf("\n... EPANET ran with warnings - check the Status Report.\n");
|
|
85
|
+
return 0;
|
|
86
|
+
}
|
|
87
|
+
else
|
|
88
|
+
{
|
|
89
|
+
ENgeterror(errcode, errmsg, 255);
|
|
90
|
+
printf("\n... EPANET failed with %s.\n", errmsg);
|
|
91
|
+
return 100;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/*
|
|
2
2
|
******************************************************************************
|
|
3
3
|
Project: OWA EPANET
|
|
4
|
-
Version: 2.
|
|
4
|
+
Version: 2.2
|
|
5
5
|
Module: mempool.c
|
|
6
6
|
Description: a simple fast poooled memory allocation package
|
|
7
7
|
Authors: see AUTHORS
|
|
8
8
|
Copyright: see AUTHORS
|
|
9
9
|
License: see LICENSE
|
|
10
|
-
Last Updated:
|
|
10
|
+
Last Updated: 05/15/2019
|
|
11
11
|
|
|
12
|
-
This module is based
|
|
12
|
+
This module is based code by Steve Hill in Graphics Gems III,
|
|
13
13
|
David Kirk (ed.), Academic Press, Boston, MA, 1992
|
|
14
14
|
******************************************************************************
|
|
15
15
|
*/
|
|
@@ -72,11 +72,7 @@ struct Mempool * mempool_create()
|
|
|
72
72
|
if (mempool == NULL) return NULL;
|
|
73
73
|
mempool->first = createMemBlock();
|
|
74
74
|
mempool->current = mempool->first;
|
|
75
|
-
if (mempool->first == NULL)
|
|
76
|
-
{
|
|
77
|
-
free(mempool);
|
|
78
|
-
return NULL;
|
|
79
|
-
}
|
|
75
|
+
if (mempool->first == NULL) return NULL;
|
|
80
76
|
return mempool;
|
|
81
77
|
}
|
|
82
78
|
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
/*
|
|
2
|
-
******************************************************************************
|
|
3
|
-
Project: OWA EPANET
|
|
4
|
-
Version: 2.
|
|
5
|
-
Module: mempool.h
|
|
6
|
-
Description: header for a simple pooled memory allocator
|
|
7
|
-
Authors: see AUTHORS
|
|
8
|
-
Copyright: see AUTHORS
|
|
9
|
-
License: see LICENSE
|
|
10
|
-
Last Updated: 11/27/2018
|
|
11
|
-
******************************************************************************
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
#ifndef MEMPOOL_H
|
|
15
|
-
#define MEMPOOL_H
|
|
16
|
-
|
|
17
|
-
struct Mempool;
|
|
18
|
-
|
|
19
|
-
struct Mempool * mempool_create();
|
|
20
|
-
void mempool_delete(struct Mempool *mempool);
|
|
21
|
-
void mempool_reset(struct Mempool *mempool);
|
|
22
|
-
char * mempool_alloc(struct Mempool *mempool, size_t size);
|
|
23
|
-
|
|
1
|
+
/*
|
|
2
|
+
******************************************************************************
|
|
3
|
+
Project: OWA EPANET
|
|
4
|
+
Version: 2.2
|
|
5
|
+
Module: mempool.h
|
|
6
|
+
Description: header for a simple pooled memory allocator
|
|
7
|
+
Authors: see AUTHORS
|
|
8
|
+
Copyright: see AUTHORS
|
|
9
|
+
License: see LICENSE
|
|
10
|
+
Last Updated: 11/27/2018
|
|
11
|
+
******************************************************************************
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
#ifndef MEMPOOL_H
|
|
15
|
+
#define MEMPOOL_H
|
|
16
|
+
|
|
17
|
+
struct Mempool;
|
|
18
|
+
|
|
19
|
+
struct Mempool * mempool_create();
|
|
20
|
+
void mempool_delete(struct Mempool *mempool);
|
|
21
|
+
void mempool_reset(struct Mempool *mempool);
|
|
22
|
+
char * mempool_alloc(struct Mempool *mempool, size_t size);
|
|
23
|
+
|
|
24
24
|
#endif
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/*
|
|
2
2
|
******************************************************************************
|
|
3
3
|
Project: OWA EPANET
|
|
4
|
-
Version: 2.
|
|
4
|
+
Version: 2.2
|
|
5
5
|
Module: output.c
|
|
6
6
|
Description: binary file read/write routines
|
|
7
7
|
Authors: see AUTHORS
|
|
8
8
|
Copyright: see AUTHORS
|
|
9
9
|
License: see LICENSE
|
|
10
|
-
Last Updated:
|
|
10
|
+
Last Updated: 05/13/2019
|
|
11
11
|
******************************************************************************
|
|
12
12
|
*/
|
|
13
13
|
|
|
@@ -567,7 +567,6 @@ int linkoutput(Project *pr, int j, REAL4 *x, double ucf)
|
|
|
567
567
|
case FCV:
|
|
568
568
|
x[i] = (REAL4)(setting * pr->Ucf[FLOW]); break;
|
|
569
569
|
case TCV:
|
|
570
|
-
case PCV:
|
|
571
570
|
x[i] = (REAL4)setting; break;
|
|
572
571
|
default: x[i] = 0.0f;
|
|
573
572
|
}
|
|
@@ -588,8 +587,8 @@ int linkoutput(Project *pr, int j, REAL4 *x, double ucf)
|
|
|
588
587
|
|
|
589
588
|
case FRICTION: // Friction factor
|
|
590
589
|
// f = 2ghd/(Lu^2) where f = friction factor
|
|
591
|
-
// u = velocity, g = grav. accel., h = head
|
|
592
|
-
//
|
|
590
|
+
// u = velocity, g = grav. accel., h = head loss
|
|
591
|
+
//loss, d = diam., & L = pipe length
|
|
593
592
|
for (i = 1; i <= net->Nlinks; i++)
|
|
594
593
|
{
|
|
595
594
|
if (net->Link[i].Type <= PIPE && ABS(hyd->LinkFlow[i]) > TINY)
|