Skip to content

Commit

Permalink
Cleaned up code
Browse files Browse the repository at this point in the history
  • Loading branch information
tbetcke committed Jan 17, 2025
1 parent 281ed9b commit 162f6ac
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 20 deletions.
2 changes: 0 additions & 2 deletions benches/assembly_benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use bempp::laplace::assembler::single_layer;
use criterion::{black_box, criterion_group, criterion_main, Criterion};
use ndelement::ciarlet::LagrangeElementFamily;
use ndelement::types::{Continuity, ReferenceCellType};
use rlst::IndexLayout;

pub fn assembly_parts_benchmark(c: &mut Criterion) {
let mut group = c.benchmark_group("assembly");
Expand All @@ -28,7 +27,6 @@ pub fn assembly_parts_benchmark(c: &mut Criterion) {
options.set_batch_size(128);

let assembler = single_layer(&options);
let index_layout = IndexLayout::from_local_counts(space.global_size(), &comm);

group.bench_function(
format!(
Expand Down
2 changes: 1 addition & 1 deletion examples/laplace_evaluator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use rand::SeedableRng;
use rand_chacha::ChaCha8Rng;
use rlst::{
operator::{interface::DistributedArrayVectorSpace, zero_element, Operator},
rlst_dynamic_array1, AsApply, Element, MultInto, OperatorBase,
rlst_dynamic_array1, AsApply, MultInto, OperatorBase,
};

fn main() {
Expand Down
2 changes: 1 addition & 1 deletion examples/neighbour_evaluator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use rand::SeedableRng;
use rand_chacha::ChaCha8Rng;
use rlst::{
operator::{interface::DistributedArrayVectorSpace, zero_element},
rlst_dynamic_array2, AsApply, Element, IndexLayout, LinearSpace, RandomAccessMut, RawAccess,
rlst_dynamic_array2, AsApply, IndexLayout, RandomAccessMut, RawAccess,
};

fn main() {
Expand Down
2 changes: 1 addition & 1 deletion examples/test_green_evaluators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use rand::{Rng, SeedableRng};
use rand_chacha::ChaCha8Rng;
use rlst::{
operator::{interface::DistributedArrayVectorSpace, zero_element},
rlst_dynamic_array1, AsApply, Element, IndexLayout, LinearSpace, NormedSpace, RawAccessMut,
rlst_dynamic_array1, AsApply, IndexLayout, RawAccessMut,
};

fn main() {
Expand Down
5 changes: 2 additions & 3 deletions src/boundary_assemblers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ use ndgrid::traits::{Entity, Grid, Topology};
use ndgrid::types::Ownership;
use rayon::prelude::*;
use rlst::{
rlst_dynamic_array2, rlst_dynamic_array4, CsrMatrix, DefaultIterator, DistributedCsrMatrix,
DynamicArray, IndexLayout, MatrixInverse, RandomAccessMut, RawAccess, RawAccessMut, RlstScalar,
Shape,
rlst_dynamic_array2, rlst_dynamic_array4, DefaultIterator, DistributedCsrMatrix, DynamicArray,
MatrixInverse, RandomAccessMut, RawAccess, RawAccessMut, RlstScalar, Shape,
};
use std::collections::HashMap;

Expand Down
7 changes: 3 additions & 4 deletions src/evaluator_tools.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! Various helper functions to support evaluators.
use std::{
cell,
collections::{HashMap, HashSet},
marker::PhantomData,
rc::Rc,
Expand All @@ -17,22 +16,22 @@ use ndgrid::{
types::Ownership,
};

use rayon::prelude::*;
use rlst::{
operator::{
interface::{
distributed_array_vector_space,
distributed_sparse_operator::DistributedCsrMatrixOperatorImpl,
DistributedArrayVectorSpace,
},
zero_element, Operator,
Operator,
},
rlst_array_from_slice2, rlst_dynamic_array1, rlst_dynamic_array2, rlst_dynamic_array3,
rlst_dynamic_array4, Array, AsApply, DefaultIterator, DistributedCsrMatrix, DistributedVector,
Element, IndexLayout, OperatorBase, RawAccess, RawAccessMut, RlstScalar, Shape,
UnsafeRandomAccessByValue, UnsafeRandomAccessMut,
};

use rayon::prelude::*;

use crate::function::FunctionSpaceTrait;

/// Create a linear operator from the map of a basis to points. The points are sorted by global
Expand Down
1 change: 0 additions & 1 deletion src/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use ndgrid::{traits::Grid, types::Ownership};
use rlst::{IndexLayout, MatrixInverse, RlstScalar};
use std::collections::HashMap;
use std::marker::PhantomData;
use std::ops::Index;
use std::rc::Rc;

type DofList = Vec<Vec<usize>>;
Expand Down
10 changes: 3 additions & 7 deletions src/greens_function_evaluators/kifmm_evaluator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,11 @@ use kifmm::{
tree::SortKind,
ChargeHandler, Evaluate, FftFieldTranslation, KiFmm, KiFmmMulti, MultiNodeBuilder,
};
use mpi::{
ffi::MPI_T_ERR_PVAR_NO_STARTSTOP,
traits::{Communicator, Equivalence},
};
use mpi::traits::{Communicator, Equivalence};
use num::Float;
use rlst::{
operator::{interface::DistributedArrayVectorSpace, zero_element},
rlst_dynamic_array1, AsApply, Element, IndexLayout, MatrixSvd, OperatorBase, RawAccess,
RawAccessMut, RlstScalar,
operator::interface::DistributedArrayVectorSpace, rlst_dynamic_array1, AsApply, Element,
IndexLayout, MatrixSvd, OperatorBase, RawAccess, RawAccessMut, RlstScalar,
};

/// This structure instantiates an FMM evaluator.
Expand Down

0 comments on commit 162f6ac

Please sign in to comment.