Skip to content
Open

c #1

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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
17 changes: 17 additions & 0 deletions dualsphysics/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
sudo: false

language:
- cpp

install:
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
- sudo apt-get update
- sudo apt-get install libgomp1 g++-4.9 -y

script:
- cd ./src/source
- ls
- make CC=g++-4.9 CPP=g++-4.9 CXX=g++-4.9 LD=g++-4.9 -f ./Makefile_cpu

notifications:
email: false
18 changes: 18 additions & 0 deletions dualsphysics/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Contributing

When contributing to this repository, please first discuss the change you wish to make via issue (in this repository), [email](mailto:dualsphysics@gmail.com), or any other method with the owners of this repository before making a change.

## Commits

Please try to write the commits in english, stating the change that it makes, and with an extended description if necessary. To optimize comprehension and make reading them easier, follow a [style guide of commiting like this one](https://chris.beams.io/posts/git-commit/)

## For external developers: Pull Request Process

1. Ensure all of the code works, specially the cases not related to the new features, using the example cases included with the main DualSPHysics package.
2. Make sure all the new files included have a valid license comment
3. Include Doxygen documentation in each one of the classes created including relevant information to understand it.
4. Open a Pull Request or contact [Dr Jose M. Dominguez](mailto:jmdalonso@gmail.com) via email to agree on including the new features or the changes.

## For internal developers: Contributions and documentation

If you incorporate something to the code that changes the way DualSPHysics works or how it is managed (e.g new command line options, new options for the XML parsing, new features in general) please don't forget to add them to [the wiki](https://github.com/DualSPHysics/DualSPHysics/wiki) so the documentation would always be updated.
Binary file added dualsphysics/Files_DualSPHysics_v5.2.pdf
Binary file not shown.
504 changes: 504 additions & 0 deletions dualsphysics/LICENSE

Large diffs are not rendered by default.

129 changes: 129 additions & 0 deletions dualsphysics/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@

<h1 align="center">
<br>
<a href="http://dual.sphysics.org/"><img src="http://design.sphysics.org/img/logo_dualsphysics.png" alt="DualSPHysics" width="300"></a>
<br>
DualSPHysics
<br>
</h1>

<h4 align="center"><a href="http://www.dual.sphysics.org" target="_blank">DualSPHysics</a> is based on the Smoothed Particle Hydrodynamics model named <a href="http://www.sphysics.org" target="_blank">SPHysics</a>.</h4>

<h4 align="center">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++, <a href="https://developer.nvidia.com/cuda-zone" target="_blank">CUDA</a> and Java codes designed to deal with real-life engineering problems.</h4>

# Instructions for regular users

If you only want a copy of DualSPHysics to create and run cases in your system, you probably want <a href="http://www.dual.sphysics.org/index.php/downloads/" target="_blank">the full DualSPHysics package</a> 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](#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 <a href="http://www.dual.sphysics.org/index.php/downloads/" target="_blank">DualSPHysics webpage</a>.

If you need help check out the wiki for this project.

# Instructions for developers

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, <a href="http://www.dual.sphysics.org/index.php/downloads/" target="_blank"> here</a>. If you compile your own DualSPHyiscs version just overwrite the one in the package.

## Developing a modified version to fit your own needs.

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.

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

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](CONTRIBUTING.md) file.

# Building the project

## Microsoft Windows

