Skip to content

Commit 3e3f71a

Browse files
committed
Added test script for spaces
1 parent f8eccbc commit 3e3f71a

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

examples/test_spaces.rs

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
//! Test function space generation
2+
3+
use std::time::Instant;
4+
5+
use mpi::traits::Communicator;
6+
use ndelement::ciarlet::LagrangeElementFamily;
7+
use ndgrid::traits::ParallelGrid;
8+
9+
fn main() {
10+
// We first evaluate the operator on a parallel grid
11+
12+
let universe = mpi::initialize().unwrap();
13+
let world = universe.world();
14+
let rank = world.rank();
15+
16+
let refinement_level = 9;
17+
18+
let grid = bempp::shapes::regular_sphere::<f64, _>(refinement_level, 1, &world);
19+
if rank == 0 {
20+
println!(
21+
"Number of elements: {}",
22+
grid.cell_layout().number_of_global_indices()
23+
);
24+
}
25+
26+
// Get the number of cells in the grid.
27+
28+
let now = Instant::now();
29+
let _space = bempp::function::FunctionSpace::new(
30+
&grid,
31+
&LagrangeElementFamily::<f64>::new(1, ndelement::types::Continuity::Standard),
32+
);
33+
let elapsed = now.elapsed();
34+
35+
if rank == 0 {
36+
println!("Function space generated in {} ms", elapsed.as_millis());
37+
}
38+
}

0 commit comments

Comments
 (0)