Dolfin in python: How do i read data from a .pvd file and plot it?
Asked by
Jens V Christiansen
Hi,
How do i read data from a .pvd file and plot it?
Say for instance the velocity solution to the stokes-iterative problem:
from dolfin import *
# Load mesh and subdomains
mesh = UnitCube(16, 16, 16)
# Define function spaces
V = VectorFunctionS
Q = FunctionSpace(mesh, "CG", 1)
W = V * Q
(u, p) = TrialFunctions(W)
# Load solution in VTK format
File("velocity.
pfile_pvd = File("pressure.
pfile_pvd >> p
# Plot solution
plot(u)
plot(p)
interactive()
-------
I get the following error:
Traceback (most recent call last):
File "plot_solution.py", line 20, in <module>
File(
TypeError: in method 'File___rshift__', argument 2 of type 'dolfin:
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Jens V Christiansen
- Solved:
- Last query:
- Last reply:
To post a message you must log in.