← Back to team overview

dolfin team mailing list archive

Re: Simple post-processing

 

>> For example, I think about grad/rot/div operators. In the simpliest case
>> /demo/pde/poisson, discrete function u is computed. Having u, I would
>> like to compute also e=-grad(u). Of course, I can write own code
>> iterating over cells and calculate gradient, but it won't be very
>> elegant solution.
>> How would you solve such problem?
> 
> Define a form that projects whatever quantity you need to a suitable
> space. Say you want to compute the gradient of a piecewise linear function:
> 
> P1 = FiniteElement("Lagrange", ..., 1)
> P0 = VectorElement("Lagrange", ..., 0)

Thank you. Here we can feel power and flexibility of form compiler :)

For archiving correctness I have to add, that my experiments (and also
your FCC manual) shows that it can't be VectorElement("Lagrange",
"tetrahedron", 0). Minimal degree for Lagrange elements is 1, only
discontinuous Lagrange allows zero degree.
So it should be:
P0 = VectorElement("Discontinuous Lagrange", "tetrahedron", 0)

> Note that you can also define functionals like the integral of u along
> the boundary, the average etc. (Use M instead of a, L in FFC.)

Yes, I've noticed demo/pde/functional example. This feature can be very
useful, but I can't found anything about it in FCC User Manual. It is
newer that documentation?

regards,
BArtek


Follow ups

References