use of parfor in matlab for a lattice boltzmann code

i'm working on lattice boltzmann method and i've written a matlab code. I would like to parallelize some parts of the code but i'm new to this so i'd appreciate your help. I'd like to know if it's possible to use the parfor for this part(collision operator):
for i=1:lx
for j=1:ly
for k=1:9
f(k,i,j)=f(k,i,j) .* (1 - omega) + omega .* feq(k,i,j);
end
end
end
I've tried to replace the outermost for loop with a parfor but the code seems to be slower.
any suggestions?
thanks in advance

 Respuesta aceptada

Edric Ellis
Edric Ellis el 5 de Abr. de 2013
Is there any reason you can't use vectorization here?
f = f .* (1-omega) + omega .* feq;

Más respuestas (0)

Categorías

Productos

Preguntada:

el 4 de Abr. de 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by