On 22/giu/09, at 13:58, [email protected] wrote:

Hello Luca,

I pass that function as a parameter to a bio-heat solver. So I wouldn't really like it to know about the fact that generated heat is a JouleHeat or some other heat source type. The best way would be usage of Function interface, but it's way too slow to compute without setting active cell. So I'm trying to keep the abstraction level at the FEFieldFunction.

I really use this wrapper to get values of gradients in quadrature points only. Do you think using fe_values.get_function_gradients() will be faster?

Yes.

If you read the documentation, you will see that FEFieldFunction needs to construct a custom quadrature rule *everytime* you call it. If all you are doing is integrating on cells, using a fixed quadrature rule, then this is an unnecessary burden, which will make your code run much slower than it should.

If you build an FEValues object (fed with the correct quadrature rules and update flags), you can extract the informations you need directly from the Vector<double> that represents your heat or whatever it is that you are representing, by calling

fe_v.reinit(cell);

fe_v.get_function_gradients(solution, grads);

and so on, as explained in many tutorials.

FEFieldFunction was really built for cases where nothing else works (for example, if you have a fluid-structure interaction problem, where there is a background fluid mesh, and a moving solid mesh that follows the flow). Of course it works for all other cases as well, and can safely be used as a fast "prototyping" tool, but it will be much slower than using directly FEValues.

Luca.
_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii

Reply via email to