CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (http://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   Creating shortcut for HelyxOS (http://www.cfd-online.com/Forums/openfoam-pre-processing/125475-creating-shortcut-helyxos.html)

UPengineer October 26, 2013 06:33

Creating shortcut for HelyxOS
 
Hello,

I am very new to both OpenFOAM and linux. I have been using HelyxOS v1.0.3 GUI for OpenFOAM 2.2.1 on Ubuntu 12.04.

I have been trying to create a shortcut to the HelyxOS on my desktop instead of manually entering in the path every time I would like to open HelyxOS, and also because others (even less linux proficient than I) will be using it in the future.

One method I have been attempting to try is by creating a text file on my desktop as below:

[Desktop Entry]
Name=HelyxOS
Exec=~/Documents/Engys/HelyxOS/v1.0.3/helyxOS.sh
Terminal=true
Type=Application


I also made sure to "allow executing file as program" in the permission tab of the properties. The problem with this is that when I double click to open and click "Run in Terminal" the terminal will pop up for 1 second and then nothing will happen.

After this I then did more research and attempted to create a launcher from gnome, meaning.
gnome-desktop-item-edit --create-new ~/Desktop

which prompted me with:

"Type"
"Name"
"Command"
"Comment"

which I filled out with:

Type --> Application
Name --> HelyxOS
Command --> /home/[User]/Documents/Engys/HelyxOS/v1.0.3/helyxOS.sh
Comment --> [None]


The problem with this is that it does not open HelyxOS from the terminal so I get the old
"Error loading VTK Librares" which also seems to happen if I try opening HelyxOS from the
folder itself with the terminal.

The only way I have been able to successfully run HelyxOS is by starting in the terminal:

>> cd Documents/Engys/HelyxOS/v1.0.3/
>> ./helyxOS.sh


Please help me understand what I am doing incorrectly.

Thank you


wyldckat October 26, 2013 11:46

Greetings UPengineer and welcome to the forum!

Many thanks for sharing this idea! Here's what I suggest and should fix the problem:
  1. If you are using OpenFOAM 2.2.1 from the Deb packages for Ubuntu, make sure you have got the symbolic link for "libmpi.so.1" ready to be used for HelyxOS:
    Code:

    cd Engys/HelyxOS/v1.0.3/
    ln -s $MPI_ARCH_PATH/lib/libmpi.so "ext/libmpi.so.1"

  2. Edit the script "Engys/HelyxOS/v1.0.3/helyxOS.sh" and change the contents from this:
    Code:

    #!/bin/bash -x

    THIS_FILE=`readlink -f $0`
    THIS_FOLDER=`dirname $THIS_FILE`

    export HELYX_LAUNCHER=$THIS_FILE
    source $THIS_FOLDER/bin/launcher.conf

    launch "HelyxOS"

    To this:
    Code:

    #!/bin/bash

    source /opt/openfoam221/etc/bashrc

    THIS_FILE=`readlink -f $0`
    THIS_FOLDER=`dirname $THIS_FILE`

    cd "${0%/*}"

    export HELYX_LAUNCHER=$THIS_FILE
    source $THIS_FOLDER/bin/launcher.conf

    launch "HelyxOS"

    This will ensure that the script is launching in a working OpenFOAM environment and that it's being launched from the correct folder (just in case ;)).
  3. Edit the file "Engys/HelyxOS/v1.0.3/bin/launcher.conf" and comment out the first export lines, namely by changing this code:
    Code:

    #!/bin/bash

    THIS_FILE=`readlink -f $0`
    THIS_FOLDER=`dirname $THIS_FILE`

    To this:
    Code:

    #!/bin/bash

    #THIS_FILE=`readlink -f $0`
    #THIS_FOLDER=`dirname $THIS_FILE`


And the rest is as you documented, namely for the desktop link!

Best regards,
Bruno

UPengineer October 29, 2013 00:51

Hello Bruno,

Thank you very much for your quick reply! I followed steps 1 through 3 as suggested. Fortunately HelyxOS appears to be working now from the Desktop without any library errors.

Unfortunately though I am unable to mesh in HelyxOS because I get multiple errors from HelyxOS for not being able to find blockMesh or snappyHexMesh as seen below in the terminal.


Code:


CASE: /home/kramer/OpenFOAM/kramer-2.2.1/run/New_Attempt
NP:  -1
/home/kramer/OpenFOAM/kramer-2.2.1/run/New_Attempt/mesh.run: line 7: blockMesh: command not found
/home/kramer/OpenFOAM/kramer-2.2.1/run/New_Attempt/mesh.run: line 8: snappyHexMesh: command not found
kramer@ubuntu:~/Documents/Engys/HelyxOS/v1.0.3$


I have never experienced these errors before. I feel that it is due to not correctly following step 1 since I just copied and pasted without knowing what
$MPI_ARCH_PATH is. I do not know if you mean that specific path, or the corresponding path on my system.

Thank you again anyway. Once I get this issue solved navigating to HelyxOS will be a lot more convenient in the future. I really appreciate your time and help.

Cheers,

Kramer

wyldckat November 2, 2013 17:27

Hi Kramer,

The problem you're seeing is likely because you missed something in step #2, namely this line:
Code:

source /opt/openfoam221/etc/bashrc
This assumed that you have OpenFOAM 2.2.1 installed at "/opt/openfoam221".

Best regards,
Bruno

UPengineer November 2, 2013 21:20

[Solved]
 
Hello again wyldckat!

I had actually figured that out yesterday when I went back through each step that you had sent. It is functioning perfectly! I am very impressed with your knowledge on the software and C++ code.
Thank you for all your help.

Sincerely,

Kramer


All times are GMT -4. The time now is 03:58.