jorgensd / dolfinx-tutorial

A reimplementation of the Springer book: https://github.com/hplgit/fenics-tutorial/, covering new topics as well as transitioning from dolfin to dolfinx
https://jorgensd.github.io/dolfinx-tutorial/
110 stars 63 forks source link

Issue on page /chapter1/fundamentals_code.html #125

Open OsbertWang opened 1 year ago

OsbertWang commented 1 year ago

My operating system is Ubuntu 22.04 in WSL for Windows 11. When I run the code, there are two points that need attention. First, pyvista.start_xvfb() should be deleted. I tried to install the recommended packages but failed to run the code. I suspect this is because WSL for Windows 11 already supports GUI in a different way. Second, dolfinx.io.VTXWriter is not defined. I found the code named utils.py, where VTXWriter is defined under the bool if _cpp.common.has_adios2. I think it means that I don't have adios2 in my WSL.

jorgensd commented 1 year ago

First, pyvista.start_xvfb() should be deleted. I tried to install the recommended packages but failed to run the code. I suspect this is because WSL for Windows 11 already supports GUI in a different way.

How are you running the code in the WSL, as a ipynb or as a Python file?

Secondly, how did you install dolfinx and the relevant dependencies?

As you point out in your second question, it does not seem like you have adios2 installed on your system prior to installing dolfinx.

OsbertWang commented 1 year ago

How are you running the code in the WSL, as a ipynb or as a Python file?

I'm running the code in the WSL as a Python file.

Secondly, how did you install dolfinx and the relevant dependencies?

As you point out in your second question, it does not seem like you have adios2 installed on your system prior to installing dolfinx.

I installed dolfinx using the PPA method and did not install adios2 beforehand.

jorgensd commented 1 year ago

I'm running the code in the WSL as a Python file.

you could try adding export PYVISTA_OFF_SCREEN=True in your environment.

I installed dolfinx using the PPA method and did not install adios2 beforehand.

To use adios2 with apt-Get it has to be Pre-installed (I think), as adios2 is not in the ubuntu package manager.

OsbertWang commented 1 year ago

you could try adding export PYVISTA_OFF_SCREEN=True in your environment.

OK. Actually, I have found that I am able to view the results without having to call pyvista.start_xvfb().

To use adios2 with apt-Get it has to be Pre-installed (I think), as adios2 is not in the ubuntu package manager.

Yes. I looked up how to install adios2 on ubuntu, and it seems that it requires installation from source. Unfortunately, I don't feel comfortable doing that at the moment.

OsbertWang commented 1 year ago

These days, I attempted to build ADIOS2 from source but unfortunately failed due to my lack of familiarity with the process. However, upon further exploration, I discovered that both FEniCSx and ADIOS2 are available on conda. As such, I am considering installing these two packages using anaconda instead.