Skip to content
Snippets Groups Projects
Commit 6b55afab authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

Merge branch 'TimeSteppingCleanup' into 'master'

Time stepping cleanup

See merge request ogs/ogs!4672
parents 1de404bd 2aebf8d2
No related branches found
No related tags found
No related merge requests found
...@@ -100,8 +100,6 @@ std::tuple<bool, double> EvolutionaryPIDcontroller::next( ...@@ -100,8 +100,6 @@ std::tuple<bool, double> EvolutionaryPIDcontroller::next(
return std::make_tuple(timestep_current.isAccepted(), h_new); return std::make_tuple(timestep_current.isAccepted(), h_new);
} }
return {};
} }
double EvolutionaryPIDcontroller::limitStepSize( double EvolutionaryPIDcontroller::limitStepSize(
......
...@@ -93,7 +93,7 @@ private: ...@@ -93,7 +93,7 @@ private:
double _e_n_minus2; ///< \f$e_{n-2}\f$. double _e_n_minus2; ///< \f$e_{n-2}\f$.
/** /**
* Forced the computed time step size in the given range * Force the computed time step size in the given range
* (see the formulas in the documentation of the class) * (see the formulas in the documentation of the class)
* or use the half of the previous time step size under some other * or use the half of the previous time step size under some other
* constrains. * constrains.
......
...@@ -426,6 +426,20 @@ std::vector<std::string> Output::getFileNamesForOutput() const ...@@ -426,6 +426,20 @@ std::vector<std::string> Output::getFileNamesForOutput() const
return output_names; return output_names;
} }
std::vector<double> calculateUniqueFixedTimesForAllOutputs(
std::vector<Output> const& outputs)
{
std::vector<double> fixed_times;
for (auto const& output : outputs)
{
auto const& output_fixed_times = output.getFixedOutputTimes();
fixed_times.insert(fixed_times.end(), output_fixed_times.begin(),
output_fixed_times.end());
}
BaseLib::makeVectorUnique(fixed_times);
return fixed_times;
}
std::ostream& operator<<(std::ostream& os, Output const& output) std::ostream& operator<<(std::ostream& os, Output const& output)
{ {
os << "Output::_output_data_specification:\t" os << "Output::_output_data_specification:\t"
......
...@@ -126,4 +126,7 @@ private: ...@@ -126,4 +126,7 @@ private:
_do_not_project_from_bulk_mesh_to_submeshes; _do_not_project_from_bulk_mesh_to_submeshes;
}; };
std::vector<double> calculateUniqueFixedTimesForAllOutputs(
std::vector<Output> const& outputs);
} // namespace ProcessLib } // namespace ProcessLib
...@@ -473,22 +473,6 @@ std::pair<double, bool> TimeLoop::computeTimeStepping( ...@@ -473,22 +473,6 @@ std::pair<double, bool> TimeLoop::computeTimeStepping(
return {dt, last_step_rejected}; return {dt, last_step_rejected};
} }
std::vector<double> calculateUniqueFixedTimesForAllOutputs(
std::vector<Output> const& outputs)
{
std::vector<double> fixed_times;
for (auto const& output : outputs)
{
auto const& output_fixed_times = output.getFixedOutputTimes();
fixed_times.insert(fixed_times.end(), output_fixed_times.begin(),
output_fixed_times.end());
}
std::sort(fixed_times.begin(), fixed_times.end());
auto const it = std::unique(fixed_times.begin(), fixed_times.end());
fixed_times.erase(it, fixed_times.end());
return fixed_times;
}
std::vector<std::function<double(double, double)>> std::vector<std::function<double(double, double)>>
TimeLoop::generateOutputTimeStepConstraints( TimeLoop::generateOutputTimeStepConstraints(
std::vector<double>&& fixed_times) const std::vector<double>&& fixed_times) const
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment