Skip to main content

fgrad

Function fgrad 

Source
pub fn fgrad(
    x: &[f64],
    nx: usize,
    ny: usize,
    nz: usize,
    vsx: f64,
    vsy: f64,
    vsz: f64,
) -> (Vec<f64>, Vec<f64>, Vec<f64>)
Expand description

Forward difference gradient operator

Computes forward differences along each axis with periodic boundary conditions.

§Arguments

  • x - Input array (nx * ny * nz)
  • nx, ny, nz - Array dimensions
  • vsx, vsy, vsz - Voxel sizes

§Returns

Tuple of (gx, gy, gz) gradient components