Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-think when the time step is updated #929

Closed
bangerth opened this issue Jun 23, 2016 · 0 comments · Fixed by #1210
Closed

Re-think when the time step is updated #929

bangerth opened this issue Jun 23, 2016 · 0 comments · Fixed by #1210

Comments

@bangerth
Copy link
Contributor

#856 points out, in a comment, that postprocessors need to use this->get_old_timestep() because the time step is updated between solving and calling postprocessors. This is, at least, confusing.

Indeed, the code looks like this in core.cc:

    // start the principal loop over time steps:
    do
      {
        start_timestep ();

        // then do the core work: assemble systems and solve
        solve_timestep ();

        pcout << std::endl;

        // update the time step size
        // for now the bool (convection/conduction dominated)
        // returned by compute_time_step is unused, will be
        // added to statistics later
        old_time_step = time_step;
        time_step = std::min (compute_time_step().first,
                              parameters.maximum_time_step);
        time_step = termination_manager.check_for_last_time_step(time_step);

        if (parameters.convert_to_years == true)
          statistics.add_value("Time step size (years)", time_step / year_in_seconds);
        else
          statistics.add_value("Time step size (seconds)", time_step);

....

       postprocessor();

This also means that we output the next time step into the statistics file, not the one that was used for the current computations. I think we should re-think the current structure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant