GithubHelp home page GithubHelp logo

aartiukh / sph-sdk Goto Github PK

View Code? Open in Web Editor NEW
13.0 1.0 1.0 310 KB

C++ implementation of Smoothed Particle Hydrodynamics

License: GNU General Public License v3.0

CMake 2.32% C++ 88.14% Python 9.54%
sph cpp opengl freeglut cmake windows linux

sph-sdk's Introduction

sph

CMake codecov Codacy Badge All Contributors

C++ implementation of Smoothed Particle Hydrodynamics.

How to build

Ubuntu

  • sudo apt-get install libxtst-dev libxrandr-dev libxxf86vm-dev
  • cd build
  • cmake -DBUILD_UNIT_TESTS=ON -DCMAKE_BUILD_TYPE=Release ..
  • make -j

Windows MSVC 2017

  • cd build
  • cmake -G "Visual Studio 15 2017 Win64" -DBUILD_UNIT_TESTS=ON -DCMAKE_BUILD_TYPE=Release ..
  • Open generated sph-sdk.sln and run Build Solution in MSVC 2017 IDE

Windows MSVC 2019

  • cd build
  • cmake -G "Visual Studio 16 2019" -A x64 -DBUILD_UNIT_TESTS=ON -DCMAKE_BUILD_TYPE=Release ..
  • Open generated sph-sdk.sln and run Build Solution in MSVC 2019 IDE

How to test

  • ctest -VV

Contributors

This project is maintained by teachers and students of Kharkiv National University of Radio Electronics (NURE), Department of Applied Mathematics (AM).

Thanks goes to these wonderful people (emoji key):

Anton Artiukh
Anton Artiukh

๐Ÿ’ป ๐Ÿ“– ๐Ÿ‘€
Oleksii Shabalin
Oleksii Shabalin

๐Ÿ’ป ๐Ÿ“–
Crosby98
Igor Lytvyn

๐Ÿ’ป ๐Ÿ“–

This project follows the all-contributors specification. Contributions of any kind welcome!

sph-sdk's People

Contributors

aartiukh avatar allcontributors[bot] avatar codacy-badger avatar crosby98 avatar mend-bolt-for-github[bot] avatar paulzcooper avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

jukey99

sph-sdk's Issues

Verify Windows MSVC 2017 build

  • Check if Windows build passes on maximum warning level. If no, fix all warnings and the build itself
  • Update README with How to build on Windows

Show FPS in the demo

Is your feature request related to a problem? Please describe.
As a user I want to see the current FPS.

Describe the solution you'd like
FPS number should be placed somewhere in the black area so it won't overlap the demo itself.

Describe alternatives you've considered
None.

Additional context
None.

Fix bug in neighbours search algorithm

Describe the bug
There is a bug in neighbours search algorithm that causes test failure (SEGFAULT) in Github Actions:

2: [----------] 19 tests from ForcesTestSuite
2: [ RUN      ] ForcesTestSuite.densityForFourNeighbours
Errors while running CTest
2/2 Test #2: sph_tests ........................***Exception: Numerical  0.15 sec

Four tests are commented temporarily:

  1. densityForFourNeighbours
  2. pressureForFourNeighbours
  3. internalForcesForFourNeighbours
  4. externalForcesForFourNeighbours

To Reproduce
Steps to reproduce the behavior:

  1. Disable commented tests.
  2. Push the changes.
  3. Check GitHub Actions logs.

Expected behavior
All tests passed.

Screenshots
Null.

Desktop (please complete the following information):

  • OS: Ubuntu
  • Version: latest used in GitHub Actions

Smartphone (please complete the following information):
Null.

Additional context
This bug can be reproduced in Release mode only, so we can assume that it is connected to uninitialised vars or some memory issues.
Experiments showed that bug is in sercher init. We need to investigate and fix this bug.

Draw 3D object by its equation F(x,y,z) = 0

Is your feature request related to a problem? Please describe.
We want to draw 3D objects by its equation F(x,y,z) = 0. This feature is needed to draw objects inserted into considered region.

Describe the solution you'd like
I suggest to use well-known Marching Cubes algorithm.
Useful refs:
https://en.wikipedia.org/wiki/Marching_cubes
https://graphics.stanford.edu/~mdfisher/MarchingCubes.html
https://github.com/nsf/mc
https://github.com/dominikwodniok/dualmc

Optimize neighbor search algorithm

Currently NSA is very slow. Consider to replace it with new one.

TODO:

  • Discover what algorithms are usually used to find neighbours in SPH.
  • Implement a benchmark in Python and compare at least 3 algorithms: naive, mesh-based and hash-based.
  • Publish benchmarking results in Wiki
  • Implement the fastest algorithms in C++ if it is not implemented yet.

Use R-functions for describing problem domain

Is your feature request related to a problem? Please describe.
Currently we use several conditions to describe a cube and use it in the collision handling. It is better to have a boundary equation instead.

Describe the solution you'd like
Implement R-operations.

Change files mode to 644

Is your feature request related to a problem? Please describe.
Change files mode to 644

Describe the solution you'd like
Use chmod command on Linux

Add algorithm description to wiki/docs

TODO:

  • Add doxygen to all classes/methods
  • Add CMake custom target for doxygen files generation
  • Consider to write formulas in doxygen comments and check if doxygen is able to generate Latex formulas properly
  • Add MD document with algorithm SPH description

SPH implementation on GPU

Is your feature request related to a problem? Please describe.
It is reasonable to implement SPH algorithm on GPU in order to speedup all calculations.

Describe the solution you'd like
It is preferable to use OpenCL for the solution as it allows to run the code on CPU and GPU as well.

Describe alternatives you've considered
Consider CUDA or OpenACC as alternatives to OpenCL

Additional context
Useful links:

Draw 3D objects in demo

Is your feature request related to a problem? Please describe.
Marching cubes algorithm is implemented. Now it is required to draw the test objects inside the cude.

Describe the solution you'd like
Call MC algorithm once and plot triangles using OpenGL.

Add more control options

Is your feature request related to a problem? Please describe.
As a user I want to have more control options: turn the cube to left, right, up and down. Particles should react on these actions appropriately.

Describe the solution you'd like
A - turn left
D - turn right
W - turn up
X - turn down
S - restore the default position

Describe alternatives you've considered
None.

Additional context
Chose a step, maybe 5 degrees?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.