i want to create a bigger application around OpenFoam, considering that the meshing is done with a Python api, i want to include the ./Allrun script into my Python files. First instict was to import os in python and insert the commands from the ./Allrun script. However i am only met with following error messages:
./Allrun: line 5: /bin/tools/RunFunctions: No such file or directory
--> FOAM FATAL ERROR :
Could not find mandatory etc entry (mode=ugo)
'controlDict'
--> FOAM FATAL ERROR :
Could not find mandatory etc entry (mode=ugo)
'controlDict'
This is the Python code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
os.system("./Allrun")
and my ./Allrun script:
#!/bin/bash
cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
gmshToFoam constant/pipeHex.msh
createPatch -overwrite
I suppose the problem is related to paths, but i don't have any idea how to resolve this.
Any help is appreciated!