SRT keeps its two explicit arithmetic variants (level: unclamped no-force, shifted direct-momentum feq; channel: uniform OneStep arithmetic), selected at compile time by BLOCK_ROOT_BC; text moved verbatim, PTX parity pending. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
48 lines
1.7 KiB
Plaintext
48 lines
1.7 KiB
Plaintext
// CelerisLab/lbm/kernels/blocked.cu
|
|
// One fixed-size blocked level (lbm/blocks.py layout), specialized at compile
|
|
// time for periodic/fine, slot/reservoir or channel stepping. Separate
|
|
// compilation entry: NX, NY are the block window including halo, so index_f
|
|
// and linear_index address one block; blockIdx.z selects the block, whose
|
|
// populations start at b*NQ*TOTAL_CELLS (block-contiguous, Q-major inside).
|
|
#include <stdint.h>
|
|
#include <math.h>
|
|
#include "config.h"
|
|
#include "core/precision.cuh"
|
|
#include "core/descriptors.cuh"
|
|
#include "core/layout.cuh"
|
|
#include "core/params.cuh"
|
|
#include "core/flags.cuh"
|
|
#include "core/obs.cuh"
|
|
#include "core/cell_kind.cuh"
|
|
#include "operators/macro.cuh"
|
|
#include "operators/collision_srt.cuh"
|
|
#if COLLISION_MODEL == 2
|
|
#include "operators/collision_mrt.cuh"
|
|
#endif
|
|
#include "streaming/pull_double_buffer.cuh"
|
|
#include "boundary/curved_boundary.cuh"
|
|
|
|
#if DIM != 2 || NQ != 9 || (COLLISION_MODEL != 0 && COLLISION_MODEL != 2) || STORE_PRECISION != 0 || USE_LES || STREAMING_MODEL != 0
|
|
#error "Blocks require FP32 D2Q9 SRT or MRT double buffers without LES"
|
|
#endif
|
|
#ifndef BLOCK_ROOT_BC
|
|
#error "Blocks require a generated BLOCK_ROOT_BC mode"
|
|
#elif BLOCK_ROOT_BC < 0 || BLOCK_ROOT_BC > 2
|
|
#error "BLOCK_ROOT_BC must be 0, 1 or 2"
|
|
#endif
|
|
|
|
#if BLOCK_ROOT_BC == 1
|
|
#include "boundary/block_wall.cuh"
|
|
#endif
|
|
#include "operators/block_collision.cuh"
|
|
|
|
// Kernels, in definition order: transfers, boundary staging, then the one full
|
|
// step selected for this module (BlockStep, or BlockChannelStep for a channel root).
|
|
#include "step/block_transfer.cu"
|
|
#include "step/block_boundary.cu"
|
|
#if BLOCK_ROOT_BC != 2
|
|
#include "step/block_step.cu"
|
|
#else
|
|
#include "step/block_channel.cu"
|
|
#endif
|