mod integrands;
pub use integrands::{Access1D, Access2D, BoundaryIntegrand, GeometryAccess};
use super::CellGeometry;
use crate::assembly::common::RlstArray;
use crate::traits::FunctionSpace;
#[cfg(feature = "mpi")]
use crate::traits::ParallelFunctionSpace;
#[cfg(feature = "mpi")]
use mpi::traits::Communicator;
use ndelement::types::ReferenceCellType;
use rlst::{CsrMatrix, RandomAccessMut, RawAccessMut, RlstScalar, Shape};
use std::collections::HashMap;
pub trait CellPairAssembler {
type T: RlstScalar;
fn assemble(&mut self, local_mat: &mut RlstArray<Self::T, 2>);
fn set_test_cell(&mut self, test_cell: usize);
fn set_trial_cell(&mut self, trial_cell: usize);
}
pub trait BoundaryAssembly {
type T: RlstScalar;
fn assemble_singular_into_dense<
Space: FunctionSpace<T = Self::T> + Sync,
Array2: RandomAccessMut<2, Item = Self::T> + Shape<2> + RawAccessMut<Item = Self::T>,
>(
&self,
output: &mut Array2,
trial_space: &Space,
test_space: &Space,
);
fn assemble_singular_into_csr<Space: FunctionSpace<T = Self::T> + Sync>(
&self,
trial_space: &Space,
test_space: &Space,
) -> CsrMatrix<Self::T>;
fn assemble_singular_correction_into_dense<
Space: FunctionSpace<T = Self::T> + Sync,
Array2: RandomAccessMut<2, Item = Self::T> + Shape<2> + RawAccessMut<Item = Self::T>,
>(
&self,
output: &mut Array2,
trial_space: &Space,
test_space: &Space,
);
fn assemble_singular_correction_into_csr<Space: FunctionSpace<T = Self::T> + Sync>(
&self,
trial_space: &Space,
test_space: &Space,
) -> CsrMatrix<Self::T>;
fn assemble_into_dense<
Space: FunctionSpace<T = Self::T> + Sync,
Array2: RandomAccessMut<2, Item = Self::T> + Shape<2> + RawAccessMut<Item = Self::T>,
>(
&self,
output: &mut Array2,
trial_space: &Space,
test_space: &Space,
);
fn assemble_nonsingular_into_dense<
Space: FunctionSpace<T = Self::T> + Sync,
Array2: RandomAccessMut<2, Item = Self::T> + Shape<2> + RawAccessMut<Item = Self::T>,
>(
&self,
output: &mut Array2,
trial_space: &Space,
test_space: &Space,
trial_colouring: &HashMap<ReferenceCellType, Vec<Vec<usize>>>,
test_colouring: &HashMap<ReferenceCellType, Vec<Vec<usize>>>,
);
}
#[cfg(feature = "mpi")]
pub trait ParallelBoundaryAssembly: BoundaryAssembly {
fn parallel_assemble_singular_into_csr<
C: Communicator,
Space: ParallelFunctionSpace<C, T = Self::T>,
>(
&self,
trial_space: &Space,
test_space: &Space,
) -> CsrMatrix<Self::T>;
fn parallel_assemble_singular_correction_into_csr<
C: Communicator,
Space: ParallelFunctionSpace<C, T = Self::T>,
>(
&self,
trial_space: &Space,
test_space: &Space,
) -> CsrMatrix<Self::T>;
}