dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #05129
Re: stokes plots
On Mon, Jun 11, 2007 at 01:40:50PM -0400, Harish Narayanan wrote:
> pcorreia@xxxxxxxxx wrote:
> > In the Stokes demo the velocity solution is written as a vtk file
> > velocity000000.vtu.
> > How can I plot each of the components say u and v (I use Paraview)? And
> > how to plot the vector field?
> >
> Assuming you've opened the file velocity.pvd in Paraview:
>
> 1. In order to plot the vector field, add a "glyph" from the filter menu
> and point it to the velocity vector (U) as the data source. You can
> change the glyph density, size, shape, etc.
> 2. In order to plot a scalar, such as a velocity component or a norm, I
> use the "calculator" filter. Click calculator, and you can refer to the
> components as U_0 and U_1. So if you wanted to plot the velocity norm,
> you'd "calculate" norm (U) and plot the result, and if you wanted to
> just plot a component, you'd just use U_0 or U_1.
>
> Harish
You should also be able to extract the components in DOLFIN and then
save (or plot) each one of them:
Function u0 = u[0];
Function u1 = u[1];
Then
plot(u0);
plot(u1);
should plot the two components as scalar fields. Or save each one to
VTK format if you don't have Viper.
/Anders
Follow ups
References