Help with 3D plot of displaced surface

Hey, there.

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 tried by changing Surface to Volume but I get a void

Is this the correct way to go?

Thanks!

Please share your data

Excuse me, I’m new to this. Do you mean my .pvd?

your .pvd, but also other files associated with it, most likely .vtp, .vtu files…

displacements.pvd (175 Bytes)
displacements000000.vtu (4.3 KB)

This should do. Thanks!

Your data is a 2D plane, you cant Volume render a plane:

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?

This has nothing to do with volume rendering, its a 3D plot.

In any case, yes, you can create such rendering in ParaView although 3D plots is not what ParaView excels at.

However your data does not contain the data needed to create such a plot, but here is an example:

What else would I need to do this in Paraview? Which files? Thanks again

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.

Okay, I think I have to read more on the implementation of this 3D plot. Thanks a lot!!

You data does have a “Displacement” vector data array. However, all the displacements appear to be in the plane of the data:

The Warp By Vector filter works fine on your data, it just produces a shift of the points in the negative x direction:

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.

1 Like

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?

Thanks!!

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.

I think I get It. I’ll come back if I need It. Thanks to both of you.

Hello again.

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.

Thanks once again.

displacements.pvd (175 Bytes)
displacements000000.vtu (296.0 KB)

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.

Yes! Using jHat and kHat. Can I ask for more information about this? Maybe an example, or any documentation on this. Thanks.

https://docs.paraview.org/en/latest/UsersGuide/filteringData.html#calculator

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:

Displacement_X*(0, 1, 0) + Displacement_Y*(0, 0, 1) = (0, Displacement_X, 0) + (0, 0, Displacement_Y) = (0, Displacement_X, Displacement_Z)

Okay! I’ll focus on the documentation and implement it. Thanks once again.