OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
FlowTracer.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2
11
12#pragma once
14#include <string>
15#include <vector>
16
17namespace openswmm::trace {
18struct Node {
19 std::string id;
20 int type{}, flags{};
21};
22struct Link {
23 std::string id;
24 int from{}, to{}, type{};
25 double length{};
26};
27
35public:
36 std::vector<Node> nodes;
37 std::vector<Link> links;
38 std::vector<SWMM_TraceNodeAverage> na;
39 std::vector<SWMM_TraceLinkAverage> la;
42 std::string error;
43 bool prepared = false;
51 int derive();
74 int prepare(const char* path, const char* cache, const char* digest, SWMM_TraceProgress cb,
75 void* user, bool live = false);
95 int estimate(int direction, int seed, SWMM_TraceValue* nv, SWMM_TraceValue* lv,
96 SWMM_TraceSummary& summary, SWMM_TraceProgress cb, void* user);
102 std::string cacheKey(const char* digest) const;
111 bool readCache(const char* path, const std::string& key);
121 bool writeCache(const char* path, const std::string& key);
122};
123} // namespace openswmm::trace
Own topology, SI hydraulic averages and steady-flow trace preparation state. The C API validates topo...
Definition FlowTracer.hpp:34
std::vector< Node > nodes
Definition FlowTracer.hpp:36
int estimate(int direction, int seed, SWMM_TraceValue *nv, SWMM_TraceValue *lv, SWMM_TraceSummary &summary, SWMM_TraceProgress cb, void *user)
Solve steady upstream/downstream fractions and conditional travel-time moments.
Definition FlowTracer.cpp:570
SWMM_TraceInfo info
Definition FlowTracer.hpp:41
std::vector< Link > links
Definition FlowTracer.hpp:37
bool readCache(const char *path, const std::string &key)
Load exact-key HDF5 report metadata and seven-column node/link averages.
Definition TraceSidecar.cpp:84
std::vector< SWMM_TraceNodeAverage > na
Definition FlowTracer.hpp:38
SWMM_TraceOptions options
Definition FlowTracer.hpp:40
std::string error
Definition FlowTracer.hpp:42
bool prepared
Definition FlowTracer.hpp:43
bool writeCache(const char *path, const std::string &key)
Write owned SI averages through an HDF5 staging sidecar and replace the target.
Definition TraceSidecar.cpp:160
std::vector< SWMM_TraceLinkAverage > la
Definition FlowTracer.hpp:39
std::string cacheKey(const char *digest) const
Build a versioned identity string for cached hydraulic averages.
Definition FlowTracer.cpp:278
int prepare(const char *path, const char *cache, const char *digest, SWMM_TraceProgress cb, void *user, bool live=false)
Definition FlowTracer.cpp:350
int derive()
Derive directions, residence/travel times and flags from installed SI averages.
Definition FlowTracer.cpp:289
Definition FlowTracer.cpp:25
Offline flow tracing and travel time over reported hydraulic averages.All dimensional values in this ...
int(* SWMM_TraceProgress)(double fraction, const char *stage, void *user)
Receive synchronous progress during trace preparation or estimation.
Definition openswmm_trace.h:34
Definition openswmm_trace.h:102
Definition openswmm_trace.h:83
Definition openswmm_trace.h:115
Definition openswmm_trace.h:107
Definition FlowTracer.hpp:18
int type
Definition FlowTracer.hpp:20
std::string id
Definition FlowTracer.hpp:19
int flags
Definition FlowTracer.hpp:20