Where to find 'project'-function in dolfinx?

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/projection.py at master · 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.

4 Likes