Skip to content

Generating block-structured grids for ocean domains

License

Notifications You must be signed in to change notification settings

daniel-zint/hpmeshgen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Generating block-structured grids for ocean domains

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published