[Numpy-discussion] Some help on matlab to numpy translation

josef.pktd@gmai... josef.pktd@gmai...
Mon Mar 15 17:53:12 CDT 2010


On Mon, Mar 15, 2010 at 5:58 PM, Nicolas Rougier
<Nicolas.Rougier@loria.fr> wrote:
>
>
> Thanks and in fact, I already wasted quite some time on and your last version will help me a lot. Unfortunately, I'm not a specialist at lattice Boltzmann methods at all so I'm not able to answer your questions (my initial idea was to convert the matlab script to be have a running example to get some starting point). Also, I found today some computers in the lab to test the matlab version and it seems to run as advertised on the site. I  now need to run both versions side by side and to check where are the differences. I will post sources as soon as I get it to run properly.
>
> Thanks again.
>
>
> Nicolas
>
>
>
>
>
> On Mar 15, 2010, at 22:32 , Friedrich Romstedt wrote:
>
>> Ok, so I send yet another version.  Maybe Bruce is right, but I didn't
>> care, because we have fret enough.  Now it not only computes
>> something, but also displays something :-(
>>
>> Nicolas, maybe you can now waste some of your time with it?  I was
>> curious, both to understand and to get it working, but I failed.  I
>> doubt especially the section "Microscopic boundary conditions",
>> because commenting it out makes things, well, say worser.  Leaving the
>> other sections out is also not recommendable, but at least not that
>> destructive.  I do not understand why in the microscopic boundary
>> section only directions 6 and 7 come into play and not 3.  Also I do
>> not understand why they occur in *all* output direction expressions.
>>
>> Furthermore, the fluid, albeit behaving also at the inlet quite
>> strange, bounces back the outlet ...
>>
>> I disabled the obstacle so far, and plotted the 4 direction
>> (downwards), and the resulting ux and uy flows.
>>
>> I give up so far.
>>
>> Friedrich
>> <lbmethod.10-03-14.Friedrich.py>_______________________________________________
>> NumPy-Discussion mailing list
>> NumPy-Discussion@scipy.org
>> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>


I'm surprised you can translate matlab without have dot products
showing up all over.

I didn't really look at the code, but aren't these dot products ?

#     % COLLISION STEP
#     for i=1:9
#        cu = 3*(cx(i)*ux+cy(i)*uy);

I usually put print shape/size inside the code for debugging until I'm
sure about correct shapes

Josef


More information about the NumPy-Discussion mailing list