project

dolfin.fem.projection.project(v, V=None, bcs=None, mesh=None, solver_type='cg', preconditioner_type='default', form_compiler_parameters=None)

Return projection of given expression v onto the finite element space V.

Arguments
v
a Function or an Expression
bcs
Optional argument list of DirichletBC
V
Optional argument FunctionSpace
mesh
Optional argument mesh.
solver_type
see solve for options.
preconditioner_type
see solve for options.
form_compiler_parameters
see Parameters for more information.

Example of usage

v = Expression("sin(pi*x[0])")
V = FunctionSpace(mesh, "Lagrange", 1)
Pv = project(v, V)

This is useful for post-processing functions or expressions which are not readily handled by visualization tools (such as for example discontinuous functions).