We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I try to translate a Jos Stam work about the fluid in 3D, I found a C++ code, but the translation don't work...I try to find where is my mistake, but every thing seems ok... but not. And I found no Java or Processing code for a 3D model, so if any body have a time to look in my code, that's be awesome !
Thx
https://www.dropbox.com/s/u5rtclf1kdux2o9/NS_2D_3D_17_7_6.zip?dl=0 [DEAD LINK]
Answers
9 .pde files, 2 .c files and a .scala file in one .zip.
you'll need to narrow this down.
hmmm, why I need to narrow that ?
...
...
Because it is unreasonable to ask people to read 9 files in three different languages because "the translation don't work." Tons to read, and no idea what we are looking for.
You need to describe the precise problem. Point to the errors, and where. Create a much simpler version of your sketch to test the basics. Does it work? If not, start with asking for help on that.
https://stackoverflow.com/help/mcve
Of course I understand all your arguments and I agree 100% and It's a thing I do usually. But in this case it's not possible...because every thing work, but finally not :( I put the file .scala and .c to show the code who give the pattern to code to translate in Java.
The only thing what I can do to reduce the code it's remove the code who is not in java, unfortunatly I cannot remove the other tab, if I do the sketch cannot be run!
sketch without other language https://www.dropbox.com/s/hheeys4xkpjq5dg/NS_2D_3D_17_7_6.zip?dl=0
But obvioullsy I forgot to say where is my problem :) it's in the tab
Z_Jos_Stam_Navier_Stoke_3D.pde
Plus I thing the problem is the distance still
0
so no Vector direction can be create. It's the only thing I can say about what's no happen in my sketch for the 3D part !Which line numbers are relevant?
Avoid posting compressed files such as ".zip" for folks to download. :-@
When such situation arises use GitHub for hosting plain single files! *-:)
GitHub has an option to download the whole repo as 1 ".zip" already. \m/
@GoToLoop I post the sketch on Github, good idea https://github.com/StanLepunK/Sketches/tree/master/FORUM/NS_2D_3D_17_7_6 @Chrisir I don't exactly where is the bug, I just know the method
get_dx()
get_dy()
andget_dz()
return a value 0, so the vector result is inconsistant :( the tab isZ_Jos_Stam_Navier_Stoke_3D.pde
May be the problem are is the methodadvect()
or inlinear_solver()
or inset_bnd()
but the algo is very complex to read for me :(Did you compare the C++ methods and the processing methods? Does everything match?
I read the code for a full day every thing seems ok and match...so next week I try to read again look if I miss something, but it's like a lace, plus I don't understand what's happen exactly in the algo, so it's very difficult for me to analyze where something can be wrong :(
;-)
Did you read the Wikipedia article about this?
what you mean about wikipedia article ?
Did you read the article about Navier-Stokes implementation on wikipedia...?
There is no article about the implementation, just the Jos Stam article : http://www.dgp.toronto.edu/people/stam/reality/Research/pdf/ns.pdf and this one http://www.dgp.toronto.edu/people/stam/reality/Research/pdf/GDC03.pdf
I know it's possible in C or C++ but how in java
https://github.com/BlainMaguire/3dfluid
https://github.com/SatanWoo/Stable-Fluids-3D/blob/master/Stable Fluids 3D/Stable Fluids 3D/solver.c
in wikipedia you can find that : https://en.wikipedia.org/wiki/Navier–Stokes_equations
Hiha... The 3D implementation is done !!!!!! 3D/2D solver