Using exactly the example given at the dolfinx home page as shown below (I am not allowed to include a link), the code block runs giving “loading widget” and nothing else happens. Is there an easier way to plot the solution output. It would seem reasonable to use the solution to interpolate of any slice of points you want - to the extent that a function might already exist.
try:
import pyvista
cells, types, x = plot.vtk_mesh(V)
grid = pyvista.UnstructuredGrid(cells, types, x)
grid.point_data["u"] = uh.x.array.real
grid.set_active_scalars("u")
plotter = pyvista.Plotter()
plotter.add_mesh(grid, show_edges=True)
warped = grid.warp_by_scalar()
plotter.add_mesh(warped)
if pyvista.OFF_SCREEN:
plotter.screenshot(out_folder / "uh_poisson.png")
else:
plotter.show()
except ModuleNotFoundError:
print("'pyvista' is required to visualise the solution.")
print("To install pyvista with pip: 'python3 -m pip install pyvista'.")
It would also be useful to know how you installed DOLFINx (apt/conda/spack/docker).
and make sure that you have installed pip install trame-jupyter-extension
I barely know as I had a nightmare of a time trying to get things installed. I think it was done with conda and maybe pip for the gmsh as the latter didn’t work with conda. Basically my experience so far is that nothing in the tutorials/instructions work from start to finish so it has been a rather frustrating experience. It would be for more helpful to explain how the data/code is structured than it is to outline how a PDE is mathematically defined. At this point I am only doing a 2D problem so I ended up using
and plotting it with matplotlib - but it took sometime to find that construct. Honestly I have no idea what I am supposed to do with the information you have given. Guessing, I need to find some file .bash or .zshrc file and put that stuff you have suggested into it. But I would say there is a 90% probability that it will just generate new problems. I’ll try the pip install since one more thing is just one more thing - google suggest others that I tried.
We try our best to have instructions as to how to use DOLFINx on most systems. However it is hard to catch every corner case.
The following conda environment works nicely with jupyter lab on my linux system: