Add a way to render the state
Note that this has exposed some scaling error that needs to be fixed.
This commit is contained in:
17
src/render.rs
Normal file
17
src/render.rs
Normal file
@@ -0,0 +1,17 @@
|
||||
use crate::SimState;
|
||||
|
||||
pub struct NumericTermRenderer;
|
||||
|
||||
impl NumericTermRenderer {
|
||||
pub fn render(&self, state: &SimState) {
|
||||
print!("E: ");
|
||||
for cell in state.cells() {
|
||||
print!("{:>8.1e} ", cell.ez());
|
||||
}
|
||||
print!("\nB: ");
|
||||
for cell in state.cells() {
|
||||
print!("{:>8.1e} ", cell.by());
|
||||
}
|
||||
print!("\n");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user