Skip to content

Commit

Permalink
Added solver.Solve iteration.
Browse files Browse the repository at this point in the history
  • Loading branch information
dwfncar committed Oct 4, 2023
1 parent 189c1af commit ce1567f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/kpp/test_kpp_to_micm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,22 @@ int main(const int argc, const char *argv[])

state.SetConcentrations(solver_params.system_, intial_concentration);

double time_step = 60; // s
int nstep = 3;

for (int i = 0; i < nstep; ++i) {

double elapsed_solve_time = 0;

std::cout << "iteration, elapsed_time: "
<< i << ", " << elapsed_solve_time << std::endl;

while (elapsed_solve_time < time_step) {
auto result = solver.Solve(time_step - elapsed_solve_time, state);
elapsed_solve_time = result.final_time_;
state.variables_[0] = result.result_.AsVector();
}
}

return 0;
}

0 comments on commit ce1567f

Please sign in to comment.