Paraview to visualize a field like in the tutorial

I realize it’s a question related to Paraview more than FEniCS, but I am trying to reproduce the views of magnetostatics.py from the FEniCS tutorial. I am talking about the figure 15 and figure 16 of https://fenicsproject.org/pub/tutorial/html/._ftut1015.html.
When I plot the vector potential using Paraview, by default it is a flat 2D surface that looks like it could become the picture of the FEniCS tutorial if I managed to make it three dimensional, but I haven’t found out how to achieve this. Any idea?

And regarding the magnetic field itself (figure 16), Paraview shows, by default, a single color (and no indication of any value). Examining the field.vtu file with a text editor seems to indicate non zero values, so Paraview should in principle be able to show some patterns instead of a flat color. I am not sure how to reproduce figure 16 at all. Any pointer?

Use the Warp by Scalar Filter. (I’ve recently updated this demo to be used with dolfin-X, and I’ve mentioned this feature specifically at the end of https://jorgensd.github.io/dolfinx-tutorial/chapter3/em.html).

In general, in paraview you have an option to chose the variable you would like to visualize.
button
Below it says vtkBlockColors, and can be changed to the field of interest.

1 Like

First of all, thanks a lot for the very quick response. I was not aware of the documentation for dolfinx, I will try to switch to it.

Thanks to your guidance I was able to reproduce the vector potential in Paraview. I also had to increase the “scale factor” in Paraview for the 3D view to appear.

However I am still unable to visualize the magnetic field.
Now, when selecting the field, all I get is the following (low resolution? So strange…) picture.


It looks very different than figure 16 of the tutorial.

The magnetic field is a vector field, and can be visualized either by using the Glyphs filter (with corresponding scaling), or the Stream Tracer to create a plot similar to the one in figure 16.

1 Like

I would hold off switching for a little while, we are making quite a few interface changes atm, to make it easier for end-users. However, feel free to leave feedback on the tutorial, using the issue tracker on the top of the page/

1 Like

Alright. On the top of my head, right now, I would say a documentation (I guess it already exists?) about how to import mesh files that are generated for example with gmsh, as I believe the support for mshr is dropped now and the only way to deal with a mesh is with an external generation.

I have a two tutorials on my personal web page:

And there are several examples (the EM example and deflection of a membrane) that used the Gmsh Python interface to create meshes in the dolfin-x tutorial.

1 Like