From c9a3db5c78afca2c79e6891f1029a600eefdc6fe Mon Sep 17 00:00:00 2001
From: Thomas Fischer <thomas.fischer@ufz.de>
Date: Thu, 25 Aug 2022 15:37:22 +0200
Subject: [PATCH] [PL/Output] Fix OutputDataSpecification; handle empty
 repeats_each_steps

---
 ProcessLib/Output/OutputDataSpecification.h | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/ProcessLib/Output/OutputDataSpecification.h b/ProcessLib/Output/OutputDataSpecification.h
index 48b4596d8cd..5b5768844eb 100644
--- a/ProcessLib/Output/OutputDataSpecification.h
+++ b/ProcessLib/Output/OutputDataSpecification.h
@@ -40,14 +40,14 @@ inline std::ostream& operator<<(std::ostream& os,
 struct OutputDataSpecification final
 {
     OutputDataSpecification(
-        std::set<std::string>&& output_variables,
-        std::vector<double>&& fixed_output_times,
-        std::vector<PairRepeatEachSteps>&& repeats_each_steps,
-        bool const output_residuals)
-        : output_variables(std::move(output_variables)),
-          fixed_output_times(std::move(fixed_output_times)),
-          repeats_each_steps(std::move(repeats_each_steps)),
-          output_residuals(output_residuals)
+        std::set<std::string>&& output_variables_,
+        std::vector<double>&& fixed_output_times_,
+        std::vector<PairRepeatEachSteps>&& repeats_each_steps_,
+        bool const output_residuals_)
+        : output_variables(std::move(output_variables_)),
+          fixed_output_times(std::move(fixed_output_times_)),
+          repeats_each_steps(std::move(repeats_each_steps_)),
+          output_residuals(output_residuals_)
     {
         if (!std::is_sorted(cbegin(fixed_output_times),
                             cend(fixed_output_times)))
@@ -56,6 +56,10 @@ struct OutputDataSpecification final
                 "Vector of fixed output time steps passed to the "
                 "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.
-- 
GitLab