Coder Social home page Coder Social logo

amgebauer / dualsphysics Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dualsphysics/dualsphysics

0.0 1.0 0.0 173.92 MB

C++/CUDA/OpenMP based Smoothed Particle Hydrodynamics (SPH) Solver

License: GNU Lesser General Public License v2.1

Shell 0.01% Batchfile 0.01% C++ 88.23% Cuda 11.48% Makefile 0.20% C 0.08%

dualsphysics's Introduction


DualSPHysics
DualSPHysics

A combined CUDA and OpenMP implementation of the Smoothed Particle Hydrodynamics method based on the advanced SPHysics code.

DualSPHysics

Instructions for regular users

If you only want a copy of DualSPHysics to make and run cases in your system, you probably want the full DualSPHysics package from the official webpage. There you will find documentation and a different set of packages for different versions of the application and 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 generated case to execute the SPH solver, so you want to check out GenCase too, included the main package on the DualSPHysics webpage.

If you need help check out the wiki for this project, or you can also check the previously mentioned download page to get a PDF guide.

Instructions for docker

You can build a Docker container of DualSPHysics using the provided Dockerfile. The Docker-container can be build with the following command:

docker build -t dualsphysics .

After a successful build, you can run DualSPHysics using docker:

docker run dualsphysics ./DualSPHysics4.2CPU_linux64

This command works similar for the other executables, e.g.:

docker run dualsphysics ./GenCase4_linux64

The Docker container runs a minimalized image of Ubuntu, thus only the linux64 executables work.

It is necessary to mount the working directory to the Docker container. Suppose you want to simulate a case defined in the file /path/to/CaseDef.xml. You have to execute the following commands:

# executes GenCase
docker run -v /path/to:/run dualsphysics ./GenCase4_linux64 /run/CaseDef /run/out/Simulation -save:all

# executes DualSPHysics
docker run -v /path/to:/run dualsphysics ./DualSPHysics4.2CPU_linux64 /run/out/Simulation /run/out -svres -cpu

On your system, the directory /path/to/out/ must exists. Here all output files are stored. The parameter -v mounts all files in path/to to the container in the directory /run.

We haven't tested the GPU version of DualSPHysics which probably will not work with the current Dockerfile. Feel free to create a pull request with an improved version.

You can run DualSPHysics on all platforms including Mac OS X with this Docker container but probably not with the optimal performance.

Instructions for developers

If you are a developer and want to use this code check the following guides.

Take into account that for generating cases and post-processing them you will need to use GenCase and the different post-processing tools included in the main DualSPHyisics package, downloadable here. If you compile your own DualSPHyiscs version just overwrite (or don use) the one in the package, but yours.

Developing a modified version to fit your own needs.

You can fork this repository and change or add anything you want in it. Keep in mind that your changes will not be taken into account into the main versions. If your objective is to add your changes/improvements to the main code, check the next section.

Developing a modified or improved version to contribute to the project.

We appreciate your efforts! But please, if you are trying to develop a feature to add to the main repository, be sure to follow the steps on the CONTRIBUTING.md file, to make the process easier for both parts and optimize the process.

Building the project

On Microsoft Windows

This application is being developed in Visual Studio 2013. The repository contains project files for that IDE and it is recomended to use them to make the process easier.

Make sure to 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.

If you prefer it, you can also use the Makefile. It is possible that you'll need to change some things in it to make it work. 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.

On GNU/Linux

You can build the project in GNU/Linux using the Makefile included in the source folder. Follow this steps (for the GPU version):

  1. Clone this repository into your system
  2. Ensure you have GCC version 4.X installed. Usually there are packages in your distro like gcc49 that provides the g++-4.9 executable.
  3. In a terminal, go to the folder DualSPHysics/SOURCE/DualSPHysics/Source/
  4. Execute make clean to make sure the environment is clean and ready to compile
  5. Execute make CC=g++-4.9 CPP=g++-4.9 CXX=g++-4.9 LD=g++-4.9 -f ./Makefile. Be sure to replace g++-4.9 for the executable name you have in your system (previously installed in step 2)

After compiling you should see a message like --- Compiled Release GPU/CPU version ---. Go to DualSPHysics/EXECS_LINUX/ to check that DualSPHyiscs_linux64 or DualSPHyiscsCPU_linux64 is there and build correctly.

For the GPU version: Install the CUDA package on your system and edit the makefile to point the CUDA libs directories to the paths on your system. Also, check the CUDA version and adapt the Makefile to it.

For the CPU version: If you want to compile de CPU version just ignore CUDA and use the makefile Makefile_cpu

Graphical user interface (GUI)

Please check DesingSPHysics website.

Contributing

Please read CONTRIBUTING.md if you want to make changes to the code that would be later merged with the main project.

Authors and people involved

  • Dr Jose M. Dominguez - Main Developer
  • Dr Alejandro Crespo
  • Prof. Moncho Gomez Gesteira
  • Dr Anxo Barreiro
  • Dr Benedict Rogers
  • Dr Georgios Fourtakas
  • Dr Athanasios Mokos
  • Dr Renato Vacondio
  • Dr Ricardo Canelas
  • Dr Stephen Longshaw
  • Dr Corrado Altomare

See also the list of contributors who participated in this project.

License

This project is licensed under the LGPL License - see the LICENSE file for details.

dualsphysics's People

Contributors

amgebauer avatar ammyg avatar dualsphysics avatar jmdalonso avatar rodland avatar zlotny avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.