add upwind/d2 to SbpOperators1d trait
This commit is contained in:
parent
56bba27a4b
commit
6f3a810cd3
|
@ -19,6 +19,13 @@ pub trait SbpOperator1d: Send + Sync {
|
||||||
fn diff_matrix(&self, n: usize) -> sprs::CsMat<Float>;
|
fn diff_matrix(&self, n: usize) -> sprs::CsMat<Float>;
|
||||||
#[cfg(feature = "sparse")]
|
#[cfg(feature = "sparse")]
|
||||||
fn h_matrix(&self, n: usize) -> sprs::CsMat<Float>;
|
fn h_matrix(&self, n: usize) -> sprs::CsMat<Float>;
|
||||||
|
|
||||||
|
fn upwind(&self) -> Option<&dyn UpwindOperator1d> {
|
||||||
|
None
|
||||||
|
}
|
||||||
|
fn d2(&self) -> Option<&dyn SbpOperator1d2> {
|
||||||
|
None
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait SbpOperator1d2: SbpOperator1d {
|
pub trait SbpOperator1d2: SbpOperator1d {
|
||||||
|
|
|
@ -65,6 +65,10 @@ impl SbpOperator1d for SBP4 {
|
||||||
fn h_matrix(&self, n: usize) -> sprs::CsMat<Float> {
|
fn h_matrix(&self, n: usize) -> sprs::CsMat<Float> {
|
||||||
super::h_matrix(Self::HBLOCK, n, self.is_h2())
|
super::h_matrix(Self::HBLOCK, n, self.is_h2())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn d2(&self) -> Option<&dyn super::SbpOperator1d2> {
|
||||||
|
Some(&Self)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<SBP: SbpOperator1d> SbpOperator2d for (&SBP, &SBP4) {
|
impl<SBP: SbpOperator1d> SbpOperator2d for (&SBP, &SBP4) {
|
||||||
|
|
|
@ -223,6 +223,10 @@ impl SbpOperator1d for Upwind4 {
|
||||||
fn h_matrix(&self, n: usize) -> sprs::CsMat<Float> {
|
fn h_matrix(&self, n: usize) -> sprs::CsMat<Float> {
|
||||||
super::h_matrix(Self::HBLOCK, n, self.is_h2())
|
super::h_matrix(Self::HBLOCK, n, self.is_h2())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn upwind(&self) -> Option<&dyn UpwindOperator1d> {
|
||||||
|
Some(&Self)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<SBP: SbpOperator1d> SbpOperator2d for (&SBP, &Upwind4) {
|
impl<SBP: SbpOperator1d> SbpOperator2d for (&SBP, &Upwind4) {
|
||||||
|
|
|
@ -71,6 +71,10 @@ impl SbpOperator1d for Upwind4h2 {
|
||||||
fn h_matrix(&self, n: usize) -> sprs::CsMat<Float> {
|
fn h_matrix(&self, n: usize) -> sprs::CsMat<Float> {
|
||||||
super::h_matrix(Self::HBLOCK, n, self.is_h2())
|
super::h_matrix(Self::HBLOCK, n, self.is_h2())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn upwind(&self) -> Option<&dyn UpwindOperator1d> {
|
||||||
|
Some(&Self)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<SBP: SbpOperator1d> SbpOperator2d for (&SBP, &Upwind4h2) {
|
impl<SBP: SbpOperator1d> SbpOperator2d for (&SBP, &Upwind4h2) {
|
||||||
|
|
|
@ -76,6 +76,10 @@ impl SbpOperator1d for Upwind9 {
|
||||||
fn h_matrix(&self, n: usize) -> sprs::CsMat<Float> {
|
fn h_matrix(&self, n: usize) -> sprs::CsMat<Float> {
|
||||||
super::h_matrix(Self::HBLOCK, n, self.is_h2())
|
super::h_matrix(Self::HBLOCK, n, self.is_h2())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn upwind(&self) -> Option<&dyn UpwindOperator1d> {
|
||||||
|
Some(&Self)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<SBP: SbpOperator1d> SbpOperator2d for (&SBP, &Upwind9) {
|
impl<SBP: SbpOperator1d> SbpOperator2d for (&SBP, &Upwind9) {
|
||||||
|
|
|
@ -79,6 +79,10 @@ impl SbpOperator1d for Upwind9h2 {
|
||||||
fn h_matrix(&self, n: usize) -> sprs::CsMat<Float> {
|
fn h_matrix(&self, n: usize) -> sprs::CsMat<Float> {
|
||||||
super::h_matrix(Self::HBLOCK, n, self.is_h2())
|
super::h_matrix(Self::HBLOCK, n, self.is_h2())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn upwind(&self) -> Option<&dyn UpwindOperator1d> {
|
||||||
|
Some(&Self)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<SBP: SbpOperator1d> SbpOperator2d for (&SBP, &Upwind9h2) {
|
impl<SBP: SbpOperator1d> SbpOperator2d for (&SBP, &Upwind9h2) {
|
||||||
|
|
Loading…
Reference in New Issue