Re: Griddata too slow
- From: Michael Wild <themiwi@xxxxxxxxxxxxxxx>
- Date: Wed, 22 Mar 2006 12:55:22 +0100
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
.
- References:
- Griddata too slow
- From: OliH
- Griddata too slow
- Prev by Date: Problem with objects
- Next by Date: Re: Using TCPIP for Matlab data aquisiton
- Previous by thread: Griddata too slow
- Next by thread: Re: Griddata too slow
- Index(es):
Relevant Pages
|