EPANET  3.0
EPANET Development Project
project.h
Go to the documentation of this file.
1 /* EPANET 3
2  *
3  * Copyright (c) 2016 Open Water Analytics
4  * Licensed under the terms of the MIT License (see the LICENSE file for details).
5  *
6  */
7 
10 
20 
21 #ifndef PROJECT_H_
22 #define PROJECT_H_
23 
24 #include "Core/network.h"
25 #include "Core/hydengine.h"
26 #include "Core/qualengine.h"
27 #include "Output/outputfile.h"
28 
29 #include <string>
30 #include <fstream>
31 
32 namespace Epanet
33 {
42 
43  class Project
44  {
45  public:
46 
47  Project();
48  ~Project();
49 
50  int load(const char* fname);
51  int save(const char* fname);
52  void clear();
53 
54  int initSolver(bool initFlows);
55  int runSolver(int* t);
56  int advanceSolver(int* dt);
57 
58  int openOutput(const char* fname);
59  int saveOutput();
60 
61  int openReport(const char* fname);
62  void writeSummary();
63  void writeResults(int t);
64  int writeReport();
65 
66  void writeMsg(const std::string& msg);
67  void writeMsgLog(std::ostream& out);
68  void writeMsgLog();
69  Network* getNetwork() { return &network; }
70 
71  private:
72 
73  Network network;
74  HydEngine hydEngine;
75  QualEngine qualEngine;
76  OutputFile outputFile;
77  std::string inpFileName;
78  std::string outFileName;
79  std::string tmpFileName;
80  std::string rptFileName;
81  std::ofstream rptFile;
82 
83  // Project status conditions
84  bool networkEmpty;
85  bool hydEngineOpened;
86  bool qualEngineOpened;
87  bool outputFileOpened;
88  bool solverInitialized;
89  bool runQuality;
90 
91  void finalizeSolver();
92  void closeReport();
93  };
94 }
95 #endif
Describes the HydEngine class.
Definition: project.cpp:26
Describes the QualEngine class.
Describes the Network class.
Simulates extended period water quality in a network.
Definition: qualengine.h:28
Encapsulates a pipe network and its simulation engines.
Definition: project.h:43
Simulates extended period hydraulics.
Definition: hydengine.h:25
Manages the writing and reading of analysis results to a binary file.
Definition: outputfile.h:30
Contains the data elements that describe a pipe network.
Definition: network.h:41