From 297e29553238a007b73e2ebde297e1052517bedb Mon Sep 17 00:00:00 2001 From: Magnus Ulimoen Date: Sat, 18 Apr 2020 21:38:39 +0200 Subject: [PATCH] add operators as upwind --- multigrid/src/parsing.rs | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/multigrid/src/parsing.rs b/multigrid/src/parsing.rs index d0170f6..bf402ea 100644 --- a/multigrid/src/parsing.rs +++ b/multigrid/src/parsing.rs @@ -52,49 +52,53 @@ pub fn json_to_grids( .unwrap_or(&default_operator.1); match (opeta, opxi) { - ("upwind4", "upwind4") => Left(Box::new(Upwind4) as Box), - ("upwind9", "upwind9") => Left(Box::new(Upwind9) as Box), - ("upwind4h2", "upwind4h2") => Left(Box::new(Upwind4h2) as Box), - ("upwind9h2", "upwind9h2") => Left(Box::new(Upwind9h2) as Box), + ("upwind4", "upwind4") => Right(Box::new(Upwind4) as Box), + ("upwind9", "upwind9") => Right(Box::new(Upwind9) as Box), + ("upwind4h2", "upwind4h2") => { + Right(Box::new(Upwind4h2) as Box) + } + ("upwind9h2", "upwind9h2") => { + Right(Box::new(Upwind9h2) as Box) + } ("upwind4", "upwind9") => { - Left(Box::new((&Upwind4, &Upwind9)) as Box) + Right(Box::new((&Upwind4, &Upwind9)) as Box) } ("upwind4", "upwind4h2") => { - Left(Box::new((&Upwind4, &Upwind4h2)) as Box) + Right(Box::new((&Upwind4, &Upwind4h2)) as Box) } ("upwind4", "upwind9h2") => { - Left(Box::new((&Upwind4, &Upwind9h2)) as Box) + Right(Box::new((&Upwind4, &Upwind9h2)) as Box) } ("upwind9", "upwind4") => { - Left(Box::new((&Upwind9, &Upwind4)) as Box) + Right(Box::new((&Upwind9, &Upwind4)) as Box) } ("upwind9", "upwind4h2") => { - Left(Box::new((&Upwind9, &Upwind4h2)) as Box) + Right(Box::new((&Upwind9, &Upwind4h2)) as Box) } ("upwind9", "upwind9h2") => { - Left(Box::new((&Upwind9, &Upwind9h2)) as Box) + Right(Box::new((&Upwind9, &Upwind9h2)) as Box) } ("upwind4h2", "upwind4") => { - Left(Box::new((&Upwind4h2, &Upwind4)) as Box) + Right(Box::new((&Upwind4h2, &Upwind4)) as Box) } ("upwind4h2", "upwind9") => { - Left(Box::new((&Upwind4h2, &Upwind9)) as Box) + Right(Box::new((&Upwind4h2, &Upwind9)) as Box) } ("upwind4h2", "upwind9h2") => { - Left(Box::new((&Upwind4h2, &Upwind9h2)) as Box) + Right(Box::new((&Upwind4h2, &Upwind9h2)) as Box) } ("upwind9h2", "upwind4") => { - Left(Box::new((&Upwind9h2, &Upwind4)) as Box) + Right(Box::new((&Upwind9h2, &Upwind4)) as Box) } ("upwind9h2", "upwind9") => { - Left(Box::new((&Upwind9h2, &Upwind9)) as Box) + Right(Box::new((&Upwind9h2, &Upwind9)) as Box) } ("upwind9h2", "upwind4h2") => { - Left(Box::new((&Upwind9h2, &Upwind4h2)) as Box) + Right(Box::new((&Upwind9h2, &Upwind4h2)) as Box) } (opeta, opxi) => panic!("combination {} {} not yet implemented", opeta, opxi),