Strange behaviour of grad(gfu_potential)

Hello,

I try to take the gradient of a scalar field. When looking at the result with ParaView i see very strange Glyphs.
See the attached picture. I can’t figure out where I made a mistake?


https://ngsolve.org/media/kunena/attachments/934/Conducting_bar_Current.py

With best regards,

Attachment: Conducting_bar_Current.py

Hello,

i noticed the same strange behavior when i want to visualize the global load vector (rhs) as a GridFunction in Paraview.

Has somebody found a solution yet ?

Best regards

When u is an order 1 H1 function, its gradient is piecewise constant, but not continuous, so you get different gradients from different elements. I think that explains the picture from your first post.

As for visualizing the rhs, did you just copy the vector into a gridfunction? That does not work, the right hand side is a dual vector, not a FEM function.