/** The fluid solver's bricks, which the solve runs over (fluid-allocation.wgsl allocateBricks). */ export interface PressureBricks { /** The computing bricks: a count, then one brick id each. */ list: GPUBuffer; /** The bricks zeroed this step: a count, then a brick id and its page each. */ zeroed: GPUBuffer; /** Indirect dispatch sizes: 8x4x4 tiles of the listed bricks, one workgroup per listed * brick, one per eight listed bricks, and one per zeroed brick. */ dispatch: GPUBuffer; offsets: { tiles: number; octets: number; zeroed: number; coarse: number[]; }; /** Each slot's solid cells (solids.wgsl). */ solids: GPUBuffer; /** The tile directory's textures (tiles.wgsl): tile records and their hash, and each * brick's entry and record. */ directory: { tiles: GPUTexture; table: GPUTexture; entries: GPUTexture; bricks: GPUTexture; }; /** Tile slots: brick ids are 64 per tile slot. */ tiles: number; /** Slots of the brick pools. */ slots: number; } /** * Geometric multigrid on the bricks: weighted-Jacobi smoothing, residual restriction, * trilinear correction. Brick levels coarsen the velocity grid down to 2³ cells; * three tile levels then coarsen the 4x4x4 bricks, only where storage exists. */ export declare class PressureSolver { private device; private uniform; private pipelines; private groups; private uniforms; private plans; /** Coarse levels; level 0's pressure and right-hand side are the caller's. */ private levels; private fineTopology?; /** Storage that follows the pool's slots, and storage that follows the tile slots. */ private brickStorage; private tileStorage; private ids; private nextId; private geometryDirty; private bricks?; private tiles; private readonly brickLevels; private readonly bottom; private readonly cells; private constructor(); static create(device: GPUDevice, uniform: GPUBuffer, velocityCells?: number): Promise; /** Call after the colliders changed, before their solid cells are redrawn. */ invalidateGeometry(): void; /** The bricks after the tiles changed or the pool grew. Storage follows the slots and * the tile slots, and every brick's topology is rebuilt on the next solve. */ setBricks(bricks: PressureBricks): void; /** Forget bind groups, dimensions and command plans; topology is rebuilt on the next solve. */ private resetPlans; /** A storage buffer of `bytes`, kept in `owner`. */ private storage; /** Two pressures and a right-hand side in half precision, and one flag byte per cell. */ private level; private allocateBricks; private allocateTiles; /** GPU memory this solver owns: coarse values, all topology and dispatch uniforms. */ get memoryBytes(): number; private id; /** Per dispatch: input, output and coarse level, bottom iterations, then the brick ids * and how the brick list is read, and the tile slots (pressure.wgsl Dimensions). */ private dimensions; /** `stride` reads the brick list: 1 for the listed bricks, 2 for the zeroed ones, 0 for * every brick id. */ private prepare; private topology; /** Topology of every slotted brick and every tile, after the geometry or the bricks * changed. */ private buildTopology; /** The commands of `cycles` V-cycles. The first finest iterate is initialized from * zero directly; coarse correction levels are initialized by restriction. */ private plan; /** * Solve for the finest level's pressure from `rhs`, both in slot order: `p` is a * ping-pong pair. The first iterate is computed from a zero guess without reading * previous pressure. Returns the solution. */ solve(encoder: GPUCommandEncoder, p: [GPUBuffer, GPUBuffer], rhs: GPUBuffer, cycles: number): GPUBuffer; dispose(): void; }