first untested sparse implementation

This commit is contained in:
Magnus Ulimoen
2020-06-12 21:04:18 +02:00
parent 9261f1b239
commit 4f772b8dc5
6 changed files with 802 additions and 40 deletions

View File

@@ -207,6 +207,20 @@ impl SbpOperator1d for Upwind4 {
fn h(&self) -> &'static [Float] {
Self::HBLOCK
}
#[cfg(feature = "sparse")]
fn diff_matrix(&self, n: usize) -> sprs::CsMat<Float> {
super::sparse_from_block(
Self::BLOCK,
Self::DIAG,
super::Symmetry::AntiSymmetric,
super::OperatorType::Normal,
n,
)
}
#[cfg(feature = "sparse")]
fn h_matrix(&self, n: usize) -> sprs::CsMat<Float> {
super::h_matrix(Self::DIAG, n, self.is_h2())
}
}
impl<SBP: SbpOperator1d> SbpOperator2d for (&SBP, &Upwind4) {