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
groundwatertransportassignment.h
Go to the documentation of this file.
1
10#ifndef OPENSWMMVIS_GROUNDWATERTRANSPORTASSIGNMENT_H
11#define OPENSWMMVIS_GROUNDWATERTRANSPORTASSIGNMENT_H
12#include <openswmm/engine/openswmm_engine.h>
14#include <QMap>
15#include <QPointF>
16#include <QStringList>
17#include <QVector>
18#include <functional>
19
21{
24 bool massSupported = false, signedConcentration = false;
30 bool operator==(const TransportSpecies &other) const = default;
31};
33 int scope = 0, cell = -1, zone = 0, layer = 0;
34 QString tag, species;
35 double value = 0;
41 bool operator==(const GroundwaterQualityRow &other) const = default;
42};
44 QString species, kind = QStringLiteral("CONC"), series;
45 double value = 0;
51 bool operator==(const GroundwaterSpeciesTerm &other) const = default;
52};
54 QString name, tag, series;
55 int scope = 2, cell = -1;
56 double flow = 0, scale = 1;
57 QVector<GroundwaterSpeciesTerm> terms;
63 bool operator==(const GroundwaterSourceRow &other) const = default;
64};
66 int cellCount = 0;
68 QStringList cellTags;
69 QVector<bool> activeCells;
70 QVector<GroundwaterQualityRow> quality;
71 QString qualityFile;
72 QVector<GroundwaterSourceRow> sources;
73 QVector<TransportSpecies> species;
74 QMap<QString, QString> options;
75 QMap<QString, QVector<QPointF>> timeSeries;
81 bool operator==(const GroundwaterTransportSnapshot &other) const;
82};
89QVector<TransportSpecies> groundwaterTransportSpecies(SWMM_Engine engine, QString *error = nullptr);
98 QString *error = nullptr);
104 QVector<int> cells;
105 QVector<double> values; // initial values or per-cell constant source flow (m3/s)
106 bool skipNoData = false;
107 QString species;
108 int zone = 0; // SAT=0 / UNSAT=1 / explicit SIGMA layer=2
109 int layer = 1; // one-based, used only for zone=2
110 QString sourceName = QStringLiteral("Assigned"), flowSeries;
111 QVector<GroundwaterSpeciesTerm> terms;
113 QVector<double> areaWeights; // positive cell areas; normalized for RegionTotal
114};
121// A true cancellation callback returns an error with after == before.
130 std::function<bool()> cancelled = {});
132 bool success = false, changed = false, rollbackComplete = true;
133 QString error;
134};
135// Full preflight and readback. A failed write attempts bounded restoration;
136// changed remains true when restoration cannot be confirmed (owner must dirty).
145 const GroundwaterTransportPreview &preview,
146 std::function<bool(int)> beforeWrite = {});
153GroundwaterTransportResult undoGroundwaterTransport(SWMM_Engine engine,
154 const GroundwaterTransportPreview &preview);
155}
156#endif
Spatial assignment of groundwater forcing to selected mesh cells.
Definition groundwaterassignment.h:22
GroundwaterTransportPreview previewGroundwaterTransport(const GroundwaterTransportRequest &request, std::function< bool()> cancelled={})
Build a validated initial-quality or groundwater-source edit using snapshot data only.
Definition groundwatertransportassignment.cpp:537
GroundwaterTransportTarget
Definition groundwatertransportassignment.h:99
GroundwaterTransportResult applyGroundwaterTransport(SWMM_Engine engine, const GroundwaterTransportPreview &preview, std::function< bool(int)> beforeWrite={})
Commit reviewed transport rows with preflight, readback and bounded restoration.
Definition groundwatertransportassignment.cpp:773
GroundwaterTransportResult undoGroundwaterTransport(SWMM_Engine engine, const GroundwaterTransportPreview &preview)
Restore the before state only when the engine still matches the reviewed after state.
Definition groundwatertransportassignment.cpp:782
QVector< TransportSpecies > groundwaterTransportSpecies(SWMM_Engine engine, QString *error=nullptr)
Read enabled groundwater species and native concentration/mass-rate metadata.
Definition groundwatertransportassignment.cpp:335
bool readGroundwaterTransportSnapshot(SWMM_Engine engine, GroundwaterTransportSnapshot *snapshot, QString *error=nullptr)
Capture inputs needed for transport validation and stale-preview detection.
Definition groundwatertransportassignment.cpp:404
GroundwaterSourceDistribution
Definition groundwatertransportassignment.h:100
void * SWMM_Engine
Definition objectdefaultsapplier.h:23
Definition groundwaterassignment.h:69
Definition groundwatertransportassignment.h:32
int cell
Definition groundwatertransportassignment.h:33
QString tag
Definition groundwatertransportassignment.h:34
double value
Definition groundwatertransportassignment.h:35
int layer
Definition groundwatertransportassignment.h:33
int scope
Definition groundwatertransportassignment.h:33
bool operator==(const GroundwaterQualityRow &other) const =default
Compare all stored GroundwaterQualityRow fields using their value equality operators.
int zone
Definition groundwatertransportassignment.h:33
QString species
Definition groundwatertransportassignment.h:34
Definition groundwatertransportassignment.h:53
double scale
Definition groundwatertransportassignment.h:56
int scope
Definition groundwatertransportassignment.h:55
QVector< GroundwaterSpeciesTerm > terms
Definition groundwatertransportassignment.h:57
QString name
Definition groundwatertransportassignment.h:54
QString series
Definition groundwatertransportassignment.h:54
QString tag
Definition groundwatertransportassignment.h:54
int cell
Definition groundwatertransportassignment.h:55
bool operator==(const GroundwaterSourceRow &other) const =default
Compare all stored GroundwaterSourceRow fields using their value equality operators.
double flow
Definition groundwatertransportassignment.h:56
Definition groundwatertransportassignment.h:43
QString series
Definition groundwatertransportassignment.h:44
double value
Definition groundwatertransportassignment.h:45
QString kind
Definition groundwatertransportassignment.h:44
QString species
Definition groundwatertransportassignment.h:44
bool operator==(const GroundwaterSpeciesTerm &other) const =default
Compare all stored GroundwaterSpeciesTerm fields using their value equality operators.
Definition groundwatertransportassignment.h:115
GroundwaterTransportTarget target
Definition groundwatertransportassignment.h:117
QString error
Definition groundwatertransportassignment.h:119
GroundwaterTransportSnapshot before
Definition groundwatertransportassignment.h:116
QVector< int > skippedCells
Definition groundwatertransportassignment.h:118
GroundwaterTransportSnapshot after
Definition groundwatertransportassignment.h:116
QVector< int > cells
Definition groundwatertransportassignment.h:118
Definition groundwatertransportassignment.h:101
GroundwaterSourceDistribution distribution
Definition groundwatertransportassignment.h:112
QVector< GroundwaterSpeciesTerm > terms
Definition groundwatertransportassignment.h:111
QVector< double > values
Definition groundwatertransportassignment.h:105
bool skipNoData
Definition groundwatertransportassignment.h:106
QVector< double > areaWeights
Definition groundwatertransportassignment.h:113
int zone
Definition groundwatertransportassignment.h:108
GroundwaterTransportTarget target
Definition groundwatertransportassignment.h:103
GroundwaterTransportSnapshot before
Definition groundwatertransportassignment.h:102
QString species
Definition groundwatertransportassignment.h:107
QVector< int > cells
Definition groundwatertransportassignment.h:104
QString flowSeries
Definition groundwatertransportassignment.h:110
QString sourceName
Definition groundwatertransportassignment.h:110
int layer
Definition groundwatertransportassignment.h:109
Definition groundwatertransportassignment.h:131
QString error
Definition groundwatertransportassignment.h:133
bool changed
Definition groundwatertransportassignment.h:132
bool success
Definition groundwatertransportassignment.h:132
bool rollbackComplete
Definition groundwatertransportassignment.h:132
Definition groundwatertransportassignment.h:65
AquiferSnapshot aquifers
Definition groundwatertransportassignment.h:67
bool operator==(const GroundwaterTransportSnapshot &other) const
Compare all snapshot inputs used to reject stale transport previews.
Definition groundwatertransportassignment.cpp:316
QVector< bool > activeCells
Definition groundwatertransportassignment.h:69
QMap< QString, QVector< QPointF > > timeSeries
Definition groundwatertransportassignment.h:75
QVector< GroundwaterQualityRow > quality
Definition groundwatertransportassignment.h:70
int cellCount
Definition groundwatertransportassignment.h:66
QVector< TransportSpecies > species
Definition groundwatertransportassignment.h:73
QVector< GroundwaterSourceRow > sources
Definition groundwatertransportassignment.h:72
QStringList cellTags
Definition groundwatertransportassignment.h:68
QMap< QString, QString > options
Definition groundwatertransportassignment.h:74
QString qualityFile
Definition groundwatertransportassignment.h:71
Definition groundwatertransportassignment.h:22
QString nativeMassRateUnits
Definition groundwatertransportassignment.h:23
bool operator==(const TransportSpecies &other) const =default
Compare all stored TransportSpecies fields using their value equality operators.
QString nativeConcUnits
Definition groundwatertransportassignment.h:23
QString id
Definition groundwatertransportassignment.h:23
bool massSupported
Definition groundwatertransportassignment.h:24
bool signedConcentration
Definition groundwatertransportassignment.h:24
double error
Definition terrainerrorfield.cpp:42
bool cancelled
Definition vectorexport.cpp:214