From 323ac2f1ee37fe72b92ecca94ce301c4ababc908 Mon Sep 17 00:00:00 2001 From: Matthew Scroggs Date: Fri, 23 Jan 2026 16:00:03 +0000 Subject: [PATCH 1/2] use values from FEniCS rather than half of values from Bempp-cl --- ndfunctionspace/examples/test_mass_matrix.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ndfunctionspace/examples/test_mass_matrix.rs b/ndfunctionspace/examples/test_mass_matrix.rs index a7374b3..706d95d 100644 --- a/ndfunctionspace/examples/test_mass_matrix.rs +++ b/ndfunctionspace/examples/test_mass_matrix.rs @@ -1,4 +1,4 @@ -//! Test values in mass matrices against values computing using Bempp +//! Test values in mass matrices against values computing using Bempp--cl and FEniCS use approx::assert_relative_eq; use ndelement::{ @@ -69,6 +69,7 @@ fn test_lagrange_mass_matrix() { } } + // Compare matrix entries to values from Bempp for i in 0..6 { assert_relative_eq!(mass_matrix[[i, i]], 0.5773502691896255, epsilon = 1e-10); } @@ -146,11 +147,11 @@ fn test_rt_mass_matrix() { } } - // The values from Bempp-cl here are divided by 2 as the basis functions in -cl are not scaled by edge length + // Compare matrix entries to FEniCS for i in 0..12 { assert_relative_eq!( mass_matrix[[i, i]], - 0.9622504486493761 / 2.0, + 0.4811252243246884, epsilon = 1e-10 ); } @@ -159,7 +160,7 @@ fn test_rt_mass_matrix() { if i != j && mass_matrix[[i, j]].abs() > 0.001 { assert_relative_eq!( mass_matrix[[i, j]].abs(), - 0.09622504486493733 / 2.0, + 0.0481125224324689, epsilon = 1e-10 ); } From a298fca9eab130bd7bfbbaf9bfe9e6617905c0ef Mon Sep 17 00:00:00 2001 From: Matthew Scroggs Date: Fri, 23 Jan 2026 16:07:16 +0000 Subject: [PATCH 2/2] fmt --- ndfunctionspace/examples/test_mass_matrix.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ndfunctionspace/examples/test_mass_matrix.rs b/ndfunctionspace/examples/test_mass_matrix.rs index 706d95d..44ef00f 100644 --- a/ndfunctionspace/examples/test_mass_matrix.rs +++ b/ndfunctionspace/examples/test_mass_matrix.rs @@ -149,11 +149,7 @@ fn test_rt_mass_matrix() { // Compare matrix entries to FEniCS for i in 0..12 { - assert_relative_eq!( - mass_matrix[[i, i]], - 0.4811252243246884, - epsilon = 1e-10 - ); + assert_relative_eq!(mass_matrix[[i, i]], 0.4811252243246884, epsilon = 1e-10); } for i in 0..12 { for j in 0..12 {