fix bench+sparse builds

This commit is contained in:
Magnus Ulimoen 2021-01-25 23:58:50 +01:00
parent 53acd300ce
commit ddfddbd33f
3 changed files with 13 additions and 3 deletions

View File

@ -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 {
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 t = 1.0;
if embedded {

View File

@ -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 {
universe.advance_upwind(0.01);
}

View File

@ -68,6 +68,7 @@ fn baseline_sparse() {
let _res = Array2::<Float>::zeros((W, H));
}
#[cfg(feature = "sparse")]
fn upwind4_diffxi_sparse() {
let dx = operators::Upwind4.op_xi().diff_matrix(W);
let dx = sprs::kronecker_product(sprs::CsMat::eye(H).view(), dx.view());