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