OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
QualityCheckpoint.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2
11
12#pragma once
14#include "SimulationContext.hpp"
15#include <algorithm>
16
17namespace openswmm::detail {
18// Native LEGACY mixing owns its persistent state on NodeData/LinkData and
19// MassBalanceData. Its lateral assembly buffers reset on every execute.
31 return c.n_nodes() > 0 && c.n_pollutants() > 0 && !c.options.ignore_quality &&
34 c.lid_usage.subcatch_index.empty() &&
35 std::none_of(c.node_subtypes.storages.lid.begin(), c.node_subtypes.storages.lid.end(),
36 [](const auto& lid) { return lid.control >= 0; }) &&
37 std::all_of(c.treatment.expressions.begin(), c.treatment.expressions.end(),
38 [](const auto& expression) { return expression.empty(); });
39}
40
52 if (c.n_nodes() == 0 || c.n_pollutants() == 0 || c.options.ignore_quality)
53 return;
54 std::string policy = "native LEGACY network pollutant checkpoint v1";
55 auto names = c.pollutant_names.names();
56 auto p = c.pollutants;
57 auto q = c.initial_quality;
58 auto solver = c.options.quality_solver;
60 a(policy, solver, names, p.units, p.mwt, p.k_decay, p.c_rain, p.c_gw, p.c_rdii, p.c_dwf,
61 p.init_conc, p.co_pollut, p.co_frac, p.snow_only, q.is_link, q.elem_name, q.elem_idx,
62 q.constituent, q.kind, q.value, q.from_file, q.file, treatment);
63}
64} // namespace openswmm::detail
Versioned archives of completed source-boundary state.
The central, reentrant simulation context for the new engine.
const std::vector< std::string > & names() const noexcept
Borrow ordered stored spellings.
Definition NameIndex.hpp:317
Definition CompletedSourceArchive.hpp:25
Definition OutfallExchange.hpp:17
bool checkpointNetworkPollutants(const SimulationContext &c)
Recognize the supported native LEGACY network-only pollutant checkpoint profile.
Definition QualityCheckpoint.hpp:30
void networkPollutantModel(CompletedSourceArchive &a, const SimulationContext &c)
Append native network pollutant configuration to the model fingerprint archive.
Definition QualityCheckpoint.hpp:51
Definition LID.cpp:39
Definition Treatment.cpp:44
@ LEGACY
Legacy-parity CSTR mixing (QualityRouting.cpp)
Definition SimulationOptions.hpp:88
std::vector< int > subcatch_index
Subcatchment index.
Definition HydrologyData.hpp:199
StorageData storages
Definition NodeSubtypes.hpp:536
bool configured
a reactions component applied
Definition ReactionData.hpp:342
Central, reentrant simulation context.
Definition SimulationContext.hpp:390
ReactionData reactions
Multispecies reaction system (EPANET-MSX conventions), parsed from the reactions component's config f...
Definition SimulationContext.hpp:624
int n_nodes() const noexcept
Number of nodes.
Definition SimulationContext.hpp:2357
NodeSubtypes node_subtypes
Relational side-tables for node subtypes (storage/outfall/divider).
Definition SimulationContext.hpp:574
TreatmentData treatment
Definition SimulationContext.hpp:764
int n_pollutants() const noexcept
Number of pollutants.
Definition SimulationContext.hpp:2369
LidUsageStore lid_usage
Definition SimulationContext.hpp:870
InitialQualityData initial_quality
Per-element initial quality rows from [INITIAL_QUALITY].
Definition SimulationContext.hpp:773
int n_subcatches() const noexcept
Number of subcatchments.
Definition SimulationContext.hpp:2363
NameIndex pollutant_names
Pollutant name → pollutant index.
Definition SimulationContext.hpp:748
SimulationOptions options
Parsed simulation options (from [OPTIONS] section).
Definition SimulationContext.hpp:452
PollutantData pollutants
Pollutant definitions and per-object quality state.
Definition SimulationContext.hpp:606
QualitySolverKind quality_solver
Water-quality engine selection ([OPTIONS] QUALITY_SOLVER).
Definition SimulationOptions.hpp:268
bool ignore_quality
Ignore water quality.
Definition SimulationOptions.hpp:596
bool water_age
[OPTIONS] WATER_AGE ON|OFF — transported water-age tracking (water age plan §1, reserved species WATE...
Definition SimulationOptions.hpp:318
bool heat_transport
[OPTIONS] HEAT_TRANSPORT ON|OFF — transported temperature (heat plan §1, reserved species TEMPERATURE...
Definition SimulationOptions.hpp:352
std::vector< LidNodeConfig > lid
Definition NodeSubtypes.hpp:77
std::vector< std::string > expressions
Index: [node * n_pollutants + pollutant].
Definition QualityData.hpp:199