Skip to content

Don't just assume that the start time is zero. #6531

@bangerth

Description

@bangerth

We have code such as this:

const double t = (this->simulator_is_past_initialization()) ? this->get_time() : 0.0;

This code is used because if we're still initializing the simulator, the current time is not yet available. The line above then simply assumes that the current time is zero -- but that's dangerous, because the start time might in fact be something else than zero, as witnessed by

    start_time              = prm.get_double ("Start time");
    if (convert_to_years == true)
      start_time *= year_in_seconds;

The right thing for these places to do is to query this->get_start_time(). That function doesn't exist yet, but I'm going to add that next.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions