[Paraview] Plotting solution vector from Matlab in Paraview

Chaitanya Raj Goyal chaitanyaraj108 at gmail.com
Sun Nov 20 12:41:24 EST 2016


Hello fellow members,

I am solving a 2D hyperbolic PDE, which gives me a solution in 'x' and 'y'
direction for each node on the mesh, for each time step. Therefore, if I
freeze the time step, I have a solution vector in 'x', and 'y', for the
whole mesh, i.e., a single value in both 'x' and 'y' direction, for each
node on mesh.

It looks like this when the solution is initially viewed in Paraview.
Observe any one of the below.


​
You can notice the 'x' and 'y' solution for all points (nodes). The no. of
rows is the total no. of nodes on mesh.

Then, I convert this vtk file to .csv, and import it to MATLAB, where I run
some post processing on the 'x' and 'y' solution vectors. Now, I have
replaced the originally imported solution vectors 'x' and 'y', with some
new values. I wanted to take back these new solutions to Paraview again for
plotting. So I used a tool called vtktrisurf in MATLAB. The problem was
that this tool only takes 1 solution vector, i.e., I can either give the
'x' solution vector or 'y'. So, I used pythagoras theorem on respective
elements of 'x' and 'y' solutions, to generate a single vector. The vtk was
created, and the simulation in PARAVIEW was exactly what I was hoping to
see. However, when I use pythagoras theorem, I convert all negative
components of the solution to positive. It will show me what I want to see
when there is no scalar warping. However, when I warp it with scalar in
Paraview, it shows the entire profile in positive values. That is not
actually true, because there were negative values in the solution. Long
story short, how can I view the correct simulation. Maybe the answer goes
back to the point where I convert my matrix in MATLAB to vtk. I also have
the option of creating a separate vtk for 'x' solution and separate for
'y'. In that case, is there a way to superpose them in Paraview to view the
correct profile?

Thanks a lot for your time and help!

Sincerely,
Chaitanya
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20161120/f92e9607/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wave.png
Type: image/png
Size: 384191 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/paraview/attachments/20161120/f92e9607/attachment-0001.png>


More information about the ParaView mailing list