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

Optimized multi resolution LBM #44

Merged
merged 117 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
78763b4
ioToVtk with slices
Ahdhn Jul 17, 2023
344b71c
adding more problems
Ahdhn Jul 17, 2023
0794e52
run script
Ahdhn Jul 17, 2023
06c7d20
more problems
Ahdhn Jul 18, 2023
fa4b16a
Merge branch 'develop' of https://github.com/Autodesk/Neon into Multi…
Ahdhn Jul 18, 2023
f7ff14f
fix problemID 8
Ahdhn Jul 19, 2023
ae0f4e2
minu bug in dat file
Ahdhn Jul 21, 2023
870fc99
update DAT files
Ahdhn Jul 25, 2023
f8d59eb
fix problem confi with more than 3 levels
Ahdhn Jul 25, 2023
dab4e48
update grid configuration and figures
Ahdhn Aug 2, 2023
75c2484
update run script
Ahdhn Aug 2, 2023
b441cfa
Update run.sh
Ahdhn Aug 2, 2023
3913e8b
avoid division by sumStore
Ahdhn Aug 3, 2023
9fef504
Update stream.h
Ahdhn Aug 3, 2023
5d6a5b4
store in register before multiply
Ahdhn Aug 3, 2023
1f1df0c
increase number of iterations in run script
Ahdhn Aug 3, 2023
cb90eb3
remove duplication
Ahdhn Aug 3, 2023
ead3a64
tweak streamFusedCoalescence
Ahdhn Aug 22, 2023
bc0d07b
Revert "tweak streamFusedCoalescence"
Ahdhn Aug 22, 2023
cbbbce0
adding option to cull extra storage of the overlapping coarser girds
Ahdhn Aug 24, 2023
8220b1f
refactor to add flow over cylinder
Ahdhn Aug 24, 2023
e21a587
cylinder position
Ahdhn Aug 24, 2023
f8cd1f3
fix bug with setting child block ID
Ahdhn Aug 28, 2023
376197d
fix initialization of the flow over cylinder
Ahdhn Aug 28, 2023
988a054
split init
Ahdhn Aug 28, 2023
6f1bde7
def BGK and KBC
Ahdhn Aug 28, 2023
8bd76d9
ops
Ahdhn Aug 28, 2023
09ddf79
tiny refactor to reduce duplicate code
Ahdhn Aug 29, 2023
8874994
Fix post process for moving wall boundary condition
Ahdhn Aug 29, 2023
782b850
add Re to the input arguments and output json
Ahdhn Aug 30, 2023
b8113a6
thin slices
Ahdhn Aug 30, 2023
be7978f
split files
Ahdhn Aug 30, 2023
da31821
movingWall = inlet, adding option to control output frequency
Ahdhn Aug 31, 2023
132f6fe
fixes for flow over cylinder
Ahdhn Aug 31, 2023
cdc8c22
sphere not cylinder
Ahdhn Aug 31, 2023
fd0fb06
report collision model
Ahdhn Aug 31, 2023
0c0ab50
fix
Ahdhn Aug 31, 2023
0ec9782
jet fighter sdf
Ahdhn Sep 5, 2023
d29577a
jet problem
Ahdhn Sep 5, 2023
bc48f13
jet problem
Ahdhn Sep 5, 2023
a1329b1
flowOverShape and use sdf to define bounce back BC
Ahdhn Sep 5, 2023
ec49d09
initFlowOverShape for the jet
Ahdhn Sep 6, 2023
e64a4d1
Fix clength and a scale to Sphere problemn
Ahdhn Sep 6, 2023
20fc9de
parametrize jet problem
Ahdhn Sep 6, 2023
3d4c409
adding polyscope
Ahdhn Sep 11, 2023
152dffb
Add input arguments in a struct
Ahdhn Sep 11, 2023
8d0c6af
replaces problemId with scale and make it user input
Ahdhn Sep 11, 2023
343f005
require device ID
Ahdhn Sep 11, 2023
3f61ad7
to compile polyscope
Ahdhn Sep 11, 2023
61788e9
fix linux compilation
Ahdhn Sep 11, 2023
6b8bdfb
fix Ubuntu compilation
Ahdhn Sep 11, 2023
2789a46
mField operator() using Idx
Ahdhn Sep 12, 2023
9503aa4
use host container for initPolyscope
Ahdhn Sep 12, 2023
786da02
added libigl to use winding number for flow over mesh
Ahdhn Sep 12, 2023
817177f
minor fix to the clength
Ahdhn Sep 12, 2023
6ecd1b0
Fix minor issue with scaling the mesh
Ahdhn Sep 12, 2023
5147782
minor fixes to get flow over mesh working
Ahdhn Sep 12, 2023
297443a
update libigl
Ahdhn Sep 13, 2023
0d88f70
Fix outlet BC
Ahdhn Sep 14, 2023
f127d8b
skip outlet BC for now, tweak mesh box size, output vtk, add mesh to …
Ahdhn Sep 14, 2023
f1fe05c
Fix clength for the mesh problem
Ahdhn Sep 14, 2023
2e8d032
clenght for jet
Ahdhn Sep 14, 2023
41a3e15
speedup inside/outside query
Ahdhn Sep 14, 2023
811e90d
Revert "speedup inside/outside query"
Ahdhn Sep 14, 2023
367f2ad
fix a bug in initSumStore
Ahdhn Sep 15, 2023
9d4a868
bGrid get neighbor degenerate case
Ahdhn Sep 18, 2023
b8bde1c
bug fix with storeFine
Ahdhn Sep 18, 2023
5ad983d
cleanup
Ahdhn Sep 18, 2023
0ef30a7
added `collideKBCFusedStore`
Ahdhn Sep 18, 2023
84afa2f
init fusedFinest
Ahdhn Sep 18, 2023
c3507d9
use int8_t with loops
Ahdhn Sep 18, 2023
fd95095
streaming push
Ahdhn Sep 19, 2023
d0905de
use libigl as static library
Ahdhn Sep 20, 2023
d8d811a
Revert "use libigl as static library"
Ahdhn Sep 20, 2023
d550a00
use igl winding number instead of signed distance
Ahdhn Sep 20, 2023
f4e8dc2
fix fused finest
Ahdhn Sep 21, 2023
70e037c
fused finest seems to work correctly now
Ahdhn Sep 21, 2023
b20594b
fused finest using KBC
Ahdhn Sep 21, 2023
4baa6a6
make polyscope optional
Ahdhn Sep 21, 2023
e38d047
comment out outlet BC
Ahdhn Sep 21, 2023
439d6ea
enforce max register count
Ahdhn Sep 21, 2023
9a1b21e
compute velocity at the end
Ahdhn Sep 21, 2023
fdb1396
minor bug
Ahdhn Sep 21, 2023
682868d
correct mlups
Ahdhn Sep 25, 2023
44cf166
Update lbmMultiRes.h
Ahdhn Sep 25, 2023
d8a17fb
benchmark script
Ahdhn Sep 25, 2023
cd467ff
Update run.sh
Ahdhn Sep 25, 2023
aeb0f07
correct report name + BGK as default
Ahdhn Sep 26, 2023
9933345
lid drive cavity problem 10
Ahdhn Sep 26, 2023
84db90b
allocate velocity and density only for visuals
Ahdhn Sep 27, 2023
5746239
fix minor bug
Ahdhn Sep 29, 2023
1b380bd
a little bump to stream fused explosion
Ahdhn Sep 29, 2023
68e5edd
stream fused coalescence
Ahdhn Oct 1, 2023
359fc73
fix streamFuseAll performance
Ahdhn Oct 1, 2023
f7224a6
fix mesh resizing for flow over mesh
Ahdhn Oct 2, 2023
c73c979
use vector field in writing the vtk
Ahdhn Oct 2, 2023
65279f6
binary vtk
Ahdhn Oct 4, 2023
605dc33
binary vtk
Ahdhn Oct 4, 2023
a1039c3
scripts
Ahdhn Oct 4, 2023
e82e16b
use the coarsest level to upsample the velocity for binary vtk
Ahdhn Oct 4, 2023
040da98
plane obj file
Ahdhn Oct 4, 2023
a0ae21e
Update practice_v28.obj
Ahdhn Oct 4, 2023
b90c97e
speedup inside/outside calculation
Ahdhn Oct 4, 2023
9740e46
bigger mesh box
Ahdhn Oct 5, 2023
0ddaee8
ghia plots
Ahdhn Oct 5, 2023
0e22d86
sphere model
Ahdhn Oct 5, 2023
a827c56
cleanup
Ahdhn Oct 12, 2023
880fe9d
cleanup
Ahdhn Oct 12, 2023
f91f0f3
fix multi-res unit test
Ahdhn Oct 12, 2023
0bbbe75
minor reorg
Ahdhn Jan 29, 2024
6949536
plot script
Ahdhn Feb 6, 2024
422ce66
experiment with 5 levels
Ahdhn Feb 12, 2024
fd73e75
speedup inside/outside calculation
Ahdhn Feb 13, 2024
f336338
minor
Ahdhn Feb 13, 2024
de579cb
fix issue where we may end up with gaps between different resolutions
Ahdhn Feb 14, 2024
25ad35c
dist to mesh for grid construction (commented out for now)
Ahdhn Feb 14, 2024
f8e7a60
add option to rotate the input model
Ahdhn Feb 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/Ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
with:
cuda: '11.7.0'
linux-local-args: '["--toolkit"]'
- run: sudo apt-get update
- run: sudo apt-get install -y xorg-dev libglu1-mesa-dev freeglut3-dev mesa-common-dev
- run: nvcc -V
- name: Checkout
uses: actions/checkout@v2
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,6 @@ temp
docs/doxygen/html/

