![]() |
HydroCouple
2.0.0-alpha.1
HydroCouple Interface Definitions
|
HydroCouple is a header-only C++20 interface standard for component-based, integrated water-resources modeling, designed for HPC, GPU, and cloud execution. It provides pure-virtual (I-prefixed) abstract interfaces for model components, exchange items, spatial/temporal data, and geospatial geometry — analogous to and extending the Open Modeling Interface (OpenMI) standard — with a typed, zero-copy hyperslab data plane, transport-neutral distributed-execution contracts, and first-class Python bindings.
Two principles govern the standard: the interface headers contain no executable code (pure declarations, enums, and plain aggregates only — shared conveniences live in the explicitly non-normative hydrocouplehelpers.h), and no speculative abstraction (every interface earns its place against a concrete consumer).
HydroCouple version 2.0.0-alpha.1 defines seven header files — each targeting a distinct modeling concern — that together describe a full component coupling framework:
| Header | Namespace | Concern |
|---|---|---|
hydrocouple.h | HydroCouple | Core model component lifecycle, the typed BufferDescriptor hyperslab data plane, exchange items, signals/slots, capabilities, error queues |
hydrocoupledistributed.h | HydroCouple::Distributed | Transport-neutral distributed execution: transports, remote-component proxies, partitioned data items with local virtual (ghost/halo) entities |
hydrocouplehelpers.h | HydroCouple::Helpers | Non-normative conveniences: DataKind metadata, descriptor arithmetic, the lifecycle transition table, typed wrappers |
hydrocoupletemporal.h | HydroCouple::Temporal | Time representation, time-marching components, time-series data items |
hydrocouplespatial.h | HydroCouple::Spatial | OGC Simple Features geometry, UGRID-congruent bulk mesh views, networks, rasters, regular grids |
hydrocouplespatialwkb.h | (global) | C-compatible OGC WKB binary geometry structures |
hydrocouplespatiotemporal.h | HydroCouple::SpatioTemporal | Combined spatio-temporal component data items |
All interfaces use pure-virtual destructors and are designed to be implemented by concrete model components, with a name convention of I prefix (e.g., IModelComponent, IOutput). Field data moves exclusively through the typed hyperslab API (getValuesInto/setValuesFrom over BufferDescriptor — a DLPack-style dtype/shape/strides/memory-space descriptor), making exchange memcpy-able and directly compatible with SIMD, MPI datatypes, HDF5 hyperslabs, GPU staging, and NumPy.
HydroCouple::HydroCouple as a CMake INTERFACE target.getValuesInto/setValuesFrom over BufferDescriptor (dtype, int64_t shape, byte strides, memory space): zero-copy, memcpy-able, strided-view aware, and GPU/MPI/HDF5/NumPy compatible.ITransport (MPI-neutral tagged messaging), remote-component proxies with normative failure semantics, and IPartitionedComponentDataItem with local virtual (ghost/halo) entity representation and epoch-stamped asynchronous halo synchronization.Helpers::isValidComponentStatusTransition(); capabilities() discovery and errors() diagnostic queues that cross process/ABI/language boundaries.std::span, std::unique_ptr, constexpr, and [[nodiscard]] throughout.HydroCouple::HYDROCOUPLE_ABI_VERSION = 2.ISignal<Args...> / ISlot<Args...>) built into the interface hierarchy, with no Qt or OpenMI dependencies.IMeshView exposes UGRID-congruent structure-of-arrays mesh access.python/).HydroCoupleConfig.cmake and HydroCoupleConfigVersion.cmake with SameMajorVersion compatibility.hydrocouple..nupkg files per platform via GitHub Packages.| Tool | Minimum Version |
|---|---|
| CMake | 3.19 |
| C++ Compiler | C++20-capable (GCC 11+, Clang 13+, MSVC 19.29+) |
| vcpkg (optional) | any recent version |
| GoogleTest (tests only) | any version compatible with vcpkg gtest port |
No runtime library dependencies are required — all headers use only the C++ standard library.
Three platform presets are provided in CMakePresets.json. All inherit from the default (Ninja) preset which sets CMAKE_TOOLCHAIN_FILE to $VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake.
| Configure Preset | Generator | Condition |
|---|---|---|
default | Ninja | any host |
windows | Visual Studio 17 2022 (x64) | hostSystemName == Windows |
linux | Unix Makefiles | hostSystemName == Linux |
macos | Xcode | hostSystemName == Darwin |
| Option | Default | Description |
|---|---|---|
HYDROCOUPLE_BUILD_TESTS | OFF | Build the GoogleTest unit test suite. Requires the gtest vcpkg port. |
This installs:
hydrocouple.h, hydrocouplespatial.h, hydrocouplespatialwkb.h, hydrocouplespatiotemporal.h, hydrocoupletemporal.h, generated version.h) → ${prefix}/include/HydroCoupleConfig.cmake, HydroCoupleConfigVersion.cmake, HydroCoupleTargets.cmake) → ${prefix}/lib/cmake/HydroCouple/${prefix}/share/HydroCouple/Generates:
HydroCouple-2.0.0-alpha.1-win64.zip + HydroCouple.x64.windows.2.0.0-alpha.1.nupkgHydroCouple-2.0.0-alpha.1-linux.tar.gz + HydroCouple.x64.linux.2.0.0-alpha.1.nupkgHydroCouple-2.0.0-alpha.1-macos.tar.gz + HydroCouple.arm64.osx.2.0.0-alpha.1.nupkgNuGet packages are published to the HydroCouple GitHub Packages feed.
After installation or using a vcpkg-integrated build:
The HydroCouple::HydroCouple target is an INTERFACE library. Linking it propagates:
HYDROCOUPLE_LIBRARY compile definitioncxx_std_20 compile feature requirementAdd HydroCouple as a dependency in your vcpkg.json:
To include unit tests:
The vcpkg manifest (vcpkg.json) declares the following:
| Field | Value |
|---|---|
name | hydrocouple |
version-semver | 2.0.0-alpha.1 |
license | MIT |
homepage | https://hydrocouple.org |
| Host dependencies | vcpkg-cmake, vcpkg-cmake-config |
Optional feature tests | adds gtest |
| Default features | tests |
The registry is configured to the official Microsoft vcpkg registry at baseline 13bde2ff13192e1b2fdd37bd9b475c7665ae6ae5.
HydroCouple version 2.0.0-alpha.1 provides seven header files defining interfaces for component-based integrated modeling:
| Header | Namespace | Purpose |
|---|---|---|
hydrocouple.h | HydroCouple | Core component lifecycle (IModelComponent), the typed hyperslab data plane (IComponentDataItem::getValuesInto/setValuesFrom over BufferDescriptor), exchange items (IInput/IOutput), capabilities() discovery, errors() diagnostic queues, signal/slot pattern, units, value definitions, and component metadata |
hydrocoupledistributed.h | HydroCouple::Distributed | Transport-neutral distributed execution: ITransport, IDistributedModelComponent, IProxyModelComponent (remote-component stand-ins), and IPartitionedComponentDataItem (local virtual ghost/halo entities with epoch-stamped asynchronous synchronization) |
hydrocouplehelpers.h | HydroCouple::Helpers | Non-normative conveniences — the single deliberate exception to the no-implementation rule: DataKind metadata, BufferDescriptor arithmetic, the lifecycle transition table, typed get/set wrappers |
hydrocoupletemporal.h | HydroCouple::Temporal | Time representation (IDateTime, ITimeSpan), time-marching components (ITimeModelComponent), and time-series data items with bulk times() access |
hydrocouplespatial.h | HydroCouple::Spatial | OGC Simple Features geometry hierarchy (IGeometry, IPoint, IPolygon, etc.), IMeshView UGRID-congruent bulk mesh access, spatial reference systems, networks, rasters, and regular grids with bulk coordinate/activity arrays |
hydrocouplespatialwkb.h | (global) | C-compatible OGC WKB (Well-Known Binary) geometry structures for serialization |
hydrocouplespatiotemporal.h | HydroCouple::SpatioTemporal | Combined spatio-temporal data items (e.g., ITimeGeometryComponentDataItem, ITimeSeriesRasterComponentDataItem) with canonical dimension orderings (time outermost) |
All interfaces are pure-virtual with an I prefix (e.g., IModelComponent) and designed for implementation by concrete model components. The interface headers contain no executable code; each specialization documents a canonical dimension ordering so producers and consumers agree on hyperslab layouts without negotiation.
For detailed API documentation, see https://hydrocouple.org/HydroCouple/ (C++) and https://hydrocouple.org/HydroCouple/python/ (Python). For concrete base classes implementing this standard, see HydroCoupleSDK.
The python/ package (hydrocouple, PEP 440 version 2.0.0a1) mirrors the standard 1:1 as Python abstract base classes and bridges both directions through Cython:
hydrocouple.loader.load() opens a compiled component library and drives it from Python, exchanging fields as NumPy arrays through the zero-copy hyperslab data plane (the ndarray is the BufferDescriptor — data pointer, dtype, shape, strides), with the GIL released around C++ compute.PyComponentBridge presents a Python component to C++ workflows as a real IModelComponent*, including its data items, capabilities(), and errors() queue.Unit tests are built when HYDROCOUPLE_BUILD_TESTS=ON. The test executable is hydrocouple_tests (140 Google Tests), linked against the HydroCouple, GTest::gtest, and GTest::gtest_main targets, and uses gtest_discover_tests() for CTest integration.
Test file test_core_types.cpp covers:
DataKind element sizes and the DataKindOf<T> trait mappingBufferDescriptor arithmetic: element counts, contiguity (packed, pitched, strided, broadcast), byte offsetsisValidComponentStatusTransition)IComponentDataItem implementation exercising hyperslab correctness: interior slabs, strided/pitched destinations, and kind/bounds/rank rejectionTest file test_hydrocouple.cpp covers:
Test file test_spatial_wkb.cpp covers:
WKBByteOrder enum class values, underlying type (uint8_t)WKBGeometryType enum class: 2D, Z, M, and ZM type codesPoint, PointZ, PointM, PointZM struct sizes, trivially_copyable, standard_layout, trivially_default_constructibleThe Python bindings carry their own pytest suite (98 tests) including enum-parity checks that parse these headers directly and an end-to-end C++/Python interop proof; see python/README.md.
Three GitHub Actions workflows run on every push and pull request to master and dev:
| Workflow file | Name | What it does | Platforms |
|---|---|---|---|
build_and_unit_test.yml | Build and Unit Test | Configures with HYDROCOUPLE_BUILD_TESTS=ON, builds, and runs ctest | ubuntu-latest (x64-linux), macos-latest (arm64-osx), windows-latest (x64-windows) |
build_and_package.yml | Build and Package | Configures with HYDROCOUPLE_BUILD_TESTS=OFF, runs CPack to produce .tar.gz/.zip/.nupkg, pushes NuGet packages to GitHub Packages | ubuntu-latest, macos-latest, windows-latest |
build_docs.yml | Build Documentation | Installs Doxygen + Graphviz, builds HTML docs, deploys to GitHub Pages, uploads hydrocouple_docs.tar.gz artifact | ubuntu-latest |
All workflows use vcpkg at ref 2025.02.14 and cache packages via the GitHub NuGet feed (https://nuget.pkg.github.com/HydroCouple/index.json).
Both documentation sites are co-deployed by build_docs.yml and cross-linked (the Doxygen navbar carries a Python API tab; the Sphinx navbar links back to the C++ Interface Docs):
Release notes live in CHANGELOG.md.
If you use HydroCouple in your research, please cite:
BibTeX:
ORCID: 0000-0002-9859-2264
HydroCouple — including the C++ interface headers, the Python bindings, the tests, and the documentation — is released under the [MIT License](License).
Copyright © 2014–2026 HydroCouple / Caleb Buahin.