use ndarray::{ArrayView, ArrayViewMut, Dimension}; use sbp::Float; use std::convert::{TryFrom, TryInto}; pub mod evalexpr; #[derive(Clone, Debug)] pub enum Evaluator { EvalExpr(evalexpr::Evaluator), } impl euler::eval::Evaluator for Evaluator { fn evaluate( &self, t: Float, x: ArrayView, y: ArrayView, rho: ArrayViewMut, rhou: ArrayViewMut, rhov: ArrayViewMut, e: ArrayViewMut, ) { match self { Self::EvalExpr(c) => c.evaluate(t, x, y, rho, rhou, rhov, e), } } } impl TryFrom for Evaluator { type Error = (); fn try_from(expr: crate::input::Expressions) -> Result { Ok(Self::EvalExpr(expr.try_into()?)) } }