rename project
This commit is contained in:
		@@ -1,6 +1,6 @@
 | 
			
		||||
use criterion::{black_box, criterion_group, criterion_main, Criterion};
 | 
			
		||||
use maxwell::operators::{SbpOperator, Upwind4, UpwindOperator, SBP4};
 | 
			
		||||
use maxwell::EulerSystem;
 | 
			
		||||
use sbp::operators::{SbpOperator, Upwind4, UpwindOperator, SBP4};
 | 
			
		||||
use sbp::EulerSystem;
 | 
			
		||||
 | 
			
		||||
fn advance_system<SBP: SbpOperator>(universe: &mut EulerSystem<SBP>, n: usize) {
 | 
			
		||||
    for _ in 0..n {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,21 +1,21 @@
 | 
			
		||||
use criterion::{black_box, criterion_group, criterion_main, Criterion};
 | 
			
		||||
use maxwell::operators::{SbpOperator, Upwind4, UpwindOperator, SBP4};
 | 
			
		||||
use maxwell::System;
 | 
			
		||||
use sbp::operators::{SbpOperator, Upwind4, UpwindOperator, SBP4};
 | 
			
		||||
use sbp::MaxwellSystem;
 | 
			
		||||
 | 
			
		||||
fn advance_system<SBP: SbpOperator>(universe: &mut System<SBP>, n: usize) {
 | 
			
		||||
fn advance_system<SBP: SbpOperator>(universe: &mut MaxwellSystem<SBP>, n: usize) {
 | 
			
		||||
    for _ in 0..n {
 | 
			
		||||
        universe.advance(0.01);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
fn advance_system_upwind<UO: UpwindOperator>(universe: &mut System<UO>, n: usize) {
 | 
			
		||||
fn advance_system_upwind<UO: UpwindOperator>(universe: &mut MaxwellSystem<UO>, n: usize) {
 | 
			
		||||
    for _ in 0..n {
 | 
			
		||||
        universe.advance_upwind(0.01);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
fn performance_benchmark(c: &mut Criterion) {
 | 
			
		||||
    let mut group = c.benchmark_group("System");
 | 
			
		||||
    let mut group = c.benchmark_group("MaxwellSystem");
 | 
			
		||||
    group.sample_size(25);
 | 
			
		||||
 | 
			
		||||
    let w = 40;
 | 
			
		||||
@@ -23,7 +23,8 @@ fn performance_benchmark(c: &mut Criterion) {
 | 
			
		||||
    let x = ndarray::Array2::from_shape_fn((h, w), |(_, i)| i as f32 / (w - 1) as f32);
 | 
			
		||||
    let y = ndarray::Array2::from_shape_fn((h, w), |(j, _)| j as f32 / (h - 1) as f32);
 | 
			
		||||
 | 
			
		||||
    let mut universe = System::<Upwind4>::new(w, h, x.as_slice().unwrap(), y.as_slice().unwrap());
 | 
			
		||||
    let mut universe =
 | 
			
		||||
        MaxwellSystem::<Upwind4>::new(w, h, x.as_slice().unwrap(), y.as_slice().unwrap());
 | 
			
		||||
    group.bench_function("advance", |b| {
 | 
			
		||||
        b.iter(|| {
 | 
			
		||||
            universe.set_gaussian(0.5, 0.5);
 | 
			
		||||
@@ -31,7 +32,8 @@ fn performance_benchmark(c: &mut Criterion) {
 | 
			
		||||
        })
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    let mut universe = System::<Upwind4>::new(w, h, x.as_slice().unwrap(), y.as_slice().unwrap());
 | 
			
		||||
    let mut universe =
 | 
			
		||||
        MaxwellSystem::<Upwind4>::new(w, h, x.as_slice().unwrap(), y.as_slice().unwrap());
 | 
			
		||||
    group.bench_function("advance_upwind", |b| {
 | 
			
		||||
        b.iter(|| {
 | 
			
		||||
            universe.set_gaussian(0.5, 0.5);
 | 
			
		||||
@@ -39,7 +41,8 @@ fn performance_benchmark(c: &mut Criterion) {
 | 
			
		||||
        })
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    let mut universe = System::<SBP4>::new(w, h, x.as_slice().unwrap(), y.as_slice().unwrap());
 | 
			
		||||
    let mut universe =
 | 
			
		||||
        MaxwellSystem::<SBP4>::new(w, h, x.as_slice().unwrap(), y.as_slice().unwrap());
 | 
			
		||||
    group.bench_function("advance_trad4", |b| {
 | 
			
		||||
        b.iter(|| {
 | 
			
		||||
            universe.set_gaussian(0.5, 0.5);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user