parent
4b0e7a99cc
commit
b3ac14d019
9 changed files with 168 additions and 37 deletions
@ -0,0 +1,56 @@ |
||||
|
||||
Colocated multigrid |
||||
|
||||
+---+---+---+---+---+---+---+---+---+ |
||||
8 | x | x | x | x | x | x | x | x | x | |
||||
+---+---+---+---+---+---+---+---+---+ |
||||
7 | 0 | | | | | | | | x | |
||||
+---+---+---+---+---+---+---+---+---+ |
||||
6 | 0 | | | | | | | | x | |
||||
+---+---+---+---+---+---+---+---+---+ |
||||
5 | 0 | | | | | | | | x | |
||||
+---+---+---+---+---+---+---+---+---+ |
||||
4 | 0 | | | | | | | | x | |
||||
+---+---+---+---+---+---+---+---+---+ |
||||
3 | 0 | | | | | | | | x | |
||||
+---+---+---+---+---+---+---+---+---+ |
||||
2 | 0 | | | | | | | | x | |
||||
+---+---+---+---+---+---+---+---+---+ |
||||
1 | 0 | | | | | | | | x | |
||||
+---+---+---+---+---+---+---+---+---+ |
||||
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | x | |
||||
+---+---+---+---+---+---+---+---+---+ |
||||
0 1 2 3 4 5 6 7 8 |
||||
|
||||
- Pressure is defined on all cells: |
||||
- The 0 cells are stored but not used (we return p = 0 on these cells) |
||||
- The x cells are not stored (we implicitly return p = 0 out of bounds) |
||||
|
||||
- Velocity is only defined in the inner cells, we always return 0 on the borders |
||||
|
||||
The Coarse grid is as follows: |
||||
|
||||
+-------+-------+-------+-------+-------+ |
||||
| | | | | | |
||||
| x | x | x | x | x | |
||||
| | | | | | |
||||
+-------+-------+-------+-------+-------+ |
||||
| | | | | | |
||||
| 0 | | | | x | |
||||
| | | | | | |
||||
+-------+-------+-------+-------+-------+ |
||||
| | | | | | |
||||
| 0 | | | | x | |
||||
| | | | | | |
||||
+-------+-------+-------+-------+-------+ |
||||
| | | | | | |
||||
| 0 | | | | x | |
||||
| | | | | | |
||||
+-------+-------+-------+-------+-------+ |
||||
| | | | | | |
||||
| 0 | 0 | 0 | 0 | x | |
||||
| | | | | | |
||||
+-------+-------+-------+-------+-------+ |
||||
|
||||
So, the size of the total grid is (2^N+1)*(2^N+1), but we store only (2^N)*(2^N), and explicitly |
||||
set the pressure to 0 on the lower and left borders. |
||||
@ -1,11 +0,0 @@ |
||||
On macOS, homebrew version of llvm must be used instead of xcode's one: |
||||
|
||||
> brew install llvm |
||||
|
||||
Have to run a local http server to serve files: |
||||
|
||||
> python3 -m http.server |
||||
|
||||
|
||||
brew llvm toolchain seems to be broken and does not find open gl header files, and trying to include them from the framework path in /applications/xcode/ etc creates a bunch of other errors, so the workaround was to download mesa openGL headers, and tweak glext.h so that it includes stdint.h instead of inttypes.h (because brew's llvm can't seem to find this one). This was annoying as fuck. |
||||
Zig cc seem to have everything needed but doesn't recognize --export-all and such, so I could'nt find a way to use it. |
||||
Loading…
Reference in new issue