Skip to content

Commit

Permalink
Hotfix time substraction (#14)
Browse files Browse the repository at this point in the history
* Fix bug

* Fix bugfix
  • Loading branch information
richterjakob authored Oct 19, 2022
1 parent ff121f3 commit f07d96f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/main.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,14 +261,15 @@ const std::string run(std::string& json_config) {
times.reserve(num_states);
}
T time = 0.0;
states.push_back(state);
times.push_back(time);

// Run integrator
DEBUG_MSG("Run time integration");
int interval_counter = 0;
int start_last_cycle =
reader.sim_num_time_steps - reader.sim_pts_per_cycle + 1;
int start_last_cycle = reader.sim_num_time_steps - reader.sim_pts_per_cycle;
if ((reader.output_last_cycle_only == false) || (0 >= start_last_cycle)) {
times.push_back(time);
states.push_back(std::move(state));
}
for (int i = 1; i < reader.sim_num_time_steps; i++) {
state = integrator.step(state, time, reader.model);
interval_counter += 1;
Expand Down

0 comments on commit f07d96f

Please sign in to comment.