projectchrono / DEM-Engine

A dual-GPU DEM solver with complex grain geometry support
Other
65 stars 14 forks source link
chrono cuda discrete-element-method gpu multi-gpu simulation

SBEL GPU DEM-Engine

A dual-GPU DEM solver with complex grain geometry support

Quick links

  • Overview, movies of demos, and where to get help
  • Use DEME with Python
  • How to compile from source
  • Numerical examples and use cases
  • Install as C++ library
  • Licensing
  • Limitations
  • Cite this work
  • Description

    DEM-Engine, nicknamed DEME, does Discrete Element Method simulations:

    Currently DEME is a C++ package with an API design similar to Chrono's, and should be easy to learn for existing Chrono users.

    You can find the movies of some of DEME's demos here.

    You are welcome to discuss DEME on Project Chrono's forum.

    PyDEME

    DEME is now available as a Python package, pyDEME. It is quick to install and pick up its usage by trying this Python version. If you want to maximize the performance and use the cutting-edge features, you can instead install the C++ version of DEME from source.

    To install pyDEME, use a Linux machine, install CUDA if you do not already have it. Useful installation instructions may be found here.

    Some additional troubleshooting tips for getting CUDA ready:

    Once CUDA is ready, you can pip install pyDEME. In your conda environement, do

    conda create -n pyDEME python=3.11
    conda activate pyDEME
    conda install cmake
    pip3 install DEME

    You can also install pyDEME via conda install: (Please don't use conda install for now, it is not yet behaving correctly)

    conda create -n pyDEME python=3.11

    conda activate pyDEME

    conda install -c projectchrono pydeme

    pyDEME can be replaced with an environement name of your choice. Other Python versions other than 3.11 should work as well.

    Then Python scripts can be executed in this environment. To understand the content of each Python demo, refer to the explanations of the C++ demos with the same names in Examples section.

    Compilation

    You can also build C++ DEME from source. It allows for potentially more performance and more tailoring.

    On a Linux machine, install CUDA. The newest release is recommended.

    Once CUDA is ready, clone this project and then:

    git submodule init
    git submodule update

    This will pull the submodule NVIDIA/jitify so that we can do runtime compilation.

    Then, one typical choice is to make a build directory in it. Then in the build directory, use cmake to configure the compilation. An example:

    mkdir build
    cd build
    cmake -DCMAKE_BUILD_TYPE=Release ..

    You may want to use this information if you need to update cmake to the newest.

    We suggest that you install a cmake GUI such as ccmake, and ninja_build generator, to better help you configure the project. In this case, the example above can be done like this alternatively:

    mkdir build
    cd build
    ccmake -G Ninja ..

    You generally do not have to change the build options in the GUI, but preferably you can change CMAKE_BUILD_TYPE to Release, and if you need to install this package as a library you can specify a CMAKE_INSTALL_PREFIX.

    Some additional troubleshooting tips for generating the project:

    Finally, build the project.

    ninja

    Some additional troubleshooting tips for building the project:

    Examples

    After the build process is done, you can start trying out the demos.

    The documentations for DEME are hosted on Chrono website (work in progress).

    Some additional troubleshooting tips for running the demos:

    Limitations

    DEME is designed to simulate the interaction among clump-represented particles, the interaction between particles and mesh-represented bodies, as well as the interaction between particles and analytical boundaries. DEME does not resolve mesh–mesh or mesh–analytical contacts.

    Install as library

    Set the CMAKE_INSTALL_PREFIX flag in cmake GUI to your desired installation path and then

    ninja install

    We provide examples of linking against both Chrono and DEME for co-simulations in chrono-projects. You need to checkout the feature/DEME branch after cloning the code.

    You need to build chrono-projects linking against a Chrono installation (Chrono installation guide is here; note you have to make install to install Chrono, not just build it), then link against DEME. The steps for building chrono-projects:

    Then build the project and you should be able to run the demo scripts that demonstrate the co-simulation between DEME and Chrono.

    More documentations on using this package for co-simulations are being added.

    Licensing

    This project should be treated as the collective intellectual property of the Author(s) and the University of Wisconsin - Madison. The following copyright statement should be included in any new or modified source files

    Copyright (c) 2021, Simulation-Based Engineering Laboratory
    Copyright (c) 2021, University of Wisconsin - Madison
    
    SPDX-License-Identifier: BSD-3-Clause

    New authors should add their name to the file CONTRIBUTORS.md rather than to individual copyright headers.

    Notes on code included from Project Chrono

    This project exists independently of Chrono so developers should be sure to include the appropriate BSD license header on any code which is sourced from Chrono::GPU(DEM) or other parts of Chrono.

    SAMPLE header for files sourced from Chrono

    Copyright (c) 2021, SBEL GPU Development Team
    Copyright (c) 2021, University of Wisconsin - Madison
    
    SPDX-License-Identifier: BSD-3-Clause
    
    This file contains modifications of the code authored by the Project Chrono 
    Development Team. The original license can be found below:
    
    Copyright (c) 2016, Project Chrono Development Team
    All rights reserved.
    
    Use of this source code is governed by a BSD-style license that can be found
    in the LICENSE file at the top level of the distribution and at
    http://projectchrono.org/license-chrono.txt. A copy of the license is below.
    
    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 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 HOLDER OR CONTRIBUTORS 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.

    Citation

    See the paper that explains the design and usage of DEME and cite

    @article{zhang_2024_deme,
    title = {Chrono {DEM-Engine}: A Discrete Element Method dual-{GPU} simulator with customizable contact forces and element shape},
    journal = {Computer Physics Communications},
    volume = {300},
    pages = {109196},
    year = {2024},
    issn = {0010-4655},
    doi = {https://doi.org/10.1016/j.cpc.2024.109196},
    author = {Ruochun Zhang and Bonaventura Tagliafierro and Colin {Vanden Heuvel} and Shlok Sabarwal and Luning Bakke and Yulong Yue and Xin Wei and Radu Serban and Dan Negruţ},
    keywords = {Discrete Element Method, GPU computing, Physics-based simulation, Scientific package, BSD3 open-source},
    }

    See the paper on using DEME for simulating rover dynamics and cite

    @article{ruochunGRC-DEM2023,
          title={A {GPU}-accelerated simulator for the {DEM} analysis of granular systems composed of clump-shaped elements}, 
          author={Ruochun Zhang and Colin {Vanden Heuvel} and Alexander Schepelmann and Arno Rogg and Dimitrios Apostolopoulos and Samuel Chandler and Radu Serban and Dan Negrut},
          year={2024},
          journal={Engineering with Computers},
          doi={https://doi.org/10.1007/s00366-023-01921-9}
    }