prototype multigrid

This commit is contained in:
Magnus Ulimoen
2020-04-01 00:08:55 +02:00
parent 3bffd18488
commit 7f0b5b8430
3 changed files with 248 additions and 5 deletions

View File

@@ -203,16 +203,16 @@ impl Field {
(rho, rhou, rhov, e)
}
fn north(&self) -> ArrayView2<Float> {
pub fn north(&self) -> ArrayView2<Float> {
self.slice(s![.., self.ny() - 1, ..])
}
fn south(&self) -> ArrayView2<Float> {
pub fn south(&self) -> ArrayView2<Float> {
self.slice(s![.., 0, ..])
}
fn east(&self) -> ArrayView2<Float> {
pub fn east(&self) -> ArrayView2<Float> {
self.slice(s![.., .., self.nx() - 1])
}
fn west(&self) -> ArrayView2<Float> {
pub fn west(&self) -> ArrayView2<Float> {
self.slice(s![.., .., 0])
}
fn north_mut(&mut self) -> ArrayViewMut2<Float> {
@@ -413,7 +413,7 @@ pub(crate) fn RHS_trad<SBP: SbpOperator>(
}
#[allow(non_snake_case)]
pub(crate) fn RHS_upwind<UO: UpwindOperator>(
pub fn RHS_upwind<UO: UpwindOperator>(
k: &mut Field,
y: &Field,
grid: &Grid<UO>,

View File

@@ -73,4 +73,11 @@ impl<SBP: super::operators::SbpOperator> Grid<SBP> {
pub fn ny(&self) -> usize {
self.x.shape()[0]
}
pub fn x(&self) -> ndarray::ArrayView2<Float> {
self.x.view()
}
pub fn y(&self) -> ndarray::ArrayView2<Float> {
self.y.view()
}
}