Skip to content

Commit

Permalink
WIP: Fixing unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tbetcke committed Dec 18, 2024
1 parent 8bfb0a0 commit 9ab474c
Show file tree
Hide file tree
Showing 13 changed files with 1,363 additions and 1,251 deletions.
11 changes: 7 additions & 4 deletions benches/assembly_benchmark.rs
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
use bempp::boundary_assemblers::BoundaryAssemblerOptions;
use bempp::function::DefaultFunctionSpace;
use bempp::function::FunctionSpace;
use bempp::function::SerialFunctionSpace;
use bempp::laplace::assembler::single_layer;
use criterion::{black_box, criterion_group, criterion_main, Criterion};
use mpi;
use ndelement::ciarlet::LagrangeElementFamily;
use ndelement::types::{Continuity, ReferenceCellType};
use ndgrid::shapes::regular_sphere;

pub fn assembly_parts_benchmark(c: &mut Criterion) {
let mut group = c.benchmark_group("assembly");
group.sample_size(20);

let _ = mpi::initialize().unwrap();
let comm = mpi::topology::SimpleCommunicator::self_comm();

for i in 3..5 {
let grid = regular_sphere(i);
let grid = bempp::shapes::regular_sphere(i, 1, &comm);
let element = LagrangeElementFamily::<f64>::new(0, Continuity::Discontinuous);

let space = SerialFunctionSpace::new(&grid, &element);
let space = DefaultFunctionSpace::new(&grid, &element);
let mut options = BoundaryAssemblerOptions::default();
options.set_regular_quadrature_degree(ReferenceCellType::Triangle, 16);
options.set_singular_quadrature_degree(
Expand Down
9 changes: 5 additions & 4 deletions examples/assembly.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
use bempp::boundary_assemblers::BoundaryAssemblerOptions;
use bempp::function::SerialFunctionSpace;
use bempp::function::DefaultFunctionSpace;
use bempp::laplace::assembler::single_layer;
use ndelement::ciarlet::LagrangeElementFamily;
use ndelement::types::{Continuity, ReferenceCellType};
use ndgrid::shapes::regular_sphere;
use rlst::{RandomAccessByRef, Shape};

fn main() {
// Create a grid, family of elements, and function space
let grid = regular_sphere(0);
let _ = mpi::initialize().unwrap();
let comm = mpi::topology::SimpleCommunicator::self_comm();
let grid = bempp::shapes::regular_sphere(0, 1, &comm);
let element = LagrangeElementFamily::<f64>::new(1, Continuity::Standard);
let space = SerialFunctionSpace::new(&grid, &element);
let space = DefaultFunctionSpace::new(&grid, &element);

// Adjust the quadrature degree for non-singular integrals on a triangle.
// This makes the integrals use a quadrature rule with 16 points
Expand Down
Loading

0 comments on commit 9ab474c

Please sign in to comment.