Triangular mesh function, triplot() trimesh() trisurf() but missing tridata? (was scattered interpolation)

classic Classic list List threaded Threaded
4 messages Options
N
Reply | Threaded
Open this post in threaded view
|

Triangular mesh function, triplot() trimesh() trisurf() but missing tridata? (was scattered interpolation)

N
Asked for help then I had problem with interpolation, got answer with good methods for interpolation and also a modified griddata(...) function from Nicholas Jankowski accepting a triangular mesh as parameter. Triangular mesh is actually used internally in griddata(...) but not possible to send as parameter so modification was rather simle.

I consider this modified function accepting a triangular wireframe mesh as parameter as very useful and would suggest to add it among the other tri functions triplot() trimesh() trisurf(). Anybody else here have any opinion about adding this function among these tri functions?

In such case I would suggest function name with parameters tridata(tri,x,y,xi,yi) or with method specified tridata(tri,x,y,xi,yi,'method') inline with other function names and paremeters. Are not sure if heading into problem expanding parameters in a natural way if/then function ever would be expanded to more dimensions.

I do not have write access to official repo to add this myself but may spend a few hours to get paremeters and comments right. I could also provide two examples, one then interpolating on scattered data and one then importing mesh from Fenics hdf5 file. Importing solutions saved in hdf5 file format, .h5 filer are simple with load command but indexes start at zero for triangulation so +1 need to be added. Mesh could be plotted with triplot(...) function and a scalar solution with plot3(...) function.


Regards Nicklas Karlsson



PTC2griddata.m (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Triangular mesh function, triplot() trimesh() trisurf() but missing tridata? (was scattered interpolation)

nrjank
> I consider this modified function accepting a triangular wireframe mesh as parameter as very useful and would suggest to add it among the other tri functions triplot() trimesh() trisurf(). Anybody else here have any opinion about adding this function among these tri functions?

I'm still not sure why this couldn't just be an extension of griddata?  if a triangulation is supplied with a compatible method, it uses your triangulation instead of the built in dulauney (sp?) triangulation.  is there more to it? with a quick glance it looks like that's the main change from the base griddata.


Reply | Threaded
Open this post in threaded view
|

Re: Triangular mesh function, triplot() trimesh() trisurf() but missing tridata? (was scattered interpolation)

Carlo de Falco-2
In reply to this post by N


Il giorno 24 mar 2020, alle ore 20:15, Nicklas Karlsson <[hidden email]> ha scritto:

I do not have write access to official repo to add this myself but may spend a few hours to get paremeters and comments right. I could also provide two examples, one then interpolating on scattered data and one then importing mesh from Fenics hdf5 file. Importing solutions saved in hdf5 file format, .h5 filer are simple with load command but indexes start at zero for triangulation so +1 need to be added. Mesh could be plotted with triplot(...) function and a scalar solution with plot3(...) function.

For plotting you could consider the fpl package that offers functions "pdemesh" and "pdeplot" compatible with matlab's pdetool and *vtk* methods to export in formats viewable with paraview.
c.





Reply | Threaded
Open this post in threaded view
|

Re: Triangular mesh function, triplot() trimesh() trisurf() but missing tridata? (was scattered interpolation)

Carlo de Falco-2


Il giorno 25 mar 2020, alle ore 10:32, Carlo de Falco <[hidden email]> ha scritto:



Il giorno 24 mar 2020, alle ore 20:15, Nicklas Karlsson <[hidden email]> ha scritto:

I do not have write access to official repo to add this myself but may spend a few hours to get paremeters and comments right. I could also provide two examples, one then interpolating on scattered data and one then importing mesh from Fenics hdf5 file. Importing solutions saved in hdf5 file format, .h5 filer are simple with load command but indexes start at zero for triangulation so +1 need to be added. Mesh could be plotted with triplot(...) function and a scalar solution with plot3(...) function.

For plotting you could consider the fpl package that offers functions "pdemesh" and "pdeplot" compatible with matlab's pdetool and *vtk* methods to export in formats viewable with paraview.
c.

And, if you are working with triangular meshes a lot, the msh package offers a few functions to create and manage meshes, including creating and importing meshes from gmsh.

c.