OpenSWMM Engine  6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
Loading...
Searching...
No Matches
openswmm::twoD::gpu Namespace Reference

Classes

struct  ArkodeKokkosContext
 Context handed to the ARKStep callbacks via ARKodeSetUserData(). More...
 
class  ArkodeKokkosSurfaceSolver
 
class  CvodeKokkosSurfaceSolver
 
struct  InertialEdgeViews
 
class  KokkosAmgPreconditioner
 BoomerAMG preconditioner over the Kokkos surface Newton matrix. More...
 
struct  KokkosSolverContext
 Context handed to the CVODE callbacks via CVodeSetUserData(). More...
 
struct  MeshViews
 Immutable mesh geometry/topology mirrored to device once at initialize(). More...
 
struct  StateViews
 Mutable per-step state mirrored on device. More...
 

Typedefs

using VecType = ::sundials::kokkos::Vector<ExecSpace>
 SUNDIALS Kokkos vector specialised on the default execution space.
 
using ExecSpace = Kokkos::DefaultExecutionSpace
 
using MemSpace = ExecSpace::memory_space
 
using DView = Kokkos::View<double*, MemSpace>
 mutable double array
 
using CDView = Kokkos::View<const double*, MemSpace>
 const double array
 
using IView = Kokkos::View<int*, MemSpace>
 mutable int array
 
using CIView = Kokkos::View<const int*, MemSpace>
 const int array
 

Enumerations

enum  : int {
  BC_WALL = 0 ,
  BC_NORMAL_FLOW = 1 ,
  BC_SPECIFIED_STAGE = 2 ,
  BC_SPECIFIED_FLOW = 3 ,
  BC_RATING_CURVE = 4
}
 

Functions

KOKKOS_INLINE_FUNCTION constexpr double inertialG ()
 Gravity constant (SI). Matches ArkodeSurfaceSolver.
 
void evaluateInertialFe (const MeshViews &m, const StateViews &s, const InertialEdgeViews &E, DView y, DView ydot, double dry_depth)
 
void evaluateInertialFi (const MeshViews &m, const StateViews &s, const InertialEdgeViews &E, DView y, DView ydot, double dry_depth)
 
void precondInertialSetup (const MeshViews &m, const StateViews &s, const InertialEdgeViews &E, DView y, DView wq, double gamma, double dry_depth)
 
void precondInertialSolve (int nt, const InertialEdgeViews &E, DView r, DView z, DView wq)
 
void writebackEdgeFlux (int nt, const InertialEdgeViews &E, DView y, DView edge_flux)
 
KOKKOS_INLINE_FUNCTION double evapSink (double rate, double depth, double dry_depth)
 Depth-limited evaporation sink (mirrors evapSink()).
 
KOKKOS_INLINE_FUNCTION double sq (double x)
 
KOKKOS_INLINE_FUNCTION int nbr_of (int e, int n0, int n1, int n2)
 
KOKKOS_INLINE_FUNCTION double regSqrt (double x, double eps)
 
KOKKOS_INLINE_FUNCTION double boundaryEdgeFlux (int bc, double slope, double h_bc, double q_flow, double depth, double head, double tri_cz, double area, double L, double n, double dh_eps)
 
void evaluateRhs (const MeshViews &m, const StateViews &s, DView y, DView ydot, double dry_depth, double limiter_eps, double dh_eps)
 
void precondSetup (const MeshViews &m, const StateViews &s)
 Build the per-cell diagonal D from the most recent edge fluxes/heads.
 
void precondSolve (const StateViews &s, DView r, DView z, double gamma)
 Apply (I − γD)^{-1} element-wise: z = r / (1 − γ·D).
 

Typedef Documentation

◆ CDView

using openswmm::twoD::gpu::CDView = Kokkos::View<const double*, MemSpace>

const double array

◆ CIView

using openswmm::twoD::gpu::CIView = Kokkos::View<const int*, MemSpace>

const int array

◆ DView

using openswmm::twoD::gpu::DView = Kokkos::View<double*, MemSpace>

mutable double array

◆ ExecSpace

using openswmm::twoD::gpu::ExecSpace = Kokkos::DefaultExecutionSpace

◆ IView

using openswmm::twoD::gpu::IView = Kokkos::View<int*, MemSpace>

mutable int array

◆ MemSpace

using openswmm::twoD::gpu::MemSpace = ExecSpace::memory_space

◆ VecType

