This repository contains a C++ implementation of the Gray-Scott reaction-diffusion model, including simulation and testing. The Gray-Scott model is a mathematical formulation that describes how the concentration of substances distributed in space changes under the influence of local chemical reactions and diffusion. This project allows users to input specific parameters to observe a variety of patterns produced by the model.
The model is described in the following figure.
The parameters required from the user are formatted as follows:
To build and run the project locally, use the following commands:
mkdir build && cd build
cmake ..
make all -j
./src/gs_main
The functionality of the simulation is continuously tested using Google Test. To run the tests locally, execute ctest
command.
Our CI/CD pipeline uses GitHub Actions and consists of two parts. First, every commit on all branches triggers a 'build' job that checks the integrity of the code and verifies that all tests pass. If a commit is made to the main branch, GitHub Actions will automatically update the official Docker image of the project on DockerHub in 'docker' job.
Here is an example of a successful GitHub Actions run:
We recommend running our software using Docker as it integrates a Python script that generates a visually appealing simulation output. Follow the steps below:
1- Open a terminal and run the following command:
docker run -p 5050:5050 -it mmohhamadd/gray-scott-sim-cpp-with-tests
2- you will be prompted to input your arbitrary values for the problem parameters. If you don't provide any, the system will generate random ones for you.
3- The C++ simulation will then start. This process may take a while.
4- Once the C++ simulation ends, the Python script will start creating an animation from the simulation outputs.
5- After the animation is created, an HTTP server will host the result. You can view the animation by visiting the following link in your web browser: http://localhost:5050/animation.gif