Re: Griddata too slow



OliH wrote:
Hi,

I have a large amount of 3D time dependent fluid flow data on a
multiblock grid. I am trying to interpolate this data on to a new 3D
grid produced my meshgrid. The spacing in the z direction of the two
grids is the same, so I am therefore looping through all the z-planes
and using griddata to find the interpolated values.

The trouble is that, for time dependency, I have to do this a number
of times, so that griddata is called many 2000-5000 times (I have not
included any 'for loops' unnecessarily). The profiler shows that the
vast majority of the time taken (many minutes) is due to the griddata
call.

Is there any way of speeding the griddata process up?

Thanks in advance,

Oli

A rouch sample of my code is below...

% X and Y are plane co-ordinates produced by meshgrid
for t=1:NTSTEPS
for BL=1:NBLOCKS
[XC,YC,ZC]=GetBlockCells(BL); % Get the cells for block
[UC,VC,WC]=GetBlockVelocities(BL);
[XHL,YHL] =FindHalo(XC,YC); % Find the block bounds.
% Get data only within block bounds.
INP=inpolygon(X,Y,XHL,YHL)>0;
for K=1:NZ
U=griddata(XC(:,:,1),YC(:,:,1),UC(:,:,K),X(INP),Y(INP));
V=griddata(XC(:,:,1),YC(:,:,1),VC(:,:,K),X(INP),Y(INP));
W=griddata(XC(:,:,1),YC(:,:,1),WC(:,:,K),X(INP),Y(INP));

end
end
end


that's one of the weaknesses of matlab i couldn't overcome myself. for visualizations i use openDX which handles multigrid data natively.


michael
.



Relevant Pages

  • Griddata too slow
    ... I have a large amount of 3D time dependent fluid flow data on a ... I am trying to interpolate this data on to a new 3D ... grid produced my meshgrid. ... and using griddata to find the interpolated values. ...
    (comp.soft-sys.matlab)
  • Re: how to get values of arbitrary positions after griddata
    ... how to get values of arbitrary positions after griddata, I have used the commands of meshgird and griddata to create the grid of my input data. ... If you interpolate your interpolated ...
    (comp.soft-sys.matlab)
  • Re: griddata with sparse Matrices?
    ... that I run easily out of memory when I increase ... The grid is not equally spaced, so I use griddata. ... interpolate this for another grid in chi-direction say x which is ...
    (comp.soft-sys.matlab)
  • Re: 2-D interpolation
    ... > contained at the junctions of grid lines in one of the grids, ... > need to interpolate from that grid, data for the juctions of the ... Griddata is simplest. ... extrapolation outside the first grid. ...
    (comp.soft-sys.matlab)
  • Re: 2D interpolation from trinagular mesh to coarser (arbitrary) triangular
    ... Anybody any hints on where to find a routine that will known read x,y, ... value and interpolate on a new x_n, ... triangular grid. ... interpolate in the coarse grid using these data as input 2, ...
    (sci.math.num-analysis)