diff --git a/.gitignore b/.gitignore deleted file mode 120000 index e844d7f..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/home/raiden/programming/TuringPatterns/cmake/.gitignore.in \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..54f1ca7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,55 @@ +# Prerequisites +*.d + +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app + +# build output +build/ + +# IDE +.idea + +# vim +*.sw* + +# sym-links added by cmake +CMakePresets.json +IgnoreWarning.h +.pre-commit-config.yaml +.clang-format +.clang-tidy + +# python cache +__pycache__/ + +# saved output files +*.npy +*.gif diff --git a/.gitmodules b/.gitmodules index e718363..dd3b00a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ [submodule "cmake"] path = cmake - url = git@github.com:pmontalb/CmakeUtilities.git + url = git@github.com:chronopoulos/cmake-utils-turing-patterns.git [submodule "PdeFiniteDifferenceSolver"] path = PdeFiniteDifferenceSolver url = git@github.com:pmontalb/PdeFiniteDifferenceSolver.git diff --git a/CMakeLists.txt b/CMakeLists.txt index df421f7..41cdc8d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.14) -project(TuringPatterns) +project(TuringPatterns CXX C CUDA) include(cmake/All.cmake) set(LANGUAGES_USE_CUDA ON CACHE BOOL "" FORCE) diff --git a/README.md b/README.md index ecfd285..e09b205 100644 --- a/README.md +++ b/README.md @@ -31,3 +31,28 @@ I made a python script that calls the C++ executable and gather the numerical re

+ +## Dependencies + +This code requires CUDA version 11. Download it here: + +https://developer.nvidia.com/cuda-11.0-download-archive + + +## Building + +``` +git submodule update --init --recursive +mkdir build +cd build/ +cmake .. +make +``` + +# Running + +From the top level: + +``` +python3 patternRunner.py +``` diff --git a/cmake b/cmake index 2a54d70..7a3d52f 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit 2a54d70c082d3576abed2348a2c1053657d63701 +Subproject commit 7a3d52f04ad20a03f44afdc3cce26cb3bd873111 diff --git a/lines_compressed.gif b/lines_compressed.gif deleted file mode 100644 index 9ac2e44..0000000 Binary files a/lines_compressed.gif and /dev/null differ diff --git a/patternRunner.py b/patternRunner.py index 1f12394..c8df112 100644 --- a/patternRunner.py +++ b/patternRunner.py @@ -14,8 +14,8 @@ X_GRID_FILE = "{}\\x_grid.npy".format(CWD) Y_GRID_FILE = "{}\\y_grid.npy".format(CWD) else: - debugBin = "{}/cmake-build-gcc-debug/TuringPatterns".format(CWD) - releaseBin = "{}/cmake-build-gcc-release/TuringPatterns".format(CWD) + debugBin = "{}/build/bin/TuringPatterns".format(CWD) + releaseBin = "{}/build/bin/TuringPatterns".format(CWD) GRID_FILE = "{}/grid.npy".format(CWD) INITIAL_CONDITION_FILE = "{}/ic.npy".format(CWD) @@ -175,7 +175,7 @@ def run_gray_scott_coral3(run=True, save=False): ["-bc", "Periodic"] + ["-xd", str(N_x)] + ["-yd", str(N_x)] + - ["-nIter", "100"] + + ["-nIter", str(N)] + ["-nIterPerRound", "100"] + ["-dt", ".5"] + ["-wns", ".05"] + @@ -207,7 +207,7 @@ def run_gray_scott_lines(run=True, save=False): ["-bc", "Periodic"] + ["-xd", str(N_x)] + ["-yd", str(N_x)] + - ["-nIter", "100"] + + ["-nIter", str(N)] + ["-nIterPerRound", "100"] + ["-dt", "1"] + ["-wns", ".05"] + @@ -399,7 +399,7 @@ def run_fitz_hugh_nagumo_low_beta(run=True, save=False): ["-bc", "ZeroFlux"] + ["-xd", str(N_x)] + ["-yd", str(N_x)] + - ["-nIter", "100"] + + ["-nIter", str(N)] + ["-nIterPerRound", "1000"] + ["-dt", "0.001"] + ["-wns", ".05"] + @@ -431,7 +431,7 @@ def run_fitz_hugh_nagumo_spatial(run=True, save=False): ["-bc", "ZeroFlux"] + ["-xd", str(N_x)] + ["-yd", str(N_x)] + - ["-nIter", "100"] + + ["-nIter", str(N)] + ["-nIterPerRound", "1000"] + ["-dt", "0.001"] + ["-wns", ".05"] + @@ -454,6 +454,7 @@ def run_fitz_hugh_nagumo_spatial(run=True, save=False): if __name__ == "__main__": + run_gray_scott_bacteria(run=True, save=False) # run_gray_scott_bacteria2(run=True, save=False) # run_gray_scott_coral(run=True, save=False) @@ -464,4 +465,5 @@ def run_fitz_hugh_nagumo_spatial(run=True, save=False): # run_brussellator_dots(run=True, save=False) # run_schnakenberg(run=True, save=False) # run_thomas(run=True, save=False) - # run_fitz_hugh_nagumo(run=True, save=False) \ No newline at end of file + # run_fitz_hugh_nagumo(run=True, save=False) +