44#ifndef OPENSWMM_ENGINE_DATA_STORAGEGEOMETRY_HPP
45#define OPENSWMM_ENGINE_DATA_STORAGEGEOMETRY_HPP
89 if (p1 <= 0.0 || p2 <= 0.0 || p3 < 0.0)
121 double& b,
double& c)
noexcept {
127 const double A = p1 / 2.0;
128 const double B = p2 / 2.0;
148 a = 2.0 * (p1 + p2) * Z;
172 return "CYLINDRICAL";
193 if (kw ==
"TABULAR") {
197 if (kw ==
"FUNCTIONAL") {
201 if (kw ==
"CYLINDRICAL") {
205 if (kw ==
"CONICAL") {
209 if (kw ==
"PARABOLIC" || kw ==
"PARABOLOID") {
213 if (kw ==
"PYRAMIDAL") {
Structure-of-Arrays (SoA) storage for all node types.
Definition ExchangeLaw.hpp:60
StorageShape
Storage-unit surface-area relation.
Definition NodeData.hpp:99
@ CONICAL
Elliptical cone (p1, p2 = base axes, p3 = side slope)
Definition NodeData.hpp:103
@ PYRAMIDAL
Rectangular pyramid (p1 = length, p2 = width, p3 = side slope)
Definition NodeData.hpp:105
@ TABULAR
Area vs. depth from a curve (StorageData::curve)
Definition NodeData.hpp:100
@ PARABOLOID
Elliptical paraboloid(p1, p2 = top axes, p3 = height ≠ 0)
Definition NodeData.hpp:104
@ CYLINDRICAL
Elliptical cylinder (p1 = major axis, p2 = minor axis)
Definition NodeData.hpp:102
@ FUNCTIONAL
Area = c + a*d^b.
Definition NodeData.hpp:101
constexpr bool storage_shape_is_valid_code(int v) noexcept
Check whether an integer lies in the public storage-shape ordinal interval.
Definition StorageGeometry.hpp:226
bool storage_shape_from_keyword(std::string_view kw, StorageShape &out) noexcept
Parse a shape keyword (caller upper-cases first).
Definition StorageGeometry.hpp:192
constexpr double kStoragePi
π to the precision legacy uses (src/legacy/engine/consts.h: #define PI 3.141592654,...
Definition StorageGeometry.hpp:59
bool storage_shape_coeffs(StorageShape s, double p1, double p2, double p3, double &a, double &b, double &c) noexcept
Derive the area-relation coefficients for a geometric shape.
Definition StorageGeometry.hpp:120
bool storage_shape_params_valid(StorageShape s, double p1, double p2, double p3) noexcept
Validate raw shape parameters.
Definition StorageGeometry.hpp:86
constexpr bool storage_shape_is_geometric(StorageShape s) noexcept
True when s is one of the four geometric shapes (i.e. its a/b/c are the quadratic coefficients,...
Definition StorageGeometry.hpp:68
const char * storage_shape_keyword(StorageShape s) noexcept
Canonical INP/GeoPackage keyword for a shape.
Definition StorageGeometry.hpp:165