From cb65316c500f3b8142811a6a76296ab166e407f6 Mon Sep 17 00:00:00 2001
From: Timo Koch <timo.koch@iws.uni-stuttgart.de>
Date: Fri, 16 Jul 2021 23:36:09 +0200
Subject: [PATCH] [python][model] Deduce discretization method from the grid
 geometry

---
 python/dumux/common/properties.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/python/dumux/common/properties.py b/python/dumux/common/properties.py
index 0e7e0f2fa4..353cdfe982 100644
--- a/python/dumux/common/properties.py
+++ b/python/dumux/common/properties.py
@@ -153,6 +153,15 @@ class TypeTag:
         else:
             self.isExistingTypeTag = False
 
+        if self.gridGeometry is not None:
+            discretizationMethod = self.gridGeometry.discMethod
+            map = {
+                "box": "BoxModel",
+                "cctpfa": "CCTpfaModel",
+            }
+            if discretizationMethod in map:
+                self.inheritsFrom += [map[discretizationMethod]]
+
         if self.inheritsFrom is not None:
             # treat existing TypeTags by converting the given string to a real TypeTag object
             for idx, parentTypeTag in enumerate(self.inheritsFrom):
-- 
GitLab