fix bench+sparse builds
This commit is contained in:
parent
53acd300ce
commit
ddfddbd33f
|
@ -9,13 +9,19 @@ fn advance_system<SBP: SbpOperator2d>(universe: &mut System<SBP>, n: usize) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn advance_system_upwind<UO: UpwindOperator2d>(universe: &mut System<UO>, n: usize) {
|
fn advance_system_upwind<UO: SbpOperator2d + UpwindOperator2d>(
|
||||||
|
universe: &mut System<UO>,
|
||||||
|
n: usize,
|
||||||
|
) {
|
||||||
for _ in 0..n {
|
for _ in 0..n {
|
||||||
universe.advance_upwind(1.0 / 40.0 * 0.2);
|
universe.advance_upwind(1.0 / 40.0 * 0.2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn advance_embedded<UO: UpwindOperator2d>(universe: &mut System<UO>, embedded: bool) {
|
fn advance_embedded<UO: SbpOperator2d + UpwindOperator2d>(
|
||||||
|
universe: &mut System<UO>,
|
||||||
|
embedded: bool,
|
||||||
|
) {
|
||||||
let dt = 0.2 / std::cmp::max(universe.nx(), universe.ny()) as Float;
|
let dt = 0.2 / std::cmp::max(universe.nx(), universe.ny()) as Float;
|
||||||
let t = 1.0;
|
let t = 1.0;
|
||||||
if embedded {
|
if embedded {
|
||||||
|
|
|
@ -9,7 +9,10 @@ fn advance_system<SBP: SbpOperator2d>(universe: &mut System<SBP>, n: usize) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn advance_system_upwind<UO: UpwindOperator2d>(universe: &mut System<UO>, n: usize) {
|
fn advance_system_upwind<UO: SbpOperator2d + UpwindOperator2d>(
|
||||||
|
universe: &mut System<UO>,
|
||||||
|
n: usize,
|
||||||
|
) {
|
||||||
for _ in 0..n {
|
for _ in 0..n {
|
||||||
universe.advance_upwind(0.01);
|
universe.advance_upwind(0.01);
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,6 +68,7 @@ fn baseline_sparse() {
|
||||||
let _res = Array2::<Float>::zeros((W, H));
|
let _res = Array2::<Float>::zeros((W, H));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "sparse")]
|
||||||
fn upwind4_diffxi_sparse() {
|
fn upwind4_diffxi_sparse() {
|
||||||
let dx = operators::Upwind4.op_xi().diff_matrix(W);
|
let dx = operators::Upwind4.op_xi().diff_matrix(W);
|
||||||
let dx = sprs::kronecker_product(sprs::CsMat::eye(H).view(), dx.view());
|
let dx = sprs::kronecker_product(sprs::CsMat::eye(H).view(), dx.view());
|
||||||
|
|
Loading…
Reference in New Issue