Skip to content

Commit 069dc3c

Browse files
chore: clean out and remove legacy sim path code
1 parent 0a560ad commit 069dc3c

1 file changed

Lines changed: 18 additions & 11 deletions

File tree

tests/validation/thermal_mass_validation.cpp

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,10 @@ void print_usage() {
5858
"Options:\n"
5959
" --output-json <path> Write JSON results file\n"
6060
" --output-csv <path> Write CSV results file\n"
61-
" --duration-s <value> Simulation duration in seconds (default: 10)\n"
62-
" --dt-values <list> Comma-separated dt values (default: 0.4,0.2,0.1,0.05,0.025)\n"
61+
" --duration-s <value> Simulation duration in seconds "
62+
"(default: 10)\n"
63+
" --dt-values <list> Comma-separated dt values (default: "
64+
"0.4,0.2,0.1,0.05,0.025)\n"
6365
" --help Show this help\n";
6466
}
6567

@@ -352,11 +354,14 @@ void write_json(const std::string &path, double duration_s,
352354
out << " {\n";
353355
out << " \"id\": \"" << json_escape(scenario.config.id) << "\",\n";
354356
out << " \"parameters\": {\n";
355-
out << " \"thermal_mass\": " << scenario.config.thermal_mass << ",\n";
356-
out << " \"heat_transfer_coeff\": " << scenario.config.heat_transfer_coeff
357+
out << " \"thermal_mass\": " << scenario.config.thermal_mass
358+
<< ",\n";
359+
out << " \"heat_transfer_coeff\": "
360+
<< scenario.config.heat_transfer_coeff << ",\n";
361+
out << " \"initial_temp\": " << scenario.config.initial_temp
362+
<< ",\n";
363+
out << " \"ambient_temp\": " << scenario.config.ambient_temp
357364
<< ",\n";
358-
out << " \"initial_temp\": " << scenario.config.initial_temp << ",\n";
359-
out << " \"ambient_temp\": " << scenario.config.ambient_temp << ",\n";
360365
out << " \"power\": " << scenario.config.power << "\n";
361366
out << " },\n";
362367
out << " \"methods\": [\n";
@@ -365,7 +370,8 @@ void write_json(const std::string &path, double duration_s,
365370
const auto &method = scenario.methods[mi];
366371
out << " {\n";
367372
out << " \"name\": \"" << json_escape(method.method) << "\",\n";
368-
out << " \"observed_order_l2\": " << method.observed_order_l2 << ",\n";
373+
out << " \"observed_order_l2\": " << method.observed_order_l2
374+
<< ",\n";
369375
out << " \"observed_order_linf\": " << method.observed_order_linf
370376
<< ",\n";
371377
out << " \"points\": [\n";
@@ -377,7 +383,8 @@ void write_json(const std::string &path, double duration_s,
377383
out << " \"steps\": " << point.steps << ",\n";
378384
out << " \"l2_error\": " << point.l2_error << ",\n";
379385
out << " \"linf_error\": " << point.linf_error << ",\n";
380-
out << " \"final_abs_error\": " << point.final_abs_error << "\n";
386+
out << " \"final_abs_error\": " << point.final_abs_error
387+
<< "\n";
381388
out << " }";
382389
if (pi + 1 < method.points.size()) {
383390
out << ",";
@@ -448,9 +455,9 @@ int main(int argc, char **argv) {
448455
for (const auto &scenario : scenarios) {
449456
ScenarioResult scenario_result;
450457
scenario_result.config = scenario;
451-
scenario_result.methods.push_back(run_method(
452-
scenario, ThermalIntegrationMethod::ForwardEuler, opts.dt_values,
453-
opts.duration_s));
458+
scenario_result.methods.push_back(
459+
run_method(scenario, ThermalIntegrationMethod::ForwardEuler,
460+
opts.dt_values, opts.duration_s));
454461
scenario_result.methods.push_back(
455462
run_method(scenario, ThermalIntegrationMethod::Rk4, opts.dt_values,
456463
opts.duration_s));

0 commit comments

Comments
 (0)