2010/3/13 Nicolas Rougier <[email protected]>: > I'm trying to translate a small matlab program for the simulation in a 2D > flow in a channel past a cylinder and since I do not have matlab access, I > would like to know if someone can help me, especially on array indexing. The > matlab source code is available at: > http://www.lbmethod.org/openlb/lb.examples.html and below is what I've done > so far in my translation effort.
> In the matlab code, there is a "ux" array of shape (1,lx,ly) and I do not
> understand syntax: "ux(:,1,col)" with "col = [2:(ly-1)]". If someone knows,
> that would help me a lot...
It means that you select all in the 0-axis all indices, in the 1-axis
the index 0 (matlab: index 1), and in the 2-axis the indices given by
the list {col}. {col} is in our case an ndarray of .ndim = 1.
I attach a modified version of your script which is running, computing
*something*. If you could provide information about matlab functions
opp() and circshift() that would be helpful. I marked sections I
changed with "CHANGED", todos with TODO and lonely notes with NOTE and
so on.
Friedrich
lbmethod.py
Description: Binary data
_______________________________________________ NumPy-Discussion mailing list [email protected] http://mail.scipy.org/mailman/listinfo/numpy-discussion
