This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

What exactly does "grad" function do?

+2 votes

I am trying to figure out what does the operator "grad" in FEniCS do to a function associated to a set of basis functions when the function is discontinuous across edges? It seems to me that I can blindly apply this to a function, for example using "RT" elements (discontinuous across edges in tangential direction), but what does grad(u) return? Does it do things element-wise? if so, then what does this mean in terms of edge-based element like RT/BDM/Nedelec?

Thanks very much!

asked Feb 20, 2014 by dzhou FEniCS Novice (170 points)

1 Answer

+1 vote
 
Best answer

It is element-wise. The dx will typically translate to quadrature points
inside the element. You may want to include jump and average terms multiplied with dS
(with quadrature points on the facet) if you want to represent grad with
RT, BDM and Nedelec elements.

answered Feb 22, 2014 by Kent-Andre Mardal FEniCS Expert (14,380 points)
selected Mar 19, 2014 by Jan Blechta

Thanks for you answer!
Just want to make sure I understand it correctly, by only using "dx", I am essentially ignoring the discontinuity across elements and just looking gradient within each element. Is that right?
By the way, where can I find info relate to this? The documentation is not clear enough...

Thanks again!

Is that right?

Yes.

The documentation is not clear enough...

You can improve it.

...