1

I'm having the same difficulty as the one expressed here: Cannot connect to X server using docker on OSX

I'm very confused about the recommended instructions in the above link (I'm a novice on docker), and I'm hoping to get clarification about the following:

1) Do we "touch foo.foam" in a regular OS X terminal or do we touch it in the docker terminal; in my case, following "docker run -ti openfoamplus/of_v30plus_rhel66 /bin/bash"

2) You suggest running paraview (mine is the most recent) just like any other Mac app. So, basically, to double-click on paraview in the Applications folder? But when opening foo.foam via the Open Menu do we just open foo.foam and press the Apply button (it gives errors), or do we actually enter "paraview foo.foam" as per your instruction above? If the latter, then nothing really happens; I can't open anything!

3) If we're supposed to just open foo.foam, what do we do after that? How is docker even aware about any of this? Anyway, when I type paraview from within docker (after foo.foam is opened) I get the same X server error. I wouldn't expect otherwise!

Hopefully, you can provide a more step-by-step set of instructions?

Thanks in advance

Community
  • 1
  • 1
ASR
  • 11
  • 1
  • 2
  • The answer you link says to download the paraview binary for mac, do you have any special requirement to use docker? – lib Apr 12 '16 at 09:32
  • I have Paraview binary for mac installed, as well as docker, within which I run OpenFoam (without problem). However, Paraview and paraFoam applications provided in OpenFoam do not work (give the X server connection error). The instructions in the link are supposed to allow a person to use the Paraview binary for mac to view the OpenFoam data in docker. But the instructions are not clear to me at all. I have followed the proposed steps but I still get the X server error, so, something's missing and/or unclear in the instructions. – ASR Apr 14 '16 at 07:44
  • No, they are supposed to use the Paraview binary for mac to view the openfoam data in mac... – lib Apr 14 '16 at 10:43

1 Answers1

1

#First steps with OpenFoam

You've successfully followed the instructions to run the cavity problem, but you run the final command paraview and the spits back an error about x server being unavailable.

here's what you do:

Download paraview natively to your mac. Then open up a terminal window and cd into the directory that you ran the cavity problem in. (note sure what directory? jump back to your docker shell and run echo $FOAM_RUN)

Once you're inside the cavity directory, make a new .foam file and open it with paraview.

$ touch foam.foam
$ open -a paraview foam.foam 

Click on that Apply button - middle of the screen on the left. At the top screen you can then select things like pressure p and plot type surface, and step through the time dumps in the upper right (initially my mesh didn't render correctly, so I had to deselect internalMesh, apply, and then select it and apply again).

enter image description here

Not really sure what you're looking at? Here's the tutorial for the problem:
http://www.openfoam.com/documentation/user-guide/cavity.php#x5-40002.1

Ali_Sh
  • 2,667
  • 3
  • 43
  • 66
Ben
  • 6,986
  • 6
  • 44
  • 71
  • Thanks for the response. However, I run OpenFoam from within docker. So, I don't have access to the files from any terminal; I have to run paraview and access my files from within docker. When I run "open -a paraview foam.foam" in docker I get "bash: open: command not found". – ASR May 12 '16 at 22:49
  • @ASR That is how I run openFoam too, but I can access the files from elsewhere. Inside of docker, what does `echo $FOAM_RUN` return? – Ben May 14 '16 at 20:59
  • thanks @hansatz; docker run -ti openfoamplus/of_v30plus_rhel66 /bin/bash ; echo $FOAM_RUN returns /root/OpenFOAM/-v3.0+/run – ASR May 15 '16 at 23:46
  • Try running a file from a shared directory. i.e. `/Users//run/` – Ben May 16 '16 at 19:01
  • First, I apologize; I'm a complete novice on docker, so I probably need to be spoonfed :) Second, I'm not sure what you're suggesting with /Users//run/ as a "shared" directory; what is it that run is shared with? As you have it stated, it's just a directory under /Users/. Anyway, there is no "run" directory under /Users/. Thanks in advance for the clarification – ASR May 22 '16 at 23:51
  • I just mean a directory that can be accessed between both Docker and OSX. `run` does not exist currently, it's something you would have to create. There is nothing special about the location of `$FOAM_RUN`, it's just a place to put files. This can be any folder you want it to be. Inside of Docker try exploring the file structure, go to your home directory `/Users/` and convince yourself that you can see the same files as you would if you opened up that location in Finder. good luck, and report back with findings. – Ben May 23 '16 at 00:07
  • "a directory that can be accessed between both Docker and OSX". On the Mac, everything seems to be internal to docker. When one starts docker at a terminal and checks the file system one sees a linux structure starting at "/". But there are no docker-mac shared directories that I can see, which can be accessed from the mac side. This appears to be a common issue: please see "practicalities" in http://www.cfd-online.com/Forums/openfoam-installation-windows-mac/165064-mac-os-x-of23x-development-environment-using-docker.html. I'd really appreciate it if you'd spell out the steps you take. – ASR May 31 '16 at 00:30
  • What directories do you see at "/"? – Ben Jun 03 '16 at 17:39
  • following "docker run -ti openfoamplus/of_v30plus_rhel66 /bin/bash", "ls /" returns "bin dev etc home lib lib64 lost+found media mnt opt proc root sbin selinux srv sys tmp usr var". BTW, my OpenFoam is in "/opt/OpenFOAM"; however, "echo $FOAM_RUN" returns "/root/OpenFOAM/-v3.0+/run". In "/root" I have ". .. .bash_history .bash_logout .bash_profile .bashrc .cshrc .entry.sh .mozilla .OpenFOAM .tcshrc". ".OpenFoam" only has a ".wmake", which is completely empty inside. – ASR Jun 06 '16 at 00:27
  • Try following the install instructions through here: http://www.openfoam.com/download/install-binary.php and starting docker with the quickstart terminal – Ben Jun 06 '16 at 00:34
  • OK. It will take some time due to other priority items, but I will return with a "progress report" once I'm done. Thanks. – ASR Jun 08 '16 at 22:04