SWMMVis  6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
groundwaterassignment.h
Go to the documentation of this file.
1
10#ifndef OPENSWMMVIS_GROUNDWATERASSIGNMENT_H
11#define OPENSWMMVIS_GROUNDWATERASSIGNMENT_H
12#include <openswmm/engine/openswmm_engine.h>
13#include <openswmm/engine/openswmm_infil2d.h>
14#include <QMap>
15#include <QPointF>
16#include <QStringList>
17#include <QVector>
18#include <functional>
19#include <limits>
20
22{
24 QVector<SWMM_Infil2DAuthoredRow> rows;
25 QString destination;
26};
28 int cell = 0, owner = 0, conflict = 0;
29 QString source, reason;
30};
33 QVector<InfiltrationOwnershipCell> cells;
34 QStringList summaries;
35 QString error;
36 bool changed = false;
37};
46previewInfiltrationOwnership(SWMM_Engine engine, const QStringList &tags, bool removeExplicit);
56 const InfiltrationOwnershipSnapshot &desired, QString *error);
57struct AquiferRow {
58 int scope = 0, cell = -1;
59 QString tag;
60 double ks = 0, zs = 0, thetaS = 0, thetaR = 0, alpha = 0;
61 QMap<QString, double> optional;
67 bool operator==(const AquiferRow &other) const = default;
68};
70 QVector<AquiferRow> rows;
71 QMap<QString, QString> options;
77 bool operator==(const AquiferSnapshot &other) const = default;
78};
80 QString key, label, unitKind;
81 double minimum = 0, maximum = std::numeric_limits<double>::max();
82 bool minimumExclusive = false, supported = true;
84};
96QString groundwaterEtForcingStatus(SWMM_Engine engine, const QString &meshMode = {});
105AquiferProcessPreview previewAquiferProcesses(SWMM_Engine engine, const QString &et,
106 const QString &link, const QString &wilting);
116bool applyAquiferProcesses(SWMM_Engine engine, const AquiferSnapshot &expected,
117 const AquiferSnapshot &desired, const QString &groundwater,
118 QString *error);
123QVector<AquiferTarget> aquiferTargets();
131bool readAquiferSnapshot(SWMM_Engine engine, AquiferSnapshot *snapshot, QString *error);
134 QVector<int> cells;
135 QStringList cellTags; // Parallel to cells; engine cell indices, not display triangles.
136 QString target;
137 QVector<double> values; // One sampled value per cell; NaN is explicit NoData.
138 bool skipNoData = false;
139};
142 QVector<AquiferRow> appended;
143 QVector<int> cells, skippedCells;
144 QVector<double> oldValues, newValues;
145 QString target, error;
146};
147// A true cancellation callback discards all actionable rows; engine state is untouched.
155 std::function<bool()> cancelled = {});
156// Append-only transaction: original authored records remain byte-for-byte in
157// engine storage. Undo removes only a verified, unchanged appended suffix.
158// The optional hook injects a failure before a numbered write for regression.
167bool applyAquiferPreview(SWMM_Engine engine, const AquiferPreview &preview, QString *error,
168 std::function<bool(int)> beforeWrite = {});
176bool undoAquiferPreview(SWMM_Engine engine, const AquiferPreview &preview, QString *error);
177}
178#endif
int link
Definition heatconfigdialog.cpp:65
Definition groundwaterassignment.h:22
QVector< AquiferTarget > aquiferTargets()
Describe assignable aquifer properties and their permitted value ranges.
Definition groundwaterassignment.cpp:177
AquiferProcessPreview previewAquiferProcesses(SWMM_Engine engine, const QString &et, const QString &link, const QString &wilting)
Validate and review groundwater ET, seepage, and wilting choices without writing.
Definition groundwaterassignment.cpp:589
bool applyAquiferPreview(SWMM_Engine engine, const AquiferPreview &preview, QString *error, std::function< bool(int)> beforeWrite={})
Append validated overrides while preserving all original authored records.
Definition groundwaterassignment.cpp:329
QString groundwaterEtForcingStatus(SWMM_Engine engine, const QString &meshMode={})
Describe the authored atmospheric demand that can drive groundwater ET.
Definition groundwaterassignment.cpp:550
bool applyInfiltrationOwnership(SWMM_Engine engine, const InfiltrationOwnershipSnapshot &expected, const InfiltrationOwnershipSnapshot &desired, QString *error)
Replace reviewed infiltration inputs after checking for intervening changes.
Definition groundwaterassignment.cpp:526
bool readAquiferSnapshot(SWMM_Engine engine, AquiferSnapshot *snapshot, QString *error)
Capture authored aquifer rows, inheritance flags, options and forcing context.
Definition groundwaterassignment.cpp:195
InfiltrationOwnershipPreview previewInfiltrationOwnership(SWMM_Engine engine, const QStringList &tags, bool removeExplicit)
Review surface infiltration conflicts with aquifer-owned cells without changing inputs.
Definition groundwaterassignment.cpp:431
bool applyAquiferProcesses(SWMM_Engine engine, const AquiferSnapshot &expected, const AquiferSnapshot &desired, const QString &groundwater, QString *error)
Apply reviewed groundwater process options after stale-input checks.
Definition groundwaterassignment.cpp:643
AquiferPreview previewAquiferAssignment(const AquiferRequest &request, std::function< bool()> cancelled={})
Resolve inherited aquifer properties into appended per-cell overrides.
Definition groundwaterassignment.cpp:242
bool undoAquiferPreview(SWMM_Engine engine, const AquiferPreview &preview, QString *error)
Remove only the unchanged suffix produced by an aquifer assignment.
Definition groundwaterassignment.cpp:362
void * SWMM_Engine
Definition objectdefaultsapplier.h:23
Definition groundwaterassignment.h:140
QVector< AquiferRow > appended
Definition groundwaterassignment.h:142
QString error
Definition groundwaterassignment.h:145
AquiferSnapshot before
Definition groundwaterassignment.h:141
QVector< int > skippedCells
Definition groundwaterassignment.h:143
QVector< double > newValues
Definition groundwaterassignment.h:144
QString target
Definition groundwaterassignment.h:145
QVector< int > cells
Definition groundwaterassignment.h:143
QVector< double > oldValues
Definition groundwaterassignment.h:144
Definition groundwaterassignment.h:85
QString afterEffective
Definition groundwaterassignment.h:87
QString forcing
Definition groundwaterassignment.h:87
bool changed
Definition groundwaterassignment.h:88
QString beforeEffective
Definition groundwaterassignment.h:87
QString groundwater
Definition groundwaterassignment.h:87
QString error
Definition groundwaterassignment.h:87
AquiferSnapshot after
Definition groundwaterassignment.h:86
AquiferSnapshot before
Definition groundwaterassignment.h:86
Definition groundwaterassignment.h:132
AquiferSnapshot before
Definition groundwaterassignment.h:133
QVector< int > cells
Definition groundwaterassignment.h:134
QString target
Definition groundwaterassignment.h:136
QVector< double > values
Definition groundwaterassignment.h:137
bool skipNoData
Definition groundwaterassignment.h:138
QStringList cellTags
Definition groundwaterassignment.h:135
Definition groundwaterassignment.h:57
int scope
Definition groundwaterassignment.h:58
double zs
Definition groundwaterassignment.h:60
double thetaS
Definition groundwaterassignment.h:60
double alpha
Definition groundwaterassignment.h:60
QMap< QString, double > optional
Definition groundwaterassignment.h:61
bool operator==(const AquiferRow &other) const =default
Compare all stored AquiferRow fields using their value equality operators.
double ks
Definition groundwaterassignment.h:60
double thetaR
Definition groundwaterassignment.h:60
QString tag
Definition groundwaterassignment.h:59
int cell
Definition groundwaterassignment.h:58
Definition groundwaterassignment.h:69
bool operator==(const AquiferSnapshot &other) const =default
Compare all stored AquiferSnapshot fields using their value equality operators.
QMap< QString, QString > options
Definition groundwaterassignment.h:71
QVector< AquiferRow > rows
Definition groundwaterassignment.h:70
Definition groundwaterassignment.h:79
double maximum
Definition groundwaterassignment.h:81
QString label
Definition groundwaterassignment.h:80
bool minimumExclusive
Definition groundwaterassignment.h:82
bool supported
Definition groundwaterassignment.h:82
QString unavailableReason
Definition groundwaterassignment.h:83
QString key
Definition groundwaterassignment.h:80
QString unitKind
Definition groundwaterassignment.h:80
double minimum
Definition groundwaterassignment.h:81
Definition groundwaterassignment.h:27
int owner
Definition groundwaterassignment.h:28
QString source
Definition groundwaterassignment.h:29
int cell
Definition groundwaterassignment.h:28
int conflict
Definition groundwaterassignment.h:28
QString reason
Definition groundwaterassignment.h:29
Definition groundwaterassignment.h:31
bool changed
Definition groundwaterassignment.h:36
InfiltrationOwnershipSnapshot before
Definition groundwaterassignment.h:32
QString error
Definition groundwaterassignment.h:35
QStringList summaries
Definition groundwaterassignment.h:34
InfiltrationOwnershipSnapshot after
Definition groundwaterassignment.h:32
QVector< InfiltrationOwnershipCell > cells
Definition groundwaterassignment.h:33
Definition groundwaterassignment.h:23
QVector< SWMM_Infil2DAuthoredRow > rows
Definition groundwaterassignment.h:24
QString destination
Definition groundwaterassignment.h:25
double error
Definition terrainerrorfield.cpp:42
bool cancelled
Definition vectorexport.cpp:214