This application is being developed in Visual Studio Community 2022 since it is free and compatible with CUDA 11.7 (<a href="https://www.visualstudio.com/vs/older-downloads/" target="_blank">download web</a>). 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](src/source/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.

## GNU/Linux

### Using Makefile

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

1. Clone this repository into your system `git clone https://github.com/DualSPHysics/DualSPHysics.git`
2. In a terminal, go to the folder `cd DualSPHysics/src/source/`
3. 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 variable `CC`, for example: `CC=/usr/local/bin/g++-11`
4. Execute `make clean` to make sure the environment is clean and ready to compile.
5. 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`

### Using CMake

Alternatively you can use [CMake](https://cmake.org) to compile DualSPHysics following these steps:

1. Clone this repository into your system `git clone https://github.com/DualSPHysics/DualSPHysics.git`
2. In a terminal, go to the folder `cd DualSPHysics/src/source/`
3. Create a temporal directory were the build files will be placed `mkdir build`
4. 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 variable `CC` and `CXX`, for example: `export CC=/usr/local/bin/gcc-11; export CXX=/usr/local/bin/g++11`
4. Go to the build folder and execute cmake `cd build; cmake ..`
5. 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`

# Graphical user interface (GUI)

<h1 align="center">
<a href="http://design.sphysics.org/"><img src="https://i.imgur.com/D5dabSD.png" alt="DualSPHysics" width="1000"></a>
</h1>

Please check [DesignSPHysics website](http://design.sphysics.org/).

# Advanced visualisation with Blender

<h1 align="center">
<a href="http://visual.sphysics.org/"><img src="https://i.imgur.com/I1psKiT.png" alt="DualSPHysics" width="1000"></a>
</h1>

Please check [VisualSPHysics website](http://visual.sphysics.org/).

# Contributing

Please read [CONTRIBUTING.md](CONTRIBUTING.md) if you want to make changes to the code.

# Authors and people involved

* **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**


## Former people involved
* **Dr Jose Gonzalez Cao**
* **Dr Ricardo Canelas**
* **Dr Athanasios Mokos**
* **Dr Stephen Longshaw**
* **Dr Anxo Barreiro**

See also the list of [contributors](https://github.com/dualsphysics/DualSPHysics/contributors) who participated in this project.

## License

This project is licensed under the LGPL License - see the [LICENSE](LICENSE) file for details.
Binary file added dualsphysics/bin.7z
Binary file not shown.
11 changes: 11 additions & 0 deletions dualsphysics/chpermissions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

chmod +x bin/linux/*_linux64
chmod +x examples/main/*/*.sh
dos2unix examples/main/*/*.sh






52 changes: 52 additions & 0 deletions dualsphysics/doc/help/BIFileInfo_Help.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@


<BIFILEINFO> Copyright (c) 2020 by Dr Jose M. Dominguez
All rights reserved.

BIFileInfo is a free tool for DualSPHysics simulations.
DualSPHysics project is an international collaboration between
University of Vigo (Spain) and University of Manchester (UK).

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the BIFileInfo nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


BIFileInfo v5.0.206 (12-04-2023)
=================================
LoadDsphConfig> .../bin/windows/DsphConfig.xml
Information about parameters of execution:

BIFileInfo file.bix <options>

Basic options:
-h Shows information about parameters
-ver Shows version information
-opt <file> Loads configuration of a file

Define output file:
-svarrays:<0/1> Save values of arrays (default=false)

Examples:
BIFileInfo file.bi4
BIFileInfo file.fbi4 -svarrays

144 changes: 144 additions & 0 deletions dualsphysics/doc/help/BoundaryVTK_Help.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@


<BOUNDARYVTK> Copyright (c) 2020 by Dr Jose M. Dominguez
All rights reserved.

BoundaryVTK is a free tool for DualSPHysics simulations.
DualSPHysics project is an international collaboration between
University of Vigo (Spain) and University of Manchester (UK).

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the BoundaryVTK nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


BoundaryVTK v5.0.206 (12-04-2023)
==================================
LoadDsphConfig> .../bin/windows/DsphConfig.xml
Information about parameters of execution:

BoundaryVTK <options>

Basic options:
-h Shows information about parameters
-ver Shows version information
-opt <file> Loads configuration from a file

-info Shows information of loaded data

Load shapes:
-loadvtk <file.vtk> Loads shapes from vtk files (PolyData). The keyword
[CaseName] is replaced by name of case and wildcards
are allowed
-loadvtk AutoActual Loads shapes from files *_Actual.vtk generated by
GenCase v4.0.074 (or higher)
-loadvtk AutoDp Loads shapes from files *_Dp.vtk like previous one
-onlymk:<values> Indicates the mk of the shapes to be loaded, affects
only the previous -loadvtk instruction and can not be
used with -onlyid
-onlyid:<values> Indicates the code of object of the shapes to be
loaded, only affects the previous -loadvtk
-changemk:<value> Changes the mk of the loaded shapes to a given value,
only affects the previous -loadvtk instruction

-loadply:<mk> <file.ply> Loads shapes from ply files with indicated mk
-loadstl:<mk> <file.stl> Loads shapes from stl files with indicated mk

Load configuration for a mobile boundary:
-filexml file.xml Loads xml file with information of the movement and
types of particles. The word 'AUTO' can be used to
load the xml used in the simulation when -motiondata
or -motiondatatime is used

-motiontime:<time>:<step> Configures the duration and time step to
simulate the movement defined in the xml file,
can not be used with -motiondatatime and -motiondata

-motiondatatime <dir> Indicates the directory where real times of the
simulation are loaded for the mobile boundary
Can not be used with -motiontime and -motiondata

-motiondata <dir> Indicates the directory where position of particles
are loaded to generate the mobile boundary
Can not be used with -motiontime and -motiondatatime

-motiondata0 <dir> It is only for restart simulations. Indicates the
directory where is the file Part_0000.bi4 to load
initial positions of particles.
Can not be used with -motiontime and -motiondatatime

-motionfile file.fbi4 Indicates the file where reference position of
particles are loaded to generate the floating body
Can not be used with -motiontime and -motiondatatime

-motionfocus:<mk> Indicates the mk to fix this body and move the rest
around. This option is only available when motion is
computed from particle data.

Define output files:
-savevtk <file.vtk> Generates vtk(polydata) files with the loaded shapes
-saveply <file.ply> Generates ply file with the loaded information
-savestl <file.stl> Generates stl file with the loaded information
-savevtkdata <file.vtk> Generates vtk(polydata) file with the loaded
shapes including mk and shape code

-savemotion <file> Generates CSV file with matrix movement from the beginning
-saveposmotion:<mk>:x:y:z <file> Generates CSV file with updated position
according movement of mk boundary
-saveposmotion:mk=<mk>,<def> Generates CSV file with updated position
according movement of mk boundary where points are defined using:
pt=<x>:<y>:<z>,pt=<x>:<y>:<z>... for a simple list of points
ptls[x=<x0>:<dx>:<nx>,y=<y0>:<dy>:<ny>,z=<z0>:<dz>:<nz>]...
ptels[x=<x0>:<dx>:<xf>,y=<y0>:<dy>:<yf>,z=<z0>:<dz>:<zf>]...
ptls and ptels are point grid definitions equivalent to POINTSLIST and
POINTSENDLIST respectively

-onlytype:<values> Indicates the type of selected mk of the shapes to be
stored, affects only the previous out option and cannot be
combined with other filters
(+ means include, - means do not include)
+/-all: To choose or reject all options
+/-fixed: Boundary fixed particles
+/-moving: Boundary moving particles
+/-floating: Floating body particles
-onlymk:<values> Indicates the mk of the shapes to be stored, affects
only the previous out option and cannot be combined
with other filters
-onlyid:<values> Indicates the code of the object of the shapes to be
stored, affects only the previous out option and cannot
be combined with other filters
-filemove <file> Loads file with displacement

-createdirs:<0/1> Creates full path for output files
(value by default is read from DsphConfig.xml or 1)
-csvsep:<0/1> Separator character in CSV files (0=semicolon, 1=coma)
(value by default is read from DsphConfig.xml or 0)

Examples:
BoundaryVTK -loadvtk bound.vtk -savevtk box.vtk -onlymk:10,12

BoundaryVTK -loadvtk *_Actual.vtk -filexml AUTO -motiondata .
BoundaryVTK -loadvtk file.vtk -filexml case.xml -motiondata .
-saveply motion.ply
BoundaryVTK -loadvtk AutoActual -motionfile data/PartFloatMotion.fbi4
-savevtk motion -onlytype:-all,floating

Loading