Comments (16)
05_Step_4
- Cell [3], I think that it would be more consistent to use
sympy.pi
instead ofnumpy.py
phi = (sympy.exp(-(x - 4 * t)**2 / (4 * nu * (t + 1))) + sympy.exp(-(x - 4 * t - 2 * numpy.pi)**2 / (4 * nu * (t + 1))))
>>phi = (sympy.exp(-(x - 4 * t)**2 / (4 * nu * (t + 1))) + sympy.exp(-(x - 4 * t - 2 * sympy.pi)**2 / (4 * nu * (t + 1))))
from cfdpython.
06_Array_Operations_with_NumPy
- After Cell [6]: it might be useful to mention that the running time depends on the computer. For some people it might be obvious, but that's not always the case.
from cfdpython.
13_Step_10
- Before cell [1], I would change
b_{i,j}=-100$ at $i=nx*3/4, j=3/4 ny
forb_{i,j}=-100$ at $i=3/4 nx, j=3/4 ny
from cfdpython.
01_Step_1
ipython notebook
>>jupyter notebook
from cfdpython.
02_Step_2
- Cell [1],
import numpy #we're importing numpy and calling it np locally
NumPy is callednumpy
and notnp
. Same goes formatplotlib.pyplot
.
from cfdpython.
14_Optimizing_Loops_with_Numba
-
The notebook mixes spaces and tabs.
-
laplace2d
functions mix the alias for NumPy, usingnumpy
andnp
. Due to this the notebook does not work, the following is the returned errorNameError: name 'np' is not defined
Clearly the NumPy + Numba combination is the fastest, but the ability to quickly optimize code with nested loops can also come in very handy in certain applications.
This is not the case in my computer. I have 91.1 µs ± 40.2 µs in the NumPy + Numba case and 62.5 µs ± 30.8 µs in the Vanilla + Numba.
from cfdpython.
15_Step_11
It might be a good idea to consider streamplots besides glyphs for the vector visualization. It suffices to change
pyplot.quiver(X, Y, u, v)
for
pyplot.streamplot(X, Y, u, v)
For some vector fields this is easier to understand, and introduces another visualization technique.
This comment is a matter of taste, so I understand if the authors don't consider it needed.
from cfdpython.
17_NumbaPro
-
The extension for this notebook has a
.bak
appended. -
Cell [1] returns the following warning
numbapro:1: ImportWarning: The numbapro package is deprecated in favour of the accelerate package. Please update your code to use equivalent functions from accelerate.
-
Cell [1] returns the following error
from numbapro import autojit, cuda, jit, float
-
Cell [5] returns the following error
DeprecationError: Deprecated keyword argument
argtypes
. Signatures should be passed as the first positional argument. -
The notebook uses Python 2.x printing.
from cfdpython.
18_Burgers_equation
-
Cell [6] returns the following error
from JSAnimation.IPython_display import display_animation
JSAnimation is not mentioned as a dependency. A workaround that is compatible with
FuncAnimation```is to use the IPython magic
%matplotlib notebookinstead of
%matplotlib inline` -
Markdown titles are missing a space between pound sign (#) and titles
from cfdpython.
19_Odd_Even_Decoupling
The notebook depends on a folder with videos that is missing from the repository.
from cfdpython.
Notebooks 17, 18 and 19 were never really edited or tested -- at this point my inclination is to just delete them (or move them to a subdirectory). Especially since numbapro no longer exists and the numba stuff in general is all very out of date.
Thoughts, @labarba ?
from cfdpython.
@labarba -- I've pushed up individual commits addressing the comments on notebooks 1, 2, 5, 6 and 13, respectively, in #46 . If you disagree with any of the fixes just let me know and I can pull out the individual commits in question.
I like the suggestion about using streamplot
(which, if I recall, was less reliable back when we wrote these).
Here's the existing quiver plot:
And here's the same plot using streamplot
instead.
Preference?
from cfdpython.
I don't know ... I like that the quiver plot shows magnitude of velocity with the arrow length.
from cfdpython.
Maybe include them both? 🤔
from cfdpython.
Regarding notebooks 17, 18, 19 — these are drafts, really… we could move them to a WiP folder?
[UPDATE] No, I think we should remove these notebooks from this repo. They could be the beginning of a new module, but "CFD Python" is round and neat up to lesson 12.
from cfdpython.
I removed notebooks 17-19 and also the very out of date Numba notebook (14). And added an additional plot to step 11 with the streamplot after the first two quiver plots. All of this in #46
from cfdpython.
Related Issues (20)
- 11 step, d(div(U))/dt term HOT 2
- Typo in Step 11 HOT 1
- Typo in the Poisson equation discretization in Step 11 HOT 2
- No pressure gradient in step 12? HOT 2
- Maybe there is a bug in code of Array Operations with NumPy HOT 3
- About equation 4 in step11 HOT 4
- Step 8 transpose equations typo
- definition of L1 norm on Step 9: 2D Laplace Equation HOT 2
- CD Derivation - Step 3
- Initialization error in Step 7 HOT 1
- cfdpython HOT 1
- Disappearing viscosity term in the discrete version of Poisson-pressure equation HOT 10
- Initialization error in Step 9 HOT 1
- Step 5: matplotlib error HOT 3
- Outdated dependencies HOT 1
- Lesson 14 build_up_b
- CFD Code Writing HOT 2
- Step #4 Initial Conditions HOT 1
- Problem reproducing the videos inside the notebooks HOT 4
- Staggered or collocated grid? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cfdpython.