fixes due to review comments

This commit is contained in:
Halvor M Nilsen 2025-02-14 15:34:35 +01:00
parent 941621b532
commit ecbe713c9b
3 changed files with 4 additions and 19 deletions

View File

@ -423,7 +423,7 @@ namespace Opm {
// initialize variables
const auto& initConfig = eclState().getInitConfig();
int end_step = Parameters::Get<Parameters::EndStep>();
int end_step = Parameters::Get<Parameters::EndStep>();
simtimer_->init(schedule, static_cast<std::size_t>(initConfig.getRestartStep()), end_step);
if (this->output_cout_) {

View File

@ -55,21 +55,6 @@ namespace Opm
return res;
}
/// Initialize from parameters. Accepts the following:
/// num_psteps (default 1)
/// stepsize_days (default 1)
void SimulatorTimer::init(const ParameterGroup& param)
{
const int num_psteps = param.getDefault("num_psteps", 1);
const int end_step = param.getDefault("end_step", 50000);
const double stepsize_days = param.getDefault("stepsize_days", 1.0);
const double stepsize = Opm::unit::convert::from(stepsize_days, Opm::unit::day);
timesteps_.clear();
timesteps_.resize(num_psteps, stepsize);
end_step_ = end_step;
total_time_ = num_psteps*stepsize;
}
/// Use the SimulatorTimer as a shim around opm-parser's Opm::TimeMap
void SimulatorTimer::init(const Schedule& schedule, std::size_t report_step, std::size_t end_step)
{
@ -171,9 +156,9 @@ namespace Opm
/// Return true if op++() has been called numSteps() times.
bool SimulatorTimer::done() const
{
if(current_step_ < end_step_){
if (current_step_ < end_step_) {
return int(timesteps_.size()) == current_step_;
}else{
} else {
return true;
}
}

View File

@ -53,7 +53,7 @@ namespace Opm
void init(const ParameterGroup& param);
/// Use the SimulatorTimer as a shim around opm-commons Schedule class
void init(const Schedule& schedule, std::size_t report_step, std::size_t end_step);
void init(const Schedule& schedule, std::size_t report_step, int end_step);
/// Whether the current step is the first step.
bool initialStep() const override;