How to write error (or sum of functions) to a file?
Asked by
André Gaul
What is the recommended way of writing a function that is the result of a sum of two functions to a file? The following code fails in the last line with the error message "TypeError: in method 'File___lshift__', argument 2 of type 'dolfin::Function const &'".
=======
from dolfin import *
mesh = UnitSquareMesh(8,8)
V = FunctionSpace(mesh, 'CG', 1)
u_ex = Expression('x[0]')
u = Function(V)
u.interpolate(u_ex)
File('u.pvd') << u
v_ex = Expression('x[1]')
v = Function(V)
v.interpolate(v_ex)
File('v.pvd') << v
File('error.pvd')<< (u-v)
=======
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Martin Sandve Alnæs
- Solved:
- Last query:
- Last reply:
To post a message you must log in.