Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Inconsistency between 'mphinterp' and 'mphplot'

Please login with a confirmed email address before reporting spam

Hello,

I am having an issue with the MATLAB-Livelink function 'mphinterp'. What I am basically trying to do is plot 2D slice plots of data from the model solution. I am operating on solutions from different steps in a parametric sweep, so I need to save data from evaluated expressions at each step. The 'mphplot' command successfully plots the slice plots in MATLAB that resemble the 3D slice plot feature in COMSOL. However, since the generated MATLAB plot only contains colordata and not the actual data, I want to extract the mesh from the MATLAB plot and use 'mphinterp' to get at the actual data at each vertex in the 2D mesh. When I do this, and replot in MATLAB, the resulting plot looks ok within each domain, but near the boundaries, the values calculated from 'mphinterp' are not consistent with values derived from 'mphplot', and results in pixelated artifacts along the domain boundaries. The attached figures demonstrate this inconsistency. These figures were generated by plotting only the vertex 'markers' in MATLAB. The vertex coordinates are identical, but the derived values are different. I am confused as to why 'mphinterp' is giving different results using the same mesh that is generated from 'mphplot'. I can produce a similar inconsistency in COMSOL by comparing a 3D Plot Group->Slice (1 quick plane at z = 0) and a 2D Plot Group->Surface from a Cut-Plane dataset generated at z = 0, for example. These plots should be identical, but they are not. The former shows a smooth transition at the boundaries (similar to 'mphplot' output) and the latter is heavily distorted near the boundary edges (similar to 'mphinterp' output). Am I missing something? Should I not get the same result from 'mphinterp' when using an identical mesh generated from 'mphplot'? If not, then how can I access the underlying data that 'mphplot' interpolates from the model solution?

Thank you for any assistance.


1 Reply Last Post 16 apr 2014, 16:49 GMT-4

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 16 apr 2014, 16:49 GMT-4
Attached are figures illustrating the same issue in COMSOL without livelink. One figure shows a 3D slice plot on one plane, and the other shows a 2D surface plot from a cutplane dataset created at the same z-axis coordiate.
Attached are figures illustrating the same issue in COMSOL without livelink. One figure shows a 3D slice plot on one plane, and the other shows a 2D surface plot from a cutplane dataset created at the same z-axis coordiate.

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.