From 66093f1e7f1ad49926268d824eaa38c18622f415 Mon Sep 17 00:00:00 2001
From: Wenqing Wang <wenqing.wang@ufz.de>
Date: Tue, 27 Jul 2021 10:32:58 +0200
Subject: [PATCH] [THM] Check the shape function orders

---
 .../CreateThermoHydroMechanicsProcess.cpp         | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/ProcessLib/ThermoHydroMechanics/CreateThermoHydroMechanicsProcess.cpp b/ProcessLib/ThermoHydroMechanics/CreateThermoHydroMechanicsProcess.cpp
index cc363c422b5..9f3996a247e 100644
--- a/ProcessLib/ThermoHydroMechanics/CreateThermoHydroMechanicsProcess.cpp
+++ b/ProcessLib/ThermoHydroMechanics/CreateThermoHydroMechanicsProcess.cpp
@@ -87,6 +87,21 @@ std::unique_ptr<Process> createThermoHydroMechanicsProcess(
         variable_u = &process_variables[2][0].get();
     }
 
+    if (variable_T->getShapeFunctionOrder() != 1)
+    {
+        OGS_FATAL(
+            "The shape function order of temperature must be 1 but its input "
+            "value in <process_variable><order> is {:d}. Please correct it.",
+            variable_T->getShapeFunctionOrder());
+    }
+    if (variable_p->getShapeFunctionOrder() != 1)
+    {
+        OGS_FATAL(
+            "The shape function order of pressure must be 1 but its input "
+            "value in <process_variable><order> is {:d}. Please correct it.",
+            variable_p->getShapeFunctionOrder());
+    }
+
     DBUG("Associate displacement with process variable '{:s}'.",
          variable_u->getName());
 
-- 
GitLab