pub struct FlatMesh {Show 17 fields
pub n_cells: usize,
pub cell_volume: Vec<Float>,
pub cell_center_x: Vec<Float>,
pub cell_center_y: Vec<Float>,
pub cell_center_z: Vec<Float>,
pub n_faces: usize,
pub face_owner: Vec<u32>,
pub face_neighbor: Vec<i32>,
pub face_area_x: Vec<Float>,
pub face_area_y: Vec<Float>,
pub face_area_z: Vec<Float>,
pub face_centroid_x: Vec<Float>,
pub face_centroid_y: Vec<Float>,
pub face_centroid_z: Vec<Float>,
pub face_surface_id: Vec<i32>,
pub cell_block_id: Vec<u32>,
pub cell_local_id: Vec<u32>,
}Expand description
Flat mesh representation for finite-volume GPU solvers.
All arrays are contiguous and indexed by a single integer ID.
Cell arrays have length n_cells; face arrays have length n_faces.
This layout eliminates all structured (i,j,k) indexing and multi-block pointer chains. The data is designed for coalesced GPU memory access: a warp of threads processing consecutive face IDs will read consecutive memory locations.
Fields§
§n_cells: usizeTotal number of cells across all blocks.
cell_volume: Vec<Float>Cell volume computed via the divergence-theorem method. Units: length^3. Must be positive for valid meshes.
cell_center_x: Vec<Float>X-coordinate of cell centroid (arithmetic mean of 8 corner nodes).
cell_center_y: Vec<Float>Y-coordinate of cell centroid.
cell_center_z: Vec<Float>Z-coordinate of cell centroid.
n_faces: usizeTotal number of faces (interior + cross-block + boundary).
face_owner: Vec<u32>Owner cell for each face. The face area vector points away from
the owner toward the neighbor. Always a valid cell index in [0, n_cells).
face_neighbor: Vec<i32>Neighbor cell for each face. For interior and cross-block faces this is
a valid cell index. For boundary faces this is -1.
face_area_x: Vec<Float>X-component of face area vector (outward normal * area magnitude).
face_area_y: Vec<Float>Y-component of face area vector.
face_area_z: Vec<Float>Z-component of face area vector.
face_centroid_x: Vec<Float>X-coordinate of face centroid (arithmetic mean of the 4 corner nodes). Matches Fortran’s ccCoord face-centroid formula (M_ccMBMesh.F:2528-2530), used by the solver to place ghost cell centers via exact plane reflection rather than a cuboid V/|A| approximation.
face_centroid_y: Vec<Float>Y-coordinate of face centroid.
face_centroid_z: Vec<Float>Z-coordinate of face centroid.
face_surface_id: Vec<i32>Surface ID for boundary faces (used for BC assignment).
-1 for interior and cross-block faces.
cell_block_id: Vec<u32>Which original block each cell came from. Length = n_cells.
cell_local_id: Vec<u32>Local cell index within the original block. Length = n_cells.
To recover (i,j,k): use the block’s cell dimensions from the CellGraph.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FlatMesh
impl RefUnwindSafe for FlatMesh
impl Send for FlatMesh
impl Sync for FlatMesh
impl Unpin for FlatMesh
impl UnsafeUnpin for FlatMesh
impl UnwindSafe for FlatMesh
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more