Reenable error output

This commit is contained in:
Magnus Ulimoen 2021-06-29 19:45:20 +02:00
parent 1c884fe09d
commit 2bad8a1b71
1 changed files with 12 additions and 9 deletions

View File

@ -293,7 +293,7 @@ fn main() {
} = config.into_runtime(); } = config.into_runtime();
let mut sys = System::new(grids, grid_connections, operators); let mut sys = System::new(grids, grid_connections, operators);
match initial_conditions { match &initial_conditions {
/* /*
parsing::InitialConditions::File(f) => { parsing::InitialConditions::File(f) => {
for grid in &sys.grids { for grid in &sys.grids {
@ -371,23 +371,26 @@ fn main() {
} }
output.add_timestep(ntime, &sys.fnow); output.add_timestep(ntime, &sys.fnow);
/*
if opt.error { if opt.error {
let time = ntime as Float * dt; let time = ntime as Float * dt;
let mut e = 0.0; let mut e = 0.0;
for ((fmod, grid), op) in sys.fnow.iter().zip(&sys.grids).zip(&sys.operators) { for ((fmod, grid), op) in sys.fnow.iter().zip(&sys.grids).zip(&sys.operators) {
let mut fvort = fmod.clone(); let mut fvort = fmod.clone();
fvort.vortex( match &initial_conditions {
grid.x(), parsing::InitialConditions::Vortex(vortexparams) => {
grid.y(), fvort.vortex(grid.x(), grid.y(), time, &vortexparams);
time, }
&vortexparams.as_ref().unwrap().clone(), parsing::InitialConditions::Expressions(expr) => {
); let (rho, rhou, rhov, e) = fvort.components_mut();
expr.as_ref()
.evaluate(time, grid.x(), grid.y(), rho, rhou, rhov, e)
}
}
e += fmod.h2_err(&fvort, &**op); e += fmod.h2_err(&fvort, &**op);
} }
outinfo.error = Some(e); outinfo.error = Some(e);
} }
*/
if opt.output_json { if opt.output_json {
println!("{}", json5::to_string(&outinfo).unwrap()); println!("{}", json5::to_string(&outinfo).unwrap());