CFDPython icon indicating copy to clipboard operation
CFDPython copied to clipboard

lessons: actually use allocated buffers in Step12 lesson

Open rohany opened this issue 1 year ago • 3 comments

rohany avatar Mar 19 '24 16:03 rohany

the variables pn, un, vn, b... are always re-initialized or reassigned within the main iteration loop or inside functions, and are not shared or referenced elsewhere in a way that would require maintaining their identity

replacing direct assignments with slice assignments is not necessary here

djeada avatar Aug 24 '25 11:08 djeada

I agree that this is not necessary to maintain correctness, but it can improve performance and memory usage in some cases by avoiding unnecessary allocation and reusing allocated slices.

rohany avatar Aug 24 '25 17:08 rohany

I agree that this is not necessary to maintain correctness, but it can improve performance and memory usage in some cases by avoiding unnecessary allocation and reusing allocated slices.

I think that I know where you are coming from, but the current patch won't result in what you try to achieve. I left a couple comments with some suggestions, hope it helps.

djeada avatar Aug 24 '25 19:08 djeada