vedo icon indicating copy to clipboard operation
vedo copied to clipboard

Using vedo to plot a slice of the 3D velocity field (dolfin simulation)

Open Tom303-afk opened this issue 4 years ago • 2 comments

Dear all,

Is it possible to use the slicePlane utility to get a (2D) slice of a 3D velocity field computed in dolfin simulations? If so, how can I do this successfully?

Thank you in advance, kind regards,

Tom303-afk avatar Mar 12 '21 20:03 Tom303-afk

Hi, at the moment it is not implemented for vector fields, but maybe this can useful #133

marcomusy avatar Mar 14 '21 13:03 marcomusy

Thank you very much! Your suggestion is very useful indeed, for a 3D velocity solution I now have:

     assign(uv.sub(0), u_[0])  
     assign(uv.sub(1), u_[1])  
     assign(uv.sub(2), u_[2])  
     plt = plot(uv,interactive=False)
     vmesh = plt.actors[0].lineWidth(0)
     vmesh.cutWithPlane(origin=(0,0.0125,0), normal=(0,1,0))
     plot(vmesh,viewup='z', interactive=False)
     show(camera={'pos':(0.04,-0.3,0.05),'focalPoint':(0.04,0.0125,0.05)})

This works flawlessly according to my needs. The rendering takes approx 20 because the mesh is consisting of many points, so I will see if I can find a way to plot a smaller amount of data points.

Tom303-afk avatar Mar 15 '21 15:03 Tom303-afk