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

Submission 02 #8

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
Empty file added .gitattributes
Empty file.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ CMakeFiles
CMakeCache.txt
cmake_install.cmake
CMakeLists.txt.user
build/*
*.vdb
OpenVDBBuild.lib
17 changes: 13 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ set(GLEW_LIBRARY_DIR ${CMAKE_LIBRARY_PATH})
find_package(OPENGL REQUIRED)
find_package(GLEW)
find_library(GLFW_LIBRARY "glfw3" HINTS ${GLFW_LIBRARY_DIR})
find_library(JSONCPP "jsoncpp")
find_library(TBB_LIBRARY "tbb_debug" HINTS ${CMAKE_LIBRARY_PATH})
find_library(OPENVDB_LIBRARY "OpenVDBBuild" HINTS ${CMAKE_LIBRARY_PATH})
find_library(OPENEXR_LIBRARY "Half" HINTS ${CMAKE_LIBRARY_PATH})
find_library(ZLIB_LIBRARY "zlibstat" HINTS ${CMAKE_LIBRARY_PATH})
find_library(BOOST_LIBRARY "libboost_system-vc140-mt-sgd-1_60" HINTS ${CMAKE_LIBRARY_PATH})

add_definitions(
-DTW_STATIC
Expand All @@ -46,14 +50,14 @@ add_definitions(
-D_CRT_SECURE_NO_WARNINGS
)

set(CORE_LIBS ${GLFW_LIBRARY} ${GLUT_LIBRARY} ${GLEW_LIBRARY} ${JSONCPP} ${OPENGL_LIBRARY} )
set(CORE_LIBS ${GLFW_LIBRARY} ${GLUT_LIBRARY} ${GLEW_LIBRARY} ${OPENGL_LIBRARY} ${TBB_LIBRARY} ${OPENVDB_LIBRARY} ${OPENEXR_LIBRARY} ${ZLIB_LIBRARY} ${BOOST_LIBRARY})

# OSX-specific hacks/fixes
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
#Link IOKit because this is where we get GL stuff for OSX
set(COREVIDEO "-framework CoreVideo")
set(IOKIT "-framework IOKit")
set(CORELIBS ${CORELIBS} ${IOKIT} ${COREVIDEO})
set(CORE_LIBS ${CORELIBS} ${IOKIT} ${COREVIDEO})
endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")

# Linux specific hacks/fixes
Expand All @@ -66,6 +70,8 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin"
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O3 -m64 -msse2 -w")
elseif(WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
endif()

if(MSVC)
Expand All @@ -82,11 +88,14 @@ endif()
# Add source files you want to compile (.cpp)
set(CORE_SRC
src/main.cpp
src/jsoncpp.cpp
src/camera/camera.cpp
src/viewer/viewer.cpp
src/fluidSolver/fluidSolver.cpp
src/scene/scene.cpp
src/geom/geom.cpp
src/geom/box_container.cpp
src/geom/box_source.cpp
src/geom/gpu_grid.cpp
)

add_executable(Thanda ${CORE_SRC})
Expand Down
133 changes: 125 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,133 @@
# CIS563-FluidSolver
# Submission 07

FluidSolver Submission guidelines:
**Updates:**
1. Fixed bugs. Now the simulation won't explode.

(Borrowed from CIS565 README)

If you have modified any of the CMakeLists.txt files at all (aside from the list of CORE_SRC), you must test that your project can build. Beware of any build issues.
# Submission 06

Open a GitHub pull request so that we can see that you have finished. The title should be "Submission: YOUR NAME".
**IMPORTANT:**
1. After generating the project using cmake and running it once to generate executable,
please copy tbb_debug.dll and Half.dll from nuparu/lib/win into where the executable resides.

2. Libraries used were compiled with VS 14 x64 compiler. They may not work with your compiler if you are using a different one.


**Min OpenGL requirement:** 4.3

In the body of the pull request, include a link to your repository.
**Visual Studio requirement:** 14 (2015) x64

Submit on canvas with a direct link to your pull request on GitHub

**Updates:**
1. Implemented FLIP using GPU kernels;

**Performance Analysis:**

And you're done!
* 20 x 20 x 20 grid:

| Particle Count | FPS |
| -------------- | ------------- |
| 19,200 | 12 |
| 153,600 | 8 |
| 518,400 | 4 |
| 1,228,800 | 2 |
| 2,400,000 | 1.2 |

| (Grid Size, Particle Count) | FPS |
| --- | --- |
| (10x10x10, 2,400) | 45 |
| (20x20x20, 19,200) | 12 |
| (40x40x40, 166,400) | 4.8 |
| (50x50x50, 320,200) | 2.7 |
| (80x80x80, 1,331,200) | 0.7 |


**Existing Problems:**
1. The simulation is unstable. Some local area will explode during the simulation.


# Submission 05

**IMPORTANT:**
1. After generating the project using cmake and running it once to generate executable,
please copy tbb_debug.dll and Half.dll from nuparu/lib/win into where the executable resides.

2. Libraries used were compiled with VS 14 x64 compiler. They may not work with your compiler
if you are using a different one.

3. Uncomment buildSDF() in FS_Grid::render() to enable writing VDB files.
You may want to change the ouput directory specified in FS_Grid::buildSDF().

**Min OpenGL requirement:** 4.3

**Visual Studio requirement:** 14 (2015) x64

**Updates:**
1. Implemented Conjugate Gradient method with Diagonal Preconditioning using GPU kernels.
Current implementation is not optimal due to heavy CPU intervention but it is still
about 10 times faster than the CPU implementation.


# Submission 04

**IMPORTANT:**

1. After generating the project using cmake and running it once to generate executable,
please copy tbb_debug.dll and Half.dll from nuparu/lib/win into where the executable resides.

2. Libraries used were compiled with VS 14 x64 compiler. They may not work with your compiler
if you are using a different one.

3. Uncomment buildSDF() in FS_Grid::render() to enable writing VDB files.
You may want to change the ouput directory specified in FS_Grid::buildSDF().

**Min OpenGL requirement:** 4.3
**Visual Studio requirement:** 14 (2015) x64

**Parallelization Performance Analysis (10 x 10 grid with 8 particles per cell):**

| Topic | Serial(FPS) | Parallel(FPS) | Comparison | Reason(if negative) |
| :--- | --- | --- | --- | --- |
| Interpolation (grid to particles) | ~= 5.0 | ~= 7.0 | +40% | |
| Interpolation (particles to grid) | ~= 7.0 | ~= 6.0 | -14.2% | Mutex overhead |
| Extrapolation | ~= 6.5 | ~= 7.0 | +7.7% | |

**Updates:**
1. Pressure solve
2. Parallelization
3. Meshing using OpenVDB


# Submission 03

**IMPORTANT:** after generating the project using cmake and running it once to generate executable,
please copy tbb_debug.dll into where the executable resides.

1. Implemented all required features;
2. Used parallel_for in trilinear interpolation.


# Submission 02

**Min OpenGL requirement:** 4.3
**Visual Studio requirement:** 14 (2015) x64

**Updates:**

1. Grid and MACGrid classes;
2. Construction and initialization of MAC grid;
3. Transfer particle velocity to grid;
4. A trilinear interpolation for PIC (not used yet. Only gravity affects particles right now);
5. Debug rendering of the grid, particles, and velocity components.


# Submission 01

Basic viewer funtionality implemented.

Tested on VS 2015, Windows 10.

Inorder to compile the code, you need to change two #define's in main.hpp:

1. SCENE_FILE_NAME: the path + name of the scene json file (e.g. "C:/path_to_scene_file/scene.json")
2. SHADERS_DIR: the directory where the shaders locate without trailing slash (e.g. "C:/path_to_shaders")
11 changes: 0 additions & 11 deletions nuparu/include/Eigen/Array

This file was deleted.

26 changes: 0 additions & 26 deletions nuparu/include/Eigen/COPYING.BSD

This file was deleted.

Loading