OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
SurfaceOwnership.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2026 Caleb Buahin
3
12
13#ifndef OPENSWMM_SURFACE_OWNERSHIP_HPP
14#define OPENSWMM_SURFACE_OWNERSHIP_HPP
15#include <functional>
16#include <string>
17#include <vector>
18namespace openswmm {
20}
21namespace openswmm::twoD {
22struct MeshData;
23struct SolverOptions2D;
24struct SubsurfaceConfig;
26 std::string subcatch;
34 bool operator==(const SurfaceOwnerRecord& other) const { return subcatch == other.subcatch; }
35};
37 int subcatch = -1;
38 std::string name, tag, reason;
39 bool reviewed = false, lumped = false;
42 int status = 0; // 0 outside, 1 unreviewed, 2 reviewed, 3 invalid/unmapped
43};
45 int subcatch = -1, cell = -1;
48};
50 std::vector<SurfaceOwnerObject> objects;
51 std::vector<SurfaceOwnerShare> shares;
52 std::vector<double> mesh_weather_area;
53 std::vector<std::string> errors;
54 std::string token;
55 bool cancelled = false;
62 bool valid() const { return errors.empty(); }
63};
64// Geometry is read-only. The same resolver serves authoring and initialization.
93SurfaceOwnershipPreview resolveSurfaceOwnership(const SimulationContext&, const MeshData&,
94 const SolverOptions2D&, const SubsurfaceConfig&,
95 const std::vector<SurfaceOwnerRecord>&,
96 const std::function<bool(int, int)>& progress = {});
107std::string parseSurfaceOwnerLine(const std::vector<std::string>&,
108 std::vector<SurfaceOwnerRecord>&);
109}
110#endif
Definition ExchangeLaw.hpp:60
std::string parseSurfaceOwnerLine(const std::vector< std::string > &t, std::vector< SurfaceOwnerRecord > &rows)
Retain one reviewed uniform subcatchment surface-ownership authoring record.
Definition SubsurfaceSections.cpp:1536
SurfaceOwnershipPreview resolveSurfaceOwnership(const SimulationContext &ctx, const MeshData &mesh, const SolverOptions2D &opts, const SubsurfaceConfig &cfg, const std::vector< SurfaceOwnerRecord > &proposed, const std::function< bool(int, int)> &progress)
Preview reviewed source footprints, receiver shares and weather-area ownership without adoption.
Definition SubsurfaceSections.cpp:1575
Definition ExchangeLaw.hpp:60
Central, reentrant simulation context.
Definition SimulationContext.hpp:390
SoA storage for 2D mixed triangle/quad mesh geometry and topology.
Definition MeshData.hpp:65
Definition SolverOptions2D.hpp:257
Everything the parser fills, before resolution onto cells.
Definition SubsurfaceData.hpp:391
Definition SurfaceOwnership.hpp:36
double native_lid_area
Definition SurfaceOwnership.hpp:41
double inside_area
Definition SurfaceOwnership.hpp:41
double declared_area
Definition SurfaceOwnership.hpp:40
std::string reason
Definition SurfaceOwnership.hpp:38
double pervious_area
Definition SurfaceOwnership.hpp:40
std::string tag
Definition SurfaceOwnership.hpp:38
double lid_area
Definition SurfaceOwnership.hpp:40
double polygon_area
Definition SurfaceOwnership.hpp:40
std::string name
Definition SurfaceOwnership.hpp:38
bool reviewed
Definition SurfaceOwnership.hpp:39
int subcatch
Definition SurfaceOwnership.hpp:37
double outside_area
Definition SurfaceOwnership.hpp:41
bool lumped
Definition SurfaceOwnership.hpp:39
int status
Definition SurfaceOwnership.hpp:42
double impervious_area
Definition SurfaceOwnership.hpp:41
Definition SurfaceOwnership.hpp:25
std::string subcatch
Definition SurfaceOwnership.hpp:26
bool operator==(const SurfaceOwnerRecord &other) const
Compare ownership records by their authored subcatchment identifier bytes.
Definition SurfaceOwnership.hpp:34
Definition SurfaceOwnership.hpp:44
double lid_area
Definition SurfaceOwnership.hpp:46
int subcatch
Definition SurfaceOwnership.hpp:45
double impervious_area
Definition SurfaceOwnership.hpp:46
int cell
Definition SurfaceOwnership.hpp:45
double native_lid_area
Definition SurfaceOwnership.hpp:47
double pervious_area
Definition SurfaceOwnership.hpp:46
double weather_area
Definition SurfaceOwnership.hpp:46
Definition SurfaceOwnership.hpp:49
bool valid() const
Test whether preview validation collected any error diagnostics.
Definition SurfaceOwnership.hpp:62
std::string token
Definition SurfaceOwnership.hpp:54
std::vector< std::string > errors
Definition SurfaceOwnership.hpp:53
std::vector< SurfaceOwnerShare > shares
Definition SurfaceOwnership.hpp:51
std::vector< SurfaceOwnerObject > objects
Definition SurfaceOwnership.hpp:50
std::vector< double > mesh_weather_area
Definition SurfaceOwnership.hpp:52
bool cancelled
Definition SurfaceOwnership.hpp:55