Skip to main content

SlfmmSystem

Struct SlfmmSystem 

Source
pub struct SlfmmSystem {
    pub near_matrix: Vec<NearFieldBlock>,
    pub t_matrices: Vec<Array2<Complex64>>,
    pub t_vector: Array1<Complex64>,
    pub d_matrices: Vec<DMatrixEntry>,
    pub s_matrices: Vec<Array2<Complex64>>,
    pub rhs: Array1<Complex64>,
    pub num_dofs: usize,
    pub num_sphere_points: usize,
    pub num_expansion_terms: usize,
    pub num_clusters: usize,
    pub cluster_dof_indices: Vec<Vec<usize>>,
}
Expand description

Result of SLFMM assembly

Fields§

§near_matrix: Vec<NearFieldBlock>

Near-field coefficient matrix (sparse, stored as dense blocks)

§t_matrices: Vec<Array2<Complex64>>

T-matrix for each cluster (element DOFs → multipole expansion)

§t_vector: Array1<Complex64>

T-vector for RHS contribution

§d_matrices: Vec<DMatrixEntry>

D-matrix entries for far cluster pairs

§s_matrices: Vec<Array2<Complex64>>

S-matrix for each cluster (multipole expansion → field DOFs)

§rhs: Array1<Complex64>

RHS vector

§num_dofs: usize

Number of DOFs

§num_sphere_points: usize

Number of integration points on unit sphere

§num_expansion_terms: usize

Number of expansion terms

§num_clusters: usize

Number of clusters

§cluster_dof_indices: Vec<Vec<usize>>

Cluster DOF mappings: for each cluster, the global DOF indices

Implementations§

Source§

impl SlfmmSystem

Source

pub fn new( num_dofs: usize, num_clusters: usize, num_sphere_points: usize, num_expansion_terms: usize, ) -> Self

Create a new empty SLFMM system

Source

pub fn extract_near_field_matrix(&self) -> Array2<Complex64>

Extract the near-field matrix as a dense matrix for preconditioning

This assembles only the near-field blocks into a dense matrix, which is much smaller than the full matrix (O(N) vs O(N²) entries).

Source

pub fn matvec(&self, x: &Array1<Complex64>) -> Array1<Complex64>

Apply the SLFMM operator: y = ([N] + [S][D][T]) * x

This is used in iterative solvers (CGS, BiCGSTAB).

The decomposition is:

  • Near-field: Direct element-to-element interactions for nearby clusters
  • Far-field: Multipole expansions with SDT factorization
§Arguments
  • x - Input vector (length = num_dofs)
§Returns
  • y - Output vector (length = num_dofs), y = A*x
Source

pub fn matvec_transpose(&self, x: &Array1<Complex64>) -> Array1<Complex64>

Apply the SLFMM operator transpose: y = A^T * x (parallelized)

Used by some iterative solvers (e.g., BiCGSTAB).

Trait Implementations§

Source§

impl Clone for SlfmmSystem

Source§

fn clone(&self) -> SlfmmSystem

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl LinearOperator<Complex<f64>> for SlfmmSystem

Source§

fn num_rows(&self) -> usize

Number of rows in the operator
Source§

fn num_cols(&self) -> usize

Number of columns in the operator
Source§

fn apply(&self, x: &Array1<Complex64>) -> Array1<Complex64>

Apply the operator: y = A * x
Source§

fn apply_transpose(&self, x: &Array1<Complex64>) -> Array1<Complex64>

Apply the transpose: y = A^T * x
Source§

fn apply_hermitian( &self, x: &ArrayBase<OwnedRepr<T>, Dim<[usize; 1]>>, ) -> ArrayBase<OwnedRepr<T>, Dim<[usize; 1]>>

Apply the Hermitian (conjugate transpose): y = A^H * x
Source§

fn is_square(&self) -> bool

Check if the operator is square

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.