How to create readable files from Matlab to Paraview to display structural deformation?

Hello,
I'm really new to Paraview, I'd like to create a plot in Paraview showing the displacement of a rectangular mesh. I use this function "vtkwrite" to export the vtk file:
I wrote this line:
vtkwrite('cantiBeam', 'polydata','triangle', xdis, ydis, z, tri);
where cantiBeam is the file name, polydata is the datatype, triangle is the element type, xdis is the deformed x coordinate, ydis is the deformed y coordinate, z is set to 0 as this is a 2d structure. tri is the connectivity.
I successfully plot this structure in Paraview like this (I used random deformation just to demonstrate):
However, I'd like to plot the deformation with colors, e.g. dark color for large deformations, for example, like in Abaqus:
I guess when creating vtk file, there needs to be the information to tell Paraview what the deformation is, but how can I do it?
Thanks!

2 Comments

I am surprised......why you want to go to Paraview to plot when you have MATLAB..... :|
How can I plot this kind of deformation plot like in Abaqus with Matlab?

Sign in to comment.

Answers (1)

It can be very much plotted......Check this file exchange for more details: https://in.mathworks.com/matlabcentral/fileexchange/32719-postprocessing-in-fem. Any more questions feel free to discuss.

8 Comments

Hi KSSV,
I just came up with the reason...... If the structure is large, with sophisticated deformation, then using Matlab to plot is doable but probably inefficient, this is why I'd like to use Paraview instead. Any ideas?
You attach a data which you feel is not doable..I will plot it and show you.
In the code "PlotFieldonMesh", when nnel = 4, is not necessarily 3d surface, it could also be 3d tetrahedron, right?
That only supports....QUA4, TRI3 eleemnts as of now....but can be extended to any case....
For example (see the .mat file), this airfoil mesh with tetrahedron elements, 2298 nodes, 8165 elements. I tried this:
tetramesh(airfoil.elem, airfoil.node)
which gave me:
Not very elegant, right? also no displacement is shown (In this example displacement = 0, but there is no displacement input in function tetramesh). This is the case when I need Paraview.
The figure is very much fine.....what made you feel not good?
First, the speed was quite slow, this structure only has 2298 nodes, if there are tens of thousands of nodes or more, would Matlab be too slow for this job?
Second, I cannot find a way to display the deformation like you did in here https://in.mathworks.com/matlabcentral/fileexchange/32719-postprocessing-in-fem
I'd like to have a contour plot of deformation like you did for this wing model.
Also, in this link:
I tried the attached example:
d = [-1 1];
[x, y, z] = meshgrid(d, d, d);
DT = delaunayTriangulation(x(:), y(:), z(:));
vtkwrite('execute', 'polydata','tetrahedron', x, y, z, DT.ConnectivityList);
It did generate a VTK file, but the plot in Paraview was like this:
obviously these are not tetrahedrons but triangular surfaces. How can I change it?

Sign in to comment.

Categories

Asked:

on 27 Sep 2017

Commented:

on 28 Sep 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!