// CelerisLab – core/params.cuh
// Runtime parameter structures transported via __constant__ memory.
// Includes: LBMParams, RigidBodyState2D, RigidBodyControl2D.
//
// Design note:
//   Only parameters that are truly consumed by current kernels should live in
//   LBMParams. Future-facing interface placeholders belong in host-side API
//   comments or TODOs, not in the active device contract.
// ============================================================================

#ifndef CELERIS_CORE_PARAMS_CUH
#define CELERIS_CORE_PARAMS_CUH

#include <stdint.h>

// ============================================================================
// LBM runtime parameters
//
// Grid topology and collision family are compile-time via generated headers.
// Runtime state is intentionally kept minimal:
//   - omega     : effective relaxation rate used by SRT/TRT/MRT
//   - fx,fy,fz  : external body force density for Guo forcing
//   - n_objects : packed telemetry contract
// ============================================================================
struct LBMParams {
    float omega;
    float fx, fy, fz;
    unsigned int n_objects;
};

__constant__ LBMParams d_params;

// ============================================================================
// Rigid-body state / control  (2D, per architecture §17.3)
// ============================================================================
struct RigidBodyState2D {
    float x, y, theta;
    float vx, vy, omega;
};

struct RigidBodyControl2D {
    float ax_cmd, ay_cmd;
    float alpha_cmd;
    int   control_mode;           // 0=force, 1=velocity, 2=displacement
};

// ============================================================================
// Halo plan (multi-GPU / AMR 预留)
// ============================================================================
struct HaloPlan {
    int       face_id;
    int       peer_gpu;
    int       level;
    size_t    count;
    int*      send_idx;
    int*      recv_idx;
};

#endif // CELERIS_CORE_PARAMS_CUH
