From 6b3d683c056734873e2a472f1824090434994e56 Mon Sep 17 00:00:00 2001 From: Matthew Scroggs Date: Mon, 15 Jul 2024 10:53:53 +0100 Subject: [PATCH] Update rlst version (#4) * bump rlst version * rlst updates * fmt --- Cargo.toml | 2 +- src/ciarlet.rs | 13 +++++-------- src/ciarlet/lagrange.rs | 27 ++++++--------------------- src/ciarlet/raviart_thomas.rs | 27 ++++++--------------------- 4 files changed, 18 insertions(+), 51 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index fdfb332..a97d76a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,7 @@ libc = "0.2" log = "0.4" rayon = "1.9" rand = "0.8.5" -rlst = "0.1.0" +rlst = "0.2.0" thiserror="1.*" [dev-dependencies] diff --git a/src/ciarlet.rs b/src/ciarlet.rs index 1b9a5b2..e91dac4 100644 --- a/src/ciarlet.rs +++ b/src/ciarlet.rs @@ -5,8 +5,8 @@ use crate::reference_cell; use crate::traits::FiniteElement; use crate::types::{Continuity, MapType, ReferenceCellType}; use rlst::{ - dense::array::views::ArrayViewMut, rlst_dynamic_array2, rlst_dynamic_array3, Array, BaseArray, - MatrixInverse, RandomAccessByRef, RandomAccessMut, RlstScalar, Shape, VectorContainer, + rlst_dynamic_array2, rlst_dynamic_array3, Array, BaseArray, MatrixInverse, RandomAccessByRef, + RandomAccessMut, RlstScalar, Shape, VectorContainer, }; pub mod lagrange; @@ -32,7 +32,7 @@ fn compute_derivative_count(nderivs: usize, cell_type: ReferenceCellType) -> usi } /// A Ciarlet element -pub struct CiarletElement { +pub struct CiarletElement { cell_type: ReferenceCellType, degree: usize, embedded_superdegree: usize, @@ -47,10 +47,7 @@ pub struct CiarletElement { interpolation_weights: EntityWeights, } -impl CiarletElement -where - for<'a> Array, 2>, 2>, 2>: MatrixInverse, -{ +impl CiarletElement { /// Create a Ciarlet element #[allow(clippy::too_many_arguments)] pub fn create( @@ -246,7 +243,7 @@ where &self.interpolation_weights } } -impl FiniteElement for CiarletElement { +impl FiniteElement for CiarletElement { type CellType = ReferenceCellType; type MapType = MapType; type T = T; diff --git a/src/ciarlet/lagrange.rs b/src/ciarlet/lagrange.rs index b0e7b78..ff8bed3 100644 --- a/src/ciarlet/lagrange.rs +++ b/src/ciarlet/lagrange.rs @@ -5,21 +5,15 @@ use crate::polynomials::polynomial_count; use crate::reference_cell; use crate::traits::ElementFamily; use crate::types::{Continuity, MapType, ReferenceCellType}; -use rlst::{ - dense::array::views::ArrayViewMut, rlst_dynamic_array2, rlst_dynamic_array3, Array, BaseArray, - MatrixInverse, RandomAccessMut, RlstScalar, VectorContainer, -}; +use rlst::{rlst_dynamic_array2, rlst_dynamic_array3, MatrixInverse, RandomAccessMut, RlstScalar}; use std::marker::PhantomData; /// Create a Lagrange element -pub fn create( +pub fn create( cell_type: ReferenceCellType, degree: usize, continuity: Continuity, -) -> CiarletElement -where - for<'a> Array, 2>, 2>, 2>: MatrixInverse, -{ +) -> CiarletElement { let dim = polynomial_count(cell_type, degree); let tdim = reference_cell::dim(cell_type); let mut wcoeffs = rlst_dynamic_array3!(T, [dim, 1, dim]); @@ -178,19 +172,13 @@ where } /// Lagrange element family -pub struct LagrangeElementFamily -where - for<'a> Array, 2>, 2>, 2>: MatrixInverse, -{ +pub struct LagrangeElementFamily { degree: usize, continuity: Continuity, _t: PhantomData, } -impl LagrangeElementFamily -where - for<'a> Array, 2>, 2>, 2>: MatrixInverse, -{ +impl LagrangeElementFamily { /// Create new family pub fn new(degree: usize, continuity: Continuity) -> Self { Self { @@ -201,10 +189,7 @@ where } } -impl ElementFamily for LagrangeElementFamily -where - for<'a> Array, 2>, 2>, 2>: MatrixInverse, -{ +impl ElementFamily for LagrangeElementFamily { type T = T; type FiniteElement = CiarletElement; type CellType = ReferenceCellType; diff --git a/src/ciarlet/raviart_thomas.rs b/src/ciarlet/raviart_thomas.rs index eb391b0..c7c9bed 100644 --- a/src/ciarlet/raviart_thomas.rs +++ b/src/ciarlet/raviart_thomas.rs @@ -7,21 +7,15 @@ use crate::traits::ElementFamily; use crate::types::{Continuity, MapType, ReferenceCellType}; use rlst::MatrixInverse; use rlst::RlstScalar; -use rlst::{ - dense::array::views::ArrayViewMut, rlst_dynamic_array2, rlst_dynamic_array3, Array, BaseArray, - RandomAccessMut, VectorContainer, -}; +use rlst::{rlst_dynamic_array2, rlst_dynamic_array3, RandomAccessMut}; use std::marker::PhantomData; /// Create a Raviart-Thomas element -pub fn create( +pub fn create( cell_type: ReferenceCellType, degree: usize, continuity: Continuity, -) -> CiarletElement -where - for<'a> Array, 2>, 2>, 2>: MatrixInverse, -{ +) -> CiarletElement { if cell_type != ReferenceCellType::Triangle && cell_type != ReferenceCellType::Quadrilateral { panic!("Unsupported cell type"); } @@ -99,19 +93,13 @@ where } /// Raviart-Thomas element family -pub struct RaviartThomasElementFamily -where - for<'a> Array, 2>, 2>, 2>: MatrixInverse, -{ +pub struct RaviartThomasElementFamily { degree: usize, continuity: Continuity, _t: PhantomData, } -impl RaviartThomasElementFamily -where - for<'a> Array, 2>, 2>, 2>: MatrixInverse, -{ +impl RaviartThomasElementFamily { /// Create new family pub fn new(degree: usize, continuity: Continuity) -> Self { Self { @@ -122,10 +110,7 @@ where } } -impl ElementFamily for RaviartThomasElementFamily -where - for<'a> Array, 2>, 2>, 2>: MatrixInverse, -{ +impl ElementFamily for RaviartThomasElementFamily { type T = T; type CellType = ReferenceCellType; type FiniteElement = CiarletElement;