mikaem / fenicstools

55 stars 36 forks source link

Clement interpolation #10

Closed MiroK closed 8 years ago

MiroK commented 8 years ago

I have added Clement interpolation of argitrary UFL built expressions. The interpolant is constructed by precomputing and caching certain averaging operator which is then applied to construct the resulting $CG_1$ (scalar, vector, tensor) function. By running the demos you'll see that the order of convergence of the interpolant is 1.5 in $L^2$ norm (this is tested on a jungle of expressions in 1d, 2d and 3d). You'll also see that the algorithm scales linearly with number of dofs of the interpolant. The tests pass but coverage of the functionality is not 100%. In particular, I have not seen if the code works in parallel. Also, before this is merged, performance of repeated clement_interpolate vs ClementInterpolant.__call__ should be evaluated. Finally the demos could be made nicer (perhaps). More suggestions?

MiroK commented 8 years ago

I added parallel tests for ClementInterpolation functionality. All tests are green. The demos are much nicer + there's a new performance demo which shows that if ClementInterpolant instance is reused you gain about 12x speed up relative to clement_interpolate. I have opened #11 as a reminder for some things to improve in the future. But for now I am done :)