typedef::sundials::kokkos::Vector< ExecSpace > openswmm::twoD::gpu::VecType = ::sundials::kokkos::Vector<ExecSpace>

SUNDIALS Kokkos vector specialised on the default execution space.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum : int
Enumerator
BC_WALL 
BC_NORMAL_FLOW 
BC_SPECIFIED_STAGE 
BC_SPECIFIED_FLOW 
BC_RATING_CURVE 

Function Documentation

◆ boundaryEdgeFlux()

KOKKOS_INLINE_FUNCTION double openswmm::twoD::gpu::boundaryEdgeFlux ( int bc,
double slope,
double h_bc,
double q_flow,
double depth,
double head,
double tri_cz,
double area,
double L,
double n,
double dh_eps )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ evaluateInertialFe()

void openswmm::twoD::gpu::evaluateInertialFe ( const MeshViews & m,
const StateViews & s,
const InertialEdgeViews & E,
DView y,
DView ydot,
double dry_depth )
inline
Here is the call graph for this function:

◆ evaluateInertialFi()

void openswmm::twoD::gpu::evaluateInertialFi ( const MeshViews & m,
const StateViews & s,
const InertialEdgeViews & E,
DView y,
DView ydot,
double dry_depth )
inline
Here is the call graph for this function:

◆ evaluateRhs()

void openswmm::twoD::gpu::evaluateRhs ( const MeshViews & m,
const StateViews & s,
DView y,
DView ydot,
double dry_depth,
double limiter_eps,
double dh_eps )
inline
Here is the call graph for this function:

◆ evapSink()

KOKKOS_INLINE_FUNCTION double openswmm::twoD::gpu::evapSink ( double rate,
double depth,
double dry_depth )

Depth-limited evaporation sink (mirrors evapSink()).

Here is the caller graph for this function:

◆ inertialG()

KOKKOS_INLINE_FUNCTION constexpr double openswmm::twoD::gpu::inertialG ( )
constexpr

Gravity constant (SI). Matches ArkodeSurfaceSolver.

Here is the caller graph for this function:

◆ nbr_of()

KOKKOS_INLINE_FUNCTION int openswmm::twoD::gpu::nbr_of ( int e,
int n0,
int n1,
int n2 )
Here is the caller graph for this function:

◆ precondInertialSetup()

void openswmm::twoD::gpu::precondInertialSetup ( const MeshViews & m,
const StateViews & s,
const InertialEdgeViews & E,
DView y,
DView wq,
double gamma,
double dry_depth )
inline
Here is the call graph for this function:

◆ precondInertialSolve()

void openswmm::twoD::gpu::precondInertialSolve ( int nt,
const InertialEdgeViews & E,
DView r,
DView z,
DView wq )
inline

Apply the block-Jacobi preconditioner: z_cells = r_cells (identity), z_edges = w_e · r_edges.

◆ precondSetup()

void openswmm::twoD::gpu::precondSetup ( const MeshViews & m,
const StateViews & s )
inline

Build the per-cell diagonal D from the most recent edge fluxes/heads.

Here is the call graph for this function:

◆ precondSolve()

void openswmm::twoD::gpu::precondSolve ( const StateViews & s,
DView r,
DView z,
double gamma )
inline

Apply (I − γD)^{-1} element-wise: z = r / (1 − γ·D).

◆ regSqrt()

KOKKOS_INLINE_FUNCTION double openswmm::twoD::gpu::regSqrt ( double x,
double eps )

Head-difference regularization for the diffusive-wave flux (mirrors SurfaceFluxCalculator::regSqrt). Below a small head ε the bare √x — whose derivative ∂F/∂Δη ∝ 1/√|Δη| → ∞ as the surface flattens — is replaced by a C¹ quadratic with FINITE slope at 0, bounding the transmissivity in deep, near-level ponding while keeping the C-property (F → 0 as Δη → 0). ε ≤ 0 restores the bare √.

Here is the caller graph for this function:

◆ sq()

KOKKOS_INLINE_FUNCTION double openswmm::twoD::gpu::sq ( double x)
Here is the caller graph for this function:

◆ writebackEdgeFlux()

void openswmm::twoD::gpu::writebackEdgeFlux ( int nt,
const InertialEdgeViews & E,
DView y,
DView edge_flux )
inline

Project the prognostic discharge q back onto the redundant edge_flux slots (inflow-positive to the storing cell), for the downstream diagnostics.