Update hdf5/ndarray
This commit is contained in:
parent
86275d2c2e
commit
d16b274fe0
|
@ -11,7 +11,7 @@ expensive_tests = []
|
|||
serde1 = ["serde", "arrayvec/serde"]
|
||||
|
||||
[dependencies]
|
||||
ndarray = "0.14.0"
|
||||
ndarray = "0.15.0"
|
||||
sbp = { path = "../sbp" }
|
||||
arrayvec = "0.6.0"
|
||||
serde = { version = "1.0.115", default-features = false, optional = true, features = ["derive"] }
|
||||
|
|
|
@ -227,14 +227,14 @@ impl Field {
|
|||
|
||||
pub(crate) fn slice<Do: Dimension>(
|
||||
&self,
|
||||
info: &ndarray::SliceInfo<[ndarray::SliceOrIndex; 3], Do>,
|
||||
info: ndarray::SliceInfo<[ndarray::SliceInfoElem; 3], ndarray::Ix3, Do>,
|
||||
) -> ArrayView<Float, Do> {
|
||||
self.0.slice(info)
|
||||
}
|
||||
|
||||
pub(crate) fn slice_mut<Do: Dimension>(
|
||||
&mut self,
|
||||
info: &ndarray::SliceInfo<[ndarray::SliceOrIndex; 3], Do>,
|
||||
info: ndarray::SliceInfo<[ndarray::SliceInfoElem; 3], ndarray::Ix3, Do>,
|
||||
) -> ArrayViewMut<Float, Do> {
|
||||
self.0.slice_mut(info)
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ authors = ["Magnus Ulimoen <magnus@ulimoen.dev>"]
|
|||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
ndarray = { version = "0.14.0", default-features = false }
|
||||
ndarray = { version = "0.15.0", default-features = false }
|
||||
plotters = { version = "0.3.0", default-features = false, features = ["svg_backend", "line_series", "point_series"] }
|
||||
sbp = { path = "../sbp" }
|
||||
json5 = { version = "0.2.8", optional = true }
|
||||
|
|
|
@ -7,7 +7,7 @@ edition = "2018"
|
|||
|
||||
[dependencies]
|
||||
sbp = { path = "../sbp", features = ["sparse"] }
|
||||
ndarray = "0.14.0"
|
||||
ndarray = "0.15.0"
|
||||
plotters = { version = "0.3.0", default-features = false, features = ["bitmap_gif", "bitmap_backend", "line_series"] }
|
||||
sprs = { version = "0.10.0", default-features = false }
|
||||
integrate = { path = "../utils/integrate" }
|
||||
|
|
|
@ -11,9 +11,6 @@ struct Field(Array1<Float>);
|
|||
impl integrate::Integrable for Field {
|
||||
type State = Array1<Float>;
|
||||
type Diff = Array1<Float>;
|
||||
fn assign(s: &mut Self::State, o: &Self::State) {
|
||||
s.assign(o)
|
||||
}
|
||||
fn scaled_add(s: &mut Self::State, o: &Self::Diff, scale: Float) {
|
||||
s.scaled_add(scale, o)
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ edition = "2018"
|
|||
sparse = ["sbp/sparse", "sprs"]
|
||||
|
||||
[dependencies]
|
||||
ndarray = "0.14.0"
|
||||
ndarray = "0.15.0"
|
||||
sbp = { path = "../sbp" }
|
||||
sprs = { version = "0.10.0", optional = true, default-features = false }
|
||||
integrate = { path = "../utils/integrate" }
|
||||
|
|
|
@ -44,14 +44,14 @@ impl Field {
|
|||
|
||||
pub(crate) fn slice<Do: Dimension>(
|
||||
&self,
|
||||
info: &ndarray::SliceInfo<[ndarray::SliceOrIndex; 3], Do>,
|
||||
info: ndarray::SliceInfo<[ndarray::SliceInfoElem; 3], ndarray::Ix3, Do>,
|
||||
) -> ArrayView<Float, Do> {
|
||||
self.0.slice(info)
|
||||
}
|
||||
|
||||
pub(crate) fn slice_mut<Do: Dimension>(
|
||||
&mut self,
|
||||
info: &ndarray::SliceInfo<[ndarray::SliceOrIndex; 3], Do>,
|
||||
info: ndarray::SliceInfo<[ndarray::SliceInfoElem; 3], ndarray::Ix3, Do>,
|
||||
) -> ArrayViewMut<Float, Do> {
|
||||
self.0.slice_mut(info)
|
||||
}
|
||||
|
@ -519,10 +519,10 @@ fn SAT_characteristics<SBP: SbpOperator2d>(
|
|||
};
|
||||
for ((((mut k, v), g), &kx), &ky) in k
|
||||
.slice_mut(s![.., .., nx - 1])
|
||||
.gencolumns_mut()
|
||||
.columns_mut()
|
||||
.into_iter()
|
||||
.zip(y.slice(s![.., .., nx - 1]).gencolumns())
|
||||
.zip(g.gencolumns())
|
||||
.zip(y.slice(s![.., .., nx - 1]).columns())
|
||||
.zip(g.columns())
|
||||
.zip(metrics.detj_dxi_dx().slice(s![.., nx - 1]))
|
||||
.zip(metrics.detj_dxi_dy().slice(s![.., nx - 1]))
|
||||
{
|
||||
|
@ -557,10 +557,10 @@ fn SAT_characteristics<SBP: SbpOperator2d>(
|
|||
};
|
||||
for ((((mut k, v), g), &kx), &ky) in k
|
||||
.slice_mut(s![.., .., 0])
|
||||
.gencolumns_mut()
|
||||
.columns_mut()
|
||||
.into_iter()
|
||||
.zip(y.slice(s![.., .., 0]).gencolumns())
|
||||
.zip(g.gencolumns())
|
||||
.zip(y.slice(s![.., .., 0]).columns())
|
||||
.zip(g.columns())
|
||||
.zip(metrics.detj_dxi_dx().slice(s![.., 0]))
|
||||
.zip(metrics.detj_dxi_dy().slice(s![.., 0]))
|
||||
{
|
||||
|
@ -600,10 +600,10 @@ fn SAT_characteristics<SBP: SbpOperator2d>(
|
|||
};
|
||||
for ((((mut k, v), g), &kx), &ky) in k
|
||||
.slice_mut(s![.., ny - 1, ..])
|
||||
.gencolumns_mut()
|
||||
.columns_mut()
|
||||
.into_iter()
|
||||
.zip(y.slice(s![.., ny - 1, ..]).gencolumns())
|
||||
.zip(g.gencolumns())
|
||||
.zip(y.slice(s![.., ny - 1, ..]).columns())
|
||||
.zip(g.columns())
|
||||
.zip(metrics.detj_deta_dx().slice(s![ny - 1, ..]))
|
||||
.zip(metrics.detj_deta_dy().slice(s![ny - 1, ..]))
|
||||
{
|
||||
|
@ -637,10 +637,10 @@ fn SAT_characteristics<SBP: SbpOperator2d>(
|
|||
};
|
||||
for ((((mut k, v), g), &kx), &ky) in k
|
||||
.slice_mut(s![.., 0, ..])
|
||||
.gencolumns_mut()
|
||||
.columns_mut()
|
||||
.into_iter()
|
||||
.zip(y.slice(s![.., 0, ..]).gencolumns())
|
||||
.zip(g.gencolumns())
|
||||
.zip(y.slice(s![.., 0, ..]).columns())
|
||||
.zip(g.columns())
|
||||
.zip(metrics.detj_deta_dx().slice(s![0, ..]))
|
||||
.zip(metrics.detj_deta_dy().slice(s![0, ..]))
|
||||
{
|
||||
|
|
|
@ -8,11 +8,11 @@ edition = "2018"
|
|||
[dependencies]
|
||||
sbp = { path = "../sbp", features = ["serde1"] }
|
||||
euler = { path = "../euler", features = ["serde1"] }
|
||||
hdf5 = "0.7.0"
|
||||
hdf5 = "0.8.0"
|
||||
integrate = { path = "../utils/integrate" }
|
||||
rayon = "1.3.0"
|
||||
indicatif = "0.17.0-beta.1"
|
||||
ndarray = { version = "0.14.0", features = ["serde"] }
|
||||
ndarray = { version = "0.15.0", features = ["serde"] }
|
||||
serde = { version = "1.0.115", features = ["derive"] }
|
||||
json5 = "0.3.0"
|
||||
indexmap = { version = "1.5.2", features = ["serde-1"] }
|
||||
|
|
|
@ -37,9 +37,9 @@ impl BaseSystem {
|
|||
let output = hdf5::File::create(output).unwrap();
|
||||
output
|
||||
.new_dataset::<u64>()
|
||||
.resizable(true)
|
||||
.shape((0..,))
|
||||
.chunk((1,))
|
||||
.create("t", (0,))
|
||||
.create("t")
|
||||
.unwrap();
|
||||
Self {
|
||||
names,
|
||||
|
@ -92,8 +92,9 @@ impl BaseSystem {
|
|||
let add_dim = |name| {
|
||||
g.new_dataset::<Float>()
|
||||
.chunk((grid.ny(), grid.nx()))
|
||||
.gzip(9)
|
||||
.create(name, (grid.ny(), grid.nx()))
|
||||
.deflate(9)
|
||||
.shape((grid.ny(), grid.nx()))
|
||||
.create(name)
|
||||
};
|
||||
let xds = add_dim("x").unwrap();
|
||||
xds.write(grid.x()).unwrap();
|
||||
|
@ -102,11 +103,11 @@ impl BaseSystem {
|
|||
|
||||
let add_var = |name| {
|
||||
g.new_dataset::<Float>()
|
||||
.gzip(3)
|
||||
.shuffle(true)
|
||||
.shuffle()
|
||||
.deflate(3)
|
||||
.chunk((1, grid.ny(), grid.nx()))
|
||||
.resizable(true)
|
||||
.create(name, (0, grid.ny(), grid.nx()))
|
||||
.shape((0.., grid.ny(), grid.nx()))
|
||||
.create(name)
|
||||
};
|
||||
add_var("rho").unwrap();
|
||||
add_var("rhou").unwrap();
|
||||
|
@ -261,8 +262,9 @@ impl BaseSystem {
|
|||
let add_dim = |name| {
|
||||
g.new_dataset::<Float>()
|
||||
.chunk((grid.ny(), grid.nx()))
|
||||
.gzip(9)
|
||||
.create(name, (grid.ny(), grid.nx()))
|
||||
.deflate(9)
|
||||
.shape((grid.ny(), grid.nx()))
|
||||
.create(name)
|
||||
};
|
||||
let xds = add_dim("x").unwrap();
|
||||
xds.write(grid.x()).unwrap();
|
||||
|
@ -271,11 +273,11 @@ impl BaseSystem {
|
|||
|
||||
let add_var = |name| {
|
||||
g.new_dataset::<Float>()
|
||||
.gzip(3)
|
||||
.shuffle(true)
|
||||
.shuffle()
|
||||
.deflate(3)
|
||||
.chunk((1, grid.ny(), grid.nx()))
|
||||
.resizable(true)
|
||||
.create(name, (0, grid.ny(), grid.nx()))
|
||||
.shape((0.., grid.ny(), grid.nx()))
|
||||
.create(name)
|
||||
};
|
||||
add_var("rho").unwrap();
|
||||
add_var("rhou").unwrap();
|
||||
|
|
|
@ -5,7 +5,7 @@ authors = ["Magnus Ulimoen <magnus@ulimoen.dev>"]
|
|||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
ndarray = { version = "0.14.0", features = ["approx"] }
|
||||
ndarray = { version = "0.15.0", features = ["approx"] }
|
||||
approx = "0.4.0"
|
||||
sprs = { version = "0.10.0", optional = true, default-features = false }
|
||||
serde = { version = "1.0.115", optional = true, default-features = false, features = ["derive"] }
|
||||
|
|
|
@ -5,7 +5,7 @@ authors = ["Magnus Ulimoen <magnus@ulimoen.dev>"]
|
|||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
ndarray = "0.14.0"
|
||||
ndarray = "0.15.0"
|
||||
sbp = { path = "../sbp" }
|
||||
log = "0.4.8"
|
||||
integrate = { path = "../utils/integrate" }
|
||||
|
|
|
@ -12,7 +12,7 @@ wasm-bindgen = "0.2.63"
|
|||
console_error_panic_hook = "0.1.6"
|
||||
wee_alloc = "0.4.5"
|
||||
sbp = { path = "../sbp", features = ["f32"] }
|
||||
ndarray = "0.14.0"
|
||||
ndarray = "0.15.0"
|
||||
euler = { path = "../euler" }
|
||||
maxwell = { path = "../maxwell" }
|
||||
shallow-water = { path = "../shallow_water" }
|
||||
|
|
Loading…
Reference in New Issue