Small questions about pyvista.Plotter() and FEniCS-X

Hi all! I would like to know how to change the window size of pyvista.Plotter()?
I try to use plotter = pyvista.Plotter(window_size=[600,2000]), and the window size does become larger, but there is a very thick gray edge. How to eliminate the thick gray edge?

In addition, I have two small questions about FEniCS-X:

(1) How to refine the mesh of the quadrilateral elements? It seems the refine function is only applicable to the simplex elements.

(2) How to conduct the parallel computation with MPI.SUM, MPI.MIN, MPI.MAX and so on? In the classical FEniCS, we can use comm = mesh.mpi_comm() and MPI.min(comm, some_value), but it does not work in FEniCS-X.

Thanks!

If you use the interactive mode with pyvista you can scale the window as you please. If you use the screenshot mode, you need to fiddle with Camera parameters. See for instance https://github.com/FEniCS/dolfinx/blob/main/python/demo/pyvista/demo_pyvista.py#L105 and the following lines, or the pyvista documentation.

There is currently no support for refinement of non-simplices.

See for instance:

or the general mpi4py documentation: Overview — MPI for Python 3.1.5 documentation
as dolfinx uses mpi4py.

Thank you, Dokken. And I have another small question about FEniCSX. Is there some way to calculate the gradient (like strain and heat flux) within the domain instead of the nodal points? Since I want to calculate the average gradient over the domain.

Project the gradient into an appropriate space, and use point evaluation (as shown in the membrane tutorial)
You can also have a look at: FEniCS 2021: FFCx code generation for expressions

Yes, actually I was also using this projection method. However, this tutorial only computes the nodal values with pressure.compute_point_values(). Can we compute the values within the element such as the Gauss integration points or center point? Since gradients might be discontinuous at the nodal points.

As shown here: Implementation — FEniCS-X tutorial
You can evaluate a dolfinx function at any point (here sampling a line through) the domain, that is not aligning with grid nodes