From 77a3ea74ca9296f6ec66f62fca210de23960656b Mon Sep 17 00:00:00 2001
From: Tobias Meisel <tobias.meisel@ufz.de>
Date: Wed, 7 Oct 2020 13:43:44 +0200
Subject: [PATCH] [PL] Parser of PRJ file now allows VTK and XDMF as output
 type

---
 ProcessLib/Output/CreateOutput.cpp | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/ProcessLib/Output/CreateOutput.cpp b/ProcessLib/Output/CreateOutput.cpp
index 0d320c0b884..d7314d72068 100644
--- a/ProcessLib/Output/CreateOutput.cpp
+++ b/ProcessLib/Output/CreateOutput.cpp
@@ -21,6 +21,7 @@
 #include "MeshLib/Mesh.h"
 
 #include "Output.h"
+#include <algorithm>
 
 namespace ProcessLib
 {
@@ -32,7 +33,16 @@ std::unique_ptr<Output> createOutput(
     DBUG("Parse output configuration:");
 
     //! \ogs_file_param{prj__time_loop__output__type}
-    config.checkConfigParameter("type", "VTK");
+    auto const type = config.getConfigParameter<std::string>("type");
+    constexpr std::array data_formats =  { "VTK", "XDMF" };
+    auto format_is_allowed = std::any_of(data_formats.cbegin(), data_formats.cend(),
+        [&type](std::string i ){ return i == type; });
+    if (!format_is_allowed)
+    {
+        OGS_FATAL("No supported file type provided. Read  `{:s}' from <output><type> \
+                    in prj File. Supported: VTK, XDMF.",
+                    type);
+    }
 
     auto const prefix =
         //! \ogs_file_param{prj__time_loop__output__prefix}
-- 
GitLab