From 7aab0bced816af52c32ada72510b126f8ed08d00 Mon Sep 17 00:00:00 2001
From: Wenqing Wang <wenqing.wang@ufz.de>
Date: Wed, 5 May 2021 16:36:46 +0200
Subject: [PATCH] [HM] Added a restriction to vertical mesh

---
 .../HydroMechanics/CreateHydroMechanicsProcess.cpp  | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/ProcessLib/HydroMechanics/CreateHydroMechanicsProcess.cpp b/ProcessLib/HydroMechanics/CreateHydroMechanicsProcess.cpp
index aec517c09e3..ec6f085e20f 100644
--- a/ProcessLib/HydroMechanics/CreateHydroMechanicsProcess.cpp
+++ b/ProcessLib/HydroMechanics/CreateHydroMechanicsProcess.cpp
@@ -19,6 +19,7 @@
 #include "MaterialLib/MPL/Medium.h"
 #include "MaterialLib/SolidModels/CreateConstitutiveRelation.h"
 #include "MaterialLib/SolidModels/MechanicsBase.h"
+#include "MeshLib/Utils/Is2DMeshOnRotatedVerticalPlane.h"
 #include "ParameterLib/Utils.h"
 #include "ProcessLib/Output/CreateSecondaryVariables.h"
 #include "ProcessLib/Utils/ProcessUtils.h"
@@ -42,6 +43,18 @@ std::unique_ptr<Process> createHydroMechanicsProcess(
     config.checkConfigParameter("type", "HYDRO_MECHANICS");
     DBUG("Create HydroMechanicsProcess.");
 
+    if (DisplacementDim == 2)
+    {
+        if (mesh.isAxiallySymmetric() &&
+            MeshLib::is2DMeshOnRotatedVerticalPlane(mesh))
+        {
+            OGS_FATAL(
+                "Mesh {:s} is on a plane rotated around the vertical axis. The "
+                "axisymmetric problem can not use such mesh.",
+                mesh.getName());
+        }
+    }
+
     auto const staggered_scheme =
         //! \ogs_file_param{prj__processes__process__HYDRO_MECHANICS__coupling_scheme}
         config.getConfigParameterOptional<std::string>("coupling_scheme");
-- 
GitLab