From a6312df1b40f30826b693c98d7dd9f33f0dad04e Mon Sep 17 00:00:00 2001
From: Norihiro Watanabe <norihiro.watanabe@ufz.de>
Date: Tue, 1 Nov 2016 21:54:07 +0100
Subject: [PATCH] fatal if the given shape function order is not supported

---
 ProcessLib/ProcessVariable.cpp          | 3 +++
 ProcessLib/Utils/LocalDataInitializer.h | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/ProcessLib/ProcessVariable.cpp b/ProcessLib/ProcessVariable.cpp
index 58e3c441585..148e9859d4a 100644
--- a/ProcessLib/ProcessVariable.cpp
+++ b/ProcessLib/ProcessVariable.cpp
@@ -37,6 +37,9 @@ ProcessVariable::ProcessVariable(
 {
     DBUG("Constructing process variable %s", _name.c_str());
 
+    if (_shapefunction_order < 1 || 2 < _shapefunction_order)
+        OGS_FATAL("The given shape function order %d is not supported", _shapefunction_order);
+
     // Boundary conditions
     //! \ogs_file_param{prj__process_variables__process_variable__boundary_conditions}
     if (auto bcs_config = config.getConfigSubtreeOptional("boundary_conditions"))
diff --git a/ProcessLib/Utils/LocalDataInitializer.h b/ProcessLib/Utils/LocalDataInitializer.h
index f9bd9b7a6d9..2708ecc8b47 100644
--- a/ProcessLib/Utils/LocalDataInitializer.h
+++ b/ProcessLib/Utils/LocalDataInitializer.h
@@ -133,6 +133,9 @@ public:
         const unsigned shapefunction_order)
         : _dof_table(dof_table)
     {
+        if (shapefunction_order < 1 || 2 < shapefunction_order)
+            OGS_FATAL("The given shape function order %d is not supported", shapefunction_order);
+
         if (shapefunction_order == 1)
         {
         // /// Lines and points ///////////////////////////////////
-- 
GitLab