diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml deleted file mode 100644 index 30aa626..0000000 --- a/.idea/codeStyles/Project.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 7d8af2d..ccf0124 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,10 +18,9 @@ set(ALTLIB_DIR ${PROJECT_SOURCE_DIR}/deps/altlib) add_subdirectory(${ALTLIB_DIR}) set(ALTMATH_DIR ${PROJECT_SOURCE_DIR}/deps/altmath) -set(altmath_build_tests OFF) +set(altmath_build_tests OFF CACHE BOOL "Turn off tests.") add_subdirectory(${ALTMATH_DIR}) - set(LIBRARY_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include) file(GLOB_RECURSE LIBRARY_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/*.h) diff --git a/demo/App.h b/demo/App.h index d17dc17..0d0fb5b 100644 --- a/demo/App.h +++ b/demo/App.h @@ -7,7 +7,7 @@ #include -#include "vec2d.h" +#include "vec2.h" #include "Camera2D.h" #include "FluidSim2D.h" #include "FluidRenderer2D.h" diff --git a/demo/CMakeLists.txt b/demo/CMakeLists.txt index 907338f..f6d4bde 100644 --- a/demo/CMakeLists.txt +++ b/demo/CMakeLists.txt @@ -3,6 +3,8 @@ file(GLOB DEMO_HEADERS *.h) add_executable(fluid_sim_demo ${DEMO_SOURCES} ${DEMO_HEADERS}) +# target_compile_definitions(fluid_sim_demo PUBLIC ALTMATH_USE_SIMD) + target_link_libraries(fluid_sim_demo LINK_PUBLIC fluid_sim) target_link_libraries(fluid_sim_demo PUBLIC altlib) target_link_libraries(fluid_sim_demo PUBLIC altmath) diff --git a/demo/Camera2D.h b/demo/Camera2D.h index dce363e..6cca71f 100644 --- a/demo/Camera2D.h +++ b/demo/Camera2D.h @@ -7,7 +7,7 @@ #include #include "vec2.h" -#include "mat4f.h" +#include "mat4.h" #include "InputManager.h" diff --git a/demo/FluidRenderer2D.cpp b/demo/FluidRenderer2D.cpp index 05ccc3b..f777bab 100644 --- a/demo/FluidRenderer2D.cpp +++ b/demo/FluidRenderer2D.cpp @@ -4,7 +4,7 @@ #include "FluidRenderer2D.h" -#include +#include #include "App.h" #include "FluidSim2D.h" diff --git a/demo/Shader.h b/demo/Shader.h index bd3fc61..33e4470 100644 --- a/demo/Shader.h +++ b/demo/Shader.h @@ -8,10 +8,10 @@ #include "Storage.h" #include "StringPool.h" -#include +#include #include #include -#include +#include struct Shader { GLuint id; diff --git a/demo/Transform.h b/demo/Transform.h index ad8dd96..e8ded9f 100644 --- a/demo/Transform.h +++ b/demo/Transform.h @@ -5,9 +5,9 @@ #ifndef ALTLIB_TRANSFORM_H #define ALTLIB_TRANSFORM_H -#include -#include -#include +#include +#include +#include #include struct Transform { diff --git a/deps/altmath b/deps/altmath index 38d5320..cc9afd4 160000 --- a/deps/altmath +++ b/deps/altmath @@ -1 +1 @@ -Subproject commit 38d53202a7dc0ecb7e497742b0310f4225f34a40 +Subproject commit cc9afd41eef4d0a4f3759ade71b366efb489e338 diff --git a/include/Array2D.h b/include/Array2D.h index 9203ed1..276f8a8 100644 --- a/include/Array2D.h +++ b/include/Array2D.h @@ -15,8 +15,7 @@ #include #include -#include -#include +#include #include "immintrin.h" template @@ -376,6 +375,7 @@ struct Array2D { (*this)(x2, y2) += disp.x * disp.y * value; } + /* void linearDistribute(vec2dx4 pos, vec4d value) { auto floor = aml::toInt(aml::floor(pos)); auto disp = vec2dx4 {pos.x - aml::toDouble(floor.x), pos.y - aml::toDouble(floor.y)}; @@ -397,6 +397,7 @@ struct Array2D { (*this)(x2.v[i], y2.v[i]) += v4.v[i]; } } + */ double linearExtract(vec2d pos) { int ui = (int) pos.x; diff --git a/include/FluidSim2D.h b/include/FluidSim2D.h index 5f82226..d7b59aa 100644 --- a/include/FluidSim2D.h +++ b/include/FluidSim2D.h @@ -7,7 +7,7 @@ #include #include -#include +#include #include "Array2D.h" #include "MACGrid2D.h" #include "PerformanceCounter.h" diff --git a/src/FluidSim2D.cpp b/src/FluidSim2D.cpp index 7b09c69..636be6a 100644 --- a/src/FluidSim2D.cpp +++ b/src/FluidSim2D.cpp @@ -4,7 +4,6 @@ // #include -#include #include #include #include @@ -595,7 +594,7 @@ void FluidSim2D::applyAdvection() { auto nextPos = pos + (2./9.)*dt*k1 + (3./9.)*dt*k2 + (4./9.)*dt*k3; nextPos = clampPos(nextPos); - if (isnan(pos.x) || isnan(pos.y)) { + if (std::isnan(pos.x) || std::isnan(pos.y)) { log_error("Advected position is NaN! pos=(%d, %d), idx=%d", pos.x, pos.y, i); exit(1); }