DualSPHysics is based on the Smoothed Particle Hydrodynamics model named SPHysics.
The code is developed to study free-surface flow phenomena where Eulerian methods can be difficult to apply, such as waves or impact of dam-breaks on off-shore structures. DualSPHysics is a set of C++, CUDA and Java codes designed to deal with real-life engineering problems.
If you only want a copy of DualSPHysics to create and run cases in your system, you probably want the full DualSPHysics package from the official website. There you will find documentation and packages of different versions for different Operating Systems.
It is possible that you want the latest version in this repository that is not yet uploaded in the official web page. In this case check the Building the project section to build an executable.
Have in mind that DualSPHysics needs a case already created to execute the SPH solver, so you need to use GenCase, which is included the main package on the DualSPHysics webpage.
If you need help check out the wiki for this project.
If you are a developer and want to use this code check the following guides.
Take into account that for pre- and post-processing you will need to use GenCase and the different post-processing tools included in the main DualSPHysics package, here. If you compile your own DualSPHyiscs version just overwrite the one in the package.
You can fork this repository and change or add anything you want. Keep in mind that your changes will not be taken into account into the main versions. If your objective is to implement your changes/improvements to the main code, check the next section.
We appreciate your efforts! But please, if you are trying to develop/implement a functionality to be added to the main repository, be sure to follow the steps described in the CONTRIBUTING.md file.
This application is being developed in Visual Studio Community 2022 since it is free and compatible with CUDA 11.7 (download web). The repository contains project files.
Make sure that you install the CUDA SDK beforehand if you want to compile the GPU version, and configure the Visual Studio project to point to the CUDA libraries directory to compile (now prepared for CUDA 11.7).
You can also use the Makefile. It is possible that you'll need to edit it. Check the GNU/Linux guide on how to compile if you're using the makefile, as it is mostly the same, just installing the things manually by yourself.
You can build the project in GNU/Linux using the Makefile included in the source folder. Follow these steps (for the GPU version):
- Clone this repository into your system
git clone https://github.com/DualSPHysics/DualSPHysics.git
- In a terminal, go to the folder
cd DualSPHysics/src/source/
- Edit the
Makefile
file with a text editor and then:- Set the
DIRTOOLKIT
variable with the path to CUDA in your system e.g.DIRTOOLKIT=/opt/cuda
- Make sure that your
G++
compiler version is compatible with the CUDA version installed in your system (e.g. CUDA 11.7 supports G++ versions up to 11.x). If you want to use an specific version, you should modify the variableCC
, for example:CC=/usr/local/bin/g++-11
- Set the
- Execute
make clean
to make sure the environment is clean and ready to compile. - Execute
make
After compiling you should see a message like --- Compiled Release GPU/CPU version ---
. Go to bin/linux/
to check that DualSPHyiscs5.2_linux64
or DualSPHyiscs5.2CPU_linux64
is there and build correctly.
For the CPU version: If you want to compile de CPU version just ignore CUDA and use the makefile Makefile_cpu
. To specify a different file to make
, use the -f
parameter: make -f Makefile_cpu
Alternatively you can use CMake to compile DualSPHysics following these steps:
- Clone this repository into your system
git clone https://github.com/DualSPHysics/DualSPHysics.git
- In a terminal, go to the folder
cd DualSPHysics/src/source/
- Create a temporal directory were the build files will be placed
mkdir build
- Make sure that your
GCC
compiler version is compatible with the CUDA version installed in your system (e.g. CUDA 11.7 supports G++ versions up to 11.x). If you want to use an specific version, you should modify the environment variableCC
andCXX
, for example:export CC=/usr/local/bin/gcc-11; export CXX=/usr/local/bin/g++11
- Go to the build folder and execute cmake
cd build; cmake ..
- Execute
make
If CUDA is not installed in your system, only the CPU version will be compiled.
If you want the binaries be placed into bin/linux
directory, just type make install
Please check DesignSPHysics website.
Please check VisualSPHysics website.
Please read CONTRIBUTING.md if you want to make changes to the code.
- Dr Jose M. Dominguez Alonso - Main Developer
- Dr Alejandro J.C. Crespo
- Prof. Moncho Gomez Gesteira
- Prof. Benedict D. Rogers
- Dr Georgios Fourtakas
- Prof. Peter Stansby
- Dr Renato Vacondio
- Dr Corrado Altomare
- Dr Angelo Tafuni
- Orlando Garcia Feal
- Ivan Martinez Estevez
- Dr Joseph O'Connor
- Dr Aaron English
- Dr Jose Gonzalez Cao
- Dr Ricardo Canelas
- Dr Athanasios Mokos
- Dr Stephen Longshaw
- Dr Anxo Barreiro
See also the list of contributors who participated in this project.
This project is licensed under the LGPL License - see the LICENSE file for details.