This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

plot matlab field from fenics parameters

0 votes

Hello

I m working paralelly Fenics and Matlab. My work is solving problem with fenics and create .h5 file and than matlab calls some parameters and plot it. Normally for FEM, I need three parameters coordinates, topology and vector (or solution). I use “trisurf” matlab function and try to plot it. But the final plot is not the same as fenics plot – and its wrong -. Do you have any idea which parameter should I use for this purpose?

By the way, I do not fully understand other parameters like “cell_dofs”, “cells”, “x_cell_dofs”. Do you have some documents regarding these parameters.

My code is simply;

pos = h5read('input_mesh.h5','/mesh/coordinates');
els = h5read('input_mesh.h5','/mesh/topology');
u_vec = h5read('output_mesh.h5','/u/vector');
pos = pos';
els = els'+1;
rx = trisurf(els,pos(:,1),pos(:,2),0*pos(:,1),u_vec,'edgecolor','k','facecolor','interp');
view(2),axis equal,colorbar

Thanks and regards
Burak

asked Jun 20, 2014 by BA FEniCS Novice (240 points)
...