GithubHelp home page GithubHelp logo

daniel-zint / hpmeshgen Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 275 KB

Generating block-structured grids for ocean domains

License: MIT License

CMake 1.95% C++ 92.13% Makefile 0.06% C 1.83% Cuda 4.03%

hpmeshgen's Introduction

This is an implementation of the Paper "Automatic Generation of Load-Balancing-Aware Block-Structured Grids for Complex Ocean Domains" presented at the International Meshing Roundtable 2022.

The provided example uses the ADCIRC mesh of the Bight of Abaco in the Bahamas region as an input. [Grenier Jr. et al.]

Requirements Linux:

(install in order as listed)

C++17

CMAKE

CUDA

Requirements

  • CUDA-capable GPU
  • A supported version of Linux with a gcc compiler and toolchain
  • NVIDIA CUDA Toolkit

Installation

  • download CUDA
  • To set path in .bashrc: get cuda installation path with
    <cuda_path>=ldconfig -p | grep cuda, e.g. /usr/local/cuda-11.0/  
    export CUDA_ROOT=<cuda_path>/bin/
    export LD_LIBRARY_PATH=<cuda_path>/lib64/
    
  • Select nvidia graphics card with
    sudo prime-select nvidia
    
  • reboot
  • check if OpenGL uses nvidia GPU:
    glxinfo | grep -i opengl
    

Verify CUDA Installation

  • Verify driver version:
    cat /proc/driver/nvidia/version
    
  • Verify the CUDA Toolkit version:
    nvcc -V
    
  • Verify running CUDA GPU jobs (Running deviceQuery and bandwidthTest)
    cuda-install-samples-[11.0].sh .
    cd NVIDIA_CUDA-[11.0]_Samples/
    make
    ./bin/[x86_64]/[linux]/release/deviceQuery
    ./bin/[x86_64]/[linux]/release/bandwidthTest
    

LIBS to install

  1. glog
  2. OpenMesh 8.1
  • Create a directory for building the libraries (non-root should note the dependency)

    mkdir 00_libs
    cd 00_libs
    
  • Clone the repositories and/or download the archives

    git clone https://github.com/google/glog.git
    wget https://www.graphics.rwth-aachen.de/media/openmesh_static/Releases/8.1/OpenMesh-8.1.tar.gz
    
  • Build+Test glog (Root users may disregard the -DCMAKE_INSTALL_PREFIX flag)

    mkdir glog/build
    cd glog/build/
    cmake .. -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="."
    cmake --build .
    cmake --build . --target test
    cmake --build . --target install
    cd ../..
    
  • Build OpenMesh 8.1 (Root users may disregard the -DCMAKE_INSTALL_PREFIX flag)

    tar -xvf OpenMesh-8.1.tar.gz
    rm OpenMesh-8.1.tar.gz
    mkdir OpenMesh-8.1/build
    cd OpenMesh-8.1/build
    cmake .. -DCMAKE_INSTALL_PREFIX="."
    cmake --build .
    cmake --build . --target install
    cd ../..
    
  • Note real path where LIBS have been installed (maybe add it to your bashrc extension if you plan on recompiling the project more often)

    realpath glog/build/ googletest/build/ OpenMesh-8.1/build/
    export TEMP_LIB_location=$(echo "$(realpath glog/build/);$(realpath OpenMesh-8.1/build)")
    

Build HPMeshGen2

  • Clone the repository
    git clone https://github.com/DanielZint/hpmeshgen.git
    
  • Building
    mkdir hpmeshgen2/build
    cd hpmeshgen2/build
    cmake .. -DCMAKE_PREFIX_PATH="$TEMP_LIB_location"
    cmake --build .
    cd ../..
    
  • Executing with parameters described in ./hpmeshgen2/HPMeshGenParameter.txt
    ./hpmeshgen2/build/bin/HPMeshGen2
    

Requirements Windows:

(install in order as listed)

CUDA

  • download
  • normal installation, restart device afterwards

CMAKE

VCPKG

OPTIONAL

VISUAL STUDIO

  • download
  • select everything that has to do with C++ or MSVC
  • select english language pack

Usage:

Use file HPMeshGenParameter.txt to configure HPMeshGen2. The file marks comments with '!'.

workingDirectory        ! is the project root folder by default but can be changed here
cacheFolder             ! storage folder for cached files (cache reduces time for recomputing meshes significantly)
nBlocks                 ! number of blocks

meshFileName            ! input mesh, usually a .14-file
sizegridSizeX           ! size grid dimensions (integer)
sizegridSizeY           ! the size grid stores the depth and edge length information

nRefinementSteps        ! the number of nodes on a fragment edge
nPatches                ! number of fragments

outputFolder            ! all output files go in here
initialMeshOutput       ! 0/1 initial mesh as .off file
reductionOutput         ! 0/1 intermediate steps of reduction as .off file
blockMeshOutput         ! 0/1 fragment mesh as .off file
sizegridOutput          ! 0/1 print size grid in .vtk format

forceFragmentNumber     ! 0/1 force fragment number, 0: change fragment number for better quality
convexHullDecimation    ! 0/1 activate masks

hpmeshgen's People

Contributors

joscao avatar

Stargazers

 avatar  avatar

Watchers

Daniel Zint avatar  avatar

Forkers

gridgeneration

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.