Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

examples: add an Lattice Boltzmann Method simulation #888

Merged
merged 12 commits into from
Jan 14, 2025

Conversation

Bruno-Vdr
Copy link
Contributor

Added into SDL examples a basic lattice boltzmann method that simulates fluids flow.

@JalonSolov
Copy link
Contributor

JalonSolov commented Dec 30, 2024

Need to run v fmt -w . in your repo, then commit the changes. That should fix the CI errors.

@Bruno-Vdr
Copy link
Contributor Author

Bruno-Vdr commented Dec 31, 2024

It's done. I'm not used to these modern workflow. I don't know if I'm supposed to close this PR and create a new one.
Regards

@spytheman
Copy link
Member

No, the PR is fine - the formatting changes are visible now.

@JalonSolov
Copy link
Contributor

Something weird in the CI here... it is trying to compile each of the lbm files separately, instead of as a single program.

@larpon
Copy link
Contributor

larpon commented Dec 31, 2024

That is odd, I can't spot any immediate reasons for it to do so - other examples are also multiple files in a sub-directory

@JalonSolov
Copy link
Contributor

Hmm... the other examples only have a single .v file, though. Shader files, etc, but only 1 .v file.

@JalonSolov
Copy link
Contributor

Is v should-compile-all sdl/examples/ treating them as separate files?

@JalonSolov
Copy link
Contributor

Yeah, that's it. From it's help:

Usage:
v should-compile-all [-c] examples/ some/deep/file.v another/
... will try to compile all .v files found in the given folders and files, one by one.
If every single one of them compiles, the command will exit with an error code of 0.
If any of them fail to compile, the command will exit with an error code of 1.

@JalonSolov
Copy link
Contributor

Since this is the first example with multiple .v files that go together, it's the first time it has been a problem.

@larpon
Copy link
Contributor

larpon commented Jan 1, 2025

You are right. I misremembered completely, my bad.

@spytheman
Copy link
Member

spytheman commented Jan 1, 2025

v should-compile-all ~/.vmodules/sdl/examples/ should work now with latest V.

./v should-compile-all examples/ (in the main V repo) also works 🥳 - the tool detects projects with v.mod files, and compiles them as a whole now, not file by file.

@JalonSolov
Copy link
Contributor

Problem with os.glob() now?

@spytheman
Copy link
Member

Yes, os.glob is a mess on windows. I think we should just use the unix implementation there too, but that will take time :-| .

For now, I just used os.walk_ext/2 instead.

@spytheman
Copy link
Member

The only remaining failure is also not related to the PR ...
We should update the macos runner name, since macos-12 was deprecated.

@larpon
Copy link
Contributor

larpon commented Jan 14, 2025

I have reduced the sizes of the png files by ~94 to ~98% and removed the empty/unneeded .gitignore in examples/lbm/.gitignore.

@spytheman I think it is good to go into master I'll make sure to propagate the changes to all the other branches when this is merged

@spytheman
Copy link
Member

Everything seems fine now, merging.

@spytheman spytheman merged commit e7be3cf into vlang:master Jan 14, 2025
4 checks passed
larpon pushed a commit to larpon/sdl that referenced this pull request Jan 14, 2025
larpon pushed a commit to larpon/sdl that referenced this pull request Jan 14, 2025
larpon pushed a commit to larpon/sdl that referenced this pull request Jan 14, 2025
larpon pushed a commit to larpon/sdl that referenced this pull request Jan 14, 2025
larpon pushed a commit to larpon/sdl that referenced this pull request Jan 14, 2025
larpon pushed a commit to larpon/sdl that referenced this pull request Jan 14, 2025
larpon pushed a commit to larpon/sdl that referenced this pull request Jan 14, 2025
larpon pushed a commit to larpon/sdl that referenced this pull request Jan 14, 2025
larpon pushed a commit to larpon/sdl that referenced this pull request Jan 14, 2025
larpon pushed a commit to larpon/sdl that referenced this pull request Jan 14, 2025
larpon pushed a commit to larpon/sdl that referenced this pull request Jan 14, 2025
larpon pushed a commit to larpon/sdl that referenced this pull request Jan 14, 2025
larpon pushed a commit to larpon/sdl that referenced this pull request Jan 14, 2025
@spytheman spytheman changed the title Added lbm example. examples: add an Lattice Boltzmann Method simulation Jan 14, 2025
larpon added a commit that referenced this pull request Jan 14, 2025
Co-authored-by: Bruno-Vdr <bruno@asterope.fr>
larpon added a commit that referenced this pull request Jan 14, 2025
Co-authored-by: Bruno-Vdr <bruno@asterope.fr>
larpon added a commit that referenced this pull request Jan 14, 2025
Co-authored-by: Bruno-Vdr <bruno@asterope.fr>
larpon added a commit that referenced this pull request Jan 14, 2025
Co-authored-by: Bruno-Vdr <bruno@asterope.fr>
larpon added a commit that referenced this pull request Jan 14, 2025
Co-authored-by: Bruno-Vdr <bruno@asterope.fr>
larpon added a commit that referenced this pull request Jan 14, 2025
Co-authored-by: Bruno-Vdr <bruno@asterope.fr>
larpon added a commit that referenced this pull request Jan 14, 2025
Co-authored-by: Bruno-Vdr <bruno@asterope.fr>
larpon added a commit that referenced this pull request Jan 14, 2025
Co-authored-by: Bruno-Vdr <bruno@asterope.fr>
larpon added a commit that referenced this pull request Jan 14, 2025
Co-authored-by: Bruno-Vdr <bruno@asterope.fr>
larpon added a commit that referenced this pull request Jan 14, 2025
Co-authored-by: Bruno-Vdr <bruno@asterope.fr>
larpon added a commit that referenced this pull request Jan 14, 2025
Co-authored-by: Bruno-Vdr <bruno@asterope.fr>
larpon added a commit that referenced this pull request Jan 14, 2025
Co-authored-by: Bruno-Vdr <bruno@asterope.fr>
larpon added a commit that referenced this pull request Jan 14, 2025
Co-authored-by: Bruno-Vdr <bruno@asterope.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants