project
is just syntactic sugar. The projection f_h of a function f onto the space V is found by computing the problem: find f_h \in V such that
(f_h, v) = (f, v) \quad \forall v \in V.
This is very easy to set up. See for example @michalhabera 's implementation in dolfiny
: dolfiny/src/dolfiny/projection.py at 202e43711c54bb5d376a6e622e0bc896a20102dd · michalhabera/dolfiny · GitHub.
The problem with the project
syntax is the uninformed user will assume it will handle many esoteric cases. For example, incomplete data in f, singular components in V, obscure functions f, reusing the LU factorisation for multiple projections onto the same space, and so on… Each of these user dependent cases should be handled by whatever the user’s numerical problem requires, and not a catch-all project
function.