don't expose sparse solver (yet)

This commit is contained in:
Magnus Ulimoen 2020-06-15 22:32:34 +02:00
parent f7a30ac1cc
commit 9fb9ad8eae
3 changed files with 8 additions and 3 deletions

View File

@ -14,7 +14,7 @@ wee_alloc = "0.4.5"
sbp = { path = "../sbp", features = ["f32"] }
ndarray = "0.13.1"
euler = { path = "../euler" }
maxwell = { path = "../maxwell", features = ["sparse"] }
maxwell = { path = "../maxwell" }
shallow-water = { path = "../shallow_water" }
console_log = "0.2.0"
log = "0.4.8"

View File

@ -438,8 +438,8 @@ class FieldDrawer {
draw();
switch (eq_set) {
case "maxwell":
// universe.advance(0.2*Math.min(1/width, 1/height));
universe.advance_with_matrix(0.2*Math.min(1/width, 1/height));
universe.advance(0.2*Math.min(1/width, 1/height));
// universe.advance_with_matrix(0.2*Math.min(1/width, 1/height));
break;
case "euler":
universe.advance_upwind(0.2*Math.min(1/width, 1/height));

View File

@ -25,6 +25,11 @@ impl MaxwellUniverse {
self.0.advance_upwind(dt)
}
#[cfg(feature = "sparse")]
pub fn advance_with_matrix(&mut self, dt: f32) {
self.0.advance_sparse(dt)
}
pub fn get_ex_ptr(&self) -> *const u8 {
self.0.field().ex().as_ptr() as *const u8
}