Skip to content
Snippets Groups Projects
Commit c9a3db5c authored by Tom Fischer's avatar Tom Fischer
Browse files

[PL/Output] Fix OutputDataSpecification; handle empty repeats_each_steps

parent bd68d365
No related branches found
No related tags found
No related merge requests found
...@@ -40,14 +40,14 @@ inline std::ostream& operator<<(std::ostream& os, ...@@ -40,14 +40,14 @@ inline std::ostream& operator<<(std::ostream& os,
struct OutputDataSpecification final struct OutputDataSpecification final
{ {
OutputDataSpecification( OutputDataSpecification(
std::set<std::string>&& output_variables, std::set<std::string>&& output_variables_,
std::vector<double>&& fixed_output_times, std::vector<double>&& fixed_output_times_,
std::vector<PairRepeatEachSteps>&& repeats_each_steps, std::vector<PairRepeatEachSteps>&& repeats_each_steps_,
bool const output_residuals) bool const output_residuals_)
: output_variables(std::move(output_variables)), : output_variables(std::move(output_variables_)),
fixed_output_times(std::move(fixed_output_times)), fixed_output_times(std::move(fixed_output_times_)),
repeats_each_steps(std::move(repeats_each_steps)), repeats_each_steps(std::move(repeats_each_steps_)),
output_residuals(output_residuals) output_residuals(output_residuals_)
{ {
if (!std::is_sorted(cbegin(fixed_output_times), if (!std::is_sorted(cbegin(fixed_output_times),
cend(fixed_output_times))) cend(fixed_output_times)))
...@@ -56,6 +56,10 @@ struct OutputDataSpecification final ...@@ -56,6 +56,10 @@ struct OutputDataSpecification final
"Vector of fixed output time steps passed to the " "Vector of fixed output time steps passed to the "
"OutputDataSpecification constructor must be sorted"); "OutputDataSpecification constructor must be sorted");
} }
if (repeats_each_steps.empty())
{
repeats_each_steps.emplace_back(1, std::numeric_limits<int>::max());
}
} }
//! All variables that shall be output. //! All variables that shall be output.
......
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