Code covered by the BSD License  

Highlights from
immiscible LB

immiscible LB

by

 

23 Jul 2009 (Updated )

Implements Immiscible Lattice Boltzmann (ILB, D2Q9) method for two phase flows

Gpu_Test.m
%
A = zeros(3);
A(:)= 1:numel(A);
B = A;
% indeces
idx1 = randperm(9);
idx2 = randperm(9);
% move to gpu
B=gpuArray(B);
A=gpuArray(A);
% statement
A(idx1)=B(idx2);

% move back to CPU
A=gather(A);
B=gather(B);
% output
A,

B,


%A(idx1)=B(idx2);
%??? Error using ==> GPUArray.subsref at 9
%Indexing is not supported for GPUArrays.
 

Contact us