docs/doxygen/latex/

!apps/lbmMultiRes/practice_v28.obj
!apps/lbmMultiRes/sphere3.obj
15 changes: 15 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@ if ("${CMAKE_BUILD_TYPE}" STREQUAL "")
set(CMAKE_BUILD_TYPE Release)
endif ()

if (WIN32)
set(LIBIGL_USE_STATIC_LIBRARY "ON" CACHE BOOL "Use Libigl as a static library")
set(NEON_USE_POLYSCOPE "ON" CACHE BOOL "Enable Ployscope for visualization")
endif()

if(${NEON_USE_POLYSCOPE})
message(STATUS "Polyscope is enabled")
else()
message(STATUS "Polyscope is disabled")
endif()


# Manage between building Neon as shared or static library
include("${PROJECT_SOURCE_DIR}/cmake/ManageLibraryType.cmake")

Expand Down Expand Up @@ -70,6 +82,9 @@ if (NOT OpenMP_CXX_FOUND)
message(FATAL_ERROR "Neon could not find OpenMP")
endif ()
target_link_libraries(NeonDeveloperLib INTERFACE OpenMP::OpenMP_CXX)
if(${NEON_USE_POLYSCOPE})
target_compile_definitions(NeonDeveloperLib INTERFACE NEON_USE_POLYSCOPE)
endif()

