rtx-cfd embedded3 item 1: the Poisson core as poisson/{problem, hierarchy, pcg} (≤ 385 lines each; the periodic wrap built once into neighbour arrays); gate 1 HELD: nz=1 bit-identical to the 2D solver (lex + red-black, cached/uncached, iterations) and every extrusion case bit-identical to the three_d oracle, planes within 1.4e-11
CI / Format Check (push) Failing after 3s
Performance Benchmarks / Run Benchmarks (push) Failing after 4s
CI / Build (ubuntu-latest) (push) Failing after 3s
Documentation / Build API Documentation (push) Failing after 4s
Documentation / Build User Guide (push) Successful in 6s
CI / Clippy Check (push) Failing after 27s
CI / Build CPU-Only (Explicit) (push) Failing after 1m10s
CI / Build (macos-latest) (push) Canceled after 0s
CI / Python Bindings (maturin) (macos-latest) (push) Canceled after 0s
CI / Test (macos-latest) (push) Canceled after 0s
CI / Test (ubuntu-latest) (push) Canceled after 0s
CI / Python Bindings (maturin) (ubuntu-latest) (push) Canceled after 0s
CI / WASM Build + Size Check (push) Canceled after 0s
CI / Distributed Training Tests (push) Canceled after 0s
CI / CI Success (push) Canceled after 0s
CI / Format Check (push) Failing after 3s
Performance Benchmarks / Run Benchmarks (push) Failing after 4s
CI / Build (ubuntu-latest) (push) Failing after 3s
Documentation / Build API Documentation (push) Failing after 4s
Documentation / Build User Guide (push) Successful in 6s
CI / Clippy Check (push) Failing after 27s
CI / Build CPU-Only (Explicit) (push) Failing after 1m10s
CI / Build (macos-latest) (push) Canceled after 0s
CI / Python Bindings (maturin) (macos-latest) (push) Canceled after 0s
CI / Test (macos-latest) (push) Canceled after 0s
CI / Test (ubuntu-latest) (push) Canceled after 0s
CI / Python Bindings (maturin) (ubuntu-latest) (push) Canceled after 0s
CI / WASM Build + Size Check (push) Canceled after 0s
CI / Distributed Training Tests (push) Canceled after 0s
CI / CI Success (push) Canceled after 0s
Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
13d30c3ce6
commit
6526a3bd38
@@ -0,0 +1,83 @@
|
||||
//! The uniform Cartesian grid and its index conventions.
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||
pub struct Grid {
|
||||
pub nx: usize,
|
||||
pub ny: usize,
|
||||
pub nz: usize,
|
||||
pub dx: f64,
|
||||
pub dy: f64,
|
||||
pub dz: f64,
|
||||
}
|
||||
|
||||
impl Grid {
|
||||
/// Cubic cells of spacing `h`.
|
||||
#[must_use]
|
||||
pub fn cubic(nx: usize, ny: usize, nz: usize, h: f64) -> Self {
|
||||
Self {
|
||||
nx,
|
||||
ny,
|
||||
nz,
|
||||
dx: h,
|
||||
dy: h,
|
||||
dz: h,
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
#[must_use]
|
||||
pub fn cells(&self) -> usize {
|
||||
self.nx * self.ny * self.nz
|
||||
}
|
||||
|
||||
#[inline]
|
||||
#[must_use]
|
||||
pub fn cell(&self, k: usize, j: usize, i: usize) -> usize {
|
||||
(k * self.ny + j) * self.nx + i
|
||||
}
|
||||
|
||||
/// `(k, j, i)` of a cell index.
|
||||
#[inline]
|
||||
#[must_use]
|
||||
pub fn kji(&self, idx: usize) -> (usize, usize, usize) {
|
||||
let nxy = self.nx * self.ny;
|
||||
(idx / nxy, (idx % nxy) / self.nx, idx % self.nx)
|
||||
}
|
||||
|
||||
/// The u face west of cell `(k, j, i)`; `i = nx` is the east face of the last cell.
|
||||
#[inline]
|
||||
#[must_use]
|
||||
pub fn uface(&self, k: usize, j: usize, i: usize) -> usize {
|
||||
(k * self.ny + j) * (self.nx + 1) + i
|
||||
}
|
||||
|
||||
#[inline]
|
||||
#[must_use]
|
||||
pub fn vface(&self, k: usize, j: usize, i: usize) -> usize {
|
||||
(k * (self.ny + 1) + j) * self.nx + i
|
||||
}
|
||||
|
||||
#[inline]
|
||||
#[must_use]
|
||||
pub fn wface(&self, k: usize, j: usize, i: usize) -> usize {
|
||||
(k * self.ny + j) * self.nx + i
|
||||
}
|
||||
|
||||
#[inline]
|
||||
#[must_use]
|
||||
pub fn n_ufaces(&self) -> usize {
|
||||
(self.nx + 1) * self.ny * self.nz
|
||||
}
|
||||
|
||||
#[inline]
|
||||
#[must_use]
|
||||
pub fn n_vfaces(&self) -> usize {
|
||||
self.nx * (self.ny + 1) * self.nz
|
||||
}
|
||||
|
||||
#[inline]
|
||||
#[must_use]
|
||||
pub fn n_wfaces(&self) -> usize {
|
||||
self.nx * self.ny * (self.nz + 1)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user