diff --git a/sbp/Cargo.toml b/sbp/Cargo.toml index 165f71f..0083e10 100644 --- a/sbp/Cargo.toml +++ b/sbp/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Magnus Ulimoen "] edition = "2018" [dependencies] -ndarray = { version = "0.13.0", features = ["approx"] } +ndarray = { version = "0.13.1", features = ["approx"] } approx = "0.3.2" packed_simd = "0.3.3" rayon = { version = "1.3.0", optional = true } diff --git a/sbp/src/euler.rs b/sbp/src/euler.rs index 57c3a23..113d99b 100644 --- a/sbp/src/euler.rs +++ b/sbp/src/euler.rs @@ -261,15 +261,8 @@ impl Field { ArrayViewMut2, ArrayViewMut2, ) { - let mut iter = self.0.outer_iter_mut(); - - let rho = iter.next().unwrap(); - let rhou = iter.next().unwrap(); - let rhov = iter.next().unwrap(); - let e = iter.next().unwrap(); - assert_eq!(iter.next(), None); - - (rho, rhou, rhov, e) + self.0 + .multi_slice_mut((s![0, .., ..], s![1, .., ..], s![2, .., ..], s![3, .., ..])) } pub fn north(&self) -> ArrayView2 { diff --git a/sbp/src/maxwell.rs b/sbp/src/maxwell.rs index 67cdf6a..dcc2676 100644 --- a/sbp/src/maxwell.rs +++ b/sbp/src/maxwell.rs @@ -73,14 +73,8 @@ impl Field { ArrayViewMut2, ArrayViewMut2, ) { - let mut iter = self.0.outer_iter_mut(); - - let ex = iter.next().unwrap(); - let hz = iter.next().unwrap(); - let ey = iter.next().unwrap(); - assert_eq!(iter.next(), None); - - (ex, hz, ey) + self.0 + .multi_slice_mut((s![0, .., ..], s![1, .., ..], s![2, .., ..])) } }