I just ran across this discussion, I feel I’m having the same problem mentioned here. I obtained some displacements in FEniCS and I’d like to have a 3dimensional plot with Paraview. I already have my 2d solution:
I implemented a small code in Python for another FEniCS program that I’m working on. In this case, It was easier to use numpy to obtain the displacements (see figure). My idea was to have something similar to this in Paraview. Is that possible?
Its all about data. ParaView can create a 3D plot from a planar data if you have vectors that are orthogonal to the plane. This is not the case in the data you shared.
Note that there is also a Warp By Scalar filter if your data has only a single component (i.e., it is scalar data). It warps along a direction you define by a magnitude proportional to the scalar component.
As far as I’m concerned right now, when I completely end my implementation on FEniCS, displacements should be a 2 components vector, being u=(ux, uy). This displacements should NOT be in the same plane that the 2D region is defining.
So, in theory, I could use warp by vector to obtain this “3d” plot, should that be correct?
Should work, I think, but you’ll need to create a 3-component vector, which you can do with the Calculator filter and an expression like jHat*u_X + kHat*u_Y - it’s not clear to me how your 2-component vectors are oriented with respect to the 3D space.
As I mentioned, I kept implementing my FEniCS solution. Now, displacements should be a vector that is not contained in the plane of the data.
With your information, I managed to use warp by vector, but I think I’m not doing it right:
(See figure) Displacements are in the same plane of the data, but they should not be. I am unsure if it is a problem with the displacements information or if it is a problem with how I’m using paraview.
The only thing I did was applying the warp by vector filter on the displacements information. I also add here my new pvd and vtu, as a working example.
ParaView can only do things with the data you provide it. As I mentioned earlier in this thread, you will likely need to use a Calculator filter to change your 2D displacement into a 3D displacement to displace the surface out of the plane.
Set your expression to something like (I don’t know what components you need to map to the X, Y, and Z dimensions) Displacement_X*jHat + Displacement_Y*kHat.
jHat is the unit vector in Y and kHat is the unit vector in Z, so the expression above corresponds to: