Harmonic Fluids
ACM SIGGRAPH 2009
This is a preliminary version of the library for solving the fluid sound radiation problem. The main purpose of it is to demonstrate the implementation of the fluid sound radiation solve described in our paper "Harmonic Fluids" at SIGGRAPH 2009.
The code provided in this page is a cluster-based parallel implementation. It runs as a Remote-Procedure-Call (RPC) service running on a group of clusters. The fluid/bubble simulation running in a separated process generates bubbles at each time step, and invoke this service to compute the transfer function expansion coefficients for each bubble. Please see the paper for detailed algorithm. On each cluster, this code also utilizes multiple-cores to achieve local parallelization.
The code is released under GNU GPL license.
The current version is the 0.1 Beta. You can download the source code from Here
The code is compiled on Linux. I haven't yet tested it on Windows/MacOS.
Required Packages:
rpcinfo -p localhost |
||
Compile it:
After download the package, unzip it. Go into the directory and create a sub-directory for building
cd hfsvcd-0.1beta/ mkdir linux-build && cd linux-build |
||
Then run cmake for configuring the Makefile. There are a couple of options.
cmake -DUSE_OPENMP=OFF ../ |
||
cmake -DUSE_64BIT_ARCH=OFF ../ |
||
cmake -DCMAKE_CXX_COMPILER=icpc -DCMAKE_C_COMPILER=icc ../ |
||
If the configuration successes, you can compile it by using make. After compiling it, the executable is ./src/hfscvd based on your current directory.
In this section, I'm going to describe how to use this computation service, and how to integrate it into your own fluid/bubble simulation. You need to read the details in the paper to understand the code.
Run the computation service:
After compiling the code, the generated executable is called hfsvcd. Run the following command to get help information
./hfsvcd -h |
||
After compiling the code, the generated executable is called hfsvcd. Its arguments accept the following options.
-d | Run the service as a daemon process. |
-c <buffer length> | Specify the local buffer length. |
-l <log file> | Specify the file name for the log file. |
Format of the RPC arguments and returns:
Solving for the fluid sound radiation:
The core part of this code is the implementation of a dual-domain fluid sound radiation solver. Most of them are implemented in the file src/cluster/MultipoleSolver.cpp, where the least-square problems are assembled. The QR-based ridge-regression(Tikhonov regularization) solution is implemented in src/linearalgebra/LeastSquareSolver.hpp.
Scheduler for solving:
When the hfsvcd service are running on a group of clusters, a scheduler is required in fluid simulation to determine that on which cluster the computation service should be invoked. I implemented a basic schedule algorithm in JobDispatcher.hpp JobRunner.hpp and JobScheduler.hpp. It always chooses the cluster with least computing jobs in queue for the next radiation solve, implemented using a producer-consumer mode.