OpenSWMM Engine  6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
Loading...
Searching...
No Matches
KokkosAmgPreconditioner.hpp
Go to the documentation of this file.
1
26
27#ifndef OPENSWMM_ENGINE_2D_GPU_KOKKOS_AMG_PRECONDITIONER_HPP
28#define OPENSWMM_ENGINE_2D_GPU_KOKKOS_AMG_PRECONDITIONER_HPP
29
31
32namespace openswmm::twoD::gpu {
33
41public:
44
47
50 void initialize(const MeshViews& mesh);
51
56 void setup(const MeshViews& mesh, const StateViews& state, double gamma,
57 bool recompute);
58
60 void solve(DView r, DView z, double gamma);
61
62 void finalize();
63 bool ready() const noexcept { return amg_ != nullptr; }
64
68 void invalidate() noexcept { hierarchy_built_ = false; }
69
70private:
71 int n_ = 0;
72 bool hierarchy_built_ = false;
73
74 // Static CSR sparsity, resident in the ExecSpace memory space.
75 IView row_ptr_;
76 IView col_idx_;
77 IView rows_;
78 IView ncols_;
79 IView diag_pos_;
80 IView edge_pos_;
81 DView values_;
82
83 // Opaque hypre handles (see HypreAmgPreconditioner.hpp rationale).
84 void* A_ = nullptr;
85 void* b_ = nullptr;
86 void* x_ = nullptr;
87 void* amg_ = nullptr;
88};
89
90} // namespace openswmm::twoD::gpu
91
92#endif // OPENSWMM_ENGINE_2D_GPU_KOKKOS_AMG_PRECONDITIONER_HPP
Performance-portable RHS pipeline for the 2D surface router (Phase 1).
~KokkosAmgPreconditioner()
Definition KokkosAmgPreconditioner.cpp:237
void initialize(const MeshViews &mesh)
Definition KokkosAmgPreconditioner.cpp:42
void finalize()
Definition KokkosAmgPreconditioner.cpp:228
KokkosAmgPreconditioner(const KokkosAmgPreconditioner &)=delete
void invalidate() noexcept
Definition KokkosAmgPreconditioner.hpp:68
void setup(const MeshViews &mesh, const StateViews &state, double gamma, bool recompute)
Definition KokkosAmgPreconditioner.cpp:140
bool ready() const noexcept
Definition KokkosAmgPreconditioner.hpp:63
KokkosAmgPreconditioner & operator=(const KokkosAmgPreconditioner &)=delete
void solve(DView r, DView z, double gamma)
Apply one BoomerAMG V-cycle: z ≈ M⁻¹ r (Views in the plugin's MemSpace).
Definition KokkosAmgPreconditioner.cpp:199
Definition ArkodeKokkosSurfaceSolver.cpp:29
Kokkos::View< int *, MemSpace > IView
mutable int array
Definition KokkosSurfaceKernels.hpp:83
Kokkos::View< double *, MemSpace > DView
mutable double array
Definition KokkosSurfaceKernels.hpp:81
Immutable mesh geometry/topology mirrored to device once at initialize().
Definition KokkosSurfaceKernels.hpp:87
Mutable per-step state mirrored on device.
Definition KokkosSurfaceKernels.hpp:102