52#ifndef OPENSWMM_ENGINE_2D_GPU_EXPLICIT_KOKKOS_SURFACE_SOLVER_HPP
53#define OPENSWMM_ENGINE_2D_GPU_EXPLICIT_KOKKOS_SURFACE_SOLVER_HPP
73 double advance(
double t_current,
double t_target)
override;
81 const noexcept
override {
return exch_host_; }
82 RunStats
run_stats() const noexcept override;
93 DView d_tri_area_, d_tri_cz_, d_tri_cx_, d_tri_cy_, d_vz_, d_vx_, d_vy_;
96 IView d_vs_ptr_, d_vs_idx_;
97 DView d_edge_length_, d_mannings_n_;
99 IView d_cL_, d_cR_, d_slotL_, d_slotR_, d_cell_ptr_, d_cell_edge_;
100 DView d_xi_, d_inv_dx_, d_zface_, d_ze_lo_, d_ze_hi_, d_nx_, d_ny_, d_mx_, d_my_;
101 DView d_n2_, d_sign_, d_lchar_;
104 DView d_volume_, d_head_, d_depth_;
105 DView d_q_, d_faccL_, d_faccR_, d_qcx_, d_qcy_;
106 DView d_rain_, d_coup_, d_evap_, d_infil_;
113 DView d_infil_applied_;
119 DView d_coupling_applied_;
123 DView d_node_fullvol_;
124 std::vector<double> infil_applied_host_;
125 std::vector<double> coupling_applied_host_;
127 IView d_active_, d_pin_t0_, d_tier_, d_face_tier_;
128 IView d_cells_compact_, d_edges_compact_;
133 IView d_bc_cell_, d_bc_slot_, d_bc_type_;
134 DView d_bc_accum_, d_bc_slope_, d_bc_head_, d_bc_flow_;
137 std::vector<int> bc_cell_host_, bc_slot_host_;
140 IView d_cp_cell_, d_cp_vertex_, d_cp_node_;
141 DView d_cp_cd_, d_cp_area_;
142 DView d_exch_, d_node_drawn_;
143 DView d_node_head_, d_node_depth_, d_node_volume_;
144 DView d_node_invert_, d_node_fulldepth_;
145 std::vector<double> exch_host_;
148 std::array<int, 9> tier_off_{};
149 std::array<int, 9> ftier_off_{};
153 bool have_perot_ =
false;
154 double t_last_sync_ = 0.0;
155 int cycles_since_rebuild_ = 1000;
156 double last_dt_ = 0.0;
157 long last_steps_ = 0, substeps_run_ = 0, face_passes_ = 0;
158 bool initialized_ =
false;
160 std::array<long, 8> tier_occupancy_{};
161 std::vector<std::pair<double, int>> telemetry_;
162 std::string telemetry_path_;
Backend-neutral interface for the 2D surface-routing time integrator.
Unique interior-edge structure for the local-inertial momentum DOFs.
Execution-space selection + view aliases for the Kokkos marcher plugin.
Abstract time integrator for the 2D surface-routing ODE system.
Definition ISurfaceSolver.hpp:63
void reconstructAllDev()
Definition ExplicitKokkosSurfaceSolver.cpp:389
void collapseToGlobalDt()
tail: everything to tier 0
Definition ExplicitKokkosSurfaceSolver.cpp:654
void settleAccumulatorsDev()
Definition ExplicitKokkosSurfaceSolver.cpp:407
void initialize(MeshData &mesh, SurfaceStateData &state, SolverOptions2D &opts) override
One-time setup. mesh and state must outlive the solver.
Definition ExplicitKokkosSurfaceSolver.cpp:145
void syncAndRebuild(double t)
Definition ExplicitKokkosSurfaceSolver.cpp:485
void finalize() override
Release all backend resources.
Definition ExplicitKokkosSurfaceSolver.cpp:1356
void pushForcings()
Definition ExplicitKokkosSurfaceSolver.cpp:1151
void pushNodeState()
Definition ExplicitKokkosSurfaceSolver.cpp:1182
void refreshDt0()
tighten-only dt0_ between rebuilds (== serial)
Definition ExplicitKokkosSurfaceSolver.cpp:623
long last_num_steps() const noexcept override
Number of internal integrator steps in the last advance() call.
Definition ExplicitKokkosSurfaceSolver.hpp:78
void publishAndCopyBack(double t_current, double t_target)
Definition ExplicitKokkosSurfaceSolver.cpp:1189
void resyncFromVolumes(double t0) override
Definition ExplicitKokkosSurfaceSolver.cpp:1350
double advance(double t_current, double t_target) override
Definition ExplicitKokkosSurfaceSolver.cpp:1250
~ExplicitKokkosSurfaceSolver() override
Definition ExplicitKokkosSurfaceSolver.hpp:69
void lazySourcesDev(double t)
Definition ExplicitKokkosSurfaceSolver.cpp:442
double last_step_size() const noexcept override
Last internal step size used by the integrator.
Definition ExplicitKokkosSurfaceSolver.hpp:79
void fireCells(int tier, double dt_c)
Definition ExplicitKokkosSurfaceSolver.cpp:789
bool is_initialized() const noexcept override
True once initialize() has completed and the solver is ready.
Definition ExplicitKokkosSurfaceSolver.hpp:83
void fireFaces(int tier, double dt_f)
Definition ExplicitKokkosSurfaceSolver.cpp:709
const std::vector< double > & last_coupling_exchange() const noexcept override
Definition ExplicitKokkosSurfaceSolver.hpp:80
RunStats run_stats() const noexcept override
Read cumulative statistics. Default: zeros (backend has no counters).
Definition ExplicitKokkosSurfaceSolver.cpp:1372
void reinitialize(double t0) override
Reinitialize the integrator at t0 after external state edits.
Definition ExplicitKokkosSurfaceSolver.cpp:1338
ExplicitKokkosSurfaceSolver()=default
void runMacroCycle(double dt0, int nsub)
Definition ExplicitKokkosSurfaceSolver.cpp:1131
Definition ExplicitKokkosSurfaceSolver.cpp:36
Kokkos::View< int *, MemSpace > IView
mutable int array
Definition KokkosTypes.hpp:65
Kokkos::View< double *, MemSpace > DView
mutable double array
Definition KokkosTypes.hpp:63
Canonical unique interior-edge layout + per-cell incidence for the local-inertial scheme.
Definition InertialEdges.hpp:61
SoA storage for 2D mixed triangle/quad mesh geometry and topology.
Definition MeshData.hpp:67
Configuration for the 2D surface routing solver.
Definition SolverOptions2D.hpp:208
Definition SurfaceStateData.hpp:59