From 1211f9f31f27a8591e64cb2ae5da15a342f7e042 Mon Sep 17 00:00:00 2001
From: Kilian Weishaupt <kilian.weishaupt@iws.uni-stuttgart.de>
Date: Tue, 8 May 2018 18:30:52 +0200
Subject: [PATCH] [freeflow][boundarytypes] Forbid setting everything to
 Dirichlet/Neumann

* not a valid combination
---
 .../staggered/freeflow/boundarytypes.hh       | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/dumux/discretization/staggered/freeflow/boundarytypes.hh b/dumux/discretization/staggered/freeflow/boundarytypes.hh
index e521a3b0a4..3ad4f51e7b 100644
--- a/dumux/discretization/staggered/freeflow/boundarytypes.hh
+++ b/dumux/discretization/staggered/freeflow/boundarytypes.hh
@@ -24,8 +24,8 @@
 #ifndef STAGGERED_FREEFLOW_BOUNDARY_TYPES_HH
 #define STAGGERED_FREEFLOW_BOUNDARY_TYPES_HH
 
-#include <dumux/common/properties.hh>
 #include <dumux/common/boundarytypes.hh>
+#include <dumux/common/typetraits/typetraits.hh>
 
 namespace Dumux
 {
@@ -102,6 +102,23 @@ public:
     bool isSymmetry() const
     { return boundaryInfo_[0].isSymmetry; }
 
+    /*!
+     * \brief  Prevent setting all boundary conditions to Dirichlet.
+     */
+    template<class T = void>
+    void setAllDirichlet()
+    {
+        static_assert(AlwaysFalse<T>::value, "Setting all boundary types to Dirichlet not permitted!");
+    }
+
+    /*!
+     * \brief  Prevent setting all boundary conditions to Neumann.
+     */
+    template<class T = void>
+    void setAllNeumann()
+    {
+        static_assert(AlwaysFalse<T>::value, "Setting all boundary types to Neumann not permitted!");
+    }
 
 protected:
     struct StaggeredFreeFlowBoundaryInfo {
-- 
GitLab