Lucas,
do I understand right that what you want is something like
v_h = f(u_h)
where f(u) is some function of the solution? If so, you're right that that
cannot hold pointwise if u_h is a finite element function and v_h should also
be a finite element function unless f has a special structure and the spaces
for u_h and v_h match. So you need
v_h = I_h f(u_h) -- interpolation
or
v_h = Pi_h f(u_h) -- projection
Which of these two you choose typically depends on the application you have.
The projection only requires you to apply f at quadrature points, and so
that's going to be easy. For I_h, you need to evaluate f(u) at the *nodal*
points of the space for v_h. That too is not complicated but you probably want
to write the interpolation function yourself, after looking at how this is
implemented in VectorTools::interpolate.
The cheap way to do the latter (but also the slow way) is to use the
FEFieldFunction class to evaluate u_h at arbitrary points. You'd then write
your own class derived from Function that gets a point as argument, calls
FEFieldFunction to evaluate u_h(x), computes f(u_h(x)), and returns that
value. This kind of function you can then provide to VectorTools::interpolate.
The problem is that FEFieldFunction is expensive. If you don't care about
speed, this is the way to go. If you do for whatever reason care about speed,
go with the approach in the previous paragraph :-)
Best
W.
--
------------------------------------------------------------------------
Wolfgang Bangerth email:
bang...@colostate.edu
www:
http://www.math.colostate.edu/~bangerth/