Giter Club home page Giter Club logo

rsugimoto / wobtoolbox Goto Github PK

View Code? Open in Web Editor NEW
46.0 2.0 4.0 1.04 MB

Author's implementation of SIGGRAPH 2023 paper, "A Practical Walk-on-Boundary Method for Boundary Value Problems."

Home Page: https://rsugimoto.net/WoBforBVPsProject/

License: MIT License

CMake 1.43% Cuda 96.25% Python 1.53% C++ 0.79%
computer-graphics integral-equations laplace-equation monte-carlo monte-carlo-methods partial-differential-equations pde poisson-equation ray-tracing siggraph

wobtoolbox's Introduction

Walk-on-Boundary Toolbox

This is a reference CUDA/OpenMP implementation of our SIGGRAPH North America 2023 paper, "A Practical Walk-on-Boundary Method for Boundary Value Problems", Sugimoto, Chen, Jiang, Batty, and Hachisuka. 2023. This repository contains implementations for key examples similar to the ones in the paper. Note this repository does not contain advanced examples like MCMC, nor general exterior Dirichlet problem solvers described in the paper.

simple_wob

The "simple_wob" example generates this image sequence.

Directory Structure

  • wob: The main header-only WoB Toolbox library which implements the core of the WoB method. Here are some brief descriptions of the main files.
    • equation_kernel.cuh: implementation of fundamental solutions for Poisson's equation.
    • bie_models.cuh: implementation of BIE models, including single-layer indirect BIE, double-layer indirect BIE, and direct BIE.
    • scene.cuh: implementation of sampling queries.
    • estimator.cuh: implementation of the standard backward or forward estimators. The choice of the specific sampling strategy for each problem is in this file, too.
  • apps: contains .cu files with main functions.
  • data: contains scene configuration JSON files and geometry .obj files.
  • deps: contains dependency libraries.

Dependencies

All dependencies are included as git submodules:

    git clone --recurse-submodules  https://github.com/rsugimoto/WoBToolbox

This repository utilizes the following external libraries.

  • Eigen: a header-only linear algebra library with CUDA kernel support.
  • rsugimoto/lbvh: a header-only CUDA BVH library, originally by ToruNiina. The author (rsugimoto) modified it to support 2D queries and line intersection queries in addition to the originally supported queries.
  • nlohmann/json: a header-only C++ JSON parser.
  • libigl: a collection of common mesh operations.
  • NVIDIA/thrust: a template utility library for CUDA. When available, the local version of Thrust shipped with CUDA is used. When CUDA installation is not found, the copy in deps directory is used to enable computation with OpenMP backend instead.

Environment

The program is tested on Linux and Apple Silicon Mac machines with CUDA 12.1 or OpenMP enabled. The program is mainly targeted at machines with CUDA with a C++17 compiler installed, but it works on CPUs with OpenMP backend using a C++20 compiler, too.

The program is untested on Windows machines. Since Eigen is used with CUDA, the compilation may fail with NVCC with MS Visual Studio.

Compile and Run

Compile this project using the standard cmake routine:

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make

This will make several executable files in the build directory. The compilation may take a few minutes if CUDA is found. You can run programs from the project directory with a required JSON configuration file, for example:

build/simple_wob_and_wos data/config_simple_wob.json

The program generates outputs under the directory (e.g. results/simple_wob/raw_data) as specified in the JSON file, in a binary format. Note that the number of samples per iteration must be adjusted with the num_sample_paths parameter in the JSON file based on the spec of your hardware to prevent getting too many output files or taking too long per iteration. The program terminates when the time exceeds max_time minute(s) after each iteration.

Once you get the outputs, you can run a visualization Python script, for example:

python visualize.py results/simple_wob

The resulting png files will be saved in the same folder (e.g. results/simple_wob/render). Other executables in build should be run with the configuration files with matching names.

wobtoolbox's People

Contributors

rsugimoto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.