mirror of
https://github.com/eliasstepanik/FluidSimulation.git
synced 2026-01-11 05:28:28 +00:00
Perfomance Good
This commit is contained in:
parent
653e85ce83
commit
f50dd3be04
@ -1,5 +1,4 @@
|
||||
using System.Numerics;
|
||||
using Hybridizer.Runtime.CUDAImports;
|
||||
using Raylib_CsLo;
|
||||
using static Raylib_CsLo.RayMath;
|
||||
|
||||
@ -61,9 +60,7 @@ public class Fluid
|
||||
diffuse(2, Vy0, Vy, visc, dt);
|
||||
|
||||
project(Vx0, Vy0, Vx, Vy);
|
||||
HybRunner runner = HybRunner.Cuda().SetDistrib(32, 32, 16, 16, 1, 0);
|
||||
wrapper = runner.Wrap(new Game());
|
||||
wrapper.Run(wrapper.advect(this,1, Vx, Vx0, Vx0, Vy0, dt));
|
||||
advect(this, 1, Vx, Vx0, Vx0, Vy0, dt);
|
||||
advect(this,2, Vy, Vy0, Vx0, Vy0, dt);
|
||||
|
||||
project(Vx, Vy, Vx0, Vy0);
|
||||
@ -192,9 +189,6 @@ public class Fluid
|
||||
set_bnd(2, velocY);
|
||||
}
|
||||
|
||||
|
||||
|
||||
[EntryPoint("run")]
|
||||
public void advect(Fluid fluid,int b, float[] d, float[] d0, float[] velocX, float[] velocY, float dt) {
|
||||
float i0, i1, j0, j1;
|
||||
|
||||
|
||||
@ -7,8 +7,8 @@ namespace PixelEngine;
|
||||
|
||||
public class Game
|
||||
{
|
||||
private const int Size = 64;
|
||||
private const int Scale = 10;
|
||||
private const int Size = 256;
|
||||
private const int Scale = 2;
|
||||
private const int Iter = 10;
|
||||
private const float Dt = 0.2f;
|
||||
private const float Diffusion = 0f;
|
||||
|
||||
@ -9,9 +9,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Altimesh.Hybridizer.Runtime.CUDAImports" Version="2.0.0" />
|
||||
<PackageReference Include="Raylib-CsLo" Version="4.2.0.3" />
|
||||
<PackageReference Include="System.Drawing.Common" Version="6.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@ -15,6 +15,7 @@ game.PMouse = GetMousePosition();
|
||||
game.Start();
|
||||
|
||||
|
||||
|
||||
while (!WindowShouldClose())
|
||||
{
|
||||
game.HandleInput();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user