#target_link_libraries(libNeonXXX INTERFACE $<BUILD_INTERFACE:NeonDeveloperLib>)

Expand Down
9 changes: 7 additions & 2 deletions apps/lbmMultiRes/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)

set (APP_NAME app-lbmMultiRes)
file(GLOB_RECURSE SrcFiles lbmMultiRes.cu lattice.h init.h postProcess.h util.h coalescence.h collide.h explosion.h stream.h store.h verify.h)
file(GLOB_RECURSE SrcFiles lbmMultiRes.cu lbmMultiRes.h lattice.h init.h postProcess.h util.h coalescence.h collide.h explosion.h stream.h store.h verify.h flowOverShape.h lidDrivenCavity.h fusedFinest.h)

add_executable(${APP_NAME} ${SrcFiles})

target_link_libraries(${APP_NAME}
PUBLIC libNeonSkeleton)
PUBLIC libNeonSkeleton glm::glm igl::core)

if(${NEON_USE_POLYSCOPE})
target_link_libraries(${APP_NAME}
PUBLIC libNeonSkeleton polyscope)
endif()

set_target_properties(${APP_NAME} PROPERTIES
CUDA_SEPARABLE_COMPILATION ON
Expand Down
22 changes: 12 additions & 10 deletions apps/lbmMultiRes/coalescence.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
#include "lattice.h"

template <typename T, int Q>
inline Neon::set::Container coalescence(Neon::domain::mGrid& grid,
const bool fineInitStore,
const int level,
const Neon::domain::mGrid::Field<int>& sumStore,
const Neon::domain::mGrid::Field<T>& fout,
Neon::domain::mGrid::Field<T>& fin)
inline Neon::set::Container coalescence(Neon::domain::mGrid& grid,
const bool fineInitStore,
const int level,
const Neon::domain::mGrid::Field<float>& sumStore,
const Neon::domain::mGrid::Field<T>& fout,
Neon::domain::mGrid::Field<T>& fin)
{
// Initiated by the coarse level (hence "pull"), this function simply read the missing population
// across the interface between coarse<->fine boundary by reading the population prepare during the store()
Expand All @@ -22,7 +22,8 @@ inline Neon::set::Container coalescence(Neon::domain::mGrid& g
return [=] NEON_CUDA_HOST_DEVICE(const typename Neon::domain::mGrid::Idx& cell) mutable {
//If this cell has children i.e., it is been refined, than we should not work on it
//because this cell is only there to allow query and not to operate on
const int refFactor = pout.getRefFactor(level);
//const int refFactor = pout.getRefFactor(level);
constexpr T repRefFactor = 0.5;
if (!pin.hasChildren(cell)) {

for (int q = 0; q < Q; ++q) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Consider template for loop.

Expand All @@ -32,15 +33,16 @@ inline Neon::set::Container coalescence(Neon::domain::mGrid& g
}
//if we have a neighbor at the same level that has been refined, then cell is on
//the interface and this is where we should do the coalescence
if (pin.hasChildren(cell, dir)) {

if (pin.hasChildren(cell, dir) && pin.isActive(cell, dir)) {
auto neighbor = pout.getNghData(cell, dir, q);
if (neighbor.mIsValid) {
if (fineInitStore) {
auto ssVal = ss.getNghData(cell, dir, q);
assert(ssVal.mData != 0);
pin(cell, q) = neighbor.mData / static_cast<T>(ssVal.mData * refFactor);
pin(cell, q) = neighbor.mData * ssVal.mData;
} else {
pin(cell, q) = neighbor.mData / static_cast<T>(refFactor);
pin(cell, q) = neighbor.mData * repRefFactor;
}
}
}
Expand Down
Loading
Loading