From 48077c19665d56f738c95442654cd0b7cfc62f0d Mon Sep 17 00:00:00 2001
From: Paul Dechamps <paul.dechamps@uliege.be>
Date: Thu, 30 Nov 2023 14:49:41 +0100
Subject: [PATCH] (chore) Added dartflo in python path

dart module is added to the python path and can be imported when running test cases
---
 blast/_src/CMakeLists.txt              | 2 +-
 blast/interfaces/dart/DartInterface.py | 2 +-
 run.py                                 | 6 +++++-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/blast/_src/CMakeLists.txt b/blast/_src/CMakeLists.txt
index b24d48d..1f7d54b 100644
--- a/blast/_src/CMakeLists.txt
+++ b/blast/_src/CMakeLists.txt
@@ -26,9 +26,9 @@ SET_PROPERTY(TARGET blastw PROPERTY SWIG_USE_TARGET_INCLUDE_DIRECTORIES ON)
 MACRO_DebugPostfix(blastw)
 
 TARGET_INCLUDE_DIRECTORIES(blastw PRIVATE ${PROJECT_SOURCE_DIR}/blast/_src
-                                        ${PROJECT_SOURCE_DIR}/modules/dartflo/dart/_src
                                         ${PROJECT_SOURCE_DIR}/modules/dartflo/ext/amfe/tbox/_src
                                         ${PROJECT_SOURCE_DIR}/modules/dartflo/ext/amfe/fwk/_src
+                                        ${PROJECT_SOURCE_DIR}/modules/dartflo/dart/_src
                                         ${PYTHON_INCLUDE_PATH})
 TARGET_LINK_LIBRARIES(blastw PRIVATE blast dart tbox fwk ${PYTHON_LIBRARIES})
 
diff --git a/blast/interfaces/dart/DartInterface.py b/blast/interfaces/dart/DartInterface.py
index 10c0f11..92c7919 100644
--- a/blast/interfaces/dart/DartInterface.py
+++ b/blast/interfaces/dart/DartInterface.py
@@ -27,7 +27,7 @@ from blast.interfaces.DSolversInterface import SolversInterface
 class DartInterface(SolversInterface):
     def __init__(self, dartCfg, vSolver, _cfg):
         try:
-            from dartflo.dart.api.core import initDart
+            from modules.dartflo.dart.api.core import initDart
             argOut = initDart(dartCfg, viscous=True)
             self.solver = argOut.get('sol') # Solver
             self.wrt = argOut.get('wrt') # Writer
diff --git a/run.py b/run.py
index 61cb32b..c78653c 100755
--- a/run.py
+++ b/run.py
@@ -22,10 +22,14 @@ def main():
     import os.path, sys
     # adds fwk/tbox to the python path
     thisdir = os.path.split(os.path.abspath(__file__))[0]
-    fwkdir = os.path.abspath(os.path.join(thisdir, 'modules/dartflo/ext/amfe'))
+    fwkdir = os.path.abspath(os.path.join(thisdir, 'modules', 'dartflo', 'ext', 'amfe'))
+    dartflodir = os.path.abspath(os.path.join(thisdir, 'modules', 'dartflo'))
     if not os.path.isdir(fwkdir):
         raise Exception('blaster/modules/dartflo/amfe not found!\n')
+    if not os.path.isdir(dartflodir):
+        raise Exception('blaster/modules/dartflo not found!\n')
     sys.path.append(fwkdir)
+    sys.path.append(dartflodir)
     # adds "." to the pythonpath
     sys.path.append(thisdir)
 
-- 
GitLab