Skip to content

add CMake language specs; various quality-of-life improvements #2

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

Open
wants to merge 8 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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore

This file was deleted.

55 changes: 55 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -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
Copy link
Owner

Choose a reason for hiding this comment

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

Is it possible to revert this line? Or did you make changes there as well?

[submodule "PdeFiniteDifferenceSolver"]
path = PdeFiniteDifferenceSolver
url = git@github.com:pmontalb/PdeFiniteDifferenceSolver.git
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,28 @@ I made a python script that calls the C++ executable and gather the numerical re
<img src="https://raw.githubusercontent.com/pmontalb/TuringPatterns/master/lines_compressed.gif">
<img src="https://raw.githubusercontent.com/pmontalb/TuringPatterns/master/schnakenberg_compressed.gif">
</p>

## 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
```
2 changes: 1 addition & 1 deletion cmake
Submodule cmake updated 1 files
+0 −1 Common.cmake
Binary file removed lines_compressed.gif
Binary file not shown.
16 changes: 9 additions & 7 deletions patternRunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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"] +
Expand Down Expand Up @@ -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"] +
Expand Down Expand Up @@ -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"] +
Expand Down Expand Up @@ -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"] +
Expand All @@ -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)
Expand All @@ -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)
# run_fitz_hugh_nagumo(run=True, save=False)